/* HOLY SMOKES: an early-2000s DVD menu on a washed-out blue TV.
   Palette lifted from the references: chlorine cyan, deep tube blue, acid lime, a hot red glint. */

:root {
  --sky: #4aa9e6;
  --sky-2: #7cc6f2;
  --ice: #d6f0ff;
  --deep: #12408c;
  --navy: #071a3c;
  --ink: #03060c;
  --lime: #d4ec2c;
  --lime-2: #a8d22a;
  --amber: #f3a72e;
  --red: #e2483c;
  --white: #f5faff;
  --dim: rgba(245, 250, 255, 0.66);
  --faint: rgba(245, 250, 255, 0.34);
  --glass: rgba(6, 26, 64, 0.42);
  --glass-2: rgba(4, 16, 40, 0.62);
  --line: rgba(245, 250, 255, 0.85);
  --wide: 'Lexend Zetta', 'Arial Black', sans-serif;
  --exa: 'Lexend Exa', 'Arial', sans-serif;
  --body: 'Lexend', 'Segoe UI', sans-serif;
  --lcd: 'VT323', 'Consolas', monospace;
  --xp: 'Trebuchet MS', Tahoma, Verdana, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #2a7fcb;
  color: var(--white);
  font: 300 16px/1.55 var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--lcd); font-size: 1.15em; color: var(--lime); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ the TV */
#bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
.crt { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.crt::before { /* scanlines */
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.crt::after { /* tube vignette */
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(0, 10, 30, 0.55) 100%);
}
.crt .grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  opacity: 0.09; mix-blend-mode: overlay;
  animation: grain 0.6s steps(6) infinite;
}
.crt .tracking {
  position: absolute; left: 0; right: 0; height: 9vh; top: -10vh;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.04) 60%, transparent);
  animation: tracking 9s linear infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-7%, 4%); } 40% { transform: translate(5%, -6%); } 60% { transform: translate(-3%, 8%); } 80% { transform: translate(8%, 2%); } }
@keyframes tracking { 0% { top: -10vh; } 70%, 100% { top: 110vh; } }
body.no-crt .crt { display: none; }
body.no-motion .crt .grain, body.no-motion .crt .tracking { animation: none; }

/* DVD player on-screen display */
.osd {
  position: fixed; top: max(18px, env(safe-area-inset-top)); right: var(--gutter); z-index: 60;
  font: 400 34px/1 var(--lcd); color: #3cff6a; letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(60, 255, 106, 0.8), 2px 0 0 rgba(255, 0, 80, 0.4);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.osd.show { opacity: 1; }

/* ------------------------------------------------------------ boot */
.boot {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 60%, #0a2550 0%, #02060f 70%);
  transition: opacity 0.6s, visibility 0.6s;
}
body:not(.is-booting) .boot { opacity: 0; visibility: hidden; }
.boot-inner { width: min(760px, calc(100vw - 32px)); text-align: center; }
.boot-logo { font: 700 clamp(30px, 7vw, 64px)/1 var(--wide); letter-spacing: -0.04em; text-transform: lowercase; }
.boot-rule { height: 2px; background: var(--line); margin: 14px 0 22px; box-shadow: 0 0 12px rgba(160, 220, 255, 0.6); }
.boot-warn { font: 300 13px/1.7 var(--exa); color: var(--dim); letter-spacing: 0.04em; margin: 0 0 34px; }
.boot-play {
  display: inline-flex; align-items: center; gap: 16px; cursor: pointer;
  background: none; border: 2px solid var(--lime); color: var(--lime); border-radius: 999px;
  padding: 14px 34px; font: 600 18px/1 var(--exa); text-transform: lowercase; letter-spacing: 0.08em;
  box-shadow: 0 0 24px rgba(212, 236, 44, 0.35), inset 0 0 18px rgba(212, 236, 44, 0.15);
  animation: breathe 2.4s ease-in-out infinite;
}
.boot-play:hover, .boot-play:focus-visible { background: var(--lime); color: var(--ink); outline: none; }
.boot-skip { display: block; margin: 22px auto 0; background: none; border: 0; color: var(--faint); cursor: pointer; font: 300 12px var(--exa); text-decoration: underline; }
@keyframes breathe { 50% { box-shadow: 0 0 40px rgba(212, 236, 44, 0.6), inset 0 0 22px rgba(212, 236, 44, 0.3); } }
.tri { display: inline-block; width: 0; height: 0; border-left: 12px solid currentColor; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }

/* ------------------------------------------------------------ masthead: the record sleeve */
.mast {
  position: relative; z-index: 10;
  padding: clamp(22px, 5vh, 54px) var(--gutter) 0;
  transition: padding 0.4s;
}
.mast .logo {
  display: inline-block; text-decoration: none;
  font: 700 clamp(34px, 7.4vw, 104px)/0.86 var(--wide); letter-spacing: -0.05em;
  color: var(--white); text-transform: lowercase;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.25);
  transform-origin: left bottom;
  transition: font-size 0.4s;
}
.mast .rule {
  height: 2px; margin: 8px calc(var(--gutter) * -1) 0; background: var(--line);
  box-shadow: 0 0 10px rgba(200, 235, 255, 0.55);
}
.mast .sub {
  text-align: right; margin-top: 6px;
  font: 400 clamp(10px, 1.25vw, 15px)/1.2 var(--exa); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--white); opacity: 0.88;
}
body:not([data-screen='menu']) .mast { padding-top: 14px; }
body:not([data-screen='menu']) .mast .logo { font-size: clamp(22px, 3.2vw, 40px); }
body[data-screen='studio'] .mast .sub { display: none; }

