/* ⌬┆⌜SKINSURF⌟┆⌬  —  styles for the whole page
   Copyright © 2025 Skinsurf (SURFNET), CC BY-NC-SA 4.0 (see index.html)

   1. SHARED BASICS + WHICH SCREEN IS SHOWING
   2. THE PORTAL (the CRT intro with ENTER)
   3. THE DIVE (the 3 seconds after ENTER)
   4. THE SURFACE (the menu)
*/


/* =========================================================================
   1. SHARED BASICS + WHICH SCREEN IS SHOWING
========================================================================= */
:root {
  --void:     #000000;   /* the tube, switched off */
  --phosphor: #00FAB3;   /* the site color */
  --hot:      #C9FFEF;   /* phosphor pushed so bright it goes white */
  --p90: rgba(0, 250, 179, .90);
  --p60: rgba(0, 250, 179, .60);
  --p35: rgba(0, 250, 179, .35);
  --p18: rgba(0, 250, 179, .18);
  --p08: rgba(0, 250, 179, .08);

  --display: "Michroma", "Eurostile", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --term:    "VT323", ui-monospace, Menlo, Consolas, monospace;

  --bezel:  clamp(6px, 1.2vmin, 14px);   /* black frame around the intro screen */
  --radius: clamp(14px, 2.6vmin, 30px);  /* how round the intro screen corners are */
  --pad:    clamp(18px, 3.2vmin, 40px);  /* gap between screen edge and readouts */
  --out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background: #000000;
  min-height: 100vh;
  width: 100%;
}

body {
  color: #00fab3;
  font-family: 'Courier New', monospace;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--phosphor); color: var(--void); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The little script at the top of index.html adds "mode-portal" (intro) or
   "mode-surface" (menu) to the page. Without JavaScript you just get the menu. */
.tube { display: none; }
html.mode-portal .tube,
html.mode-surface .tube { display: block; }

html.mode-portal,
html.mode-portal body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
html.mode-portal .surface,
html.mode-portal .scanlines { display: none; }

/* on the menu, the intro screen turns into the moving background */
html.mode-surface .tube {
  inset: 0;
  z-index: 0;
  border-radius: 0;
  background: #000000;
  box-shadow: none;
  pointer-events: none;
  touch-action: auto;
}
html.mode-surface .stage,
html.mode-surface .hud,
html.mode-surface .signal,
html.mode-surface .crt,
html.mode-surface .beam { display: none; }


/* =========================================================================
   2. THE PORTAL (the CRT intro with ENTER)
========================================================================= */
.tube {
  position: fixed;
  top:    max(var(--bezel), env(safe-area-inset-top));
  right:  max(var(--bezel), env(safe-area-inset-right));
  bottom: max(var(--bezel), env(safe-area-inset-bottom));
  left:   max(var(--bezel), env(safe-area-inset-left));
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  color: var(--phosphor);
  font-family: var(--display);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: radial-gradient(120% 95% at 50% 50%, #000f0b 0%, #000 64%);
  box-shadow: 0 0 0 1px var(--p08), 0 0 80px -24px var(--p35);
  transition: box-shadow .8s ease;
}
.is-leaving .tube { box-shadow: 0 0 0 1px rgba(0, 250, 179, .03), 0 0 80px -24px transparent; }

/* everything that "is the picture" lives in here, so it can power on/off */
.picture {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-origin: 50% var(--surface-y, 60%);
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- center: logo, tagline, button ---------- */
.stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--pad) var(--pad) calc(var(--pad) + 3vh);
  pointer-events: none;
}

/* a soft dark pool behind the logo so the net never crowds the letters */
.stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(1150px, 125vw);
  height: min(600px, 74vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, .78), rgba(0, 0, 0, .4) 55%, transparent);
  transition: opacity .5s ease;
  z-index: -1;
}

/* ⌬ ┆ ⌜SKINSURF⌟ ┆ ⌬ */
.lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.6vw, 24px);
  font-weight: 400;
  font-size: clamp(28px, min(7.2vw, 12.5vh), 90px);
  line-height: 1;
}

