/*
 * Design philosophy — Sir Jony Ive (after GUMA)
 * One material. One light source. One shadow depth.
 * The care is the product. If it can be removed without loss, remove it.
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #0A0A0A; --ink-2: #555; --ink-3: #767676; /* AA-contrast (bumped from GUMA #AAA) */
  --paper: #FFF; --paper-2: #F6F6F6;
  --sage: #1B6B54; --sage-light: #EAF3EF;
  --border: rgba(0,0,0,0.08);
  --r: 22px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05);
  --shadow-lift: 0 2px 4px rgba(0,0,0,0.05), 0 16px 40px rgba(0,0,0,0.09);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}

/* ── Nav ─────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100; height: 56px; padding: 0 32px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.nav-right { display: flex; align-items: center; gap: 6px; }
.nav-note { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: -0.1px; }
.nav-link { font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; padding: 6px 14px; border-radius: 100px; transition: color .15s, background .15s; letter-spacing: -0.1px; }
.nav-link:hover { color: var(--ink); background: var(--paper-2); }
.nav-cta { font-size: 13px; font-weight: 600; color: var(--paper); background: var(--ink); text-decoration: none; padding: 8px 18px; border-radius: 100px; letter-spacing: -0.1px; transition: opacity .12s; }
.nav-cta:hover { opacity: 0.85; }

/* ── Layout ──────────────────────────────────── */
.wrap { max-width: 760px; margin: 0 auto; padding: 72px 32px 120px; }
.wrap > section:first-of-type { margin-top: 0; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--sage); margin-bottom: 20px; }
h1 { font-size: clamp(40px, 6vw, 60px); font-weight: 800; line-height: 1.02; letter-spacing: -2.5px; margin-bottom: 18px; }
.lede { font-size: 18px; font-weight: 400; color: var(--ink-2); max-width: 30em; margin-bottom: 40px; }

/* ── Drop zone (the focal lamp) ──────────────── */
.drop {
  display: block; background: var(--paper);
  border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 60px 28px; text-align: center;
  cursor: pointer; transition: box-shadow .2s, border-color .2s, background .2s;
}
.drop:hover, .drop.over { box-shadow: var(--shadow-lift); border-color: var(--sage); background: var(--sage-light); }
.drop strong { display: block; font-size: 19px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.3px; }
.drop span { color: var(--ink-3); font-size: 14px; font-weight: 500; }
input[type=file] { display: none; }

.privacy { display: inline-flex; gap: 8px; align-items: center; margin-top: 24px; font-size: 13px; font-weight: 600; color: var(--sage); background: var(--sage-light); padding: 7px 15px; border-radius: 100px; }

/* ── Messages ────────────────────────────────── */
.msg { margin: 20px 0; padding: 14px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; }
.msg.err { background: #FEF2F2; color: #B91C1C; }
.msg.warn { background: var(--sage-light); color: var(--sage); }

/* ── Results ─────────────────────────────────── */
.results { margin-top: 44px; }
.bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.bar h2 { font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); margin: 0; }
button.dl { background: var(--ink); color: var(--paper); border: 0; border-radius: 100px; padding: 11px 24px; font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: -0.1px; cursor: pointer; transition: opacity .12s; }
button.dl:hover { opacity: 0.82; }
button.dl:disabled { opacity: 0.35; cursor: default; }

.tablewrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--paper-2); font-weight: 600; color: var(--ink-2); position: sticky; top: 0; letter-spacing: -0.1px; }
td { color: var(--ink); font-weight: 500; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

/* ── Manual column mapping ───────────────────── */
.map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 18px 0; }
.map label { font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 6px; }
.map select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink); background: var(--paper); }

/* ── Narrative sections ──────────────────────── */
.section { margin-top: 104px; }
.section-title { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -1.4px; line-height: 1.05; margin-bottom: 16px; }
.section-lede { font-size: 17px; color: var(--ink-2); margin-bottom: 44px; max-width: 34em; }

.pair { padding: 30px 0; border-top: 1px solid var(--border); }
.pair-problem { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 8px; }
.pair-detail { font-size: 15px; color: var(--ink-2); margin-bottom: 18px; max-width: 38em; }
.pair-fix { display: flex; gap: 12px; font-size: 16px; color: var(--ink); line-height: 1.5; max-width: 38em; }
.pair-fix .dot { margin-top: 9px; flex-shrink: 0; }

.forward { margin-top: 104px; padding: 52px 44px; background: var(--paper-2); border-radius: var(--r); }
.forward .kicker { color: var(--sage); }
.forward-title { font-size: clamp(25px, 3.4vw, 33px); font-weight: 800; letter-spacing: -1px; line-height: 1.08; margin-bottom: 28px; }
.fwd-item { display: flex; gap: 16px; padding: 20px 0; border-top: 1px solid var(--border); }
.fwd-item:first-of-type { border-top: 0; padding-top: 0; }
.fwd-num { font-size: 12px; font-weight: 700; color: var(--sage); letter-spacing: 1px; flex-shrink: 0; padding-top: 3px; }
.fwd-text strong { display: block; font-size: 16px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.2px; }
.fwd-text span { font-size: 15px; color: var(--ink-2); }

/* ── Before / after ──────────────────────────── */
.ba { margin: 4px 0 8px; }
.ba-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.ba-label.before { color: var(--ink-3); }
.ba-label.after { color: var(--sage); }
.ba-sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ba-src { border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 16px; background: var(--paper); overflow: hidden; }
.ba-src-name { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; margin-bottom: 12px; }
.ba-src-body { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; line-height: 1.85; color: var(--ink-3); white-space: pre; overflow: hidden; max-height: 96px; }
.ba-src-catch { margin-top: 12px; font-size: 11px; font-weight: 600; color: #B91C1C; }
.ba-arrow { display: flex; justify-content: center; margin: 22px 0; }
.ba-arrow .pill { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--sage); background: var(--sage-light); padding: 9px 18px; border-radius: 100px; }
.ba-arrow .pill .dot { background: var(--sage); }

.cta-row { margin-top: 44px; }
.cta-row a { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none; padding: 13px 26px; border-radius: 100px; font-size: 15px; font-weight: 600; letter-spacing: -0.1px; transition: opacity .12s; }
.cta-row a:hover { opacity: 0.85; }

footer { margin-top: 72px; color: var(--ink-3); font-size: 12px; font-weight: 500; letter-spacing: 0.2px; }

@media (max-width: 560px) {
  .forward { padding: 36px 24px; }
  nav { padding: 0 20px; } .wrap { padding: 48px 20px 96px; }
  .map { grid-template-columns: repeat(2, 1fr); }
  .ba-sources { grid-template-columns: 1fr; }

  /* Results table → stacked cards (6 columns don't fit a phone) */
  #results .tablewrap { overflow: visible; border: 0; box-shadow: none; background: transparent; }
  #results table, #results tbody, #results tr, #results td { display: block; width: auto; }
  #results thead { display: none; }
  #results tr {
    background: var(--paper); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 12px;
  }
  #results td {
    display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: baseline;
    padding: 4px 0; border: 0; white-space: normal; text-align: left;
  }
  #results td.num { text-align: left; }
  #results td.empty { display: none; }
  #results td::before {
    content: attr(data-label); color: var(--ink-3); font-weight: 600;
    font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  }
  #results tr:last-child td { border: 0; }
}
