/* Word Chain Climb website. Colours and type follow the game (CLAUDE.md › Design specs). */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url("/fonts/nunito-latin.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --paper: #FAF6EF;
  --ink: #2A2622;
  --mute: #6B6259;
  --tile: #FFFFFF;
  --tile-edge: #E2D9CB;
  --line: #E7DFD2;
  --card: #FFFFFF;
  --panel: #F3ECE0;
  --teal: #1F6F6B;
  --teal-text: #1F6F6B;
  --teal-edge: #154F4C;
  --tint: #DCEDEA;
  --locked-edge: #B9D8D3;
  --coral: #F26B5B;
  --coral-edge: #B44C3E;
  --gold: #F2B84B;
  --gold-edge: #C4922F;
  --error: #D8412F;
  --hint-icon: #9A6B00;
  --on-color: #FFFFFF;
  --on-gold: #2A2622;
  --shadow: rgba(42, 38, 34, .45);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161412;
    --ink: #F4EEE4;
    --mute: #AAA092;
    --tile: #2B2724;
    --tile-edge: #0C0B0A;
    --line: #2F2A26;
    --card: #211E1B;
    --panel: #1F1C19;
    --teal: #2A8C85;
    --teal-text: #5CC1B8;
    --teal-edge: #1B5F5A;
    --tint: #1D3A37;
    --locked-edge: #173C39;
    --coral: #F07161;
    --hint-icon: #F2B84B;
    --shadow: rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 700 16px/1.6 var(--font);
}
img, svg { max-width: 100%; }
a { color: var(--teal-text); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-weight: 900; line-height: 1.08; text-wrap: balance; margin: 0; }

.wrap { max-width: 1040px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }

/* Header and footer, shared by every page */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 900; }
.brand img { width: 36px; height: 36px; border-radius: 22.5%; box-shadow: 0 0 0 1px var(--line); }
.bar nav { display: flex; gap: 22px; font-size: 15px; font-weight: 800; }
.bar nav a { color: var(--mute); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--ink); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 24px 32px; border-top: 2px solid var(--line); font-size: 14px; font-weight: 800; color: var(--mute); }
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--mute); }

/* Labels and pills */
.lab { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-text); }
.lab.mute { color: var(--mute); }
.pill { display: inline-flex; padding: 11px 20px; border-radius: 999px; font-size: 15px; font-weight: 800; background: var(--ink); color: var(--paper); text-decoration: none; }

/* Tiles, as in the game: 3px bottom edge, rounded, Nunito 900 */
.row { display: flex; gap: 7px; }
.t {
  position: relative; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--tile); color: var(--ink); box-shadow: 0 3px 0 var(--tile-edge);
  font-size: 23px; font-weight: 900; line-height: 1;
}
.row.sm { gap: 4px; }
.sm .t { width: 30px; height: 30px; border-radius: 8px; font-size: 15px; box-shadow: 0 2px 0 var(--tile-edge); }
.st .t { background: var(--teal); color: var(--on-color); box-shadow: 0 3px 0 var(--teal-edge); }
.tg .t { background: var(--coral); color: var(--on-color); box-shadow: 0 3px 0 var(--coral-edge); }
.lk .t { box-shadow: 0 3px 0 var(--locked-edge); }
.sm.lk .t { box-shadow: 0 2px 0 var(--locked-edge); }
.t.ch { background: var(--tint); color: var(--teal-text); }
.em .t { background: transparent; box-shadow: none; border: 2.5px dashed var(--line); }
.er .t { outline: 2.5px solid var(--error); outline-offset: -2.5px; }
.t.hn { outline: 2.5px solid var(--gold); outline-offset: -2.5px; }