.benzene {
  flex: none;
  width: .46em;
  height: .46em;
  overflow: visible;
  color: var(--p60);
}
.lockup .benzene { stroke-width: 1.6; }

.rule {
  flex: none;
  width: 1px;
  height: 1.1em;
  background: repeating-linear-gradient(to bottom, var(--p35) 0 2px, transparent 2px 5px);
}

.mark {
  position: relative;
  display: block;
  padding: .36em .5em;
}
.mark::before,
.mark::after {
  content: "";
  position: absolute;
  width: .34em;
  height: .34em;
  border: 0 solid var(--phosphor);
  filter: drop-shadow(0 0 5px var(--p60));
}
.mark::before { top: 0;    left: 0;  border-width: 2px 0 0 2px; }
.mark::after  { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.word {
  position: relative;
  display: block;
  white-space: nowrap;
  letter-spacing: .15em;
  margin-right: -.15em;
  font-kerning: none;
  text-shadow:
    0 0 1px var(--phosphor),
    0 0 .08em var(--p60),
    0 0 .3em var(--p35),
    0 0 .9em var(--p18);
}

.ch { display: inline-block; text-align: center; }
.ch.live { color: var(--p60); text-shadow: 0 0 .25em var(--p35); }
.ch.hit  { color: var(--hot); text-shadow: 0 0 .06em var(--hot), 0 0 .3em var(--p90), 0 0 .8em var(--p60); }

/* signal interference: two ghost copies slip sideways for a split second */
.word::before,
.word::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
.word.glitch::before { opacity: .9;  color: var(--hot); clip-path: inset(12% 0 60% 0); transform: translateX(-.06em); }
.word.glitch::after  { opacity: .75; clip-path: inset(58% 0 18% 0); transform: translateX(.08em); }

/* 『 NET ⏣ PORTAL 』 */
.tagline {
  display: flex;
  align-items: center;
  gap: .9em;
  margin-top: clamp(14px, 2.4vh, 26px);
  font-size: clamp(9px, 1.1vw, 12.5px);
  line-height: 1;
  color: var(--p60);
  white-space: nowrap;
}
.tagline .tw { letter-spacing: .62em; margin-right: -.62em; }
.tagline .kagi {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", "Noto Sans JP", "MS Gothic", sans-serif;
  font-size: 1.3em;
  color: var(--p35);
}
.tagline .hexring {
  width: 1.3em;
  height: 1.3em;
  color: var(--phosphor);
  filter: drop-shadow(0 0 4px var(--p60));
}

/* ---------- ENTER ---------- */
.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: clamp(34px, 8vh, 88px);
}

.enter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13em;
  padding: 1.3em 2.4em;
  font-family: var(--display);
  font-size: clamp(13px, 1.3vw, 16px);
  letter-spacing: .6em;
  line-height: 1;
  color: var(--phosphor);
  text-decoration: none;
  background: rgba(0, 0, 0, .8);
  border: 1px solid var(--p35);
  outline: none;
  cursor: pointer;
  pointer-events: auto;
  text-shadow: 0 0 .6em var(--p60);
  box-shadow: 0 0 36px -10px var(--p60), inset 0 0 24px -12px var(--p90);
  transition: color .25s, text-shadow .25s, border-color .25s, box-shadow .45s, transform .15s;
}
.enter__label { position: relative; z-index: 1; margin-right: -.6em; }
.enter__fill {
  position: absolute;
  inset: 0;
  background: var(--phosphor);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .45s var(--out), background-color .15s;
}
.enter .c {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 0 solid var(--phosphor);
  filter: drop-shadow(0 0 4px var(--p60));
  transition: transform .5s var(--out), opacity .3s;
}
.enter .c--tl { top: -6px;    left: -6px;  border-width: 2px 0 0 2px; }
.enter .c--tr { top: -6px;    right: -6px; border-width: 2px 2px 0 0; }
.enter .c--bl { bottom: -6px; left: -6px;  border-width: 0 0 2px 2px; }
.enter .c--br { bottom: -6px; right: -6px; border-width: 0 2px 2px 0; }

