/* whyarcade.com home: the mosaic, every film, the feed. Tokens and shared pieces are in base.css. */

.skip { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--paper); color: var(--ink); padding: 10px 14px; font: 500 14px var(--f-mono); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- buttons: the actions we want ---------- */
.btn-primary { display: inline-flex; align-items: center; gap: 0.6em; background: var(--ink); color: var(--paper); text-decoration: none; font: 600 clamp(15px, 0.95vw, 30px) var(--f-text); letter-spacing: 0.005em; padding: 0.95em 1.35em; transition: transform 0.35s var(--ease-out), background 0.25s; -webkit-tap-highlight-color: transparent; }
.btn-primary i { width: 0.5em; height: 0.5em; background: var(--vermilion); flex: none; transform-origin: 50% 100%; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:hover i { animation: sqhop 620ms var(--ease-out); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-follow { font: 600 0.8em var(--f-text); color: var(--ink); background: var(--paper); text-decoration: none; padding: 9px 16px; transition: transform 0.3s var(--ease-out); }
.btn-follow:hover { transform: translateY(-1px); }
@keyframes sqhop { 35% { transform: translateY(-90%) scale(0.9, 1.1); } 68% { transform: translateY(0) scale(1.3, 0.7); } 84% { transform: translateY(-12%); } }
.sq.hop, .stat i.hop { animation: sqhop 620ms var(--ease-out); }

/* ---------- the header: hidden over the mosaic, slides in once the brand tile has scrolled away ---------- */
.home-head { transform: translateY(-110%); opacity: 0; visibility: hidden; transition: transform 0.45s var(--ease-out), opacity 0.3s, visibility 0s 0.45s; }
body.show-head .home-head { transform: none; opacity: 1; visibility: visible; transition: transform 0.45s var(--ease-out), opacity 0.3s; }
.head-right { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 40px); }
@media (max-width: 700px) { .site-head .platforms { display: none; } }

/* ---------- intro: the "?" draws itself, the square drops, then it flies into the brand tile ---------- */
.intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--ink); pointer-events: none; transition: background-color 0.55s var(--ease-out); }
.intro .mark { height: min(34svh, 52vw); color: var(--paper); transition: transform 0.62s cubic-bezier(0.65, 0, 0.35, 1), color 0.5s; transform-origin: 50% 50%; }
.intro .mark-q { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.7s 0.05s var(--ease-out) forwards; }
.intro .mark-dot { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; animation: drop 0.42s 0.58s var(--ease-snap) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-2.2px) scale(0.85, 1.2); } 55% { opacity: 1; transform: translateY(0) scale(1.3, 0.7); } 100% { opacity: 1; transform: none; } }
.intro.fly { background-color: rgba(18, 17, 16, 0); }
.intro.fly .mark { color: var(--ink); }
body.nomark .brand-tile .lockup .mark { opacity: 0; }
/* failsafe: if the script never runs, show everything anyway (no-JS visitors get nojs.css) */
body.nomark .brand-tile .lockup .mark, .mosaic.pre > :not(.brand-tile) { animation: failsafe 0.01s 3.5s forwards; }
@keyframes failsafe { to { opacity: 1; visibility: visible; } }