/* Reading layout for Support, Privacy and 404 */
.doc { max-width: 68ch; padding-block: 24px 56px; }
.doc h1 { font-size: clamp(34px, 6vw, 46px); margin-bottom: 10px; }
.doc h2 { font-size: 24px; margin: 40px 0 10px; }
.doc h3 { font-size: 18px; margin: 24px 0 6px; }
.doc p, .doc li { color: var(--mute); }
.doc p { margin: 0 0 14px; }
.doc ul { padding-left: 1.2em; margin: 0 0 14px; }
.doc li { margin-bottom: 6px; }
.doc strong, .doc b { color: var(--ink); }
.doc .updated { font-size: 14px; font-weight: 800; }
.doc .lost { display: grid; justify-items: start; gap: 18px; padding-block: 24px; }

.doc .contact { margin: 18px 0 8px; padding: 20px 22px; border-radius: 22px; background: var(--card); box-shadow: 0 3px 0 var(--tile-edge); }
.doc .contact h2 { margin-top: 0; }
.doc .mail { font-size: 20px; font-weight: 900; margin: 6px 0 12px; overflow-wrap: anywhere; }
.faq { display: grid; gap: 10px; }
.faq details { border-radius: 16px; background: var(--card); box-shadow: 0 2px 0 var(--tile-edge); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 12px 18px; font-size: 16px; font-weight: 900; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--teal-text); }
.faq details[open] summary::after { content: "−"; }
.faq details > :not(summary) { margin-inline: 18px; }
.faq details > :last-child { margin-bottom: 16px; }
.doc .notice { margin: 0 0 14px; padding: 14px 18px; border-left: 4px solid var(--line); font-size: 14px; }
.doc .notice p { margin: 0 0 8px; }

.doc .lede { font-size: 18px; color: var(--ink); margin: 18px 0 20px; }
.doc .glance { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.doc .glance li { margin: 0; padding: 16px 18px; border-radius: 18px; background: var(--card); box-shadow: 0 3px 0 var(--tile-edge); }
.glance b { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 900; color: var(--ink); }
.glance b::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--teal); }
.doc .glance p { margin: 6px 0 0; font-size: 14px; }
@media (max-width: 560px) { .doc .glance { grid-template-columns: 1fr; } }

/* ---------- Landing page ---------- */