/* a pulse along the surface line just arrived */
.enter.ping { border-color: var(--p90); transition-duration: .05s; }

.enter:focus-visible,
.enter.is-pressed {
  color: var(--void);
  text-shadow: none;
  border-color: var(--phosphor);
  box-shadow: 0 0 60px -6px var(--p90);
}
.enter:focus-visible .enter__fill,
.enter.is-pressed .enter__fill { transform: scaleX(1); }
.enter.is-pressed .enter__fill { background-color: var(--hot); }
.enter:focus-visible .c--tl { transform: translate(-4px, -4px); }
.enter:focus-visible .c--tr { transform: translate(4px, -4px); }
.enter:focus-visible .c--bl { transform: translate(-4px, 4px); }
.enter:focus-visible .c--br { transform: translate(4px, 4px); }
.enter:active { transform: scale(.98); }

@media (hover: hover) {
  .enter:hover {
    color: var(--void);
    text-shadow: none;
    border-color: var(--phosphor);
    box-shadow: 0 0 60px -6px var(--p90);
  }
  .enter:hover .enter__fill { transform: scaleX(1); }
  .enter:hover .c--tl { transform: translate(-4px, -4px); }
  .enter:hover .c--tr { transform: translate(4px, -4px); }
  .enter:hover .c--bl { transform: translate(-4px, 4px); }
  .enter:hover .c--br { transform: translate(4px, 4px); }
}

.hint {
  font-family: var(--term);
  font-size: 18px;
  line-height: 1;
  color: var(--p35);
}
.hint kbd {
  font: inherit;
  color: var(--p60);
  padding: 0 .3em;
  border: 1px solid var(--p18);
}

/* ---------- corner readouts ---------- */
.hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  font-family: var(--term);
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1;
  color: var(--p60);
}
.cell {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: .32em;
  white-space: nowrap;
}
.cell--tl { top: var(--pad);    left: var(--pad); }
.cell--tr { top: var(--pad);    right: var(--pad); align-items: flex-end; }
.cell--bl { bottom: var(--pad); left: var(--pad); }
.cell--br { bottom: var(--pad); right: var(--pad); align-items: flex-end; }

.row   { display: flex; align-items: center; gap: .45em; }
.lit   { color: var(--phosphor); text-shadow: 0 0 6px var(--p60); }
.faint { color: var(--p35); }
.hud .benzene { width: .95em; height: .95em; color: var(--phosphor); }

.bracket {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid var(--p35);
}
.bracket--tl { top: calc(var(--pad) * .45);    left: calc(var(--pad) * .45);  border-width: 1px 0 0 1px; }
.bracket--tr { top: calc(var(--pad) * .45);    right: calc(var(--pad) * .45); border-width: 1px 1px 0 0; }
.bracket--bl { bottom: calc(var(--pad) * .45); left: calc(var(--pad) * .45);  border-width: 0 0 1px 1px; }
.bracket--br { bottom: calc(var(--pad) * .45); right: calc(var(--pad) * .45); border-width: 0 1px 1px 0; }

.blink {
  width: .42em;
  height: .42em;
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--p60);
  animation: blink 1.4s steps(1) infinite;
}
@keyframes blink { 50% { opacity: .12; } }

.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: .62em; }
.bars i { width: 3px; background: var(--phosphor); opacity: .16; }
.bars i:nth-child(1) { height: 30%; }
.bars i:nth-child(2) { height: 40%; }
.bars i:nth-child(3) { height: 50%; }
.bars i:nth-child(4) { height: 60%; }
.bars i:nth-child(5) { height: 70%; }
.bars i:nth-child(6) { height: 80%; }
.bars i:nth-child(7) { height: 90%; }
.bars i:nth-child(8) { height: 100%; }
.bars i.on { opacity: .95; box-shadow: 0 0 4px var(--p60); }