/* ---------- the mosaic: the first screen, edge to edge ---------- */
.mosaic {
  --pad: clamp(6px, 0.6vw, 12px); --gap: clamp(6px, 0.6vw, 12px); --cols: 6;
  --col: calc((100vw - 2 * var(--pad) - (var(--cols) - 1) * var(--gap)) / var(--cols));
  --row: min(calc(var(--col) * 1.02), calc((100svh - 2 * var(--pad) - 2 * var(--gap)) / 3));
  display: grid; gap: var(--gap); padding: var(--pad);
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(3, var(--row));
  grid-template-areas: "T1 Q1 B B T3 Q3" "T1 T2 B B T3 T4" "Q2 T2 B B Q4 T4";
}
.mosaic.pre > :not(.brand-tile) { opacity: 0; }
.brand-tile { grid-area: B; }
.m-slot { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.m-slot > .tile { position: absolute; inset: 0; aspect-ratio: auto; }
@media (max-width: 1099px) {
  .mosaic { --cols: 4; grid-template-rows: auto repeat(3, calc(var(--col) * 1.02)); grid-template-areas: "B B B B" "T1 Q1 T2 Q2" "T1 T3 T2 T4" "Q3 T3 Q4 T4"; }
}
@media (max-width: 699px) {
  .mosaic { --cols: 2; grid-template-rows: auto repeat(6, calc(var(--col) * 1.02)); grid-template-areas: "B B" "T1 Q1" "T1 Q2" "T2 T3" "T2 T3" "Q3 T4" "Q4 T4"; }
}

/* the brand tile: the one light tile, the place to look first, and the follow button */
.brand-tile { position: relative; background: var(--paper); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between; gap: clamp(20px, 2.4vw, 40px); padding: clamp(20px, 2.4vw, 52px); min-height: 0; overflow: hidden; }
.brand-tile .mark { color: var(--ink); }
.brand-tile .lockup { color: var(--ink); font-size: clamp(16px, 0.6vw + 11px, 28px); align-self: flex-start; }
.brand-tile .typed { font-family: var(--f-word); font-weight: 600; letter-spacing: -0.035em; line-height: 0.96; font-size: clamp(38px, 3.9vw, 112px); margin: 0; min-height: 2.88em; }
.typed .caret { display: inline-block; width: 0.06em; height: 0.78em; background: currentColor; vertical-align: -0.05em; margin-left: 0.04em; animation: blink 1s steps(1) infinite; }
.typed .q-mark { height: 0.74em; }
.brand-tile .lede { margin: clamp(14px, 1.6vw, 28px) 0 0; max-width: 30em; color: rgba(18, 17, 16, 0.72); font-size: clamp(15px, 1.1vw, 32px); line-height: 1.45; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px clamp(14px, 1.4vw, 24px); }
.cta-alt { font: 500 clamp(13px, 0.8vw, 24px) var(--f-mono); color: var(--ink); text-decoration: none; border-bottom: 1.5px solid rgba(18, 17, 16, 0.3); padding-bottom: 3px; transition: border-color 0.25s; }
.cta-alt:hover { border-color: var(--vermilion); }
.brand-tile .launch { margin: 14px 0 0; color: rgba(18, 17, 16, 0.6); font-size: clamp(11px, 0.62vw, 18px); }
.brand-tile .launch:empty { display: none; }
@media (max-width: 1099px) { .brand-tile { justify-content: flex-start; } .brand-tile .typed { font-size: clamp(36px, 7.4vw, 76px); min-height: 1.92em; } }
@media (max-width: 699px) { .brand-tile { gap: 18px; } .brand-tile .typed { font-size: clamp(32px, 9.4vw, 52px); min-height: 2.88em; } .brand-tile .lede { margin-top: 10px; font-size: 15px; } .cta .btn-primary { width: 100%; justify-content: center; } .brand-tile .launch { margin-top: 10px; } }

/* number tiles: big figures between the films, counting like a film's live number */
.stat { background: var(--ink-2); display: flex; flex-direction: column; justify-content: space-between; padding: clamp(14px, 1.5vw, 32px); transition: background 0.3s; }
.stat:hover { background: var(--ink-3); }
.stat .v { display: flex; align-items: flex-end; gap: 0.1em; font-family: var(--f-mono); font-weight: 500; font-size: clamp(38px, 4.4vw, 128px); line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat i { display: inline-block; width: 0.2em; height: 0.2em; background: var(--vermilion); margin-bottom: 0.06em; transform-origin: 50% 100%; flex: none; }
.stat .t { color: var(--paper-70); font-size: clamp(13px, 0.95vw, 28px); line-height: 1.3; max-width: 14em; }

/* ---------- film tiles (mosaic and wall) ---------- */
.tile { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: var(--ink-2); transition: opacity 0.5s, transform 0.7s var(--ease-out), filter 0.4s; }
.tile.rise { opacity: 0; transform: translateY(24px); }
.tile.rise.in { opacity: 1; transform: none; }
.tile video { position: absolute; inset: 0; transition: transform 0.8s var(--ease-out); }
.tile:not(.slot)::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 22%; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, rgba(18,17,16,0.55), transparent); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover video { transform: scale(1.045); }
  .wall:has(.tile:hover) .tile:not(:hover):not(.rise:not(.in)) { opacity: 0.45; filter: saturate(0.5); }
}
.hit { all: unset; position: absolute; inset: 0; cursor: pointer; z-index: 3; -webkit-tap-highlight-color: transparent; }
.tile .hit:focus-visible { outline: 2px solid var(--paper); outline-offset: -2px; }
.tile .over { position: absolute; left: 0; right: 0; bottom: 0; padding: 45% clamp(12px, 1.1vw, 22px) clamp(12px, 1.1vw, 22px); background: linear-gradient(to top, rgba(18,17,16,0.9), transparent); pointer-events: none; }
.tile h2, .tile h3 { position: relative; font-family: var(--f-word); font-weight: 600; letter-spacing: -0.01em; line-height: 1.06; font-size: clamp(17px, 1.25vw, 34px); margin: 0; }
.tile .top { position: absolute; top: clamp(12px, 1.1vw, 20px); left: clamp(12px, 1.1vw, 20px); right: clamp(12px, 1.1vw, 20px); display: flex; justify-content: space-between; gap: 8px; pointer-events: none; z-index: 1; }
.tile .top .label { color: var(--paper-70); }
.tile .watch-cue { position: absolute; right: clamp(12px, 1.1vw, 20px); bottom: clamp(12px, 1.1vw, 20px); }
.slot { display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(14px, 1.4vw, 24px); }
.slot .glow { position: absolute; inset: auto 0 0 0; height: 70%; opacity: 0.16; background: linear-gradient(to top, var(--hue, transparent), transparent); pointer-events: none; transition: opacity 0.6s; animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.26; } }
.slot:hover .glow { opacity: 0.34; }
.slot h2, .slot h3 { margin-bottom: 12px; }
.m-slot .slot h2 { font-size: clamp(19px, 1.6vw, 44px); }
.slot .soon { position: relative; display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 0.72em; color: var(--paper-50); }

