/* wordeft.com: one stylesheet for the home page, the three pages and the 404 (docs/plans/plan_website.md).
   Hand-kept, no build step. Nothing here or in a page may name another host: no web font, no CDN, no analytics
   (the privacy page promises none; hosting.test.ts holds it). */

/* The app's colour tokens (Wordy/Assets.xcassets/Colors, named in Wordy/Design/Tone.swift): light, dark and
   Increase Contrast. Every surface is the ground or the white surface; a game's colour is only an edge. */
:root {
  color-scheme: light dark;
  --ground: #F4F3F0; --surface: #FFFFFF; --well: #E4E2DD;
  --ink: #16161A; --ink2: #66666D;
  --gold: #FFC629; --gold-wash: #FFECB6;
  --crossing: #FE9254; --arrows: #05CDB8; --letterrun: #E6426C; --chain: #0689C8;
  --round: ui-rounded, "SF Pro Rounded", "SF Compact Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #141416; --surface: #1F1F22; --well: #26262A;
    --ink: #FFFFFF; --ink2: #9C9CA3;
    --gold-wash: #504424;
  }
}
@media (prefers-contrast: more) {
  :root { --ink2: #4A4A50; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --ink2: #C6C6CC; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.55 var(--text); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--round); letter-spacing: -0.015em; margin: 0; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--chain); }
a:focus-visible { outline: 3px solid var(--chain); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#content:focus { outline: none; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: 10px; z-index: 9; }

/* The frame every page shares: the header, the footer. */
/* The footer stands at the window's foot on a page shorter than the window (the 404, support on a desktop). */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; font: 900 24px/1 var(--round); letter-spacing: -0.015em; text-decoration: none; }
.top nav, footer nav { display: flex; margin: 0 -10px; }
.top nav a, footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font: 700 15px/1 var(--round); }
.top nav a { color: var(--ink2); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; margin-top: auto; padding: 60px 0 32px; }
.sig { display: flex; align-items: center; gap: 14px; font: 800 16px/1 var(--round); }
.trio { display: flex; margin-left: -4px; }
.trio img { width: 34px; height: 34px; margin-right: -10px; }

/* The home page. The crowd: thirty faces in five centred rows (6, 6, 2 + you + 2, 6, 7) on a grid of fourteen
   half cells. A picture is its cell: the disc is three quarters of the picture, so no disc touches another, and
   the ringed one, a cell and a half across in a place two cells wide, covers nobody. */
.hero { text-align: center; padding: 14px 0 4px; }
.crowd { --c: min(52px, calc((100vw - 40px) / 7)); list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(14, calc(var(--c) / 2)); justify-content: center; align-items: center; }
.crowd li { grid-column: span 2; }
.crowd li:nth-child(1), .crowd li:nth-child(7), .crowd li:nth-child(13), .crowd li:nth-child(18) { grid-column: 2 / span 2; }
.crowd img { width: var(--c); height: var(--c); }
.crowd .you { grid-column: span 4; display: flex; justify-content: center; }
.crowd .you img { width: calc(var(--c) * 1.5); height: calc(var(--c) * 1.5); border-radius: 50%; box-shadow: 0 0 0 calc(var(--c) * 0.09) var(--gold); }
.hero h1 { font-weight: 900; font-size: clamp(32px, 9.75vw, 38px); line-height: 1.04; margin-top: 22px; }
.lede { color: var(--ink2); margin: 12px auto 18px; max-width: 30rem; text-wrap: balance; }
/* Not a control: a flat tag, no raised face and no pressed edge. After release the store's own badge stands here. */
.soon { display: inline-block; margin: 0; background: var(--well); font: 800 15px/1 var(--round); padding: 11px 16px; border-radius: 999px; white-space: nowrap; }

section { margin-top: 44px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.head h2 { font-weight: 900; font-size: 26px; line-height: 1.15; }
.head p { flex-basis: 100%; margin: 0; color: var(--ink2); text-wrap: balance; }
.head .tag { flex-basis: auto; background: var(--well); color: var(--ink); font: 800 12px/1 var(--round); letter-spacing: 0.02em; padding: 6px 9px; border-radius: 999px; }

/* A sample of a day's list (made-up names and numbers, marked "Example"), drawn as the app's rows. */
.list { list-style: none; margin: 16px 0 0; padding: 6px 0; background: var(--surface); border-radius: 24px; }
.list li { display: grid; grid-template-columns: 26px 44px 1fr auto; align-items: center; gap: 10px; padding: 6px 16px; }
.list .n { font: 900 17px/1 var(--round); color: var(--ink2); text-align: center; font-variant-numeric: tabular-nums; }
.list img { width: 56px; height: 56px; max-width: none; margin: -6px; }
.list .who { font: 800 17px/1.2 var(--round); }
.list .pts { font: 800 15px/1.2 var(--round); font-variant-numeric: tabular-nums; text-align: right; }
.list .pts small { display: block; font: 600 13px/1.3 var(--text); color: var(--ink2); }
.list .me { background: var(--gold-wash); margin: 4px 6px; border-radius: 16px; padding: 8px 10px; }
.list .me .n, .list .me .pts small { color: var(--ink); }
.note { font-size: 13px; color: var(--ink2); margin: 8px 4px 0; }

.games { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.games li { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 14px; background: var(--surface); border-radius: 20px; padding: 12px 16px 12px 14px; box-shadow: inset 5px 0 0 var(--edge); }
.games img { width: 64px; height: 64px; object-fit: contain; }
.games h3 { font-weight: 900; font-size: 19px; }
.games p { margin: 2px 0 0; font-size: 15px; line-height: 1.4; color: var(--ink2); }
.crossing { --edge: var(--crossing); } .arrows { --edge: var(--arrows); } .letterrun { --edge: var(--letterrun); } .chain { --edge: var(--chain); }

.crests { list-style: none; margin: 18px 0 0; padding: 0; display: flex; justify-content: space-between; }
.crests li { flex: 1; text-align: center; font: 800 14px/1.2 var(--round); }
.crests img { width: 72px; height: 72px; object-fit: contain; margin: 0 auto 6px; }

/* The rules, privacy and support pages (and the 404): the owner's words in one white panel on the ground. Only the
   look is set here; nothing of a page's <main> is changed. */
.wrap.page { max-width: calc(46rem + 40px); }
.panel { background: var(--surface); border-radius: 28px; margin: 14px -8px 0; padding: 26px 20px 28px; }
.panel main { display: block; }
.panel h1 { font-weight: 900; font-size: 34px; line-height: 1.1; margin: 0 0 14px; }
.panel h2 { font-weight: 800; font-size: 21px; line-height: 1.25; margin: 30px 0 6px; }
.panel p, .panel ul { margin: 0 0 12px; }
.panel ul { padding-left: 1.2rem; }
.panel li { margin: 0 0 10px; }
.panel main > :last-child { margin-bottom: 0; }

@media (min-width: 760px) {
  .wrap { padding: 0 40px; }
  .wrap.page { max-width: calc(46rem + 80px); }
  .top { padding-top: 16px; }
  .crowd { --c: 76px; }
  .hero { padding-top: 22px; }
  .hero h1 { font-size: 64px; margin-top: 30px; }
  .lede { font-size: 20px; margin-bottom: 22px; }
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  section, .split section { margin-top: 60px; }
  .league { text-align: center; }
  .league .head { justify-content: center; }
  .crests { max-width: 600px; margin: 24px auto 0; }
  .crests img { width: 88px; height: 88px; }
  .panel { margin: 20px 0 0; padding: 44px 56px 48px; }
  .panel h1 { font-size: 44px; }
  footer { padding-top: 76px; }
}

/* Motion: once, on arrival, the faces pop in and the ringed one comes last. Nothing loops; none with Reduce Motion. */
@media (prefers-reduced-motion: no-preference) {
  .crowd li { animation: pop 0.42s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
  .crowd li:nth-child(5n+1) { animation-delay: 0s; }
  .crowd li:nth-child(5n+2) { animation-delay: 0.06s; }
  .crowd li:nth-child(5n+3) { animation-delay: 0.12s; }
  .crowd li:nth-child(5n+4) { animation-delay: 0.18s; }
  .crowd li:nth-child(5n) { animation-delay: 0.24s; }
  .crowd li.you { animation-delay: 0.5s; animation-duration: 0.55s; }
  @keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
}
