/*
 * Give me something (givemesomething.to): the front page. A TV's app menu (concept E, chosen 2026-10-14 from
 * seven; the others are under the git tag `concepts`): a short list of the verbs, and a screen showing the
 * site in focus as it really looks. Watch's Living Room tokens, all three verb colours, Red Hat Display and
 * Red Hat Text, dark only. Rules in docs/DESIGN.md.
 */

@font-face { font-family: 'Red Hat Display'; src: url('fonts/red-hat-display-latin-wght-normal.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'Red Hat Text'; src: url('fonts/red-hat-text-latin-wght-normal.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  /* Neutral ramp (dimmed-room blue-black), back to front: the same as Watch */
  --canvas: #0a0d13;
  --surface: #121722;
  --raised: #1b2230;
  --line: #263044;
  --line-strong: #6c7a93;
  --ink-3: #8a97ab;
  --ink-2: #b4bfd0;
  --ink: #eef2f8;
  /* One colour per verb (PLATFORM.md: Brand) */
  --watch: #f0b84a;
  --watch-strong: #ffcb66;
  --play: #6fdc9b;
  --play-strong: #93efb8;
  --read: #ff8f7a;
  --read-strong: #ffaa99;

  --font-display: 'Red Hat Display', system-ui, sans-serif;
  --font-body: 'Red Hat Text', system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: dark;
}

/* Each verb sets --c (its colour) and --c-strong (hover); the room's light and focus rings follow it. */
.v-watch { --c: var(--watch); --c-strong: var(--watch-strong); }
.v-play { --c: var(--play); --c-strong: var(--play-strong); }
.v-read { --c: var(--read); --c-strong: var(--read-strong); }

* { box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* The page itself is clear so the room's light (.glow) shows behind it. */
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-size: 15px; line-height: 1.45; display: flex; flex-direction: column; }
a { color: inherit; }
h1 { margin: 0; font: inherit; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--c, var(--watch)); outline-offset: 3px; }
[hidden] { display: none !important; } /* the env tag's hidden state wins over any layout's display */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.caps { font-family: var(--font-body); font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
/* Local and Preview are tagged loudly so neither is mistaken for the live site (as on Watch). */
.env-tag { margin-left: 10px; padding: 3px 6px 2px; border-radius: 4px; background: var(--watch); color: #191103; font-size: 10px; letter-spacing: 0.08em; vertical-align: 1px; }

/* The room's light: a glow of the verb in focus, behind everything (on its own layer, so it can flicker: D-020) */
.glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--canvas); }
.glow::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 75% at 72% 45%, color-mix(in srgb, var(--c) 19%, transparent), transparent 70%); }

/*
 * ── The glows flicker like a TV's light in a dark room (D-020) ──
 * Both rise and fall unevenly, together, over 11 seconds: the room's light (.glow::before) and the glow under the
 * screen (.screen-glow, a box the screen's size behind it). Only their opacity moves, which the browser hands to the
 * graphics card; animating the glow's colour or a box-shadow itself would redraw it every frame (measured: a tenth
 * of the page's time). At rest (reduced motion) they sit at 0.8, the strength they had before they moved.
 */
.glow::before, .screen-glow { opacity: 0.8; animation: gms-tv-light 11s ease-in-out infinite; }
@keyframes gms-tv-light {
  0%, 100% { opacity: 0.8; } 9% { opacity: 1; } 14% { opacity: 0.66; } 22% { opacity: 0.86; } 35% { opacity: 0.68; } 41% { opacity: 1; }
  55% { opacity: 0.76; } 63% { opacity: 0.92; } 70% { opacity: 0.6; } 82% { opacity: 0.86; } 90% { opacity: 0.7; }
}

/*
 * The page is three blocks: the side (lockup line, list, key hint), the screen, and the line about the site
 * with its Open button. Each screen shape only places them (docs/DESIGN.md: Layout). Desktop: the side
 * beside the screen and centred on it, the line about the site under the screen.
 */