/* ---------- every film ---------- */
.films { padding-top: clamp(64px, 8vw, 150px); scroll-margin-top: 70px; }
.wall-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; margin-bottom: clamp(16px, 2vw, 30px); }
.wall-head h2 { font-family: var(--f-word); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(34px, 4vw, 100px); line-height: 1; margin: 0; }
.count { display: flex; align-items: baseline; gap: 10px; font-family: var(--f-mono); color: var(--paper-70); font-size: 0.85em; }
.count .n { color: var(--paper); font-size: 1.6em; font-weight: 500; font-variant-numeric: tabular-nums; }
.count .cursor { align-self: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: clamp(16px, 2vw, 28px); }
.chips:empty { display: none; }
.chips button { font: 500 0.78em var(--f-mono); letter-spacing: 0.06em; color: var(--paper-70); background: none; border: 1px solid var(--paper-12); padding: 10px 14px; cursor: pointer; transition: color 0.25s, background 0.25s, border-color 0.25s; }
.chips button:hover { color: var(--paper); border-color: var(--paper-30); }
.chips button[aria-pressed="true"] { color: var(--ink); background: var(--paper); border-color: var(--paper); }
.chips button .k { opacity: 0.55; margin-left: 6px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 15vw, 360px), 1fr)); gap: clamp(8px, 0.9vw, 18px); }
.more { display: block; margin: clamp(20px, 2.4vw, 40px) auto 0; font: 500 0.85em var(--f-mono); letter-spacing: 0.06em; color: var(--paper); background: none; border: 1px solid var(--paper-30); padding: 14px 26px; cursor: pointer; }
.more:hover { border-color: var(--paper); }
.more[hidden] { display: none; }

/* ---------- closing follow links ---------- */
.ask { padding-top: clamp(64px, 8vw, 150px); }
.go { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: clamp(22px, 2.4vw, 40px); font-family: var(--f-mono); font-size: 0.85em; letter-spacing: 0.04em; }
.go a { text-decoration: none; color: var(--paper); border-bottom: 1px solid var(--paper-30); padding: 6px 0 5px; transition: border-color 0.3s; }
.go a:hover { border-color: var(--vermilion); }

