/* Alterword website. The app's own printed puzzle page: black ink on warm paper, thin rules,
   Archivo and Archivo Extra Condensed, one magenta marker. Tokens mirror lib/app/theme.dart. */
@font-face { font-family: "Archivo"; src: url("/alterword/assets/fonts/archivo-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/alterword/assets/fonts/archivo-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/alterword/assets/fonts/archivo-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/alterword/assets/fonts/archivo-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Archivo Display"; src: url("/alterword/assets/fonts/archivoextracondensed-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --paper: #EFEBE2; --sheet: #F6F3EC; --ink: #141414; --ink-soft: #5F5B53; --rule: #D2CCBF;
  --tile: #FAF8F3; --accent: #D0157A; --accent-tint: #F5D3E4; --on-accent: #FFFFFF; --bad: #B3261E;
  --display: "Archivo Display", "Archivo", "Arial Narrow", sans-serif;
  --sans: "Archivo", system-ui, -apple-system, sans-serif;
  --gut: clamp(1rem, 4vw, 3.5rem);
  --max: 76rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171614; --sheet: #211F1C; --ink: #EFEAE0; --ink-soft: #A6A094; --rule: #3A3732;
    --tile: #1E1C19; --accent: #FF4F9F; --accent-tint: #4C2337; --on-accent: #171614; --bad: #FF8A80;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: clamp(16px, 16px + (100vw - 1440px) * .006, 24px); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--sans);
  overflow-x: clip; caret-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: .92; letter-spacing: 0; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h3 { font-size: 2rem; }
p { margin: 0 0 1rem; }
.kicker { font: 700 .8125rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .14em; margin: 0 0 1rem; color: var(--ink); }
.kicker::before { content: ""; display: inline-block; width: .7em; height: .7em; background: var(--accent); margin-right: .55em; vertical-align: -.02em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .75rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.button { display: inline-block; border: 2px solid var(--ink); padding: .7rem 1.1rem; font-weight: 700; text-decoration: none; margin: .25rem; }
.button:hover { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------ header, masthead, footer */
.top { display: flex; align-items: center; gap: 1.5rem; max-width: var(--max); margin: 0 auto; padding: 1rem var(--gut); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.mark { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--ink); border: 3px solid var(--ink); width: 2.1rem; height: 2.1rem; }
.mark i { display: grid; place-items: center; font: 900 .7rem/1 var(--sans); font-style: normal; background: var(--paper); color: var(--ink); }
.mark i.hot { background: var(--accent); color: var(--on-accent); }
.name { font: 900 1.5rem/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.nav { display: flex; gap: 1.25rem; margin-left: auto; font-weight: 600; font-size: .9375rem; }
.nav a { text-decoration: none; padding: .5rem 0; }
.langs { display: flex; gap: .15rem; font: 700 .8125rem/1 var(--sans); }
.langs a { text-decoration: none; padding: .55rem .45rem; border: 1px solid transparent; min-width: 2.75rem; min-height: 2.75rem; display: grid; place-items: center; }
.langs a[aria-current] { border-color: var(--ink); }
.masthead { max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; padding: .45rem var(--gut);
  border-block: 3px double var(--ink); font: 700 .8125rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .1em;
  margin-inline: max(var(--gut), calc((100vw - var(--max)) / 2 + var(--gut))); padding-inline: 0; }
.masthead .date:empty { display: none; }
.foot { border-top: 3px double var(--ink); margin-top: 4rem; }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 2rem var(--gut) 3rem; display: grid; gap: 1.25rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-weight: 600; }
.foot-links a, .linkish { padding: .5rem 0; }
.linkish { background: none; border: 0; font: inherit; color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; cursor: pointer; }
.linkish:hover { color: var(--accent); }
.fine { color: var(--ink-soft); font-size: .8125rem; max-width: 60rem; margin: 0; }

/* ------------------------------------------------ tiles: the app's letter squares */
.tiles { display: inline-flex; gap: .3em; font: 900 1em/1 var(--sans); }
.tiles i { font-style: normal; display: grid; place-items: center; width: 1.6em; height: 1.6em; border: .09em solid var(--ink); border-radius: .14em; background: var(--tile); color: var(--ink); }
.tiles i.hot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tiles.sm { font-size: 1rem; }
.tiles.big { font-size: 3rem; margin: 1rem 0 1.5rem; }

/* ------------------------------------------------ hero: the ladder is the shape */
section { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gut) 0; }
.hero { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-top: clamp(2rem, 5vw, 4rem); }
.hero h1 { font-size: clamp(3.25rem, 6.4vw, 6rem); line-height: .88; margin-bottom: 1.5rem; }
.hero h1 span + span { color: var(--accent); }
.lede { font-size: 1.125rem; max-width: 34rem; }
.cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.75rem; }
.store img { display: block; width: 10.5rem; height: auto; }
.note { color: var(--ink-soft); font-size: .9375rem; }
.hero-ladder { margin: 0; justify-self: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: clamp(1.6rem, 3.4vw, 2.75rem); }
.steps li { position: relative; }
.steps li + li::before { content: ""; position: absolute; left: -1.1em; top: -.45em; width: .7em; height: .9em; border-left: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.js .steps li { opacity: 0; transform: translateY(.4em); transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1); }
.js .steps li.on { opacity: 1; transform: none; }
.js .steps li.on i.hot { animation: stamp .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes stamp { 0% { transform: scale(.4) rotate(-8deg); } 70% { transform: scale(1.08); } 100% { transform: none; } }

/* ------------------------------------------------ section heads */
.sec-head { max-width: 46rem; margin-bottom: 2.5rem; }
.sec-head h2 { margin-bottom: 1rem; }
.sec-head p:last-child { font-size: 1.125rem; }

/* ------------------------------------------------ try it: the playable ladder */
.board { max-width: 34rem; margin: 0 auto; background: var(--sheet); border: 6px solid var(--ink); padding: clamp(1rem, 3vw, 1.75rem); display: grid; gap: 1rem; justify-items: center; }
.board-bar { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--rule); padding-bottom: .75rem; text-align: center; font-variant-numeric: tabular-nums; }
.board-bar small { display: block; font: 700 .75rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.board-bar b { font: 900 1.375rem/1.3 var(--sans); }
.board-target .tiles { font-size: 1.375rem; }
.board-target i { border-color: var(--rule); color: var(--ink-soft); }
.board-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: 1.375rem; min-height: 2.2rem; }
.board-rows li { animation: drop .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes drop { from { opacity: 0; transform: translateY(-.5em); } }
.board-input .tiles { font-size: 2rem; }
.board-input i { border-width: .08em; }
.board-input i.cur { box-shadow: inset 0 -.18em 0 var(--accent); }
.board-input.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.board.solved .board-input { display: none; }
.msg { min-height: 1.5em; margin: 0; font-weight: 700; text-align: center; }
.msg.bad { color: var(--bad); }
.board-tools { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.tool, .k { font: 700 1rem/1 var(--sans); color: var(--ink); background: var(--tile); border: 1.5px solid var(--ink); border-radius: .3rem; cursor: pointer; transition: background-color .15s, color .15s, transform .1s; }
.tool { padding: .75rem 1.1rem; min-height: 2.75rem; }
.tool.primary { background: var(--ink); color: var(--paper); }
.tool:hover, .k:hover { background: var(--accent-tint); }
.tool.primary:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.k:active, .tool:active { transform: scale(.96); }
.keys { width: 100%; display: grid; gap: .35rem; user-select: none; }
.kr { display: flex; gap: .3rem; justify-content: center; }
.k { flex: 1 1 0; max-width: 2.6rem; min-height: 2.9rem; padding: 0; display: grid; place-items: center; }
.k.wide { max-width: 4.2rem; flex-grow: 1.6; font-size: .8125rem; }
.k[data-k="enter"] { background: var(--ink); color: var(--paper); }
.board.solved .keys { opacity: .35; pointer-events: none; }
.board-note { font-size: .8125rem; color: var(--ink-soft); margin: 0; }
.try-more { text-align: center; max-width: 34rem; margin: 1.25rem auto 0; color: var(--ink-soft); }

/* ------------------------------------------------ the three games, in newspaper columns */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 3px solid var(--ink); }
.game { padding: 1.75rem clamp(1rem, 2.5vw, 2rem) 0; border-left: 1px solid var(--rule); }
.game:first-child { border-left: 0; padding-left: 0; }
.game:last-child { padding-right: 0; }
.game h3 { margin: 1.5rem 0 .75rem; }
.game > div, .game > ol { height: 11rem; display: grid; place-items: center start; }
.mini-ladder { list-style: none; margin: 0; padding: 0; gap: .4rem; align-content: center; }
.mini-acro { align-content: center; gap: .6rem; }
.mini-acro .clue { font-style: italic; margin: 0; color: var(--ink-soft); }
.mini-acro .grid, .mini-acro .quote { display: flex; gap: 0; }
.mini-acro .grid i, .mini-acro .quote i { font-style: normal; position: relative; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 1.5px solid var(--ink); margin-left: -1.5px; font: 900 1.25rem/1 var(--sans); background: var(--tile); }
.mini-acro .grid b { position: absolute; top: .1rem; left: .2rem; font: 700 .55rem/1 var(--sans); }
.mini-acro .quote i { width: 1.25rem; height: 1.6rem; font-size: .8rem; border-width: 1px; margin-left: -1px; }
.mini-acro .quote i:nth-child(4n) { margin-right: .4rem; }
.mini-acro .quote i.f { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.mini-wheel { grid-template-columns: auto 1fr; gap: 1.25rem; }
.wheel { position: relative; width: 8.5rem; height: 8.5rem; border: 2px solid var(--ink); border-radius: 50%; display: block; background: var(--tile); }
.wheel i { position: absolute; left: 50%; top: 50%; width: 2.1rem; height: 2.1rem; margin: -1.05rem; display: grid; place-items: center; font: 900 1.2rem/1 var(--sans); font-style: normal;
  transform: rotate(calc(var(--k) * 360deg / var(--n))) translateY(-2.75rem) rotate(calc(var(--k) * -360deg / var(--n))); }
.found { list-style: none; margin: 0; padding: 0; font: 700 .9375rem/1.9 var(--sans); letter-spacing: .12em; }
.found li { border-bottom: 1px solid var(--rule); }

/* ------------------------------------------------ daily and scorecard */
.daily { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.daily h2 { margin-bottom: 1rem; }
.daily-copy p:last-child { font-size: 1.125rem; max-width: 36rem; }
.scorecard { width: 100%; border-collapse: collapse; background: var(--sheet); border: 2px solid var(--ink); font-variant-numeric: tabular-nums; }
.scorecard caption { text-align: left; font: 900 1.375rem/1 var(--display); text-transform: uppercase; letter-spacing: .04em; padding: 0 0 .6rem; }
.scorecard th, .scorecard td { padding: .8rem 1rem; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 600; }
.scorecard td { text-align: right; font-weight: 700; }
.scorecard tfoot th, .scorecard tfoot td { border-top: 3px double var(--ink); border-bottom: 0; font: 900 1.375rem/1 var(--sans); }
.scorecard tfoot td { color: var(--accent); }

/* ------------------------------------------------ friends: the one ink section */
.friends { max-width: none; padding: 0; margin-top: clamp(3rem, 8vw, 6rem); background: var(--ink); color: var(--paper); }
.friends-in { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) var(--gut); display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.friends .kicker { color: var(--paper); }
.friends h2 { margin-bottom: 1rem; }
.friends p:last-child { font-size: 1.125rem; max-width: 36rem; }
.room { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.room i { aspect-ratio: 1; border: 2px solid var(--paper); position: relative; overflow: hidden; }
.room i::after { content: ""; position: absolute; inset: auto 0 0 0; height: calc(var(--d) * 100%); background: var(--paper); transform-origin: bottom; }
.room i:nth-child(3)::after { background: var(--accent); }
.js .room i::after { transform: scaleY(0); transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.js .room.in i::after { transform: none; }
.room i:nth-child(2)::after { transition-delay: .1s; } .room i:nth-child(3)::after { transition-delay: .2s; } .room i:nth-child(4)::after { transition-delay: .3s; }
.room i:nth-child(5)::after { transition-delay: .4s; } .room i:nth-child(6)::after { transition-delay: .5s; } .room i:nth-child(7)::after { transition-delay: .6s; } .room i:nth-child(8)::after { transition-delay: .7s; }

/* ------------------------------------------------ fair play, languages, numbers */
.ruled { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
.ruled li { padding: 1.1rem 0 1.1rem 2rem; border-bottom: 1px solid var(--rule); font-size: 1.125rem; position: relative; }
.ruled li::before { content: ""; position: absolute; left: 0; top: 1.45rem; width: .8rem; height: .8rem; border: 2px solid var(--ink); }
.samples { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 3rem; }
.samples li { display: flex; align-items: center; gap: .8rem; font-size: 1.125rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.samples .code { font: 900 .8125rem/1 var(--sans); letter-spacing: .1em; width: 2rem; }
.pair { display: inline-flex; align-items: center; gap: .8rem; }
.samples .arrow { color: var(--accent); font-weight: 900; }
.numbers { list-style: none; margin: 0; padding: 1.5rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 3px double var(--ink); }
.numbers li { display: grid; gap: .25rem; }
.numbers strong { font: 900 clamp(2.5rem, 6vw, 4.5rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.numbers span { font-weight: 600; color: var(--ink-soft); }

/* ------------------------------------------------ faq and last call */
.faq { max-width: 52rem; }
.faq h2 { margin-bottom: 1.5rem; }
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font-weight: 700; font-size: 1.125rem; padding: 1.1rem 2rem 1.1rem 0; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: .25rem; top: .9rem; font: 900 1.5rem/1 var(--sans); color: var(--accent); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { max-width: 44rem; }
.last { text-align: center; padding-bottom: 1rem; }
.last p { max-width: 36rem; margin-inline: auto; }
.last h2 { font-size: clamp(2.75rem, 7vw, 5.5rem); margin-bottom: 1rem; }
.last .store { display: inline-block; margin-top: .75rem; }

/* ------------------------------------------------ reveal */
.js .rv { opacity: 0; transform: translateY(1.25rem); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.js .rv.in { opacity: 1; transform: none; }
.cols .game:nth-child(2) { transition-delay: .12s; } .cols .game:nth-child(3) { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .js .rv, .js .steps li { opacity: 1; transform: none; transition: opacity .3s; }
  .js .steps li.on i.hot, .board-rows li, .board-input.shake { animation: none; }
  .js .room i::after { transform: none; transition: none; }
}

/* ------------------------------------------------ text pages */
.paper { padding: clamp(1.5rem, 4vw, 3rem) var(--gut) 0; }
.sheet { max-width: 46rem; margin: 0 auto; background: var(--sheet); border: 1px solid var(--rule); padding: clamp(1.5rem, 5vw, 3.5rem); }
.sheet h1 { font-size: clamp(2.75rem, 7vw, 4.5rem); margin-bottom: .75rem; }
.sheet h2 { font-family: var(--sans); text-transform: none; font-size: 1.375rem; font-weight: 800; line-height: 1.25; margin: 2.25rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.sheet p, .sheet li { max-width: 40rem; overflow-wrap: anywhere; }
.sheet ul, .sheet ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.sheet li { margin-bottom: .5rem; }
.sheet li::marker { color: var(--accent); }
.updated { color: var(--ink-soft); font-weight: 600; }
.table { overflow-x: auto; margin: 0 0 1.25rem; }
table:not(.scorecard) { border-collapse: collapse; font-size: .9375rem; min-width: 36rem; }
table:not(.scorecard) th, table:not(.scorecard) td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table:not(.scorecard) th { border-bottom: 2px solid var(--ink); }
code { font: 600 .875em/1 ui-monospace, Menlo, monospace; background: var(--paper); padding: .1em .3em; }
.center { text-align: center; }
.nf .langlinks { margin-top: 1.5rem; }

/* ------------------------------------------------ consent banner, mapped to the site */
:root { --consent-bg: var(--sheet); --consent-fg: var(--ink); --consent-line: var(--ink); --consent-radius: 0; --consent-button-radius: .3rem; --consent-button-bg: var(--tile); --consent-button-fg: var(--ink); --consent-font: 500 .9375rem/1.45 var(--sans); }
.consent { border-width: 3px !important; }
.consent-close { font: 400 1.5rem/1 var(--sans) !important; }
.consent-link { padding: .5rem 0 !important; text-decoration: underline !important; text-underline-offset: .18em; }

/* ------------------------------------------------ widths */
@media (max-width: 960px) {
  .hero, .daily, .friends-in { grid-template-columns: 1fr; }
  .hero-ladder { justify-self: start; padding-left: 1.2em; }
  .cols { grid-template-columns: 1fr; }
  .game, .game:first-child { border-left: 0; padding: 1.75rem 0 1.5rem; border-bottom: 1px solid var(--rule); }
  .numbers { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .samples { grid-template-columns: 1fr; }
  .room { max-width: 22rem; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .langs { margin-left: auto; }
  .langs a { min-width: 2.75rem; padding: .55rem .2rem; }
  .masthead { font-size: .6875rem; letter-spacing: .06em; }
  .masthead span:last-child { display: none; }
  .ruled, .samples { grid-template-columns: 1fr; }
  .samples li { font-size: .9375rem; gap: .5rem; }
  .k { min-height: 2.75rem; font-size: .9375rem; }
  .kr { gap: .2rem; }
  .board { border-width: 4px; }
  .board-bar b { font-size: 1.125rem; }
  .board-bar { gap: .5rem; }
}
@media (max-width: 380px) {
  .name { display: none; }
  .samples li { font-size: .8125rem; }
}
