:root {
      --bg: #FFF8EE;
      --surface: #FFFFFF;
      --surface-muted: #F1F0ED;
      --fg: #1F221C;
      --ink-strong: #131411;
      --ink-deep: #0C0C0B;
      --muted: color-mix(in oklch, var(--fg) 66%, var(--surface));
      --border: #EBEAE8;
      --accent: #A8D16C;
      --on-dark: #FFFFFF;
      --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
      --fg-soft: color-mix(in oklch, var(--fg) 6%, transparent);
      --font-display: 'Moderat Extended', 'Arial Black', sans-serif;
      --font-body: Inter, Arial, sans-serif;
      --font-mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;
      --fs-h1: clamp(26px, 4.4vw, 48px);
      --fs-h2: clamp(22px, 3.4vw, 50px);
      --fs-h3: 22px;
      --fs-lead: 19px;
      --fs-body: 16px;
      --fs-meta: 13px;
      --gap-xs: 8px;
      --gap-sm: 12px;
      --gap-md: 20px;
      --gap-lg: 32px;
      --gap-xl: 56px;
      --gap-2xl: 96px;
      --container: 1240px;
      --gutter: 30px;
      --radius: 16px;
      --radius-lg: 16px;
    }
    *, *::before, *::after { box-sizing: border-box; }
    html { -webkit-text-size-adjust: 100%; }
    body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.55; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
    button, input { font: inherit; }
    button { cursor: pointer; }
    a { color: inherit; text-decoration: none; }
    p { text-wrap: pretty; }
    h1, h2, h3 { text-wrap: balance; }
    .container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
    .section { padding-block: clamp(56px, 8vw, 112px); }
    .section + .section { border-top: 1px solid var(--border); }
    .stack { display: flex; flex-direction: column; }
    .stack > * + * { margin-top: var(--gap-md); }
    .row { display: flex; align-items: center; gap: var(--gap-md); }
    .row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
    .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-lg); }
    .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-lg); }
    .grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }
    .h1, h1 { overflow-wrap: break-word; font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 700; line-height: .96; letter-spacing: 0; text-transform: uppercase; margin: 0; }
    .h2, h2 { overflow-wrap: break-word; font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700; line-height: 1.05; letter-spacing: 0; text-transform: uppercase; margin: 0; }
    .h3, h3 { overflow-wrap: break-word; font-family: var(--font-body); font-size: var(--fs-h3); font-weight: 700; line-height: 1.35; margin: 0; }
    .lead { color: var(--muted); font-size: var(--fs-lead); line-height: 1.55; max-width: 54ch; margin: 0; }
    .eyebrow { font-family: var(--font-body); font-size: 14px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; color: var(--fg); margin: 0 0 var(--gap-md); }
    .meta { color: var(--muted); font-family: var(--font-body); font-size: var(--fs-meta); }
    .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
    .topnav { position: sticky; inset-block-start: 0; z-index: 10; background: color-mix(in oklch, var(--bg) 96%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in oklch, var(--fg) 10%, transparent); }
    .topnav-inner { min-height: 76px; display: flex; align-items: stretch; justify-content: space-between; gap: var(--gap-lg); }
    .topnav-inner > .meta { display: flex; align-items: center; }
    .logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 18px; font-weight: 700; text-transform: uppercase; }
    .logo small { padding-left: 12px; border-left: 1px solid color-mix(in oklch, var(--fg) 18%, transparent); font-family: var(--font-body); font-size: 11px; font-weight: 400; letter-spacing: .04em; }
    .logo-mark { display: none; }