/* loading readout, only shown after ENTER */
.prog { display: none; }
.loadbar {
  position: relative;
  width: 5.5em;
  height: 2px;
  overflow: hidden;
  background: var(--p18);
}
.loadbar i {
  position: absolute;
  inset: 0;
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--p60);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- signal artifacts (part of the picture) ---------- */
.signal {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

/* the slow bright band of the screen refreshing */
.roll {
  position: absolute;
  left: 0;
  right: 0;
  top: -40%;
  height: 40%;
  background: linear-gradient(to bottom,
    transparent,
    rgba(201, 255, 239, .022) 70%,
    rgba(201, 255, 239, .045) 78%,
    transparent);
  animation: roll 9s linear infinite;
}
@keyframes roll { to { transform: translateY(350%); } }

/* film grain, tinted phosphor */
.grain {
  position: absolute;
  inset: -48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 .98 0 0 0 0 .7 0 0 0 2.2 -1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: .08;
  animation: grain .5s steps(1) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-22px, 13px); }
  33%  { transform: translate(17px, -25px); }
  50%  { transform: translate(-9px, 31px); }
  67%  { transform: translate(28px, 7px); }
  83%  { transform: translate(-30px, -18px); }
  100% { transform: translate(0, 0); }
}

/* the bright line you see when an old TV turns on/off */
.beam,
.reveal-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--surface-y, 60%);
  z-index: 4;
  height: 2px;
  margin-top: -1px;
  background: var(--hot);
  box-shadow: 0 0 10px 2px var(--p90), 0 0 44px 8px var(--p35);
  opacity: 0;
  pointer-events: none;
}
.reveal-beam {
  position: fixed;
  top: 50%;
  z-index: 10000;
}

/* ---------- the glass: scanlines, vignette, reflection ---------- */
.crt {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  border-radius: inherit;
}
.crt__scan {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .4) 2px 3px),
    repeating-linear-gradient(to right, rgba(0, 0, 0, .14) 0 1px, transparent 1px 3px);
  animation: flicker 7s steps(1) infinite;
}
@keyframes flicker {
  0%   { opacity: 1; }
  6%   { opacity: .86; }
  7%   { opacity: 1; }
  41%  { opacity: .93; }
  42%  { opacity: 1; }
  77%  { opacity: .84; }
  78%  { opacity: .97; }
  79%  { opacity: 1; }
  100% { opacity: 1; }
}
.crt__glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(55% 40% at 22% 6%, rgba(201, 255, 239, .05), transparent 70%),
    radial-gradient(130% 105% at 50% 50%, transparent 56%, rgba(0, 0, 0, .62) 100%);
  box-shadow: inset 0 0 120px 10px rgba(0, 0, 0, .8), inset 0 0 2px 1px var(--p08);
}

/* ---------- power on (page load) ---------- */
.is-booting .picture { animation: power-on .8s var(--out) both; }
.is-booting .beam    { animation: beam-on .8s ease-out both; }
.is-quick .picture,
.is-quick .beam      { animation-duration: .45s; }