/* glitch burst on transitions */
body.glitch .mast .logo, body.glitch main { animation: rgbsplit 0.32s steps(3) 1; }
@keyframes rgbsplit {
  0% { text-shadow: 4px 0 var(--red), -4px 0 var(--sky-2); transform: translateX(3px) skewX(-4deg); filter: hue-rotate(40deg); }
  50% { text-shadow: -3px 0 var(--lime), 3px 0 var(--red); transform: translateX(-4px); clip-path: inset(10% 0 30% 0); }
  100% { text-shadow: none; transform: none; filter: none; clip-path: none; }
}

/* ------------------------------------------------------------ screens */
main { position: relative; z-index: 10; }
.screen { display: none; padding: 0 var(--gutter) 90px; }
.screen.active { display: block; animation: screenIn 0.45s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.screen-title {
  font: 600 clamp(20px, 3vw, 34px)/1.1 var(--exa); text-transform: lowercase; letter-spacing: 0.02em;
  margin: clamp(22px, 5vh, 50px) 0 18px;
}
.screen-title::before { content: '▸ '; color: var(--lime); }
.screen-lede { color: var(--dim); max-width: 760px; margin: 0 0 26px; }

/* ------------------------------------------------------------ the DVD menu */

.dvd-menu { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dvd-menu a {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 6px 18px 6px 12px; border-radius: 999px; text-decoration: none;
  font: 500 clamp(18px, 2.5vw, 34px)/1.15 var(--wide); letter-spacing: -0.03em; text-transform: lowercase;
  color: var(--white); text-shadow: 0 2px 14px rgba(0, 20, 70, 0.55);
  outline: none; transition: color 0.12s;
}
.dvd-menu.small a { font-size: clamp(14px, 1.5vw, 19px); }
.dvd-menu.small { margin-top: 34px; }
.dvd-menu.row { flex-direction: row; justify-content: flex-end; flex-wrap: wrap; }
.dvd-menu .cur { /* the DVD cursor: a lime pip that spins in when selected */
  width: 14px; height: 14px; flex: none; border-radius: 3px;
  border: 2px solid var(--lime); transform: rotate(45deg) scale(0); transition: transform 0.18s;
}
.dvd-menu a.sel, .dvd-menu a:focus-visible { color: var(--lime); }
.dvd-menu a.sel .cur, .dvd-menu a:focus-visible .cur { transform: rotate(45deg) scale(1); animation: pip 1.6s linear infinite; background: rgba(212, 236, 44, 0.25); }
.dvd-menu a.sel::after, .dvd-menu a:focus-visible::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(212, 236, 44, 0.16) 30%, rgba(212, 236, 44, 0.08));
  box-shadow: inset 0 0 0 1px rgba(212, 236, 44, 0.45);
}
@keyframes pip { to { transform: rotate(405deg) scale(1); } }

