/* WhatsApp Wrapped. Flat bone and ink, one serif word, pills. No gradients, no glass, no glow. */
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/InstrumentSerif-Italic.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --bg: #F4F1EA;
  --surface: #FFFFFF;
  --ink: #0C0B10;
  --muted: #5F5B53;
  --hair: rgba(12, 11, 16, .12);
  --track: #E4E0D6;
  --secondary: #E2DED3;
  --on-ink: #F4F1EA;
  --focus: #2B4BFF;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0B10;
    --surface: #17161B;
    --ink: #F4F1EA;
    --muted: #A9A59C;
    --hair: rgba(244, 241, 234, .14);
    --track: #2B2A30;
    --secondary: #2B2A30;
    --on-ink: #0C0B10;
    --focus: #8FA2FF;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-underline-offset: .2em; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; font-size: 1.08em; }

.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 10; background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.skip-link:focus { left: 12px; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.site-header { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -.4px; text-decoration: none; color: var(--ink); }
.header-download { font-size: 14px; font-weight: 600; text-decoration: none; padding: 10px 0; }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 72px; }

/* Hero */
.hero { padding: 40px 0 8px; max-width: 680px; }
.tag { display: inline-block; margin: 0 0 22px; padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 600; line-height: 1.2; }
h1 { margin: 0 0 16px; font-size: clamp(54px, 15vw, 116px); line-height: .94; letter-spacing: -.045em; font-weight: 800; }
h1 em { font-size: 1.1em; letter-spacing: -.01em; }
.lede { margin: 0 0 28px; font-size: 19px; line-height: 1.45; color: var(--muted); max-width: 30ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--on-ink);
  font: 600 17px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.btn:active { opacity: .82; }
.btn-secondary { background: var(--secondary); color: var(--ink); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 15px; }