@keyframes power-on {
  0%, 22% { transform: scale(1, .004); opacity: 0; }
  23%     { opacity: 1; }
  65%     { transform: scale(1, 1.012); }
  100%    { transform: none; opacity: 1; }
}
@keyframes beam-on {
  0%   { opacity: 1; transform: scaleX(.01); }
  22%  { opacity: 1; transform: scaleX(1); }
  55%  { opacity: 0; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

/* intro: things flicker on one by one */
@keyframes flick-in {
  0%   { opacity: 0; }
  12%  { opacity: .9; }
  22%  { opacity: .1; }
  38%  { opacity: 1; }
  52%  { opacity: .45; }
  66%  { opacity: 1; }
  100% { opacity: 1; }
}

.is-booting .ch { opacity: 0; }
.is-booting .ch.live,
.is-booting .ch.set { opacity: 1; }

.is-booting .deco,
.is-booting .cell,
.is-booting .bracket { opacity: 0; }
.is-booting .lockup.on .deco,
.is-booting .hud.on .bracket,
.is-booting .cell.on { animation: flick-in .5s steps(1) both; }

.is-booting .mark::before { opacity: 0; transform: translate(-.3em, -.3em); }
.is-booting .mark::after  { opacity: 0; transform: translate(.3em, .3em); }
.is-booting .lockup.on .mark::before,
.is-booting .lockup.on .mark::after {
  opacity: 1;
  transform: none;
  transition: transform .7s var(--out), opacity .2s;
}

.is-booting .tagline    { opacity: 0; clip-path: inset(0 50%); }
.is-booting .tagline.on { opacity: 1; clip-path: inset(0 0); transition: clip-path .7s var(--out), opacity .2s; }

.is-booting .enter        { opacity: 0; }
.is-booting .enter .c--tl { transform: translate(-18px, -18px); }
.is-booting .enter .c--tr { transform: translate(18px, -18px); }
.is-booting .enter .c--bl { transform: translate(-18px, 18px); }
.is-booting .enter .c--br { transform: translate(18px, 18px); }
.is-booting .gate.on .enter    { opacity: 1; transition: opacity .35s; }
.is-booting .gate.on .enter .c { transform: none; transition: transform .6s var(--out); }
.is-booting .hint          { opacity: 0; }
.is-booting .gate.on .hint { opacity: 1; transition: opacity .5s .3s; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .lockup .benzene,
  .lockup .rule { display: none; }
  .lockup { font-size: clamp(26px, min(9.2vw, 12vh), 64px); }
}

@media (max-width: 560px) {
  .hud { font-size: 15px; }
  .stage { padding-bottom: calc(var(--pad) + 6vh); }
}

/* phones and tablets: no mouse, so hide mouse-only bits */
@media (hover: none) {
  .hint,
  .coords { display: none; }
}


/* =========================================================================
   3. THE DIVE (the 3 seconds after ENTER)
========================================================================= */
.is-diving .tube  { cursor: none; }
.is-diving .enter { pointer-events: none; }
.is-diving .stage::before { opacity: 0; }

/* logo, tagline and button sink into the surface line */
.is-diving .lockup,
.is-diving .tagline,
.is-diving .gate { animation: absorb .55s cubic-bezier(.6, 0, .9, .5) both; }
.is-diving .tagline { animation-delay: .03s; }
.is-diving .lockup  { animation-delay: .06s; }
@keyframes absorb {
  0%   { opacity: 1; transform: none; }
  18%  { opacity: .5; }
  26%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--dy, 0px)) scale(1.04, .06); }
}

.is-diving .coords { display: none; }
.is-diving .prog   { display: flex; }
.is-diving .blink  { animation-duration: .6s; }

/* the intro screen switches off (squashes to a line, then a dot) */
.is-leaving .picture { animation: power-off .4s cubic-bezier(.55, 0, .85, .35) forwards; }
.is-leaving .beam    { animation: beam-off .4s linear forwards; }

@keyframes power-off {
  0%   { transform: none; opacity: 1; }
  40%  { transform: scale(1, .004); opacity: 1; }
  41%  { transform: scale(1, .004); opacity: 0; }
  100% { transform: scale(1, .004); opacity: 0; }
}
@keyframes beam-off {
  0%, 34% { opacity: 0; transform: scaleX(1); }
  40%     { opacity: 1; transform: scaleX(1); }
  78%     { opacity: 1; transform: scaleX(.006); }
  100%    { opacity: 0; transform: scaleX(.003); }
}

/* ...and the menu switches on */
.is-revealing .surface {
  animation: power-on .35s var(--out) both;
  transform-origin: 50% 50vh;
}
.is-revealing .reveal-beam { animation: beam-on .35s ease-out both; }


/* =========================================================================
   4. THE SURFACE (the menu)
========================================================================= */
.surface {
  position: relative;
  z-index: 10;
}
.surface:focus { outline: none; }

.scanlines, header, .container, footer {
  position: relative;
  z-index: 10;
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(0deg, rgba(0, 250, 179, 0.02) 0px, rgba(0, 250, 179, 0.02) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 2px);
  pointer-events: none;
  z-index: 999;
}