.menu { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 40px 32px;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: 'side screen' '. about'; gap: 22px 64px; align-content: center; }
.side { grid-area: side; align-self: center; min-width: 0; }
/* The lockup line, and the Beta tag beside it (as on Watch: its .proto-tag). The tag sits outside .pre, so it stays
   behind when the line flies into a site's header. */
.masthead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 22px 22px; }
.pre { display: block; width: fit-content; margin: 0; font-size: 12px; color: var(--ink-2); view-transition-name: gms-pre; }
.beta-tag { padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; line-height: 1.2; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ── The list ───────────────────────────────────────────────────────── */
.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.list > li { display: grid; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 84px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 220ms var(--ease), background-color 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease); }
.item .word { font-family: var(--font-display); font-weight: 900; font-size: 44px; line-height: 1; letter-spacing: 0.04em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 65%, var(--canvas)); transition: color 220ms var(--ease); }
.item .hint { font-size: 15px; color: var(--ink-3); }
.item.on { transform: scale(1.04); background: var(--raised); border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent), 0 20px 40px -18px rgb(0 0 0 / 0.7); }
/* The verb in focus is the one that flies into the site's header on the way in */
.item.on .word { color: var(--c); view-transition-name: gms-verb; }
.item:focus-visible { outline: none; }
.keys { margin: 22px 0 0 22px; font-size: 12px; color: var(--ink-3); }
kbd { display: inline-block; min-width: 20px; padding: 2px 5px; border: 1px solid var(--line-strong); border-radius: 4px; font: 700 11px/1.2 var(--font-body); text-align: center; color: var(--ink-2); }

/* ── The screen: a real look at each site's listings ────────────────── */
/* 16:10, as wide as its column but never taller than the window leaves room for. The glow of the verb's colour
   under it is a box of the same size and place behind it (.screen-glow), so the glow can move on its own (D-020). */
.screen, .screen-glow { grid-area: screen; width: min(100%, calc((100dvh - 220px) * 1.6)); aspect-ratio: 16 / 10; justify-self: start; border-radius: 14px; }
.screen { position: relative; display: block; overflow: hidden; background: var(--surface); text-decoration: none; view-transition-name: gms-screen; -webkit-tap-highlight-color: transparent; container-type: size; box-shadow: 0 0 0 1px var(--line); }
.screen-glow { pointer-events: none; box-shadow: 0 40px 90px -40px color-mix(in srgb, var(--c) 66%, transparent); transition: box-shadow 400ms var(--ease); }
/*
 * Each preview is a tall strip of the site's listings, as wide as the screen, shown as an endless stream
 * (D-016): once the picture has loaded, hub.js gives its <picture> the class "feeding" and --strip, --ratio and
 * --feed-time, and the strip is drawn twice on the ::before, sliding up at a steady 40px a second so the loop
 * never jumps. Pointing at the screen stops it. Until then the picture itself shows, from the top.
 */
.screen .shot { position: absolute; inset: 0; opacity: 0; }
.screen .shot img { position: absolute; top: 0; left: 0; display: block; width: 100%; height: auto; }
.screen .shot.feeding img { opacity: 0; }
.screen .shot.feeding::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--ratio) * 100cqw * 2);
  background: var(--strip) repeat-y 0 0 / 100% calc(var(--ratio) * 100cqw); }