/* ------------------------------------------------------------ scene selection */
.scene-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: clamp(14px, 2.4vw, 34px); }
.scene { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; text-decoration: none; outline: none; }
.scene .thumb {
  grid-column: 1 / -1; display: block; aspect-ratio: 16 / 10.4; overflow: hidden;
  border: 3px solid rgba(245, 250, 255, 0.75); border-radius: 6px; margin-bottom: 12px;
  box-shadow: 0 14px 40px rgba(0, 20, 60, 0.45);
  transition: transform 0.25s, border-color 0.15s, box-shadow 0.2s;
}
.scene img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.9) contrast(1.05); transition: filter 0.2s; }
.scene .num { grid-row: 2 / 4; font: 400 54px/0.9 var(--lcd); color: var(--lime); }
.scene .name { font: 700 clamp(18px, 2.2vw, 28px)/1 var(--wide); letter-spacing: -0.04em; align-self: end; }
.scene .tag { font: 300 12px/1.4 var(--exa); color: var(--dim); text-transform: uppercase; letter-spacing: 0.12em; }
.scene.sel .thumb, .scene:focus-visible .thumb { border-color: var(--lime); transform: translateY(-4px) scale(1.02); box-shadow: 0 0 0 4px rgba(212, 236, 44, 0.25), 0 18px 50px rgba(0, 20, 60, 0.6); }
.scene.sel .name, .scene:focus-visible .name { color: var(--lime); }
.scene.sel img { filter: saturate(1.15) contrast(1.08); }