header {
  padding: 2rem;
  border-bottom: 1px solid #00fab3;
  opacity: 0.9;
  background: #000000;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.terminal-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #00fab3;
  background: #000000;
  animation: dotPulse 2s infinite;
}

.dot:nth-child(2) { animation-delay: 0.3s; }
.dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotPulse {
  0%, 100% { background: #000000; box-shadow: none; }
  50% { background: #00fab3; box-shadow: 0 0 10px #00fab3; }
}

.terminal-path {
  font-size: 0.9rem;
  color: #00fab3;
  flex-grow: 1;
}

/* the startup sound keeps playing on the menu; this lets people stop it */
.sound-ctl {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.1rem;
  color: #00fab3;
  background: rgba(0, 250, 179, 0.08);
  border: 1px solid rgba(0, 250, 179, 0.5);
  border-radius: 2px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 250, 179, 0.15);
  transition: background 0.2s, color 0.2s;
}
.sound-ctl[hidden] { display: none; }
.sound-ctl:hover,
.sound-ctl:focus-visible {
  background: #00fab3;
  color: #000000;
  outline: none;
}
.sound-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.sound-bars i {
  width: 3px;
  height: 100%;
  background: currentColor;
  transform-origin: 50% 100%;
  transform: scaleY(0.2);
}

.surface h1 {
  font-size: 2.5rem;
  letter-spacing: 0.5rem;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.surface h1::before {
  content: '> ';
  animation: caret-blink 1s infinite;
}

.surface h1::after {
  content: '_';
  animation: caret-blink 1s infinite;
  margin-left: 5px;
}

@keyframes caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.system-info {
  display: flex;
  gap: 2rem;
  font-size: 0.85rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  gap: 0.5rem;
}

.info-label {
  color: #00fab3;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  background: #000000;
}

.command-line {
  background: rgba(0, 250, 179, 0.03);
  border: 1px solid rgba(0, 250, 179, 0.3);
  border-left: 3px solid #00fab3;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  box-shadow: inset 0 0 20px rgba(0, 250, 179, 0.05);
}

.command-line::before {
  content: '~ ';
  color: #00fab3;
  font-weight: bold;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

/* the cards are real links now (keyboard + middle-click work) */
.dir-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: #000000;
  border: 1px solid rgba(0, 250, 179, 0.3);
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.dir-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), #00fab3, rgba(0, 0, 0, 0));
  animation: scan 3s linear infinite;
}

@keyframes scan {
  0% { left: -100%; }
  100% { left: 100%; }
}

.dir-card:hover,
.dir-card:focus-visible {
  border-color: #00fab3;
  box-shadow: 0 0 30px rgba(0, 250, 179, 0.3), inset 0 0 30px rgba(0, 250, 179, 0.05);
  transform: translateY(-3px) scale(1.02);
  outline: none;
}

.dir-card:hover::before,
.dir-card:focus-visible::before {
  animation-duration: 1s;
}

.card-header {
  background: rgba(0, 250, 179, 0.1);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 250, 179, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

.dir-card:hover .card-header,
.dir-card:focus-visible .card-header {
  background: rgba(0, 250, 179, 0.2);
}

.card-id {
  font-size: 0.75rem;
  font-weight: bold;
}

.card-status {
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid #00fab3;
  border-radius: 2px;
  text-transform: uppercase;
  background: rgba(0, 250, 179, 0.1);
  box-shadow: 0 0 10px rgba(0, 250, 179, 0.2);
}

.card-body {
  padding: 1.5rem;
  background: #000000;
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  text-shadow: 0 0 10px rgba(0, 250, 179, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title::before {
  content: '//';
  font-size: 1rem;
}

.card-desc {
  opacity: 0.8;
  line-height: 1.8;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: rgba(0, 250, 179, 0.8);
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 250, 179, 0.2);
}

.meta-item::before {
  content: '▸ ';
}

.warning-banner {
  background: rgba(0, 250, 179, 0.05);
  border: 1px solid rgba(0, 250, 179, 0.3);
  border-left: 4px solid #00fab3;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: warningPulse 2s infinite;
}

@keyframes warningPulse {
  0%, 100% { border-left-color: #00fab3; }
  50% { border-left-color: rgba(0, 250, 179, 0.3); }
}

.warning-icon {
  font-size: 1.5rem;
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

footer {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(0, 250, 179, 0.2);
  background: #000000;
}

/* Responsive: merged and cleaned */
@media (max-width: 768px) {
  header { padding: 1rem; }
  .container { padding: 1rem; max-width: 100%; margin: 0; }
  header img { width: 100%; max-width: 300px; height: auto; margin: 0 auto; display: block; }
  .terminal-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
  .terminal-path { font-size: 0.8rem; word-break: break-word; width: 100%; }
  .system-info { gap: 0.5rem; margin-top: 0.5rem; font-size: 0.75rem; flex-direction: column; }
  .info-item { flex: 0 0 calc(50% - 0.25rem); justify-content: space-between; }
  .directory-grid { grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; padding: 0; }
  .card-header { padding: 0.75rem 1rem; }
  .card-body { padding: 1rem; }
  .card-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
  .card-desc { font-size: 0.85rem; line-height: 1.5; margin-bottom: 0.75rem; }
  .card-meta { gap: 1rem; padding-top: 0.75rem; font-size: 0.7rem; }
  .command-line { padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; }
  .warning-banner { padding: 0.75rem 1rem; margin: 1rem 0; font-size: 0.85rem; flex-direction: row; gap: 0.5rem; }
  .warning-icon { font-size: 1.2rem; flex-shrink: 0; }
  footer { padding: 1.5rem 1rem; margin-top: 2rem; }
  footer p { font-size: 0.8rem; margin: 0.5rem 0; word-break: break-word; }
  .dir-card { min-height: 120px; }
  .card-title, .card-status { touch-action: manipulation; }
  .scanlines { background: repeating-linear-gradient(0deg, rgba(0, 250, 179, 0.015) 0px, rgba(0, 250, 179, 0.015) 1px, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0) 3px); }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container { padding: 1.5rem; max-width: 100%; }
  .directory-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  header { padding: 1.5rem; }
  header img { max-width: 350px; width: 100%; height: auto; }
  .system-info { gap: 1.5rem; }
}

@media (max-width: 480px) {
  header, .container { padding: 0.75rem; }
  .system-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .info-item { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .card-header { padding: 0.5rem 0.75rem; }
  .card-body { padding: 0.75rem; }
  .card-title { font-size: 1rem; }
  .card-desc { font-size: 0.8rem; }
  .card-meta { flex-direction: column; gap: 0.5rem; }
  .warning-banner { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
  footer { padding: 1rem 0.75rem; }
  footer p { font-size: 0.75rem; }
  .directory-grid { grid-template-columns: 1fr; }
}

@media (max-width: 320px) {
  .terminal-path { font-size: 0.7rem; }
  .system-info { grid-template-columns: 1fr; }
  .command-line, .warning-banner { font-size: 0.75rem; }
}

@media (min-width: 1400px) {
  .container { max-width: 95%; padding: 2rem 1.5rem; }
  .directory-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
}

.container, .directory-grid, .dir-card { min-width: 0; }


/* =========================================================================
   CALMER VERSION for people who turn on "reduce motion" on their device
========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .crt__scan,
  .grain,
  .blink,
  .dot,
  .dir-card::before,
  .warning-banner,
  .warning-icon { animation: none; }
  .roll { display: none; }
  .is-diving .lockup,
  .is-diving .tagline,
  .is-diving .gate { animation: fade-away .45s ease both; }
  .is-leaving .picture { animation: fade-away .4s ease forwards; }
  .is-leaving .beam,
  .is-revealing .reveal-beam { animation: none; }
  .is-revealing .surface { animation: fade-in .35s ease both; }
  .dir-card:hover,
  .dir-card:focus-visible { transform: none; }
}
@keyframes fade-away { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