.drop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-radius: 28px; }
.drop .btn { flex: 1 1 100%; }
@media (min-width: 560px) { .drop .btn { flex: 0 1 auto; } }
#wrapped-file:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.drop-hint { display: none; width: 100%; margin: 2px 0 0; color: var(--muted); font-size: 15px; }
@media (hover: hover) and (pointer: fine) and (min-width: 720px) {
  .drop { padding: 22px; margin: 0 -24px; border: 2px dashed transparent; transition: border-color .15s ease, background-color .15s ease; }
  .drop.is-over { border-color: var(--ink); background: var(--surface); }
  .drop-hint { display: block; }
}
.drop.is-busy { opacity: .6; pointer-events: none; }
.status { margin: 12px 0 0; font-weight: 600; }
.status:empty { margin: 0; }
.status.is-error { color: #C2361B; }
@media (prefers-color-scheme: dark) { .status.is-error { color: #FF8A6E; } }
.small { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* Results */
.results { padding: 56px 0 8px; scroll-margin-top: 8px; }
.results-head h2, .cards h2, .howto h2, .faq h2, .cta h2 { margin: 0; font-size: clamp(34px, 8vw, 56px); line-height: 1; letter-spacing: -.035em; font-weight: 800; }
.results-head h2:focus { outline: none; }
.sample-flag { display: inline-block; margin: 14px 0 0; padding: 6px 12px; border-radius: 999px; background: var(--secondary); font-size: 13px; font-weight: 600; }

.who { margin: 28px 0 24px; }
.who-q { margin: 0 0 10px; font-weight: 600; }
.who-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 18px; border: 1px solid var(--hair); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 16px/1 var(--sans); cursor: pointer; touch-action: manipulation; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.stats { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .stats { grid-template-columns: 1fr 1fr; gap: 16px; } .stat-hero { grid-column: 1 / -1; } }
.stat { background: var(--surface); border: 1px solid var(--hair); border-radius: 22px; padding: 22px 20px 20px; min-width: 0; }
.stat-title { display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 600; line-height: 1.3; letter-spacing: 0; }
.stat-big { margin: 0; font-size: clamp(54px, 15vw, 76px); line-height: 1; font-weight: 800; letter-spacing: -.045em; overflow-wrap: anywhere; }
.stat-hero .stat-big { font-size: clamp(64px, 20vw, 120px); }
.stat-emoji .stat-big { letter-spacing: 0; }
.stat-label { margin: 8px 0 0; font-size: 17px; font-weight: 600; }
.stat-note { margin: 16px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

.rows { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; align-items: baseline; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-value { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 15px; }
.row-bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.row-bar i { display: block; height: 100%; border-radius: 4px; background: var(--ink); }
.row-tag { grid-column: 1 / -1; justify-self: start; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--ink); }
.row-tag:empty { display: none; }

.emoji-rows, .word-rows { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.emoji-rows li, .word-rows li { display: grid; gap: 6px; }
.emoji-list { display: flex; gap: 18px; flex-wrap: wrap; }
.emoji-item { display: inline-flex; align-items: baseline; gap: 6px; }
.emoji-glyph { font-size: 30px; line-height: 1; }
.emoji-count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.word-list { display: flex; gap: 6px; flex-wrap: wrap; }
.word { padding: 4px 12px; border-radius: 999px; background: var(--track); font-size: 15px; font-weight: 600; }

.hours { margin-top: 18px; }
.hours-bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; align-items: end; height: 96px; }
.hours-bars i { display: block; background: var(--track); border-radius: 4px 4px 0 0; min-height: 2px; }
.hours-bars i.is-peak { background: var(--ink); }
.hours-axis { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.facts { margin: 4px 0 0; display: grid; gap: 14px; }
.fact { border-top: 1px solid var(--hair); padding-top: 12px; }
.fact dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.fact dd { margin: 2px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.fact-sub { display: block; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); }

.first { margin: 16px 0 0; }
.first blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
.first figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }

/* Cards */
.cards { margin: 56px 0 0; }
.toggle { display: inline-flex; align-items: center; gap: 10px; margin: 18px 0 0; min-height: 44px; font-weight: 600; cursor: pointer; }
.toggle input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
.card-row { display: flex; gap: 14px; margin: 16px -16px 0; padding: 4px 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: thin; }
.card { flex: 0 0 auto; width: min(62vw, 244px); margin: 0; scroll-snap-align: start; display: grid; gap: 10px; }
.card img { width: 100%; aspect-ratio: 9 / 16; border-radius: 14px; border: 1px solid var(--hair); background: var(--track); }
.card .btn { width: 100%; }
@media (min-width: 900px) {
  .card-row { margin: 16px 0 0; padding: 4px 0 8px; overflow: visible; }
  .card { flex: 1 1 0; width: auto; max-width: 260px; }
}

/* Call to action */
.cta { margin: 56px 0 0; padding: 32px 22px; border-radius: 28px; background: var(--ink); color: var(--on-ink); }
.cta h2 { font-size: clamp(32px, 7.5vw, 52px); max-width: 16ch; }
.cta p { margin: 16px 0 24px; font-size: 18px; line-height: 1.45; max-width: 46ch; opacity: .86; }
.cta .btn { background: var(--on-ink); color: var(--ink); }
.cta .small { margin: 12px 0 0; color: inherit; opacity: .7; font-size: 13px; }
@media (prefers-color-scheme: dark) { .cta { background: var(--surface); color: var(--ink); border: 1px solid var(--hair); } .cta .btn { background: var(--ink); color: var(--on-ink); } }
.again { margin: 24px 0 0; }

/* Export steps and FAQ */
.howto, .faq { margin: 80px 0 0; max-width: 760px; }
.howto-cols { display: grid; gap: 14px; margin-top: 24px; }
@media (min-width: 680px) { .howto-cols { grid-template-columns: 1fr 1fr; } }
.howto-col { background: var(--surface); border: 1px solid var(--hair); border-radius: 22px; padding: 20px 20px 8px; }
.howto-col h3 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.01em; }
.howto-col ol { margin: 0; padding-left: 22px; }
.howto-col li { margin: 0 0 12px; padding-left: 2px; }
.howto-col li::marker { font-weight: 700; }
.howto-more { margin: 18px 0 0; color: var(--muted); }
.howto-more a { color: var(--ink); font-weight: 600; }
.faq-item { border-top: 1px solid var(--hair); padding: 20px 0 4px; }
.faq-item:first-of-type { margin-top: 24px; }
.faq-item h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.faq-item p { margin: 0 0 14px; color: var(--muted); }

footer { border-top: 1px solid var(--hair); padding: 28px 16px max(28px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px 32px; color: var(--muted); font-size: 13px; line-height: 20px; }
footer .brand { font-size: 15px; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; }
footer a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