.screen .shot.on.feeding::before { animation: gms-feed var(--feed-time) linear infinite; }
.screen:hover .shot.on::before { animation-play-state: paused; }
@keyframes gms-feed { to { transform: translateY(-50%); } }
/* The top and bottom of the stream fade into the room */
.screen::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(var(--canvas), transparent 14%, transparent 86%, var(--canvas)); }
/* On arrival, and changing site, a preview turns on like an old TV: a bright line opening into the picture (D-019 for the others) */
.screen .shot.on { opacity: 1; animation: gms-tv-on 620ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes gms-tv-on {
  0% { clip-path: inset(49.5% 50% 49.5% 50%); filter: brightness(6) saturate(0); }
  30% { clip-path: inset(49.5% 0 49.5% 0); filter: brightness(5) saturate(0); }
  100% { clip-path: inset(0); filter: none; }
}
.caption { position: absolute; z-index: 3; right: 14px; bottom: 12px; padding: 5px 9px; border-radius: 6px; background: rgb(5 7 11 / 0.82); font-size: 12px; color: var(--ink-2); opacity: 0; transition: opacity 300ms var(--ease); }
.screen .caption.on { opacity: 1; }

.about { grid-area: about; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; min-width: 0; }
.about p { max-width: 34ch; min-height: 2lh; font-size: 19px; line-height: 1.35; color: var(--ink); }
/* Two lines and a button's height are kept even for Read (one line, no button), so changing site never moves the page */
.actions { min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-3); }
.open { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 8px; background: var(--c); color: var(--canvas); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.open:hover { background: var(--c-strong); }

/* Leaving for another domain (and where browsers can't carry a transition): the screen grows to fill the window */
.cover { position: fixed; z-index: 200; overflow: hidden; background: var(--to); pointer-events: none; }
.cover img { position: absolute; top: 0; left: 0; width: 100%; height: auto; }

/* ── How each site's preview comes on (D-019): hub.js sets the screen's data-enter as the site changes ── */
/* Watch: the TV switch-on above. Play: the picture comes in blocky and sharpens in four quick steps, like an old
   game loading (drawn by hub.js on a canvas over it). Read: uncovered right to left behind a turning page's edge. */
.screen[data-enter='none'] .shot.on, .screen[data-enter='pixels'] .shot.on { animation: none; }
.screen .pixels { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.screen[data-enter='turn'] .shot.on { animation: gms-turn 440ms cubic-bezier(0.3, 0.6, 0.2, 1) both; }
@keyframes gms-turn { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }
.screen[data-enter='turn']::before { content: ''; position: absolute; top: 0; bottom: 0; width: 28%; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(255 236 228 / 0.12) 46%, rgb(0 0 0 / 0.5) 50%, transparent); animation: gms-turn-edge 440ms cubic-bezier(0.3, 0.6, 0.2, 1) both; }
@keyframes gms-turn-edge { from { left: 86%; } 80% { opacity: 1; } to { left: -14%; opacity: 0; } }

/* ── Footer: one quiet line, like Watch's ───────────────────────────── */
.site-footer { display: flex; justify-content: flex-end; align-items: center; max-width: 1280px; width: 100%; margin: 0 auto; padding: 0 32px 20px; font-size: 12px; color: var(--ink-3); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 20px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ── The privacy note (/hub/privacy): one 720px column, as on Watch's info pages ── */
.info-head { width: 100%; max-width: 784px; margin: 0 auto; padding: 20px 32px 0; }
.info-head .back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 12px; color: var(--ink-2); text-decoration: none; }
.info-head .back:hover { color: var(--ink); }
.info { flex: 1; width: 100%; max-width: 784px; margin: 0 auto; padding: 16px 32px 48px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.info h1 { margin: 12px 0 16px; font-family: var(--font-display); font-weight: 800; font-size: clamp(36px, 6vw, 56px); line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.info .lede { font-size: 18px; line-height: 1.5; color: var(--ink); }
.info h2 { margin: 36px 0 8px; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.2; color: var(--ink); }
.info ul { margin: 0; padding-left: 20px; }
.info li + li { margin-top: 8px; }
.info b, .info code { color: var(--ink); }
.info code { font-size: 0.9em; }
.info a { color: var(--watch); text-underline-offset: 3px; }
.site-footer a[aria-current='page'] { color: var(--ink); }
/* The not-found page's way back: each site's lockup, in its colour (404.html) */
.info .lost { display: grid; gap: 10px; margin: 20px 0 24px; padding: 0; list-style: none; }
.info .lost li + li { margin-top: 0; }
.info .lost a { display: inline-grid; gap: 4px; padding: 10px 0; text-decoration: none; }
.info .lost .caps { font-size: 10px; color: var(--ink-2); }
.info .lost b { font-family: var(--font-display); font-weight: 900; font-size: 34px; line-height: 0.9; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c); }
.info .lost a:hover b { color: var(--c-strong); }
@media (max-width: 899px) {
  .info-head { padding: max(12px, env(safe-area-inset-top)) 16px 0; }
  .info { padding: 8px 16px 32px; }
}

/*
 * ── Phones held upright (and tablets): the page fills the screen. The side is a column of three tall tiles
 * with the lockup line over them, the screen fills the rest of the width and height with the site's phone
 * listings, and the line about the site and a full-width Open button sit at the bottom, under your thumb.
 */
@media (max-width: 899px) and (orientation: portrait) {
  .menu { min-height: calc(100dvh - 76px); /* the footer wraps to two lines on phones */ padding: max(20px, env(safe-area-inset-top)) 16px 12px;
    grid-template-columns: minmax(96px, 24%) minmax(0, 1fr); grid-template-rows: minmax(320px, 1fr) auto; grid-template-areas: 'side screen' 'about about'; gap: 16px 12px; align-content: stretch; }
  .side { display: flex; flex-direction: column; gap: 12px; align-self: stretch; }
  .masthead { margin: 0; }
  .pre { font-size: clamp(10px, 1.7vw, 13px); line-height: 1.5; letter-spacing: 0.18em; }
  .beta-tag { font-size: 10px; }
  .env-tag { display: table; margin: 6px 0 0; }
  .list { flex: 1; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .item { flex-direction: column; justify-content: center; gap: 8px; min-height: 64px; padding: 0 6px; border-radius: 12px; background: var(--surface); border-color: var(--line); }
  .item.on { transform: none; background: var(--raised); }
  .item .word { font-size: clamp(19px, 5.2vw, 34px); letter-spacing: 0.03em; }
  .item .hint, .keys { display: none; }
  .screen, .screen-glow { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 12px; }
  .caption { right: 8px; bottom: 8px; padding: 4px 7px; font-size: 10px; }
  .about { gap: 12px; }
  .about p { max-width: none; font-size: clamp(16px, 2.6vw, 20px); }
  .actions { width: 100%; min-height: 52px; }
  .open { flex: 1; min-height: 52px; }
  .site-footer { padding: 0 16px max(8px, env(safe-area-inset-bottom)); }
  .site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ── Phones turned sideways: the desktop layout, compact, the screen sized to the window's height ── */
@media (max-width: 899px) and (orientation: landscape) {
  .menu { padding: 16px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); grid-template-columns: 190px minmax(0, 1fr); gap: 12px 24px; }
  .masthead { margin: 0 0 10px 14px; }
  .pre { font-size: 10px; }
  .beta-tag { font-size: 10px; }
  .list { gap: 6px; }
  .item { min-height: 54px; padding: 0 14px; border-radius: 10px; }
  .item.on { transform: none; }
  .item .word { font-size: 28px; }
  .keys { display: none; }
  .screen, .screen-glow { width: min(100%, calc((100dvh - 120px) * 1.6)); border-radius: 10px; }
  .about p { font-size: 15px; }
  .actions, .open { min-height: 44px; }
  .site-footer { padding: 0 20px 8px; }
}

/*
 * The hand-off into a site on this domain (Watch now): a cross-page view transition. The screen becomes the
 * site's page and "GIVE ME SOMETHING TO" + the verb land in its header; the old page fades out, then the new
 * one in. The site declares the same names and timing (docs/ARCHITECTURE.md: The hand-off).
 */
@view-transition { navigation: auto; }
:root { --vt: 520ms; }
::view-transition { background: var(--canvas); }
::view-transition-group(*) { animation-duration: var(--vt); animation-timing-function: var(--ease); }
::view-transition-old(gms-screen), ::view-transition-new(gms-screen) { height: 100%; object-fit: cover; object-position: top; }
::view-transition-old(root), ::view-transition-old(gms-screen) { animation: gms-out calc(var(--vt) * 0.4) ease-out both; }
::view-transition-new(root), ::view-transition-new(gms-screen) { animation: gms-in calc(var(--vt) * 0.7) ease-in calc(var(--vt) * 0.3) both; }
@keyframes gms-out { to { opacity: 0; } }
@keyframes gms-in { from { opacity: 0; } }

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