/* Tiltyard Games, "now playing" view: a hero with one phone that changes channel beside a
   scoreboard of the six games, then alternating feature rows with each phone tilted a few degrees
   (a tilt, as in pinball), then studio and contact. System faces only; nothing fetched from
   another origin. */
:root {
  --ink: #0a0c10; --panel: #11151d; --raise: #161b25; --line: #222a38; --line-hi: #34405a;
  --fg: #edf0f6; --dim: #c9cfdb; --muted: #949db0;
  --gold: #f2b63c; --azure: #7c9cff; --acc: #f2b63c;
  --f-display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--ink); color: var(--fg); font: 15.5px/1.55 var(--f-body); }
a { color: var(--gold); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 30; }
.skip:focus { left: 12px; }

/* Header */
.bar-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: rgba(10, 12, 16, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ink); }
.bar-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-display); font-weight: 800; font-size: 17px; color: var(--fg); text-decoration: none; }
.brand svg { width: 24px; height: 24px; }
.bar-top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.bar-top nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.bar-top nav a:hover { color: var(--fg); background: var(--panel); }
@media (max-width: 560px) { .bar-top nav a { padding: 6px 7px; font-size: 13.5px; } .brand { font-size: 0; gap: 0; } .brand svg { width: 26px; height: 26px; } }

/* Hero: pitch and scoreboard on the left, the channel-changing phone on the right */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(620px 520px at 74% 50%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 70%); transition: background .6s; pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "board tv"; gap: 28px 56px; padding-block: 56px 60px; align-items: center; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.board { grid-area: board; }
.tv { grid-area: tv; align-self: center; display: flex; justify-content: center; }
@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tv" "board"; padding-block: 36px 40px; }
}
h1 { margin: 14px 0 16px; font-family: var(--f-display); font-weight: 800; font-size: clamp(42px, 6.4vw, 80px); line-height: .98; letter-spacing: -.03em; text-wrap: balance; }
h1 em { font-style: normal; color: var(--gold); }
.lede { margin: 0; max-width: 48ch; color: var(--muted); font-size: 18px; }
.board .label { display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.board .dot { width: 8px; height: 8px; border-radius: 4px; background: #ff5a5a; box-shadow: 0 0 0 4px rgba(255, 90, 90, .15); }
.channels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
@media (max-width: 520px) { .channels { grid-template-columns: minmax(0, 1fr); } }
.ch { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 12px 12px; border-radius: 12px; text-decoration: none; color: var(--muted); border: 1px solid transparent; overflow: hidden; }
.ch img { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 9px; opacity: .7; transition: opacity .2s; }
.ch .nm { font-weight: 650; font-size: 15px; color: var(--dim); }
.ch .gn { font-size: 12.5px; }
.ch:hover { background: var(--panel); }
.ch[aria-current="true"] { background: var(--panel); border-color: var(--line); }
.ch[aria-current="true"] img { opacity: 1; }
.ch[aria-current="true"] .nm { color: var(--fg); }
.ch .bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px; border-radius: 1px; background: var(--line); overflow: hidden; opacity: 0; }
.ch[aria-current="true"] .bar { opacity: 1; }
.ch .bar::after { content: ""; position: absolute; inset: 0; background: var(--acc); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* Phone */
/* The frame itself (rim, buttons, bezel, glass) lives in device.css; this sets size, lean and shadow. */
.phone { position: relative; aspect-ratio: 9 / 19.5; border-radius: 40px; cursor: zoom-in;
  filter: drop-shadow(0 34px 40px rgba(0, 0, 0, .55)) drop-shadow(0 10px 14px rgba(0, 0, 0, .35)); }
.phone .device { --r: 40px; --rim: 4px; --bezel: 6px; }
.phone.big { width: 300px; transform: rotate(2.5deg); }
@media (max-width: 880px) { .phone.big { width: min(260px, 66vw); } }
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity .45s; }
.layer.on { opacity: 1; }

/* Section heads */
header.sec { margin-bottom: 8px; max-width: 640px; }
header.sec h2 { margin: 8px 0 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.025em; }
header.sec p { margin: 10px 0 0; color: var(--muted); }

/* Feature rows */
.games { padding-block: 64px 24px; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px 64px; align-items: center; padding-block: 48px; border-bottom: 1px solid var(--line); }
.feature:last-child { border-bottom: 0; }
.feature:nth-of-type(even) .media { order: 2; }
.feature .media { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; padding-block: 12px; }
.feature .media::before { content: ""; position: absolute; width: 360px; height: 360px; max-width: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 30%, transparent), transparent 68%); pointer-events: none; }
.feature .phone { width: 236px; transform: rotate(-4deg); transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.feature .phone .device { --r: 34px; --bezel: 5px; }
.feature:nth-of-type(even) .phone { transform: rotate(4deg); }
.feature .phone:hover, .feature .phone:focus-visible { transform: rotate(0deg) scale(1.02); }
.copy { min-width: 0; display: grid; gap: 12px; }
.copy .top { display: flex; align-items: center; gap: 14px; }
.copy .top img { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.copy .top div { display: grid; gap: 6px; justify-items: start; }
.genre { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--acc); }
.pill { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; border: 1px solid var(--line-hi); color: var(--dim); }
.pill.live { background: var(--acc); border-color: var(--acc); color: var(--ink); }
.copy h3 { margin: 4px 0 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(34px, 4.2vw, 52px); line-height: 1.02; letter-spacing: -.025em; }
.copy .hook { margin: 0; font-size: 20px; font-weight: 600; color: var(--acc); }
.copy .desc { margin: 0; max-width: 52ch; color: var(--dim); font-size: 16.5px; }
.copy .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line); }
.where { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-weight: 600; font-size: 14px; }
.links a { text-decoration: none; }
.links .store { line-height: 0; }
.links .store img { height: 40px; width: auto; }
@media (max-width: 820px) {
  .feature { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 40px; }
  .feature:nth-of-type(even) .media { order: 0; }
  .feature .phone { width: 210px; }
}