.btn { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 28px; padding: 12px 18px 12px 21px; border-radius: var(--radius); border: 2px solid transparent; font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: .01em; text-transform: uppercase; transition: transform .05s ease, background .2s ease, border-color .2s ease, gap .2s ease; }
    .btn::after { content: '↘'; font-family: var(--font-body); font-size: 20px; font-weight: 400; line-height: 1; }
    .btn:active { transform: translateY(1px); }
    .btn-primary { background: var(--accent); color: var(--ink-deep); border-color: var(--accent); }
    .btn-primary:hover { background: color-mix(in oklch, var(--accent) 88%, var(--fg)); color: var(--ink-deep); gap: 38px; }
    .btn:disabled { cursor: wait; opacity: .62; }
    .btn-secondary { background: transparent; color: var(--fg); border-color: var(--accent); }
    .btn-secondary:hover { border-color: var(--accent); background: var(--accent); color: var(--ink-deep); gap: 38px; }
    .btn-tertiary { min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--fg); border-radius: 0; background: transparent; color: var(--fg); }
    .btn-tertiary:hover { gap: 38px; border-bottom-color: var(--fg); }
    .btn:focus-visible, .toggle input:focus-visible + span { outline: 2px solid var(--ink-deep); outline-offset: 2px; }
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
    .hero-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); gap: clamp(56px, 8vw, 118px); align-items: center; }
    .hero-cta { display: flex; gap: var(--gap-sm); flex-wrap: wrap; margin-top: 30px; }
    .hero-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; color: var(--muted); font-size: 14px; }
    .hero-note svg { flex: none; margin-top: 2px; }
    .phone-shell { width: 100%; max-width: 500px; justify-self: end; padding: 10px 10px 10px 62px; border: 0; border-radius: 190px 28px 28px 190px; background: var(--ink-deep); box-shadow: none; }
    .phone-screen { min-height: 590px; display: flex; flex-direction: column; border: 1px solid color-mix(in oklch, var(--on-dark) 10%, transparent); border-radius: 22px; background: var(--ink-deep); color: var(--on-dark); overflow: hidden; }
    .phone-bar { display: flex; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid color-mix(in oklch, var(--on-dark) 10%, transparent); }
    .phone-screen .meta, .phone-screen .dropzone p, .phone-screen .toggle-copy small, .phone-screen .dropzone svg { color: color-mix(in oklch, var(--on-dark) 62%, transparent); }
    .phone-body { display: flex; flex: 1; flex-direction: column; padding: 24px; }
    .dropzone { flex: 1; min-height: 280px; display: grid; place-items: center; padding: 28px; border: 1px solid color-mix(in oklch, var(--on-dark) 16%, transparent); border-radius: var(--radius-lg); text-align: center; background: color-mix(in oklch, var(--on-dark) 4%, transparent); }
    .dropzone svg { margin: 0 auto 18px; color: var(--muted); }
    .dropzone strong { display: block; font-family: var(--font-body); font-size: 22px; font-weight: 700; line-height: 1.25; }
    .dropzone p { max-width: 28ch; margin: 9px auto 0; color: var(--muted); font-size: 14px; }
    .toggle { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; margin-block: 20px; cursor: pointer; }
    .toggle input { position: absolute; opacity: 0; }
    .toggle-ui { inline-size: 44px; block-size: 24px; border: 1px solid color-mix(in oklch, var(--on-dark) 20%, transparent); border-radius: 999px; background: var(--ink-deep); position: relative; transition: background .15s ease; }
    .toggle-ui::after { content: ''; position: absolute; inset: 3px auto auto 3px; inline-size: 16px; block-size: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease; }
    .toggle input:checked + .toggle-ui { background: var(--accent); border-color: var(--accent); }
    .toggle input:checked + .toggle-ui::after { transform: translateX(20px); background: var(--ink-deep); }
    .toggle-copy strong { display: block; font-size: 14px; }
    .toggle-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
    #process { background: var(--surface-muted); }
    .feature { border-top: 1px solid color-mix(in oklch, var(--fg) 18%, transparent); padding-top: 24px; }
    .feature .feature-mark { inline-size: 36px; block-size: 36px; display: grid; place-items: center; margin-bottom: var(--gap-md); border: 1px solid var(--border); border-radius: 10px; color: var(--fg); }
    .feature .feature-mark svg { inline-size: 18px; block-size: 18px; }
    .feature h3 { margin-bottom: 7px; }
    .feature p { margin: 0; color: var(--muted); font-size: 15px; }
    .section-head { max-width: 640px; margin-bottom: var(--gap-xl); }
    .result-shell { display: grid; grid-template-columns: minmax(260px, .82fr) minmax(0, 1.18fr); min-height: 520px; overflow: hidden; border: 1px solid color-mix(in oklch, var(--fg) 10%, transparent); border-radius: var(--radius-lg); background: var(--surface); }
    .result-pane { min-width: 0; display: flex; flex-direction: column; padding: 24px; }
    .result-pane + .result-pane { border-left: 1px solid var(--border); }
    .pane-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 32px; margin-bottom: 16px; }
    .pane-title { color: var(--muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
    .paper { flex: 1; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-muted); color: var(--ink-deep); font-size: 13px; overflow: hidden; }
    .result-photo { width: 100%; height: 100%; min-height: 360px; border-radius: var(--radius); object-fit: contain; object-position: top; background: var(--surface-muted); }
    .paper-head { display: grid; grid-template-columns: 42px 1fr; gap: 13px; align-items: center; margin-bottom: 22px; }
    .portrait { inline-size: 42px; block-size: 52px; background: color-mix(in oklch, var(--muted) 35%, var(--fg)); }
    .line { block-size: 7px; margin: 8px 0; border-radius: 3px; background: color-mix(in oklch, var(--fg) 20%, transparent); }
    .line.short { inline-size: 52%; }
    .line.medium { inline-size: 74%; }
    .cv-output { flex: 1; margin: 0; white-space: pre-wrap; overflow: hidden; color: var(--fg); font: 15px/1.72 var(--font-mono); }
    .placeholder { display: inline; padding: 2px 5px; border-radius: 4px; background: var(--fg); color: var(--on-dark); font-weight: 700; }
    .error { color: var(--fg); border-left: 2px solid var(--fg); padding-left: 12px; }
    .metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
    .metric { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-size: 12px; }
    .metric b { color: var(--fg); }
    .idle-state { flex: 1; display: grid; place-content: center; max-width: 32ch; margin: auto; text-align: center; }
    .idle-state h2 { font-size: clamp(38px, 5vw, 64px); }
    .idle-state p { margin: 14px 0 0; color: var(--muted); font-size: 18px; }
    #stand-view > section:first-child { min-height: calc(100vh - 76px); display: grid; place-items: center; background: var(--ink-deep); color: var(--on-dark); }
    #stand-view > section:first-child .eyebrow, #stand-view > section:first-child .idle-state p { color: var(--on-dark); }
    #stand-view > section:first-child .btn-secondary { color: var(--on-dark); }
    #stand-view > section:first-child .btn-tertiary { color: var(--on-dark); border-bottom-color: var(--on-dark); }
    .pulse { inline-size: 66px; block-size: 66px; margin: 0 auto 30px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
    @keyframes pulse { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }
    .pagefoot { padding-block: var(--gap-xl); color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); background: var(--surface-muted); }
    [hidden] { display: none !important; }
    #file { display: none; }
    @media (max-width: 1100px) {
      :root { --gutter: 30px; }
      .grid-2, .grid-3, .grid-2-1, .hero-split, .result-shell { grid-template-columns: 1fr; }
      .hero-split { gap: var(--gap-xl); }
      .phone-shell { width: 100%; max-width: 520px; justify-self: center; }
      .result-pane + .result-pane { border-left: 0; border-top: 1px solid var(--border); }
      .result-shell { min-height: auto; }
      .paper { min-height: 320px; }
    }
    @media (max-width: 620px) {
      :root { --gutter: 18px; }
      .topnav-inner { min-height: 72px; }
      .logo span:last-child { font-size: 15px; }
      .logo small { display: none; }
.section { padding-block: 54px; }
      .hero-split { align-items: start; }
      .hero-cta { flex-direction: column; }
      .hero-cta .btn { width: 100%; }
      .phone-shell { padding: 6px; border-radius: 24px; }
      .phone-screen { min-height: 560px; border-radius: 18px; }
      .dropzone { min-height: 250px; }
      .card { padding: 22px; }
      .result-pane { padding: 18px; }
      .row-between { align-items: flex-start; flex-direction: column; }
    }
    @media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ---- application additions on top of the exported system ---------------- */
.tag { font-family: var(--font-mono); font-size: .92em; font-weight: 700;
  background: var(--accent-soft); color: var(--ink-deep);
  border: 1px solid color-mix(in oklch, var(--accent) 55%, transparent);
  border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.cv-output { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.62;
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--gap-md); }
.chip { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; color: var(--muted); }
.chip b { color: var(--fg); font-family: var(--font-display); }
.chip.on { border-color: color-mix(in oklch, var(--accent) 60%, transparent);
  color: var(--ink-deep); background: var(--accent-soft); }
.note-quote { margin: 0 0 var(--gap-md); padding: 10px 16px; font-style: italic;
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0; }
.field { display: block; margin-top: var(--gap-md); }
.field > span { display: block; font-size: var(--fs-meta); text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 6px;
  font-family: var(--font-display); font-weight: 700; }
.field textarea { width: 100%; min-height: 54px; resize: vertical; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--fg); font-family: var(--font-body); font-size: 16px; }
.field textarea:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 2px; }
.dots::after { content: ''; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: '' } 25% { content: '.' } 50% { content: '..' } 75% { content: '...' } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }


