/* WordGamr's page (arcg.co/wordgamr/), on top of game.css. Neutral and warm, built around the walnut of the Marble &
   Brass look and the new sky-and-cobalt wordmark. October adds the Halloween hero (shown until the end of October 31;
   src/schedule.js swaps it for the walnut hero by itself).
   Spacing is an 8-point scale; type is one fluid scale (xs to 4xl) shared by every section. */

.g-wordgamr {
  /* color */
  --ws-walnut: #2B1B11; --ws-ink: #15162A; --ws-ink-2: #1E2038;
  --ws-paper: #FAF8F4;  --ws-mist: #EFEBE4;
  --ws-text: #1C1B22;   --ws-text-2: #4A4752;            /* 16.1:1 and 8.6:1 on paper */
  --ws-on-ink: #ECE8F4; --ws-on-ink-2: #B8B3C7;          /* 14.8:1 and 8.7:1 on ink */
  --ws-sky: #86C8EF;    --ws-cobalt: #173F84;            /* the wordmark's two colors; sky is 9.6:1 on ink */
  --ws-gold: #F2B04A;                                    /* 9.4:1 on ink */
  --ws-hair-dark: rgba(255, 255, 255, .12); --ws-hair-light: rgba(28, 27, 34, .12);
  --hw-night: #120C24; --hw-pumpkin: #FF8A1F; --hw-moon: #F4E9C8; --hw-text: #DCD3EE;

  /* type */
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.5rem, 1.25rem + .8vw, 1.875rem);
  --fs-2xl: clamp(2rem, 1.45rem + 2.2vw, 3rem);
  --fs-3xl: clamp(2.25rem, 1.35rem + 3.6vw, 3.75rem);
  --fs-4xl: clamp(2.75rem, 1.6rem + 4.8vw, 4.5rem);

  /* space */
  --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --section-y: clamp(80px, 48px + 6vw, 144px);

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1); --dur-1: 180ms; --dur-2: 280ms; --dur-3: 700ms;

  /* game.css's variables, moved onto the neutral palette */
  --g-deep: var(--ws-ink); --g-deep-2: var(--ws-ink-2); --g-ink: var(--ws-text); --g-ink-2: var(--ws-text-2);
  --g-page: var(--ws-paper); --g-light: var(--ws-mist);
  --g-on-deep: var(--ws-on-ink); --g-on-deep-2: var(--ws-on-ink-2); --g-head-on-deep: #FFE2A8;
  --g-chapter: #B8B3C7; --g-chapter-b: #ECE8F4;
  --g-phone: #0D0E1A; --g-shade: 20, 12, 7; --g-link: #1F55B8; --g-link-hi: #173F84;
}
.g-wordgamr main { font-size: var(--fs-base); line-height: 1.65; }
.g-wordgamr main h2 { font-size: var(--fs-3xl); line-height: 1.03; letter-spacing: -.015em; }
.g-wordgamr main h3 { line-height: 1.12; }
.g-wordgamr .section-intro { max-width: 48ch; margin-top: var(--s-5); font-size: var(--fs-lg); line-height: 1.55; }
.g-wordgamr .eyebrow { margin-bottom: var(--s-4); color: var(--ws-cobalt); font: 800 var(--fs-xs)/1.4 var(--body); letter-spacing: .14em; text-transform: uppercase; }
.g-wordgamr .pz .eyebrow, .g-wordgamr .materials .eyebrow { color: var(--ws-sky); }
.g-wordgamr .phone { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1), 0 36px 64px -28px rgba(var(--g-shade), .7); }

