/* THE SITE'S LOOK (2026-12-03): a CRT tube lit from inside, after the developer's references
   (Spotify's 2026 artist page, and the "logos in 1984" reels): smooth, grained, glowing.

   Four layers, back to front:
   1. THE TUBE (behind): dark glass with a soft olive glow round its walls, and rings of light
      flowing down its throat from the top and up from the bottom, coloured as halation is
      (a mint-cyan core, violet, then rose, then an olive haze), blurred and slow.
   2. THE PAGE: every word in the game's emerald phosphor and its pixel type, crisp so it
      reads; the title blooms as a lit logo does. Words and pictures come into focus as they
      arrive (blurred and violet first, then sharp), as the reference's numbers do.
      The game's footage glows on the glass like a lit picture.
   3. THE GRAIN: fine film grain over everything, moving.
   4. THE GLASS (in front): the phosphor's stripe mask and faint scanlines (seen only where the
      picture is lit), the tube's falloff and rounded corners.
   The front page starts as a tape does (ntsc-rs's tracking hunt for a second), then focuses.
   Nothing boxed (the developer: no borders or plates). Persian pages mirror. Motion only where
   prefers-reduced-motion allows it; no script anywhere. */

@font-face{font-family:"Kashi Pixel";src:url(/fonts/KashiPixel-Regular.ttf) format("truetype");font-display:block}
@font-face{font-family:"Faryad";src:url(/fonts/Faryad-Regular.ttf) format("truetype");font-display:swap}

@property --h{syntax:"<integer>";inherits:false;initial-value:0}
@property --m10{syntax:"<integer>";inherits:false;initial-value:0}
@property --m1{syntax:"<integer>";inherits:false;initial-value:0}
@property --s10{syntax:"<integer>";inherits:false;initial-value:0}
@property --s1{syntax:"<integer>";inherits:false;initial-value:0}

