/* Ruang studi: paper surfaces, academic teal, editorial type and restrained motion. */
:root {
  --bg: #f6f5f0; --surface: #fffefa; --surface-2: #eeeee7;
  --text: #35463f; --heading: #183d34; --muted: #65746d;
  --border: #dedfd5; --border-strong: #c4cdc2;
  --primary: #0f766e; --primary-hover: #115e59; --primary-ink: #fff;
  --primary-soft: #e4eee7; --brand: #0f766e; --radius: 14px;
  --shadow: 0 8px 24px -18px #183d3433; --shadow-lg: 0 18px 40px -24px #183d3440;
}
body { background: var(--bg); }
.wrap { max-width: 1320px; padding-inline: 48px; }
.topbar { background: var(--bg); backdrop-filter: none; }
.topbar-inner { height: 84px; }
.brand { font-size: 1.25rem; letter-spacing: -.04em; }
.brand img { width: 34px; height: 34px; }
.topnav { gap: 18px; }
.topnav a { font-size: .84rem; }
.pill-accent { background: #efe9d9; color: #775427; padding: 5px 13px; font-size: .72rem; }
.hero { padding: 52px 0 64px; min-height: calc(100svh - 84px); }
.hero::before { display: none; }
.hero-grid { grid-template-columns: .9fr 1.15fr; gap: 48px; align-items: center; }
.studio-kicker { font-size: .65rem; font-weight: 750; letter-spacing: .16em; color: var(--primary); margin-bottom: 28px; }
.eyebrow-pill { padding: 0; background: none; border: none; font-size: .72rem; font-weight: 550; color: var(--muted); margin-bottom: 18px; }
.eyebrow-pill svg { width: 15px; height: 15px; color: var(--primary); }
h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.6rem, 4.2vw, 4rem); font-weight: 400; letter-spacing: -.04em; line-height: 1.07; text-wrap: initial; margin-bottom: 22px; }
h1 .hl { color: var(--primary); }
.lead { font-size: .96rem; line-height: 1.75; max-width: 430px; margin-bottom: 26px; }
.lead strong { font-weight: 600; }
.dropzone { grid-template-columns: 42px 1fr; justify-items: start; gap: 12px 14px; text-align: left; padding: 22px; border: 1px dashed #a8bbae; border-radius: 12px; box-shadow: none; background: #fffefa; }
.dz-icon { width: 42px; height: 42px; border-radius: 9px; grid-row: span 1; }
.dz-icon svg { width: 23px; height: 23px; }
.dz-title { font-size: .92rem; }
.dz-hint { font-size: .72rem; margin-top: 4px; line-height: 1.5; }
.dropzone .btn { grid-column: 1 / -1; width: 100%; min-height: 48px; padding: 12px 20px; font-size: .86rem; border-radius: 8px; box-shadow: none; }
.dz-foot { grid-column: 1 / -1; justify-self: center; font-size: .68rem; }
.trust { gap: 10px 18px; margin-top: 18px; font-size: .67rem; font-weight: 500; }
.trust svg { width: 14px; height: 14px; }
.document-workspace { background: #e9ede5; border: 1px solid #d7dfd3; border-radius: 12px; overflow: hidden; align-self: stretch; display: flex; flex-direction: column; min-width: 0; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 17px 20px; border-bottom: 1px solid #d7dfd3; font-size: .66rem; color: #69786e; }
.preview-filename { display: flex; gap: 9px; align-items: center; color: #354a3e; font-weight: 600; }
.file-mark { background: #fffefa; color: #0f766e; display: grid; place-items: center; width: 24px; height: 28px; border: 1px solid #cad6c7; border-radius: 3px; font-family: Georgia, serif; font-weight: 700; font-size: 14px; }
.preview-controls { align-self: center; display: none; padding: 4px; gap: 4px; margin: 22px 0 20px; background: #dce3d8; border-radius: 7px; }
.preview-tab { padding: 7px 18px; border: 0; border-radius: 5px; background: transparent; color: #61735f; font: 600 .7rem var(--font); cursor: pointer; transition: background 180ms var(--ease-out), color 180ms var(--ease-out), transform 120ms var(--ease-out); }
.preview-tab[aria-pressed='true'] { background: #fffefa; color: #17594a; box-shadow: 0 1px 4px #173e3310; }
.preview-tab span { margin-left: 6px; color: var(--primary); }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px 18px; flex: 1; align-items: start; }
.comparison-side { min-width: 0; }
.comparison-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 12px; color: #334c3e; font-size: .76rem; font-weight: 700; }
.comparison-detail { font-size: .58rem; font-weight: 500; color: #69786e; }
.demo-paper { background: #fff; color: #26322c; padding: 18px 16px 12px; box-shadow: 0 5px 12px -8px #163a3338; font: 14px/1.55 'Times New Roman', serif; }
.demo-block:nth-child(1) { min-height: 104px; }
.demo-block:nth-child(2) { min-height: 186px; }
.demo-block:nth-child(3) { min-height: 164px; }
.demo-note { display: flex; align-items: center; gap: 5px; margin: 0 0 14px; font: 500 9px/1.4 var(--font); color: #825742; }
.demo-note > span { display: grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: #f6ece3; font-size: 9px; }
.demo-after .demo-note { color: #27634f; }
.demo-after .demo-note > span { background: #e1eee5; }
.demo-title { font-size: 14px; font-weight: 700; line-height: 1.6; text-align: center; }
.demo-subtitle { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.demo-paragraph { margin: 0; text-align: justify; text-indent: 18px; }
.demo-caption { margin: 0 0 7px; font-size: 12px; }
.demo-table-clip { overflow: hidden; }
.demo-table { width: 100%; border-collapse: collapse; font: 12px/1.5 'Times New Roman', serif; }
.demo-table th, .demo-table td { border: 1px solid #8c9890; padding: 5px 6px; text-align: left; white-space: nowrap; }
.demo-table th { font-weight: 700; background: #f3f6f3; }
.demo-page { display: block; border-top: 1px solid #e7eae5; padding-top: 10px; font: 9px/1.5 var(--font); color: #7b867e; text-align: center; }
.demo-before .demo-title { font: 700 16px/1.25 Arial, sans-serif; text-align: left; }
.demo-before .demo-paragraph { font: italic 13px/1.15 Arial, sans-serif; text-align: left; text-indent: 0; }
.demo-before .demo-table { width: 130%; }
.demo-before .demo-table th, .demo-before .demo-table td { border-color: #bca18e; }
.demo-before .demo-table-clip { border-right: 2px dashed #be8060; }
.preview-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 15px 20px; background: #e0e7da; color: #65745d; font-size: .65rem; }
.preview-state { display: flex; align-items: center; gap: 7px; color: #365f43; font-weight: 600; }
.preview-state > span:first-child { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #cbdcc5; }
.info { padding: 80px 0; border-top: 1px solid var(--border); }
.info-head { text-align: left; max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 42px; align-items: end; }
.info-head h2 { font: 400 clamp(1.9rem, 3vw, 2.7rem)/1.12 Georgia, serif; letter-spacing: -.03em; max-width: 420px; }
.info-head p { font-size: .9rem; max-width: 460px; }
.features { gap: 0 28px; }
.feature { padding: 24px 0; background: transparent; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.feature h3 { font-size: .9rem; }
.feature p { font-size: .79rem; line-height: 1.8; }
.f-icon { width: 32px; height: 32px; background: none; margin-bottom: 18px; }
.f-icon svg { width: 25px; height: 25px; }
.info-alt { background: #eeefe7; }
.how li { text-align: left; padding: 0 28px 0 0; }
.how li:not(:last-child)::after { display: none; }
.how-num { background: none; color: #9ba994; box-shadow: none; border-radius: 0; width: auto; height: auto; font: italic 42px Georgia, serif; margin-bottom: 24px; }
.how h3 { font-size: 1.05rem; }
.how p { margin: 0; font-size: .85rem; line-height: 1.8; }
.privacy { border: 0; border-top: 1px solid #ccd5c6; border-radius: 0; background: none; padding: 28px 0 0; }
.privacy p { font-size: .85rem; }
.faq details { border-radius: 0; border: 0; border-bottom: 1px solid var(--border); background: none; }
.faq summary { padding: 22px 0; font-size: .9rem; }
.faq details p { padding: 0 0 22px; font-size: .85rem; line-height: 1.8; }
.footer { background: var(--bg); font-size: .75rem; }
.card { box-shadow: none; }
.panel-section { padding-top: 36px; }
.btn:active, .preview-tab:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .dropzone:not(.drag):hover { background: var(--surface); border-color: var(--primary); box-shadow: none; transform: translateY(-2px); }
  .feature:hover { background: transparent; border-color: var(--primary); box-shadow: none; transform: none; }
  .btn:hover { transform: translateY(-2px); }
  .topnav a:hover { background: transparent; color: var(--primary); }
  .preview-tab:hover { color: var(--primary); }
}
.studio-enter { animation: studio-arrive 600ms var(--ease-out) both; }
.studio-enter:nth-child(2) { animation-delay: 70ms; }
@keyframes studio-arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1100px) {
  .wrap { padding-inline: 32px; }
  .hero-grid { gap: 36px; }
  .preview-local { display: none; }
  .comparison { gap: 10px; padding: 18px 12px; }
  .demo-paper { padding-inline: 12px; }
  .trust { font-size: .65rem; }
}
@media (max-width: 900px) {
  .wrap { padding-inline: 22px; }
  .topbar-inner { height: 70px; }
  .topnav a { display: none; }
  .hero { padding: 34px 0 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  h1 { font-size: clamp(2.7rem, 8vw, 3.8rem); }
  .studio-kicker { margin-bottom: 24px; font-size: .6rem; }
  .hero-visual { max-width: none; width: 100%; }
  .info { padding: 48px 0; }
  .info-head { grid-template-columns: 1fr; gap: 14px; margin-bottom: 28px; }
  .features { grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .feature { display: block; }
  .how { gap: 28px; }
  .how-num { margin-bottom: 10px; }
}
@media (max-width: 600px) {
  .preview-controls { display: flex; }
  .comparison { grid-template-columns: 1fr; padding: 0 20px 22px; }
  .comparison[data-view='after'] [data-document='before'],
  .comparison[data-view='before'] [data-document='after'] { display: none; }
  .comparison-heading { justify-content: space-between; }
  .demo-paper { padding: 22px; }
  .demo-block:nth-child(2) { min-height: 168px; }
  .preview-bottom { padding-inline: 14px; font-size: .6rem; }
  .illustration-label { display: none; }
}
@media (max-width: 420px) {
  .features { grid-template-columns: 1fr; }
  .eyebrow-pill { font-size: .66rem; }
  .dropzone { padding: 18px; gap: 12px; }
  .dz-hint { font-size: .67rem; }
  .trust { font-size: .63rem; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-enter { animation: soft-fade 160ms ease both; animation-delay: 0ms; }
  .btn:hover, .btn:active, .preview-tab:active { transform: none; }
}

/* Native popover handles Escape, outside clicks, top-layer rendering and focus return. */
.settings-trigger { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; min-height: 44px; background: var(--surface-2); color: var(--heading); border: 1px solid var(--border); border-radius: 8px; font: 600 .76rem var(--font); cursor: pointer; }
.settings-trigger svg, .preferences-close svg { width: 18px; height: 18px; }
.settings-trigger:hover { border-color: var(--brand); }
.preferences-panel { position: fixed; inset: 76px 24px auto auto; margin: 0; width: 292px; max-width: calc(100vw - 32px); padding: 22px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); }
.preferences-panel::backdrop { background: transparent; }
.preferences-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; }
.preferences-heading h2 { font: 700 1rem/1.4 var(--font); margin: 0; }
.preferences-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; }
.preferences-close:hover { background: var(--surface-2); }
.preference-field { display: grid; gap: 9px; font-size: .8rem; font-weight: 600; }
.preference-field select { width: 100%; min-height: 44px; padding: 9px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 7px; font: 500 .85rem var(--font); }
.theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; margin: 20px 0 0; border: 0; min-width: 0; }
.theme-options legend { font-size: .8rem; font-weight: 600; padding: 0; margin-bottom: 9px; }
.theme-options label { display: flex; align-items: center; gap: 7px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 7px; font-size: .82rem; cursor: pointer; }
.theme-options label:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--heading); }
.theme-options input { accent-color: var(--primary); margin: 0; }
.preferences-hint { color: var(--muted); font-size: .7rem; line-height: 1.6; margin: 18px 0 0; }
:root[data-theme='dark'] {
  --bg: #101b18; --surface: #172620; --surface-2: #20362c;
  --text: #dae5de; --heading: #eff6f0; --muted: #a4b9ac;
  --border: #30473a; --border-strong: #53735d;
  --primary: #79d2bc; --primary-hover: #9de2cf; --primary-ink: #10291f;
  --primary-soft: #234438; --brand: #79d2bc;
  --ok: #86dba5; --ok-soft: #1a3a29; --warn: #f3cc83; --warn-soft: #403323;
  --err: #ffb2a9; --err-soft: #462b2b; --accent: #f1a973; --accent-soft: #443123; --accent-ink: #f9cba9;
  --shadow-sm: 0 1px 2px #0003; --shadow: 0 8px 24px -18px #0008; --shadow-lg: 0 18px 40px -24px #000c;
  color-scheme: dark;
}
:root[data-theme='dark'] .dropzone { background: var(--surface); border-color: var(--border-strong); }
:root[data-theme='dark'] .document-workspace { background: #1c3027; border-color: var(--border); }
:root[data-theme='dark'] .preview-toolbar { color: var(--muted); border-color: var(--border); }
:root[data-theme='dark'] .preview-filename, :root[data-theme='dark'] .comparison-heading { color: var(--heading); }
:root[data-theme='dark'] .comparison-detail { color: var(--muted); }
:root[data-theme='dark'] .file-mark { background: var(--surface); border-color: var(--border-strong); color: var(--primary); }
:root[data-theme='dark'] .preview-controls, :root[data-theme='dark'] .preview-bottom { background: #243d30; color: var(--muted); }
:root[data-theme='dark'] .preview-tab { color: var(--muted); }
:root[data-theme='dark'] .preview-tab[aria-pressed='true'] { background: #355341; color: #eaf5ee; }
:root[data-theme='dark'] .preview-state { color: #b6dbc1; }
:root[data-theme='dark'] .preview-state > span:first-child { background: #3a5e46; }
:root[data-theme='dark'] .info-alt { background: #15251e; }
:root[data-theme='dark'] .privacy { border-color: var(--border); }
/* The sample depicts a printed document, so its paper remains white in either theme. */
.demo-paper { color-scheme: light; }
@media (max-width: 900px) {
  .settings-trigger { padding-inline: 10px; font-size: .72rem; }
  .preferences-panel { top: 64px; right: 16px; }
}