/* Hero: the headline beside two tilted phones with real screenshots */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 32px; align-items: center; padding-block: 28px 64px; }
.hero-copy { min-width: 0; display: grid; justify-items: start; gap: 4px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 58px); line-height: 1.02; margin: 8px 0 16px; }
.hero h1 span { display: block; }
.hero h1 em { font-style: normal; color: var(--teal-text); }
.lead { font-size: 18px; line-height: 1.55; color: var(--mute); max-width: 36ch; margin: 0 0 22px; }
.hero .pill, .summit .pill { margin: 0; }
.phones { position: relative; width: min(420px, 100%); aspect-ratio: 420 / 470; justify-self: center; }
.phone { position: absolute; width: 51%; padding: 1.7%; border-radius: 19% / 8.8%; background: #1C1A18; box-shadow: 0 24px 50px -18px var(--shadow); }
.phone img { display: block; width: 100%; height: auto; border-radius: 16.5% / 7.6%; }
.phone.back { left: 2.4%; top: 4%; transform: rotate(-7deg); }
.phone.front { right: 2.4%; top: 0; transform: rotate(5deg); }

/* Try it here */
.try { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; background: var(--panel); border-radius: 36px; padding: 48px 44px; margin-bottom: 40px; }
.try [hidden] { display: none !important; }
.try h2 { font-size: 40px; margin: 8px 0 12px; }
.try-sub { font-size: 17px; color: var(--mute); max-width: 34ch; margin: 0 0 26px; }
.pairs { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 26px; }
.pairs button { font: inherit; font-size: 14px; font-weight: 900; letter-spacing: .04em; min-height: 48px; padding: 0 18px; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: 0 3px 0 var(--tile-edge); cursor: pointer; }
.pairs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: 0 3px 0 var(--shadow); }
.stepcard { display: grid; gap: 14px; background: var(--card); border-radius: 24px; padding: 20px 24px; }
.step-head { display: flex; justify-content: space-between; align-items: center; }
.count { font-size: 16px; font-weight: 800; color: var(--mute); font-variant-numeric: tabular-nums; }
.count b { color: var(--ink); font-weight: 900; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills i { width: 38px; height: 12px; border-radius: 99px; border: 2.5px solid var(--line); }
.pills i.step { background: var(--teal); border-color: var(--teal); }
.pills i.hinted { background: var(--gold); border-color: var(--gold); }
.pills i.over { background: var(--coral); border-color: var(--coral); }
.tools { display: flex; align-items: center; gap: 14px; }
.icon-btn { display: grid; place-items: center; width: 52px; height: 48px; border: 0; border-radius: 14px; background: var(--card); color: var(--mute); box-shadow: 0 3px 0 var(--tile-edge), inset 0 0 0 1.5px var(--line); cursor: pointer; }
.icon-btn.hint { color: var(--hint-icon); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.hint-count { font-size: 15px; font-weight: 800; color: var(--mute); }
.won { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.won-line { flex: 1; min-width: 14ch; font-size: 15px; font-weight: 800; }
.again { font: inherit; font-size: 14px; font-weight: 900; min-height: 44px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--teal); color: var(--on-color); box-shadow: 0 3px 0 var(--teal-edge); cursor: pointer; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 900; color: var(--on-color); }
.badge.perfect { background: var(--gold); color: var(--on-gold); }
.badge.great { background: var(--teal); }
.badge.good { background: var(--coral); }

.board { position: relative; display: grid; justify-items: center; gap: 26px; min-width: 0; }
.ladder { --tw: 62px; position: relative; display: grid; gap: 12px; padding: 0 28px; }
.ladder::before, .ladder::after { content: ""; position: absolute; top: -10px; bottom: 0; width: 5px; border-radius: 3px; background: var(--line); }
.ladder::before { left: 0; }
.ladder::after { right: 0; }
.ladder .row { gap: 12px; }
.ladder .t { width: var(--tw); height: var(--tw); border-radius: 16px; font-size: calc(var(--tw) * .5); }
.ladder .tg .t { box-shadow: 0 4px 0 var(--coral-edge); }
.ladder .st .t { box-shadow: 0 4px 0 var(--teal-edge); }
.gap { display: flex; justify-content: center; gap: 8px; }
.gap i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.climbed { position: relative; display: grid; gap: 12px; margin: 0 -28px; padding: 0 28px; }
.climbed::before, .climbed::after { content: ""; position: absolute; top: 0; bottom: 0; width: 5px; border-radius: 3px; background: var(--teal); z-index: 1; }
.climbed::before { left: 0; }
.climbed::after { right: 0; }
.rung-now .t { cursor: pointer; background: var(--tile); box-shadow: none; border: 2.5px solid var(--line); }
.rung-now .t.ch { background: var(--tint); }
.rung-now .t.cur { border-color: var(--teal); }
.rung-now .t.cur::after { content: ""; position: absolute; bottom: 10px; left: 50%; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: var(--teal); animation: blink 1s steps(1) infinite; }
.rung-now.shake { animation: shake .3s; }
.rung-now.shake .t { border-color: var(--error); }
.t.squash { animation: squash .26s ease-out; }
.t.pulse { border-color: var(--gold) !important; animation: pulse 1.8s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 17% { transform: translateX(-8px); } 33% { transform: translateX(8px); } 50% { transform: translateX(-6px); } 67% { transform: translateX(6px); } 83% { transform: translateX(-3px); } }
@keyframes squash { 0% { transform: scaleY(1); } 46% { transform: scaleY(.06); } 100% { transform: scaleY(1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 184, 75, .6); } 50% { box-shadow: 0 0 0 9px rgba(242, 184, 75, 0); } }
.toast { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); z-index: 2; padding: 8px 14px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 900; white-space: nowrap; }
.nojs { margin: 0; font-size: 15px; font-weight: 800; color: var(--mute); }
.keys { display: grid; gap: 10px; width: 100%; max-width: 560px; }
.keys div { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.keys .r2 { grid-template-columns: repeat(9, 1fr); padding: 0 5%; }
.keys .r3 { grid-template-columns: 1.9fr repeat(7, 1fr) 1.9fr; }
.keys button { height: 56px; padding: 0; border: 0; border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: 0 3px 0 var(--tile-edge); font: inherit; font-size: 17px; font-weight: 900; cursor: pointer; touch-action: manipulation; }
.keys button.go { background: var(--teal); color: var(--on-color); box-shadow: 0 3px 0 var(--teal-edge); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.keys button.go:disabled { opacity: .42; cursor: default; }

/* The sections: each is a rung, tagged with the next word of COLD → WARM */
.rung { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; padding-block: 44px; border-top: 2px solid var(--line); }
.tag { display: grid; gap: 8px; align-content: start; }
.tag > span { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.rung h2 { font-size: 30px; margin: 6px 0 10px; }
.rung-body > p:not(.lab) { color: var(--mute); max-width: 58ch; margin: 0 0 14px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.card { display: grid; justify-items: start; align-content: start; gap: 12px; padding: 16px; border-radius: 18px; background: var(--card); box-shadow: 0 3px 0 var(--tile-edge); font-size: 14px; color: var(--mute); line-height: 1.45; }
.card b { font-size: 15px; color: var(--ink); }
.toast-chip { padding: 5px 10px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 900; }
.rates, .chips, .devices, .week { list-style: none; margin: 0; padding: 0; }
.rates { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.rates li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--card); box-shadow: 0 3px 0 var(--tile-edge); font-size: 14px; font-weight: 800; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; margin-top: 10px; }
.week li { display: grid; gap: 6px; align-content: end; text-align: center; font-size: 12px; font-weight: 800; color: var(--mute); line-height: 1.3; }
.week b { color: var(--ink); font-size: 13px; }
.week i { display: block; border-radius: 8px 8px 3px 3px; background: var(--teal); }
.week .d1 { height: 30px; } .week .d2 { height: 48px; } .week .d3 { height: 64px; } .week .d4 { height: 74px; }
.week .d5 { height: 80px; } .week .d6 { height: 96px; } .week .d7 { height: 118px; background: var(--coral); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips li { padding: 7px 12px; border-radius: 99px; background: var(--card); box-shadow: 0 2px 0 var(--tile-edge); font-size: 13px; font-weight: 800; }
.chips li.on { background: var(--gold); color: var(--on-gold); box-shadow: 0 2px 0 var(--gold-edge); }
.devices { display: flex; flex-wrap: wrap; align-items: end; gap: 48px; margin-top: 18px; color: var(--ink); }
.devices li { display: grid; justify-items: center; gap: 14px; font-size: 17px; font-weight: 900; }
.summit { display: grid; justify-items: center; gap: 16px; padding-block: 56px 44px; border-top: 2px solid var(--line); text-align: center; }
.summit h2 { font-size: 38px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-block: 12px 40px; }
  .phones { width: min(380px, 100%); }
  .try { grid-template-columns: 1fr; padding: 32px 20px; border-radius: 28px; }
  .rung { grid-template-columns: 1fr; gap: 14px; padding-block: 36px; }
  .tag { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; }
  .trio { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .bar nav { gap: 16px; }
  .brand { font-size: 15px; }
  .try { margin-inline: -12px; padding: 28px 12px; }
  .try h2 { font-size: 32px; }
  .ladder { --tw: 50px; padding: 0 20px; }
  .ladder .row, .climbed { gap: 9px; }
  .climbed { margin: 0 -20px; padding: 0 20px; }
  .keys { gap: 8px; }
  .keys div { gap: 4px; }
  .keys button { height: 50px; font-size: 15px; border-radius: 9px; }
  .keys button.go { font-size: 10px; letter-spacing: 0; }
  .week li { font-size: 10px; }
  .devices { gap: 28px; }
  .summit h2 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