:root{
  color-scheme:dark;
  /* CrtOsd: PHOSPHOR, REST, QUIET, HOT, INK */
  --phos:#5cffa8;
  --rest:rgba(92,255,168,.78);
  --quiet:rgba(92,255,168,.56);
  --hot:#e6fff2;
  --ink:#04100a;
  --read:#c9f7dc;
  --tube:#0c0f0e;
  --mint:#7dffe0;
  --violet:#9a86ff;
  --rose:#ff5d8a;
  --olive:rgba(96,140,66,.32);
  --glow:0 0 .32em rgba(92,255,168,.42),0 0 1px rgba(92,255,168,.8);
  --fringe:-.6px 0 rgba(255,70,110,.32),.6px 0 rgba(70,150,255,.32);
  --bloom:0 0 2px rgba(230,255,242,.7),0 0 .14em rgba(92,255,168,.85),0 0 .5em rgba(92,255,168,.4),0 0 1.3em rgba(154,134,255,.32);
  --u:16px;
  --pad:max(20px,env(safe-area-inset-left));
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;background:var(--tube)}
body{
  margin:0;min-height:100vh;color:var(--rest);
  font:var(--u)/1.6 "Kashi Pixel","Faryad",monospace;
  -webkit-font-smoothing:antialiased;
}
html[lang=fa] body{line-height:2}
html{scrollbar-color:#24302a var(--tube)}
::selection{background:var(--phos);color:var(--ink);text-shadow:none}

/* ─── 1. THE TUBE ─────────────────────────────────────────────── */
/* Dark glass, its walls lit olive, its middle left dark for the words. Under everything (-1):
   the page takes a layer of its own while the tape starts. */
.tube{position:fixed;inset:0;pointer-events:none;z-index:-1;overflow:hidden;
  background:
    radial-gradient(62% 48% at 50% 50%,var(--tube) 30%,transparent 78%),
    radial-gradient(120% 95% at 50% 50%,transparent 42%,var(--olive) 72%,rgba(60,90,48,.14) 88%,transparent 100%),
    var(--tube)}
/* The rings: each a thin ellipse of light, its colour across its width as halation spreads it,
   blurred once and then only moved (cheap on a phone). Four flow down from the top and four up
   from the bottom (the same flow, turned over), each shrinking and fading as it goes in. */
.flow{position:absolute;left:0;right:0;height:50%;top:0}
.flow.up{top:auto;bottom:0;transform:rotate(180deg)}
.flow i{position:absolute;left:50%;top:0;width:min(92vw,980px);aspect-ratio:3.4;
  translate:-50% -50%;filter:blur(clamp(4px,.8vw,9px));opacity:0;
  background:radial-gradient(closest-side,transparent 48%,var(--olive) 57%,rgba(255,93,138,.75) 66%,
    rgba(154,134,255,.95) 74%,var(--mint) 81%,#d9fff4 86%,var(--mint) 90%,rgba(154,134,255,.9) 95%,transparent 100%);
  /* Only the arc nearer the middle is lit, as a lens in the reference: the far one fades. */
  -webkit-mask-image:linear-gradient(to bottom,transparent 38%,#000 72%);mask-image:linear-gradient(to bottom,transparent 38%,#000 72%)}
.flow i:nth-child(1){opacity:.95;scale:1.05;translate:-50% -40%}
.flow i:nth-child(2){opacity:.7;scale:.8;translate:-50% -5%}
.flow i:nth-child(3){opacity:.45;scale:.6;translate:-50% 25%}
.flow i:nth-child(4){opacity:.22;scale:.45;translate:-50% 50%}
@media (prefers-reduced-motion:no-preference){
  .flow i{opacity:0;animation:flow 12s linear infinite}
  .flow i:nth-child(2){animation-delay:-3s}
  .flow i:nth-child(3){animation-delay:-6s}
  .flow i:nth-child(4){animation-delay:-9s}
}
@keyframes flow{
  0%{translate:-50% -75%;scale:1.25;opacity:0}
  14%{opacity:1}
  100%{translate:-50% 70%;scale:.35;opacity:0}}
.flow{opacity:.8}
/* A wide screen: flatter rings, so they keep to the top and bottom edges as on a phone. */
@media (orientation:landscape){.flow i{aspect-ratio:5.6}}
.page-text .flow{opacity:.45}

/* THE TAPE STARTS (the front page only): PLAY pressed — for a second the deck's tracking hunts,
   ntsc-rs's bars racing up over the picture (screen-blended: their black adds nothing) while
   the picture rolls and locks, in jumps. The VCR's own OSD and the glass never roll. */
.start{display:none}
@media (prefers-reduced-motion:no-preference){
  .page-home .start{display:block;position:fixed;inset:0;z-index:8;width:100%;height:100%;
    object-fit:cover;pointer-events:none;mix-blend-mode:screen;animation:start-hunt 1s steps(1) forwards}
  .page-home :is(main,header.top){animation:start-roll .9s cubic-bezier(.25,.8,.3,1) both}
}
@keyframes start-hunt{0%{opacity:1}60%{opacity:.85}80%{opacity:.4}100%{opacity:0;visibility:hidden}}
@keyframes start-roll{
  0%{transform:translate3d(-1.5%,-38vh,0) skewX(3deg)}28%{transform:translate3d(1%,16vh,0) skewX(-2deg)}
  50%{transform:translate3d(-.5%,-5vh,0)}70%{transform:translate3d(0,1.5vh,0)}100%{transform:none}}

/* ─── 2. THE VCR'S OSD ────────────────────────────────────────── */
.vcr{position:fixed;z-index:9;top:max(14px,env(safe-area-inset-top));left:var(--pad);right:var(--pad);
  display:flex;justify-content:space-between;pointer-events:none;
  font-size:var(--u);line-height:1;letter-spacing:.06em;color:var(--hot);
  text-shadow:var(--glow),0 0 2px #000,1px 1px 0 rgba(0,0,0,.7)}
.vcr-play{display:inline-flex;align-items:center;gap:.5em;animation:osd-gone 0s 6s forwards}
.vcr-play .tri{width:.62em;height:.72em}
@keyframes osd-gone{to{visibility:hidden}}
.vcr-counter{color:var(--quiet);text-shadow:0 0 2px #000}
.vcr-counter::after{
  counter-reset:h var(--h) m10 var(--m10) m1 var(--m1) s10 var(--s10) s1 var(--s1);
  content:counter(h) ":" counter(m10) counter(m1) ":" counter(s10) counter(s1);
  animation:s1 10s steps(10) infinite,s10 60s steps(6) infinite,m1 600s steps(10) infinite,
    m10 3600s steps(6) infinite,h 36000s steps(10) infinite}
html[lang=fa] .vcr-counter::after{
  content:counter(h,persian) ":" counter(m10,persian) counter(m1,persian) ":" counter(s10,persian) counter(s1,persian)}
@keyframes s1{from{--s1:0}to{--s1:10}}
@keyframes s10{from{--s10:0}to{--s10:6}}
@keyframes m1{from{--m1:0}to{--m1:10}}
@keyframes m10{from{--m10:0}to{--m10:6}}
@keyframes h{from{--h:0}to{--h:10}}

/* A triangle as the game draws one (no glyph: neither font has ▶). Mirrors in Persian. */
.tri{display:inline-block;width:.56em;height:.66em;background:currentColor;flex:none;
  clip-path:polygon(0 0,100% 50%,0 100%)}
.tri.back,[dir=rtl] .tri{clip-path:polygon(100% 0,0 50%,100% 100%)}
[dir=rtl] .tri.back{clip-path:polygon(0 0,100% 50%,0 100%)}

/* The page itself: the OSD's words over the tube's light. */
.wrap{max-width:1120px;margin:0 auto;
  padding:calc(max(14px,env(safe-area-inset-top)) + 4.6em) var(--pad) 72px}
/* Over the tube (-1): the footage (2), then the words (3). */
main :is(h1,h2,h3,p,ul,ol,hr),footer{position:relative;z-index:3}
header.top{position:absolute;z-index:3;top:calc(max(14px,env(safe-area-inset-top)) + 2.2em);
  left:var(--pad);right:var(--pad);display:flex;justify-content:space-between;align-items:baseline;gap:1em;
  font-size:var(--u);letter-spacing:.06em}
a{color:var(--phos);text-decoration-thickness:2px;text-underline-offset:.3em}
a:focus-visible{outline:2px solid var(--phos);outline-offset:4px}
.home{text-decoration:none;text-transform:uppercase;text-shadow:var(--glow)}
.twin{color:var(--rest);text-decoration:none;padding:4px 0}
.twin:hover,.home:hover{color:var(--hot)}

h1,h2,h3{font-weight:400;color:var(--phos);text-shadow:var(--glow),var(--fringe);margin:0}
h1{font-size:calc(var(--u) * 2);line-height:1.25;margin:1.4em 0 .5em;letter-spacing:.02em}
h2{font-size:calc(var(--u) * 1.5);line-height:1.3;margin:2.2em 0 .6em;letter-spacing:.03em}
h3{font-size:var(--u);line-height:1.5;margin:1.6em 0 .2em;text-transform:uppercase;letter-spacing:.06em}
html[lang=fa] h3{text-transform:none}
p{margin:0 0 1em}
strong{color:var(--hot);font-weight:400}
code{font:inherit;color:var(--quiet)}
ul,ol{padding-inline-start:1.4em;margin:0 0 1em}
li{margin:.5em 0}
li::marker{color:var(--quiet)}
hr{border:0;height:2px;margin:2.4em 0;
  background:repeating-linear-gradient(90deg,var(--quiet) 0 4px,transparent 4px 10px);opacity:.5}

/* THE ONE SOLID KEY: a pill of lit phosphor, its words cut out dark, its light drifting from
   emerald to mint to gold and back; white-hot under the finger. */
.key{display:inline-flex;align-items:center;gap:.75em;min-height:52px;padding:0 1.4em;
  background:linear-gradient(100deg,var(--phos),#c4ffe6 35%,#ffe08a 65%,var(--phos)) 0 0/300% 100%;
  color:var(--ink);text-decoration:none;text-transform:uppercase;letter-spacing:.06em;border-radius:999px;
  box-shadow:0 0 10px rgba(92,255,168,.5),0 0 28px rgba(154,134,255,.35);text-shadow:none}
@media (prefers-reduced-motion:no-preference){.key{animation:drift 9s ease-in-out infinite alternate}}
@keyframes drift{to{background-position:100% 0}}
.key:hover,.key:focus-visible{background:var(--hot);box-shadow:0 0 14px rgba(92,255,168,.7),0 0 36px rgba(154,134,255,.5)}
html[lang=fa] .key{text-transform:none}

/* A line that can be chosen: words alone, the ▶ beside the one under the finger. */
.menu{list-style:none;padding:0;margin:1.6em 0}
.menu li{margin:0}
.menu a{display:flex;align-items:center;gap:.7em;min-height:44px;text-decoration:none;
  text-transform:uppercase;letter-spacing:.06em;color:var(--phos);text-shadow:var(--glow)}
html[lang=fa] .menu a{text-transform:none}
.menu a .tri{opacity:0}
.menu a:hover .tri,.menu a:focus-visible .tri{opacity:1}
.menu a:hover{color:var(--hot)}

.quiet{color:var(--quiet)}

/* ─── THE FRONT PAGE ──────────────────────────────────────────── */
.hero{display:grid;grid-template-columns:minmax(0,1fr);gap:32px;text-align:center;
  margin-top:.6em;grid-template-areas:"words" "footage" "more"}
.hero .menu a{justify-content:center}
.hero-words{grid-area:words}.hero .footage{grid-area:footage}.hero-more{grid-area:more}
.title{font-size:calc(var(--u) * 4);line-height:1;margin:0 0 .35em;letter-spacing:.04em;
  text-transform:uppercase;color:var(--phos);
  text-shadow:var(--bloom),-2px 0 rgba(255,60,110,.45),2px 0 rgba(60,140,255,.45)}
html[lang=fa] .title{text-transform:none;font-size:calc(var(--u) * 3.5);line-height:1.4}
.lede{font-size:calc(var(--u) * 1.5);line-height:1.45;color:var(--hot);text-shadow:var(--glow);margin:0 0 .8em}
.hero p{max-width:30em;margin-inline:auto}
.hero-words .lede{margin:0}

/* The footage: the game on tape (ntsc-rs), bare (no frame), glowing on the glass, under the words. */
.footage{position:relative;z-index:2;margin:0}
.footage video,.footage img{display:block;width:100%;height:auto;border-radius:14px;background:#000;
  box-shadow:0 0 1px 1px rgba(200,255,228,.22),0 0 24px rgba(92,255,168,.3),0 0 80px rgba(154,134,255,.26)}
.footage figcaption{position:relative;z-index:3;margin-top:.8em;font-size:var(--u);color:var(--quiet)}
.footage .still{display:none}
.hero .footage{justify-self:center;width:min(72vw,340px,calc(70vh * 540 / 1170))}

.chapter{margin-top:4.5em;scroll-margin-top:4.2em}
.chapter>h2{margin:0 0 1em}
.chapter-body{display:grid;grid-template-columns:minmax(0,1fr);gap:32px;align-items:start}
.chapter-text{max-width:36em}
.pictures{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.pictures .footage{width:100%}
.single{justify-self:center;width:min(72vw,320px,calc(76vh * 540 / 1170))}

.rules{list-style:none;padding:0;margin:0;counter-reset:rule}
.rules li{counter-increment:rule;margin:0 0 1.3em;padding-inline-start:2.6em;position:relative}
.rules li::before{content:counter(rule,decimal-leading-zero);position:absolute;inset-inline-start:0;top:.05em;color:var(--quiet)}
html[lang=fa] .rules li::before{content:counter(rule,persian)}
.rules h3{margin:0 0 .15em}
.rules p{margin:0}
.score{list-style:none;padding:0;margin:1.2em 0}
.score li{display:flex;gap:1em;margin:.35em 0}
.score b{font-weight:400;color:var(--hot);min-width:4.6em;flex:none}

.ways{list-style:none;padding:0;margin:0}
.ways li{margin:0 0 1.1em}
.ways h3{margin:0}
.ways p{margin:0}

.closing{margin-top:4.5em}
footer{margin-top:5em;color:var(--quiet);font-size:var(--u)}
footer nav{display:flex;flex-wrap:wrap;gap:.2em 1.4em;margin-bottom:1em}
footer nav a{display:inline-block;padding:8px 0;color:var(--rest);text-decoration:none}
footer nav a:hover{color:var(--hot);text-decoration:underline}

/* ─── THE LEGAL PAGES: the same set, made for reading ─────────── */
.page-text main{max-width:40em}
.page-text main p,.page-text main li{color:var(--read)}
.page-text main h1{margin-top:1.2em}
.page-text .back{margin-top:2.4em}

/* ─── FOCUS ────────────────────────────────────────────────────── */
@keyframes focus{
  0%{filter:blur(14px);opacity:0;color:var(--violet)}
  45%{filter:blur(5px);opacity:.85;color:var(--rose)}
  100%{filter:none;opacity:1}}
@media (prefers-reduced-motion:no-preference){
  .page-home :is(.title,.lede,.hero .footage){animation:focus 1.1s cubic-bezier(.2,.7,.2,1) both}
  .page-home .title{animation-delay:.85s}
  .page-home .lede{animation-delay:1.05s}
  .page-home .hero .footage{animation-delay:1.2s}
  @supports (animation-timeline:view()){
    :is(.chapter h2,.chapter .footage,.rules li,.ways li,.score,.page-text main h1,.page-text main h2){
      animation:focus linear both;animation-timeline:view();animation-range:entry 0% entry 90%}
  }
}

/* ─── 3. THE GRAIN ────────────────────────────────────────────── */
.grain{position:fixed;inset:-192px;z-index:9;pointer-events:none;
  background:url(/media/grain.png) 0 0/192px;mix-blend-mode:overlay;opacity:.55}
@media (prefers-reduced-motion:no-preference){.grain{animation:grain .6s steps(1) infinite}}
@keyframes grain{
  0%{transform:translate(0,0)}12%{transform:translate(-61px,37px)}25%{transform:translate(43px,-88px)}
  37%{transform:translate(-120px,-15px)}50%{transform:translate(77px,101px)}62%{transform:translate(-33px,-140px)}
  75%{transform:translate(129px,22px)}87%{transform:translate(-95px,66px)}}

/* ─── 4. THE GLASS ────────────────────────────────────────────── */
.glass{position:fixed;inset:0;z-index:10;pointer-events:none;border-radius:18px;
  background:
    repeating-linear-gradient(90deg,rgba(0,0,0,.12) 0 1px,transparent 1px 3px),
    repeating-linear-gradient(to bottom,rgba(0,0,0,.07) 0 1px,transparent 1px 3px),
    radial-gradient(140% 105% at 50% 46%,transparent 58%,rgba(0,0,0,.42) 86%,rgba(0,0,0,.75) 100%),
    linear-gradient(128deg,rgba(220,255,235,.045),transparent 26%,transparent 74%,rgba(220,255,235,.02));
  box-shadow:0 0 0 60vmax #010201,inset 0 0 50px rgba(0,0,0,.55),inset 0 0 2px rgba(92,255,168,.08)}

/* ─── SIZES ───────────────────────────────────────────────────── */
@media (min-width:760px){
  :root{--u:20px;--pad:40px}
  .hero{margin-top:1em}
  .hero .footage{width:min(100%,380px,calc(80vh * 540 / 1170))}
  .chapter-body{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:56px}
  .chapter-body.flip{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}
  .chapter-body.flip .chapter-text{order:2}
  .chapter-body.pics{grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr)}
  .glass{border-radius:28px}
}
@media (min-width:1200px){:root{--u:24px}}

/* ─── STILL, FOR THOSE WHO ASK ────────────────────────────────── */
@media (prefers-reduced-motion:reduce){
  .vcr-counter::after{animation:none}
  .vcr-play{animation:none}
  .footage video{display:none}
  .footage .still{display:block}
}
@media print{
  .tube,.grain,.glass,.vcr{display:none}
  body{background:#fff;color:#000}
  h1,h2,h3,a,.page-text main p,.page-text main li{color:#000;text-shadow:none}
}