/* ---------- heroes ---------- */
.g-wordgamr .ws-hero { position: relative; z-index: 1; overflow-x: clip; background: var(--ws-walnut); }   /* above the next section, so the phones can overlap it */
.g-wordgamr .ws-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.g-wordgamr .ws-hero .wrap { position: relative; z-index: 2; }
.ws-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7); padding-top: var(--s-7); }
.ws-hero-copy { position: relative; }
.ws-logo { margin: 0; line-height: 0; }
.ws-logo img { width: min(100%, 280px); height: auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45)); }
.ws-lede { margin-top: var(--s-5); color: #fff; font: 700 var(--fs-lg)/1.45 var(--body); }
.ws-lede span { display: block; }
.ws-platforms { margin-top: var(--s-3); color: #F5E6CF; font-size: var(--fs-sm); font-weight: 700; letter-spacing: .02em; }
.g-wordgamr .hero-actions { margin-top: var(--s-6); }

/* walnut (from November 1): WordGamr's own walnut planks. Phones get the tall photo; wide screens the same photo turned
   so the planks run across (2532 px wide, so it stays sharp; turned, never stretched) */
.ws-hero.wn { background: var(--ws-walnut) url("/assets/wordgamr/walnut.webp") 50% 0 / cover no-repeat; }
.ws-hero.wn::before { background: linear-gradient(180deg, rgba(20, 12, 7, .55) 0%, rgba(20, 12, 7, .2) 48%, rgba(20, 12, 7, .45) 100%); }

/* three Themes on the same round, fanned; the side phones slide out from behind once on load */
.fan { position: relative; height: 452px; margin-bottom: -64px; --front: 208px; --side: 172px; --off: 64px; --drop: 28px; }
.fan .phone { position: absolute; left: 50%; bottom: 0; width: var(--side); padding: 7px; border-radius: 30px; translate: calc(-50% + var(--x, 0px)) var(--drop); }
.fan .phone img { border-radius: 24px; }
.fan .front { z-index: 2; width: var(--front); padding: 9px; border-radius: 38px; translate: -50% 0; }
.fan .front img { border-radius: 30px; }
.fan .left { --x: calc(var(--off) * -1); }
.fan .right { --x: var(--off); }
.js .fan .left, .js .fan .right { --x: 0px; opacity: 0; transition: translate var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out); }
.js .fan.is-open .left { --x: calc(var(--off) * -1); opacity: 1; }
.js .fan.is-open .right { --x: var(--off); opacity: 1; transition-delay: 120ms; }
@media (prefers-reduced-motion: reduce) { .js .fan .left, .js .fan .right { transition: none; } }

/* Halloween (until the end of October 31): the game's Haunted Hollow scene */
.ws-hero.hw { background: var(--hw-night); }
.hw-scene { position: absolute; inset: 0; z-index: 0; background: url("/assets/wordgamr/haunted.webp") 50% 28% / cover no-repeat; }
.ws-hero.hw::before { background: linear-gradient(180deg, rgba(18, 12, 36, .86) 0%, rgba(18, 12, 36, .62) 52%, rgba(18, 12, 36, .35) 84%, var(--ws-ink) 100%); }
.hw-pill { display: inline-block; margin-top: var(--s-6); padding: 6px 14px; border-radius: 999px; background: var(--hw-pumpkin); color: var(--hw-night); font: 800 var(--fs-xs)/1.3 var(--body); letter-spacing: .12em; text-transform: uppercase; }
.g-wordgamr main .hw-title { margin-top: var(--s-4); color: var(--hw-moon); font-size: var(--fs-4xl); line-height: .98; letter-spacing: -.02em; text-shadow: 0 2px 24px rgba(255, 138, 31, .25); }
.hw-lede { max-width: 34ch; margin-top: var(--s-4); color: var(--hw-text); font-size: var(--fs-lg); line-height: 1.5; font-weight: 600; }
.hw-meta { margin-top: var(--s-4); color: var(--hw-moon); font-size: var(--fs-sm); font-weight: 800; }
.hw-meta + .ws-platforms { margin-top: 6px; color: #BFB3D9; }
.hw-phone { justify-self: center; margin-bottom: -64px; }
.hw-phone .phone { width: 240px; background: #07050E; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08), 0 0 80px -16px rgba(255, 138, 31, .4), 0 40px 70px -24px rgba(0, 0, 0, .8); }
.hw-phone video { aspect-ratio: 780 / 1688; background: var(--hw-night); }
/* both heroes: a tablet held sideways behind, the phone in front (game.css .duo) */
.g-wordgamr .duo { justify-self: center; margin-bottom: -64px; }
.hw-duo .duo-phone { background: #07050E; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08), 0 0 80px -16px rgba(255, 138, 31, .45), 0 40px 70px -24px rgba(0, 0, 0, .8); }
.hw-duo .duo-phone video { display: block; width: 100%; height: auto; aspect-ratio: 780 / 1688; background: var(--hw-night); }
.hw-duo .duo-tablet { background: #07050E; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08), 0 0 90px -20px rgba(255, 138, 31, .3), 0 40px 70px -24px rgba(0, 0, 0, .8); }

/* ---------- Make it yours ---------- */
.pz { position: relative; background: var(--ws-ink); color: var(--ws-on-ink); padding: calc(var(--section-y) + 64px) 0 var(--section-y); overflow-x: clip; }
.pz::before { content: ""; position: absolute; inset: 0; pointer-events: none;   /* the crossword board's grid, faintly */
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center top;
  -webkit-mask-image: radial-gradient(75% 60% at 30% 45%, #000 25%, transparent 75%); mask-image: radial-gradient(75% 60% at 30% 45%, #000 25%, transparent 75%); }
.pz .wrap { position: relative; }
.pz-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "media" "list"; gap: var(--s-7); }
.pz-copy { grid-area: copy; }
.pz-media { grid-area: media; justify-self: center; }
.pz-list { grid-area: list; }
.pz h2 { color: #fff; }
.pz .section-intro { color: var(--ws-on-ink-2); }
.pz-stick { display: flex; flex-direction: column; align-items: center; }
.pz-media .phone { width: 232px; background: #07080F; }
.pz-media video { aspect-ratio: 780 / 1688; background: var(--ws-ink); }
.pz-caption { display: flex; align-items: center; justify-content: center; min-height: 40px; margin-top: var(--s-5); padding: 0 18px; border-radius: 999px; background: rgba(134, 200, 239, .1); box-shadow: inset 0 0 0 1px rgba(134, 200, 239, .28); color: var(--ws-sky); font: 800 var(--fs-sm)/1 var(--body); letter-spacing: .02em; white-space: nowrap; }
.pz-caption span { display: block; }
.pz-caption span.in { animation: pz-in var(--dur-1) var(--ease-out); }
@keyframes pz-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pz-caption span.in { animation: none; } }

.kinds { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ws-hair-dark); }
.kind { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: var(--s-4); row-gap: 2px; align-items: center; padding: var(--s-4) var(--s-3) var(--s-4) var(--s-3); border-bottom: 1px solid var(--ws-hair-dark); transition: background-color var(--dur-2) ease, box-shadow var(--dur-2) ease; }
.kind svg { grid-row: 1 / span 2; width: 26px; height: 26px; fill: none; stroke: var(--ws-sky); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kind-name { color: #fff; font: 800 var(--fs-lg)/1.2 var(--display); white-space: nowrap; }
.kind-desc { grid-column: 2; color: var(--ws-on-ink-2); font-size: var(--fs-sm); line-height: 1.45; }
.kind-count { grid-row: 1 / span 2; grid-column: 3; color: var(--ws-gold); font: 800 var(--fs-xl)/1 var(--display); font-variant-numeric: tabular-nums; }
.kind[data-active] { background: linear-gradient(90deg, rgba(134, 200, 239, .14), rgba(134, 200, 239, 0) 75%); box-shadow: inset 2px 0 0 var(--ws-sky); }
.kinds-total { margin-top: var(--s-5); color: var(--ws-on-ink-2); font-size: var(--fs-sm); }

/* ---------- Themes ---------- */
.looks { background: var(--ws-paper); padding: var(--section-y) 0; }
.looks-head { max-width: 760px; }
.looks h2 { color: var(--ws-text); }
.looks .section-intro { color: var(--ws-text-2); }
.look-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-7) var(--s-5); margin: var(--s-8) 0 0; padding: 0; list-style: none; }
.look { display: flex; flex-direction: column; align-items: center; width: 150px; }
.look .phone { width: 100%; padding: 6px; border-radius: 26px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1), 0 24px 40px -24px rgba(21, 22, 42, .45); }
.look .phone img { border-radius: 21px; }
.look-name { position: relative; margin-top: var(--s-4); color: var(--ws-text); font: 800 var(--fs-base)/1.2 var(--display); white-space: nowrap; }
.look-tag { margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: var(--hw-pumpkin); color: var(--hw-night); font: 800 11px/1.3 var(--body); letter-spacing: .1em; text-transform: uppercase; }
@media (hover: hover) {
  .look .phone { transition: translate var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
  .look:hover .phone { translate: 0 -6px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1), 0 36px 56px -28px rgba(21, 22, 42, .55); }
  .look-name::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--ws-gold); scale: 0 1; transform-origin: left; transition: scale var(--dur-2) var(--ease-out); }
  .look:hover .look-name::after { scale: 1 1; }
}
@media (prefers-reduced-motion: reduce) { .look .phone, .look-name::after { transition: none; } }

.features { display: grid; grid-template-columns: minmax(0, 1fr); margin: var(--s-9) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ws-hair-light); }
.features li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: var(--s-4); align-content: start; padding: var(--s-5) 0; border-bottom: 1px solid var(--ws-hair-light); }
.features svg { grid-row: 1 / span 3; width: 26px; height: 26px; fill: none; stroke: var(--ws-cobalt); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.features h3 { color: var(--ws-text); font-size: var(--fs-lg); white-space: nowrap; }
.features p { margin-top: 6px; color: var(--ws-text-2); font-size: var(--fs-sm); line-height: 1.55; }
.feat-tag { justify-self: start; margin-top: var(--s-3); padding: 2px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(23, 63, 132, .35); color: var(--ws-cobalt); font: 800 11px/1.5 var(--body); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- How it plays (rules) ---------- */
.g-wordgamr .materials { padding: var(--section-y) 0; }
.g-wordgamr .materials h2 { max-width: none; color: #fff; font-size: var(--fs-3xl); }
.g-wordgamr .mat-grid { gap: var(--s-7) var(--s-6); margin-top: var(--s-8); }
.g-wordgamr .mat-name { gap: var(--s-3); margin-top: 20px; }
.g-wordgamr .mat-name h3 { font-size: var(--fs-xl); }
.g-wordgamr .mat-copy { margin-top: var(--s-4); font-size: var(--fs-sm); }
.g-wordgamr .pill, .g-wordgamr .pill-2, .g-wordgamr .pill-3 { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .26); color: #FFE2A8; font-size: 12px; letter-spacing: .02em; }

/* ---------- Modes ---------- */
.g-wordgamr .modes { padding: var(--section-y) 0; }
.g-wordgamr .modes h2 { max-width: 15ch; font-size: var(--fs-3xl); color: var(--ws-text); }
.g-wordgamr .mode h3 { font-size: var(--fs-xl); color: var(--ws-text); }
.g-wordgamr .phones .phone { transform: none; }
.g-wordgamr .phones .p1 { left: 2%; top: 56px; }
.g-wordgamr .phones .p2 { left: 48%; top: 0; }

/* ---------- Collect ---------- */
.g-wordgamr .collect { padding: var(--section-y) 0; background: var(--ws-paper); border-top: 1px solid var(--ws-hair-light); }
.g-wordgamr .collect h2 { max-width: none; color: var(--ws-text); font-size: var(--fs-3xl); }
.ways { display: grid; grid-template-columns: minmax(0, 1fr); margin: var(--s-8) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ws-hair-light); }
.ways li { padding: var(--s-5) 0 var(--s-6); border-bottom: 1px solid var(--ws-hair-light); }
.way-n { display: block; color: var(--ws-cobalt); font: 800 var(--fs-xs)/1 var(--body); letter-spacing: .14em; }
.ways h3 { margin-top: var(--s-3); color: var(--ws-text); font-size: clamp(1.25rem, 1rem + .6vw, 1.5rem); white-space: nowrap; }
.ways p { max-width: 40ch; margin-top: var(--s-3); color: var(--ws-text-2); font-size: var(--fs-base); }
.g-wordgamr .collect .tile-row { justify-content: center; margin-top: var(--s-8); }

/* ---------- VIP: one glow less ---------- */
.g-wordgamr .vip { padding: var(--section-y) 0; }
.g-wordgamr .vip h2 { font-size: var(--fs-3xl); text-shadow: none; }

/* ---------- closing: quiet, on paper ---------- */
.g-wordgamr .closing { background: var(--ws-paper); border-top: 1px solid var(--ws-hair-light); padding: var(--s-9) 0; }
.g-wordgamr .closing h2 { color: var(--ws-text); font-size: var(--fs-2xl); line-height: 1.06; }
.g-wordgamr .closing p { color: var(--ws-text-2); font-size: var(--fs-lg); font-weight: 600; }

/* ---------- 600 px and up ---------- */
@media (min-width: 600px) {
  .fan { height: 520px; margin-bottom: -80px; --front: 240px; --side: 200px; --off: 104px; --drop: 32px; }
  .ws-logo img { width: min(100%, 320px); }
  .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-7); }
  .look { width: 168px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-7); }
  .hw-phone .phone { width: 260px; }
}