/* ---- mobile first: the phone is the primary surface -------------------- */
@media (max-width: 700px) {
  /* A device mockup inside a real phone is just wasted width. Drop the capsule
     frame and let the scanner be the page. */
  .phone-shell { max-width: none; padding: 0; border-radius: var(--radius-lg); background: transparent; }
  .phone-screen { min-height: 0; border-radius: var(--radius-lg); }
  .phone-body { padding: 18px; }
  .dropzone { min-height: 0; padding: 20px; }
  .dropzone strong { font-size: 18px; }
  /* Get the scan control above the fold: the explainer lives further down anyway. */
  .hero-split > div > .hero-cta { display: none; }
  .hero-note { margin-top: 16px; font-size: 13px; }
  .lead { font-size: 17px; }
  .section { padding-block: 36px; }
  .hero-split { gap: 28px; }
  .result-pane { padding: 18px; }
  .result-shell { min-height: 0; }
}


/* ---- captured photo stays a thumbnail, never a full-bleed image --------- */
#shot { display: block; width: auto; max-width: 100%; max-height: 132px; margin: 0 auto;
  border-radius: var(--radius); background: var(--surface); }
.dropzone.has-photo { min-height: 0; padding: 16px; }
/* The phone shows the original small; the stand view is where it is big. */
.result-photo { width: auto; max-width: 100%; height: auto; min-height: 0;
  max-height: 220px; object-fit: contain; margin-inline: auto; }
#submit, #retake { margin-top: var(--gap-sm); }