/* ------------------------------------------------------------ plugin pages */
.pl { display: none; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(20px, 3.5vw, 54px); margin-top: clamp(20px, 4vh, 40px); align-items: start; }
.pl.active { display: grid; }
.tv { position: relative; border-radius: 14px; overflow: hidden; border: 3px solid rgba(245, 250, 255, 0.8); box-shadow: 0 24px 70px rgba(0, 15, 50, 0.55); background: #000; }
.tv img { display: block; width: 100%; height: auto; }
.tv::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px), radial-gradient(ellipse at 30% 10%, rgba(255, 255, 255, 0.12), transparent 50%); pointer-events: none; }
.kicker { font: 400 22px/1 var(--lcd); color: var(--lime); margin: 0; }
.pl h2 { font: 700 clamp(34px, 5vw, 70px)/0.9 var(--wide); letter-spacing: -0.05em; margin: 4px 0 16px; }
.lede { font: 400 17px/1.55 var(--body); margin: 0 0 18px; }
.feat { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.feat li { padding-left: 22px; position: relative; font-size: 14.5px; color: rgba(245, 250, 255, 0.9); }
.feat li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 8px; height: 8px; border: 2px solid var(--lime); transform: rotate(45deg); }
.feat b { font-weight: 600; color: var(--white); }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0 0 24px; padding: 14px 18px; background: var(--glass); border: 1px solid rgba(245, 250, 255, 0.2); border-radius: 10px; backdrop-filter: blur(6px); }
.spec dt { font: 400 12px/1.6 var(--exa); text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.spec dd { margin: 0; font-size: 14px; }
.spec .free { font: 400 22px/1 var(--lcd); color: var(--lime); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.pl .credit { margin: 18px 0 0; font-size: 12px; opacity: 0.85; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  padding: 11px 22px; border-radius: 999px; border: 2px solid var(--white); background: rgba(3, 12, 30, 0.25);
  font: 600 14px/1 var(--exa); text-transform: lowercase; letter-spacing: 0.06em; outline: none;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn .tri { border-left-width: 9px; border-top-width: 6px; border-bottom-width: 6px; }
.btn:hover, .btn:focus-visible, .btn.sel { background: var(--white); color: var(--ink); }
.btn.lime { border-color: var(--lime); color: var(--lime); }
.btn.lime:hover, .btn.lime:focus-visible, .btn.lime.sel { background: var(--lime); color: var(--ink); box-shadow: 0 0 26px rgba(212, 236, 44, 0.45); }

/* ------------------------------------------------------------ text panels */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 26px; }
.cols.two { grid-template-columns: 1fr 1fr; }
.panel-txt { background: var(--glass); border: 1px solid rgba(245, 250, 255, 0.18); border-radius: 12px; padding: 18px 22px; backdrop-filter: blur(8px); }
.panel-txt h3 { font: 600 15px/1 var(--exa); text-transform: uppercase; letter-spacing: 0.14em; color: var(--lime); margin: 6px 0 12px; }
.panel-txt h3:not(:first-child) { margin-top: 22px; }
.panel-txt p, .panel-txt li { font-size: 14.5px; }
.panel-txt ul, .panel-txt ol { padding-left: 20px; margin: 0; }
.panel-txt li { margin-bottom: 6px; }
.fineprint { font-size: 12.5px; color: var(--white); margin-top: 22px; display: inline-block; padding: 8px 12px; border-radius: 8px; background: var(--glass-2); }
.faq details { border-top: 1px solid rgba(245, 250, 255, 0.15); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 400; list-style: none; outline: none; }
.faq summary::before { content: '+'; display: inline-block; width: 20px; color: var(--lime); font-family: var(--lcd); font-size: 20px; }
.faq details[open] summary::before { content: '–'; }
.faq summary:focus-visible { color: var(--lime); }
.faq details p { margin: 8px 0 4px 20px; color: var(--dim); }

/* downloads */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.dl { background: var(--glass-2); border: 1px solid rgba(245, 250, 255, 0.2); border-radius: 12px; padding: 18px 20px; backdrop-filter: blur(8px); }
.dl h3 { font: 700 26px/1 var(--wide); letter-spacing: -0.04em; margin: 0 0 4px; }
.dl > p { margin: 0 0 14px; color: var(--dim); font: 300 12px var(--exa); text-transform: uppercase; letter-spacing: 0.12em; }
.dl .meta { font: 400 17px/1.25 var(--lcd); color: #9ff7b8; margin: 12px 0 0; word-break: break-all; }
.dl .meta span { color: var(--dim); }
.dl .btn { width: 100%; justify-content: center; }

/* setup */
.setup-grid { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 30px; align-items: start; }
.setup-list { display: grid; gap: 4px; }
.opt {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; cursor: pointer;
  background: none; border: 0; border-radius: 999px; padding: 9px 18px; text-align: left; outline: none;
  font: 500 clamp(15px, 1.8vw, 21px)/1.2 var(--wide); letter-spacing: -0.03em; text-transform: lowercase;
}
.opt b { font: 400 22px/1 var(--lcd); color: var(--lime); letter-spacing: 1px; font-weight: 400; }
.opt.sel, .opt:focus-visible { background: rgba(212, 236, 44, 0.14); box-shadow: inset 0 0 0 1px rgba(212, 236, 44, 0.5); color: var(--lime); }
.opt:disabled { opacity: 0.45; cursor: default; }
.legal-links { list-style: none; padding: 0 !important; }
.legal-links a { color: var(--white); }

/* ------------------------------------------------------------ footer */
.fine {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  padding: 10px var(--gutter) max(10px, env(safe-area-inset-bottom));
  font: 300 11px/1.3 var(--exa); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim);
  background: linear-gradient(to top, rgba(2, 12, 32, 0.55), transparent);
}
.fine a { color: var(--dim); text-decoration: none; }
.fine a:hover { color: var(--white); }
.fine .remote { margin-left: auto; }
.fine kbd { font: 400 15px/1 var(--lcd); color: var(--lime); margin: 0 3px; }
body[data-screen='studio'] .fine { position: static; background: none; }
.noscript { position: fixed; inset: auto 0 0 0; z-index: 99; padding: 16px; background: #000; }

/* ------------------------------------------------------------ narrow screens */
@media (max-width: 900px) {
  .dvd-menu { align-items: flex-start; }
  .dvd-menu.row { justify-content: flex-start; }
  .scene-row, .dl-grid, .cols, .cols.two { grid-template-columns: 1fr; }
  .pl.active { grid-template-columns: 1fr; }
  .setup-grid { grid-template-columns: 1fr; }
  .fine .remote { display: none; }
  .fine { position: static; background: none; }
  .screen { padding-bottom: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .crt .grain, .crt .tracking, .boot-play, .dvd-menu .cur { animation: none !important; }
  .screen.active { animation: none; }
}

/* ------------------------------------------------------------ brand: the wordmark (inline SVG, recolourable) */
.wm { display: block; line-height: 0; --hs-paper: #fff; --hs-ink: #000; --hs-script: #fff; }
.wm svg, .wm img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 18px rgba(0, 16, 50, 0.45)); }
.mast .logo { font-size: 0; line-height: 0; width: clamp(240px, 42vw, 640px); }
body:not([data-screen='menu']) .mast .logo { font-size: 0; width: clamp(170px, 20vw, 290px); }
.boot-mascot { display: block; width: clamp(120px, 18vh, 190px); height: auto; margin: 0 auto -6px; animation: bob 3.2s ease-in-out infinite; }
.boot-logo { width: min(520px, 86vw); margin: 0 auto; font-size: 0; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }

/* ------------------------------------------------------------ visuals: tool cards */
.tool-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 44px); }
.tool { grid-template-rows: auto auto auto auto auto; }
.tool-copy { grid-column: 1 / -1; margin: 10px 0 14px; font-size: 14.5px; line-height: 1.55; color: rgba(245, 250, 255, 0.9); text-shadow: 0 1px 10px rgba(0, 20, 60, 0.6); }
.tool-open { grid-column: 1 / -1; justify-self: start; }
.tool.sel .tool-open, .tool:focus-visible .tool-open { background: var(--lime); color: var(--ink); }
@media (max-width: 900px) { .tool-row { grid-template-columns: 1fr; } }