/* ---------- 960 px and up: two columns ---------- */
@media (min-width: 960px) {
  .ws-hero-grid { grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: var(--s-8); align-items: center; padding-top: var(--s-8); }
  .ws-hero-copy { padding-bottom: var(--s-9); }
  .ws-logo img { width: min(100%, 360px); }
  .ws-lede { margin-top: var(--s-6); font-size: 1.5rem; }
  .fan { align-self: end; height: 610px; margin-bottom: -96px; --front: 280px; --side: 236px; --off: 132px; --drop: 36px; }
  .fan .front { padding: 11px; border-radius: 46px; } .fan .front img { border-radius: 36px; }
  .fan .phone:not(.front) { padding: 9px; border-radius: 40px; } .fan .phone:not(.front) img { border-radius: 31px; }
  .ws-hero.wn { background-image: url("/assets/wordgamr/walnut-wide.webp"); background-position: 50% 50%; }
  .ws-hero.wn::before { background: linear-gradient(90deg, rgba(20, 12, 7, .62) 0%, rgba(20, 12, 7, .3) 46%, rgba(20, 12, 7, 0) 72%), linear-gradient(180deg, rgba(20, 12, 7, .3) 0%, rgba(20, 12, 7, 0) 30%); }
  /* the scene sits on the right at its own size (never enlarged) and fades into the night on the left */
  .hw-scene { left: auto; width: min(64%, 920px); background-position: 50% 84%; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%); mask-image: linear-gradient(90deg, transparent 0%, #000 38%); }
  .ws-hero.hw::before { background: linear-gradient(90deg, rgba(18, 12, 36, .9) 0%, rgba(18, 12, 36, .55) 40%, rgba(18, 12, 36, 0) 70%), linear-gradient(180deg, rgba(18, 12, 36, .45) 0%, rgba(18, 12, 36, 0) 35%, rgba(21, 22, 42, 0) 78%, var(--ws-ink) 100%); }
  .hw-phone { align-self: end; margin-bottom: -96px; }
  .g-wordgamr .duo { align-self: center; justify-self: end; margin: 8px 0 -40px; }
  .hw-phone .phone { width: 290px; padding: 11px; border-radius: 46px; } .hw-phone video { border-radius: 36px; }

  .pz { padding-top: calc(var(--section-y) * 1.25 + 96px); padding-bottom: calc(var(--section-y) * 1.25); }
  .pz-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "media copy" "media list"; column-gap: var(--s-9); row-gap: var(--s-7); align-items: start; }
  .pz-media { justify-self: start; align-self: stretch; }
  .pz-stick { position: sticky; top: 112px; }
  .pz-media .phone { width: 300px; padding: 11px; border-radius: 48px; } .pz-media video { border-radius: 38px; }

  .kinds { grid-template-columns: minmax(0, 1fr); }   /* one column beside the phone until there's room for two */
  .ways { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s-6); border-top: 0; }
  .ways li { border-top: 1px solid var(--ws-hair-light); border-bottom: 0; }
  .look-grid { flex-wrap: nowrap; gap: 40px; }
  .look { width: auto; flex: 1 1 0; max-width: 228px; }
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-wordgamr .phones .p1 { left: 0; }
  .g-wordgamr .phones .p2 { left: 46%; }
}
@media (min-width: 1180px) { .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) and (max-width: 1100px) { .look-name { font-size: var(--fs-sm); } }
@media (max-width: 380px) { .ws-lede { font-size: 1.125rem; } .pz-media .phone { width: 216px; } .look { width: 136px; } .g-wordgamr .phones .p2 { left: auto; right: 0; } }

/* ---------- phones: WORDGAMR's eight letter tiles in two rows of four, WORD over GAMR, as in the logo ---------- */
@media (max-width: 560px) {
  .g-wordgamr .collect .tile-row { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 300px; }
}