/* The wall: clips pinned at slight angles */
.wallsec { padding-block: 56px 24px; border-top: 1px solid var(--line); background: linear-gradient(var(--panel), var(--ink) 60%); }
.wall { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 30px 18px; margin-top: 30px; }
@media (max-width: 1040px) { .wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  /* on a phone the wall becomes a strip to swipe through */
  .wall { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px 4px 22px; scrollbar-width: none; }
  .wall::-webkit-scrollbar { display: none; }
  .tile { scroll-snap-align: start; }
}
.tile { position: relative; margin: 0; aspect-ratio: 9 / 19.5; border-radius: 20px; overflow: hidden; background: #000; cursor: zoom-in;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06); transform: rotate(-1.6deg); transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.tile:nth-child(3n + 2) { transform: rotate(1.4deg) translateY(14px); }
.tile:nth-child(3n) { transform: rotate(-.6deg) translateY(-6px); }
.tile:hover, .tile:focus-visible { transform: rotate(0) scale(1.03); z-index: 2; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.tile figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 12px; background: linear-gradient(transparent, rgba(5, 6, 9, .92)); display: grid; gap: 2px; }
.tile figcaption b { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--acc); }
.tile figcaption span { font-size: 12.5px; line-height: 1.35; color: var(--fg); }

/* Studio and contact */
.studio, .contact { padding-block: 64px; border-top: 1px solid var(--line); }
.studio .wrap, .contact .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px 64px; align-items: start; }
@media (max-width: 820px) { .studio .wrap, .contact .wrap { grid-template-columns: minmax(0, 1fr); } }
.prose h2 { margin: 8px 0 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.02em; }
.prose p { margin: 12px 0 0; max-width: 60ch; color: var(--dim); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.facts div { background: var(--panel); padding: 18px 20px; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-family: var(--f-display); font-weight: 700; font-size: 22px; }
.addr { margin: 0; display: grid; gap: 14px; }
.addr div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.addr dt { color: var(--muted); }
.addr dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .addr div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

footer { border-top: 1px solid var(--line); }
footer .wrap { padding-block: 22px 40px; display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--muted); }
footer .legal { font-size: 11.5px; }

/* Full-size viewer */
.lb { position: fixed; inset: 0; z-index: 20; background: rgba(5, 6, 9, .96); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lb .view { display: flex; align-items: center; justify-content: center; gap: 36px; flex-wrap: wrap; min-width: 0; max-height: 100%; overflow-y: auto; }
.lb .phone { height: min(80vh, 840px); width: auto; cursor: default; animation: lift .6s cubic-bezier(.22, 1, .36, 1) both; }
.lb .phone .device { --r: 48px; --rim: 4px; --bezel: 6px; }
@keyframes lift { from { opacity: 0; translate: 0 26px; scale: .97; } }
.lb .cap { max-width: 340px; display: grid; gap: 8px; }
.lb .cap .n { font-family: var(--f-mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.lb .cap h3 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 30px; line-height: 1.08; }
.lb .cap .hook { margin: 0; font-weight: 600; color: var(--gold); }
.lb .cap p { margin: 0; color: var(--dim); }
.lb .nav { width: 48px; height: 48px; border-radius: 24px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font-size: 20px; cursor: pointer; }
.lb .nav:hover { border-color: var(--gold); color: var(--gold); }
.lb .x { position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font-size: 20px; cursor: pointer; z-index: 2; }
@media (max-width: 760px) {
  .lb { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-items: start; padding-top: max(70px, env(safe-area-inset-top, 0px)); }
  .lb .view { grid-column: 1 / -1; grid-row: 1; gap: 18px; }
  .lb .phone { height: 56vh; }
  .lb .prev { grid-column: 1; grid-row: 2; justify-self: start; }
  .lb .next { grid-column: 2; grid-row: 2; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  .feature .phone, .tile, .layer, .hero::before { transition: none; }
}

/* Clip progress under phones with several clips */
.meta { display: grid; justify-items: center; gap: 8px; }
.meta .clip { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: opacity .25s; }
.meta .clip.out { opacity: 0; }
.prog { display: flex; gap: 4px; width: 132px; height: 2.5px; }
.prog i { flex: 1; background: rgba(255, 255, 255, .14); border-radius: 2px; overflow: hidden; }
.prog b { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--acc); }
.lb .prog { width: 160px; } .lb .prog b { background: #fff; }

/* Rows rise into place as they scroll in; the hero arrives on load */
.js .feature { opacity: 0; translate: 0 34px; transition: opacity .9s cubic-bezier(.22, 1, .36, 1), translate .9s cubic-bezier(.22, 1, .36, 1); }
.js .feature.in { opacity: 1; translate: 0 0; }
.js .hero .pitch, .js .hero .board, .js .hero .tv { opacity: 0; translate: 0 18px; transition: opacity .9s cubic-bezier(.22, 1, .36, 1), translate .9s cubic-bezier(.22, 1, .36, 1); }
.js .hero .board { transition-delay: .1s; } .js .hero .tv { transition-delay: .18s; }
.js.ready .hero .pitch, .js.ready .hero .board, .js.ready .hero .tv { opacity: 1; translate: 0 0; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .js .feature, .js .hero .pitch, .js .hero .board, .js .hero .tv { opacity: 1; translate: none; transition: none; } .lb .phone { animation: none; } }