/* ---------- the follow bar (phones): one tap from anywhere on the page ---------- */
.follow-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: none; align-items: center; gap: 14px; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); background: rgba(18, 17, 16, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--paper-12); transform: translateY(110%); transition: transform 0.4s var(--ease-out); }
.follow-bar .btn-primary { background: var(--paper); color: var(--ink); padding: 0.8em 1.1em; font-size: 15px; flex: 1; justify-content: center; }
.follow-bar > a:not(.btn-primary) { font: 500 13px var(--f-mono); color: var(--paper-70); text-decoration: none; padding: 10px 2px; }
body.show-bar .follow-bar { transform: none; }
@media (max-width: 899px) { .follow-bar { display: flex; } .site-foot { padding-bottom: 96px; } }

/* ---------- the viewer: a vertical feed, one film per screen ---------- */
html.lock, html.lock body { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 100; background: var(--ink-0); opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0s 0.35s; }
.viewer.open { opacity: 1; visibility: visible; transition: opacity 0.35s; }
.feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { display: none; }
.panel { position: relative; height: 100svh; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; gap: clamp(24px, 4vw, 90px); overflow: hidden; isolation: isolate; }
.panel .screen { position: relative; height: min(92svh, 1700px); aspect-ratio: 9 / 16; isolation: isolate; cursor: pointer; }
.panel .screen .shell { position: absolute; inset: 0; overflow: hidden; background: var(--ink-0); }
.panel .screen .ambient { inset: -60% -130%; }
.panel .paused { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity 0.2s; z-index: 2; }
.panel .paused span { width: 64px; height: 64px; display: grid; place-items: center; background: rgba(11,10,9,0.55); backdrop-filter: blur(6px); }
.panel .paused span::before { content: ""; width: 0; height: 0; border-left: 18px solid var(--paper); border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.panel.is-paused .paused { opacity: 1; }
.panel .side { width: min(28vw, 480px); }
.panel .side h2 { font-family: var(--f-word); font-weight: 600; letter-spacing: -0.02em; line-height: 1.02; font-size: clamp(30px, 2.8vw, 68px); margin: 10px 0 16px; }
.panel .side p { color: var(--paper-70); margin: 0 0 18px; }
.panel .num-line { font-family: var(--f-mono); color: var(--paper); }
.panel .acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.panel .acts button, .panel .acts .btn { font: 500 0.78em var(--f-mono); letter-spacing: 0.06em; color: var(--paper); background: rgba(11,10,9,0.4); border: 1px solid var(--paper-30); padding: 10px 14px; cursor: pointer; backdrop-filter: blur(6px); text-decoration: none; }
.panel .acts button:hover, .panel .acts .btn:hover { border-color: var(--paper); }
.panel .watch { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--f-mono); font-size: 0.8em; }
.panel .watch a { color: var(--paper-70); text-underline-offset: 3px; }
.panel .watch a:hover { color: var(--paper); }
@media (max-width: 899px) {
  .panel .screen { height: 100svh; width: 100%; aspect-ratio: auto; }
  .panel .side { position: absolute; left: 0; right: 0; bottom: 0; width: auto; padding: 48% 20px max(26px, env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(11,10,9,0.92), transparent); pointer-events: none; }
  .panel .side a, .panel .side button { pointer-events: auto; }
  .panel .side h2 { font-size: clamp(28px, 8vw, 44px); }
}
.panel.end { flex-direction: column; text-align: center; padding: 0 var(--gutter); gap: 14px; }
.panel.end h2 { font-family: var(--f-word); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(36px, 5vw, 120px); line-height: 1; margin: 0; }
.panel.end ul { list-style: none; padding: 0; margin: 4px 0 10px; color: var(--paper-50); line-height: 1.9; }
.panel.end .go { justify-content: center; margin-top: 8px; }
.end-label { display: flex; gap: 10px; align-items: center; }
.close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 3; font: 500 0.78em var(--f-mono); letter-spacing: 0.08em; color: var(--paper); background: rgba(11,10,9,0.5); border: 1px solid var(--paper-12); padding: 11px 15px; cursor: pointer; backdrop-filter: blur(8px); }
.close:hover { border-color: var(--paper-30); }
.hint { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 3; white-space: nowrap; }
@media (max-width: 899px), (hover: none) { .hint { display: none; } }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 150; transform: translate(-50%, 20px); opacity: 0; background: var(--paper); color: var(--ink); font: 500 13px var(--f-mono); letter-spacing: 0.04em; padding: 10px 16px; transition: opacity 0.25s, transform 0.35s var(--ease-out); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
