@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Instrument+Serif:ital@0;1&family=Share+Tech+Mono&family=Special+Elite&family=UnifrakturCook:wght@700&family=VT323&display=swap');

:root {
  color-scheme: dark;
  --signal: #80eb70;
  --signal-soft: #b4f7a8;
  --metal: #171a18;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; min-width: 320px; background: #040504; color: #d2d0c8; font-family: "Share Tech Mono", monospace; }

.terminal-home { width: 100vw; height: 100dvh; }
.home-console {
  width: calc(100vw + 36px);
  height: calc(100dvh + 28px);
  margin: -14px -18px;
  padding: clamp(18px, 1.45vw, 28px) clamp(20px, 1.75vw, 34px);
  display: flex;
  flex-direction: column;
  gap: clamp(7px,.55vw,10px);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 38%,#101210 0%,#050605 48%,#010201 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.035), inset 0 -24px 46px #000;
  position: relative;
}
.home-console::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .11;
  mix-blend-mode: screen;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.15) 4px, transparent 5px);
}

.terminal-header {
  flex: 0 0 clamp(56px,7.2dvh,78px);
  padding: clamp(9px,1.1dvh,13px) clamp(54px,6vw,104px) 0;
  display: grid;
  align-items: center;
  position: relative;
  z-index: 6;
}
.terminal-header::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,transparent,rgba(126,135,124,.11) 18%,rgba(126,135,124,.11) 82%,transparent);
}
.terminal-nav { width: min(100%,1060px); margin: 0 auto; display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(14px,2.4vw,44px); }
.terminal-nav a {
  min-width: 0;
  padding: clamp(10px,1.4dvh,15px) 10px;
  border: 1px solid #3b403b;
  border-radius: 4px;
  color: #b5b2aa;
  background:
    linear-gradient(104deg,rgba(255,255,255,.025),transparent 32%),
    linear-gradient(160deg,#1d1f1d,#090a09 72%);
  box-shadow: inset 0 1px rgba(221,225,217,.14), inset 0 -5px 8px #000, 0 0 0 2px #030403, 0 4px 8px #000;
  text-decoration: none;
  text-align: center;
  letter-spacing: .1em;
  font-size: clamp(10px,.95vw,15px);
}
.terminal-nav a:hover, .terminal-nav a:focus-visible { color: #e1ded6; border-color: #6c726b; outline: none; box-shadow: inset 0 1px rgba(235,238,230,.22), inset 0 -5px 8px #000, 0 0 16px rgba(219,225,214,.14), 0 4px 8px #000; }

.screen-well {
  flex: 1 1 0;
  min-height: 0;
  margin: 0 clamp(2px,.55vw,10px);
  padding: clamp(17px,1.45vw,28px) clamp(104px,7.1vw,132px) clamp(18px,1.55vw,30px) clamp(18px,1.55vw,30px);
  display: flex;
  flex-direction: column;
  border: 1px solid #090a09;
  border-radius: clamp(20px,2.2vw,38px);
  background:
    linear-gradient(116deg,rgba(255,255,255,.018),transparent 24%,rgba(255,255,255,.009) 54%,transparent 72%),
    repeating-linear-gradient(0deg,#050605 0 2px,#020302 3px,#040504 5px),
    #020302;
  box-shadow:
    inset 0 0 0 3px #000,
    inset 0 0 0 5px #141714,
    inset 0 0 0 8px #010201,
    inset 26px 25px 46px #000,
    inset -18px -18px 30px rgba(76,82,75,.055),
    0 0 0 2px #020302,
    0 9px 20px #000,
    0 24px 48px rgba(0,0,0,.76);
  position: relative;
  z-index: 2;
}
.screen-well::before {
  content: "";
  position: absolute;
  inset: clamp(9px,.8vw,15px);
  border: 1px solid rgba(77,82,76,.2);
  border-radius: calc(clamp(20px,2.2vw,38px) - 9px);
  box-shadow: inset 13px 13px 24px #000, inset -4px -4px 10px rgba(108,114,106,.045), 0 1px rgba(151,157,147,.035);
  pointer-events: none;
}
.bezel-layer,
.bezel-overlay { display: none; }
.master-screen {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: clamp(8px,.7vw,13px) solid transparent;
  border-radius: clamp(15px,1.7vw,28px);
  background:
    linear-gradient(#020302,#020302) padding-box,
    linear-gradient(145deg,#454a44 0%,#151815 15%,#000 44%,#050605 65%,#2a2e29 88%,#080a08 100%) border-box;
  box-shadow:
    inset 0 0 0 2px #000,
    inset 0 0 0 3px rgba(153,161,151,.13),
    inset 0 0 68px #000,
    0 0 0 4px #000,
    0 0 0 6px #242824,
    0 0 0 10px #010201,
    0 9px 14px #000,
    0 19px 30px rgba(0,0,0,.86);
  position: relative;
  z-index: 2;
}
.master-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: .22; filter: grayscale(.55) contrast(1.32) brightness(.56) saturate(.68); transform: scale(1.025); }
.signal-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(9,22,12,.15), rgba(0,0,0,.56) 72%), linear-gradient(100deg, rgba(0,8,18,.2), transparent 35%, rgba(24,0,0,.15)); }
.signal-noise { position: absolute; inset: 0; opacity: .42; mix-blend-mode: screen; pointer-events: none; background: repeating-linear-gradient(0deg,transparent 0 2px,rgba(161,196,163,.11) 3px,transparent 4px); }
.master-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  border: 2px solid rgba(126,136,125,.2);
  border-radius: inherit;
  padding: clamp(5px,.46vw,8px);
  background:
    linear-gradient(103deg,transparent 5%,rgba(255,255,255,.035) 5.2%,transparent 5.5%) 0 0/37% 100%,
    repeating-linear-gradient(113deg,transparent 0 43px,rgba(210,218,207,.035) 44px,transparent 45px 91px);
  box-shadow: inset 7px 7px 13px #000, inset -5px -5px 11px rgba(105,112,104,.16), inset 0 0 0 5px rgba(0,0,0,.55);
  -webkit-mask: linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .9;
  pointer-events: none;
}
.master-screen::after { content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none; border-radius: inherit; box-shadow: inset 26px 0 48px rgba(0,0,0,.72), inset -26px 0 48px rgba(0,0,0,.72), inset 0 22px 42px #000, inset 0 -22px 42px #000; }

.screen-index { position: absolute; top: clamp(78px,9.3dvh,100px); z-index: 3; color: #697669; letter-spacing: .16em; font-size: clamp(8px,.7vw,11px); }
.screen-index--left { left: clamp(24px,3vw,52px); }
.screen-index--right { right: clamp(24px,3vw,52px); color: #78d66e; }
.screen-index--right i { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 9px #52ef48; }

.boot-copy { position: absolute; z-index: 4; left: 50%; top: 56%; width: min(86%,1100px); transform: translate(-50%,-50%); text-align: center; transition: opacity .75s ease, filter .75s ease, transform .75s ease; }
.is-booting .boot-copy { opacity: 0; filter: blur(7px); transform: translate(-50%,-46%) scale(.98); }
.boot-code { color: #849184; letter-spacing: .22em; font-size: clamp(8px,.78vw,12px); }
.boot-copy h1 {
  margin: clamp(10px,1.8dvh,20px) 0 0;
  color: #aaa9a4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(68px,13vw,210px);
  font-weight: 800;
  line-height: .84;
  letter-spacing: -.075em;
  text-shadow: 3px 0 rgba(0,255,205,.27), -3px 0 rgba(255,20,20,.17), 0 7px 15px #000;
  position: relative;
}
.boot-copy h1::before, .boot-copy h1::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.boot-copy h1::before { color: rgba(72,255,222,.65); text-shadow: -5px 0 rgba(63,240,255,.35); }
.boot-copy h1::after { color: rgba(255,76,64,.42); text-shadow: 5px 0 rgba(255,39,32,.35); }
.logo-letter {
  position: relative;
  z-index: 1;
  display: inline-block;
  cursor: default;
  outline: 0;
}

.acronym-echoes {
  position:absolute;
  z-index:5;
  inset:0;
  overflow:hidden;
  pointer-events:none;
}

.acronym-echo {
  position:absolute;
  display:block;
  color:rgba(200,211,194,.88);
  line-height:.82;
  opacity:0;
  filter:blur(7px) contrast(1.2);
  text-shadow:2px 0 rgba(74,255,218,.22),-2px 0 rgba(255,57,46,.16),0 0 11px rgba(154,222,143,.18),0 5px 10px #000;
  transform:translateY(7px) scale(.97);
  transition:opacity 110ms linear,filter 160ms ease,transform 160ms ease;
  white-space:nowrap;
}

.acronym-echo.is-visible {
  opacity:.92;
  filter:blur(0) contrast(1.08);
  transform:translateY(0) scale(1);
  animation:acronym-signal-in 420ms steps(2,end);
}

.acronym-echo--its-one {
  top:23%;
  left:8%;
  font-family:"UnifrakturCook",Georgia,serif;
  font-size:clamp(30px,4.1vw,72px);
  letter-spacing:.015em;
  transform:rotate(-3deg) translateY(7px);
}
.acronym-echo--its-one.is-visible { transform:rotate(-3deg) translateY(0); }

.acronym-echo--not {
  left:47%;
  bottom:11.5%;
  font-family:"Bebas Neue",Impact,sans-serif;
  font-size:clamp(34px,5.4vw,92px);
  letter-spacing:.13em;
  transform:translateX(-50%) translateY(7px) scaleX(.82);
}
.acronym-echo--not.is-visible { transform:translateX(-50%) translateY(0) scaleX(.82); }

.acronym-echo--me {
  top:20%;
  left:50%;
  font-family:"Instrument Serif",Georgia,serif;
  font-size:clamp(35px,5vw,88px);
  font-style:italic;
  transform:translateX(-50%) translateY(7px) skewX(-7deg);
}
.acronym-echo--me.is-visible { transform:translateX(-50%) translateY(0) skewX(-7deg); }

.acronym-echo--its-two {
  top:23%;
  left:8%;
  font-family:"Special Elite","Courier New",monospace;
  font-size:clamp(25px,3.25vw,58px);
  letter-spacing:.08em;
  text-transform:uppercase;
  transform:rotate(2deg) translateY(7px);
}
.acronym-echo--its-two.is-visible { transform:rotate(2deg) translateY(0); }

.acronym-echo--someone {
  right:7.5%;
  bottom:12.5%;
  font-family:"Bebas Neue",Impact,sans-serif;
  font-size:clamp(30px,4.4vw,78px);
  letter-spacing:.16em;
  transform:translateY(7px) scaleX(.72);
  transform-origin:right center;
}
.acronym-echo--someone.is-visible { transform:translateY(0) scaleX(.72); }

.acronym-echo--else {
  top:23%;
  right:8%;
  font-family:"Instrument Serif",Georgia,serif;
  font-size:clamp(32px,4.5vw,80px);
  font-style:italic;
  letter-spacing:.04em;
  transform:rotate(-4deg) translateY(7px) scale(.96);
}
.acronym-echo--else.is-visible { transform:rotate(-4deg) translateY(0) scale(1); }

@keyframes acronym-signal-in {
  0% { clip-path:inset(0 0 82% 0); opacity:.08; }
  18% { clip-path:inset(58% 0 13% 0); transform:translate(4px,-1px); }
  37% { clip-path:inset(17% 0 54% 0); opacity:1; }
  58% { clip-path:inset(72% 0 4% 0); transform:translate(-3px,1px); }
  76% { clip-path:inset(6% 0 68% 0); }
  100% { clip-path:inset(0); }
}
.is-glitching .boot-copy h1 { animation: logo-jolt .42s steps(2,end); }
.is-glitching .boot-copy h1::before { opacity: .62; animation: logo-slice-a .42s steps(2,end); }
.is-glitching .boot-copy h1::after { opacity: .5; animation: logo-slice-b .42s steps(2,end); }
@keyframes logo-jolt {
  0%,100% { transform: translate(0); }
  20% { transform: translate(-3px,1px) skewX(-1deg); }
  42% { transform: translate(4px,-1px); }
  58% { transform: translate(-1px,2px) skewX(.7deg); }
  78% { transform: translate(2px,0); }
}
@keyframes logo-slice-a {
  0% { clip-path: inset(8% 0 72%); transform: translate(-7px,-1px); }
  35% { clip-path: inset(44% 0 34%); transform: translate(8px,1px); }
  68% { clip-path: inset(73% 0 8%); transform: translate(-4px,0); }
  100% { clip-path: inset(20% 0 60%); transform: translate(0); }
}
@keyframes logo-slice-b {
  0% { clip-path: inset(66% 0 13%); transform: translate(6px,1px); }
  40% { clip-path: inset(18% 0 63%); transform: translate(-8px,0); }
  76% { clip-path: inset(48% 0 30%); transform: translate(5px,-1px); }
  100% { clip-path: inset(76% 0 7%); transform: translate(0); }
}

.archive-port {
  position: absolute;
  z-index: 4;
  top: 57%;
  right: clamp(12px,1.25vw,24px);
  width: clamp(78px,5.7vw,102px);
  height: clamp(220px,33dvh,286px);
  transform: translateY(-50%);
  perspective: 760px;
}
.archive-port::before {
  content: "";
  position: absolute;
  inset: -9px -4px -9px 7px;
  z-index: 0;
  border: 1px solid #201a12;
  border-radius: 7px 2px 2px 7px;
  background: linear-gradient(90deg,#000 0%,#0c0a07 30%,#16110b 73%,#020201 100%);
  box-shadow:
    inset 17px 0 24px #000,
    inset -2px 0 5px rgba(190,137,65,.1),
    0 0 0 4px #000,
    0 0 0 5px #282119,
    -12px 10px 22px #000;
}
.archive-port::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: -2px;
  right: 9%;
  width: 60%;
  height: 6px;
  border-radius: 1px;
  background: linear-gradient(90deg,#251508,#ad6d27 48%,#2b1809);
  box-shadow: 0 0 5px rgba(198,123,41,.18), inset 0 1px rgba(255,222,160,.2);
}
.archive-handle {
  position: absolute;
  z-index: 1;
  top: 5%;
  right: 22%;
  width: clamp(62px,4.55vw,80px);
  height: 90%;
  text-decoration: none;
  transform-origin: right center;
  transform: rotateY(-11deg) rotateZ(-.7deg) translateX(-2px);
  transition: opacity .75s ease, transform .22s ease, filter .22s ease;
}
.archive-handle::before {
  content: "";
  position: absolute;
  inset: 4px -9px -6px 8px;
  border-radius: 2px;
  background: linear-gradient(90deg,#080604,#18120c 66%,#030201);
  box-shadow: 7px 7px 14px rgba(0,0,0,.88);
  transform: translateZ(-1px);
}
.archive-face {
  position: absolute;
  inset: 0;
  padding: 17px 0 14px;
  display: grid;
  grid-template-rows: 12px 1fr 18px;
  place-items: center;
  border: 1px solid #3b2d1d;
  border-radius: 4px 2px 4px 3px;
  clip-path: polygon(3% 1%,94% 0,100% 4%,98% 97%,8% 100%,0 95%);
  color: #b58d51;
  background:
    linear-gradient(90deg,rgba(255,231,185,.075),transparent 22%,rgba(0,0,0,.62) 88%),
    repeating-linear-gradient(0deg,rgba(255,255,255,.018) 0 1px,transparent 1px 4px),
    linear-gradient(165deg,#29231b,#15110d 52%,#070605 100%);
  box-shadow:
    inset 2px 0 rgba(255,224,174,.11),
    inset -7px 0 12px #000,
    inset 0 -7px 10px #000,
    -7px 8px 16px rgba(0,0,0,.74);
  letter-spacing: .18em;
  font-size: clamp(9px,.7vw,12px);
  overflow: hidden;
}
.archive-face::before {
  content: "";
  position: absolute;
  inset: 18% 14% 14%;
  border: 1px solid rgba(177,132,69,.22);
  border-radius: 2px;
  background: linear-gradient(90deg,#070604,rgba(37,29,19,.34),#050403);
  box-shadow: inset 4px 0 9px #000;
  pointer-events: none;
}
.archive-face i { width: 7px; height: 7px; border-radius: 50%; background: #a46b2b; box-shadow: 0 0 6px rgba(190,117,39,.5); position: relative; z-index: 1; }
.archive-face strong { writing-mode: vertical-rl; text-orientation: mixed; font-weight: normal; position: relative; z-index: 1; }
.archive-face b { color: #92612b; font-size: 12px; font-weight: normal; line-height: 1; position: relative; z-index: 1; }
.is-booting .archive-handle { opacity: 0; transform: rotateY(-11deg) rotateZ(-.7deg) translateX(18px); }
.archive-handle:hover, .archive-handle:focus-visible {
  outline: none;
  transform: rotateY(-7deg) rotateZ(-.3deg) translateX(-8px);
  filter: brightness(1.08);
}
.archive-handle > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.archive-title,
.archive-arrow { display: none; }

.screen-footer { position: absolute; z-index: 3; left: clamp(24px,3vw,52px); right: clamp(24px,3vw,52px); bottom: clamp(16px,2vw,30px); display: flex; justify-content: space-between; color: #4d574e; letter-spacing: .15em; font-size: clamp(7px,.62vw,10px); }

.system-rail {
  flex: 0 0 clamp(54px,6.8dvh,68px);
  margin: 0 clamp(8px,1.3vw,20px);
  padding: 8px clamp(20px,3vw,52px);
  display: grid;
  grid-template-columns: auto minmax(160px,1fr) auto;
  align-items: center;
  gap: clamp(22px,3vw,54px);
  border: 1px solid #070807;
  border-radius: 6px 6px 3px 3px;
  background:
    linear-gradient(90deg,rgba(255,255,255,.035),transparent 21%,transparent 70%,rgba(0,0,0,.24)),
    linear-gradient(165deg,#2a2d29,#111310 46%,#070807 84%);
  box-shadow:
    inset 0 2px rgba(196,203,192,.2),
    inset 0 -9px 15px #000,
    inset 8px 0 15px rgba(255,255,255,.018),
    0 0 0 2px #20231f,
    0 5px 10px #000,
    0 13px 24px rgba(0,0,0,.52);
  position: relative;
  z-index: 2;
  overflow: hidden;
}
.system-rail::before { content: ""; position: absolute; inset: 0; z-index: 0; opacity: .34; pointer-events: none; background: repeating-linear-gradient(113deg,transparent 0 47px,rgba(220,225,211,.035) 48px,transparent 49px 96px), radial-gradient(ellipse at 24% 10%,rgba(255,255,255,.045),transparent 23%); mix-blend-mode: screen; }
.system-rail::after { content: ""; position: absolute; left: 1.5%; right: 1.5%; top: 3px; height: 1px; background: linear-gradient(90deg,transparent,rgba(175,183,172,.18) 11%,rgba(175,183,172,.08) 72%,transparent); pointer-events: none; }
.system-rail > * { position: relative; z-index: 1; }
.rail-power { display: flex; align-items: center; gap: 10px; color: #777c76; letter-spacing: .16em; font-size: clamp(7px,.62vw,10px); white-space: nowrap; }
.rail-power i { width: 9px; height: 9px; border-radius: 2px; background: #e7352d; box-shadow: 0 0 9px #e32018,inset 0 1px #ff8e87; }
.signal-trace { height: 31px; min-width: 0; border-left: 1px solid #1b1f1b; border-right: 1px solid #1b1f1b; background: linear-gradient(180deg,rgba(0,0,0,.22),transparent 46%,rgba(0,0,0,.2)); position: relative; overflow: hidden; opacity: .7; filter: saturate(.52); }
.signal-trace::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: linear-gradient(90deg,transparent,#465143 10%,#75806d 46%,#515c4d 76%,transparent); box-shadow: 0 0 3px rgba(105,125,98,.18); transform: rotate(-.08deg); }
.signal-trace canvas { display: none; }
.signal-trace i { position: absolute; inset: 3px 2%; background: #76836d; opacity: .5; filter: blur(.28px); clip-path: polygon(0 50%,3% 49%,5% 44%,6% 56%,8% 48%,12% 52%,15% 46%,17% 54%,19% 36%,21% 67%,23% 47%,27% 53%,30% 43%,33% 58%,36% 48%,40% 51%,43% 29%,45% 74%,47% 45%,50% 55%,53% 38%,55% 64%,58% 47%,61% 53%,64% 34%,66% 69%,69% 46%,72% 56%,75% 41%,78% 60%,81% 48%,84% 52%,87% 39%,89% 63%,92% 46%,95% 55%,97% 48%,100% 51%,100% 54%,97% 51%,95% 58%,92% 49%,89% 67%,87% 43%,84% 55%,81% 51%,78% 64%,75% 44%,72% 59%,69% 49%,66% 73%,64% 37%,61% 56%,58% 50%,55% 68%,53% 41%,50% 58%,47% 48%,45% 78%,43% 32%,40% 54%,36% 51%,33% 61%,30% 46%,27% 56%,23% 50%,21% 71%,19% 39%,17% 57%,15% 49%,12% 55%,8% 51%,6% 59%,5% 47%,3% 52%,0 53%); }
.signal-trace i::after { content: ""; position: absolute; inset: 2px 0 -2px; background: inherit; opacity: .2; filter: blur(1px); }
.rail-model { color: #454b46; letter-spacing: .16em; font-size: clamp(7px,.62vw,10px); white-space: nowrap; }

@media (min-width: 1101px), (min-width: 901px) and (orientation: landscape) {
  .terminal-home {
    display: grid;
    place-items: center;
    background: radial-gradient(ellipse at center,#11130f 0%,#050605 48%,#010201 100%);
  }

  .home-console {
    width: min(100vw,calc(100dvh * 1.7768331562));
    height: min(100dvh,calc(100vw / 1.7768331562));
    aspect-ratio: 1672 / 941;
    margin: 0;
    padding: 0;
    gap: 0;
  }

  .screen-well {
    position: absolute;
    top: -3.45%;
    left: -4.05%;
    width: 108.1%;
    height: 100.2%;
    flex: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    isolation: isolate;
    background: #010201;
    box-shadow: none;
  }

  .screen-well::before { display: none; }

  .bezel-layer {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    user-select: none;
  }

  .bezel-overlay {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    filter: drop-shadow(0 12px 18px rgba(0,0,0,.82));
  }

  .master-screen {
    position: absolute;
    z-index: 1;
    left: 10.96%;
    right: 11.01%;
    top: 13.28%;
    bottom: 13.92%;
    width: auto;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 5px;
    background: #020302;
    box-shadow: inset 0 0 72px #000;
  }

  .master-screen::before { display: none; }

  .master-screen::after {
    background:
      radial-gradient(ellipse at 50% 46%,transparent 48%,rgba(0,0,0,.54) 100%),
      linear-gradient(90deg,rgba(0,0,0,.28),transparent 12% 88%,rgba(0,0,0,.34));
    box-shadow: inset 0 0 22px rgba(0,0,0,.88);
  }

  .terminal-header {
    flex-basis: clamp(54px,6.8dvh,72px);
    padding: clamp(9px,1.1dvh,13px) clamp(46px,5vw,88px) 0;
  }

  .terminal-nav a {
    color: #d0cec7;
    border-color: rgba(158,163,155,.58);
    text-shadow: 0 0 5px rgba(224,226,219,.34);
    box-shadow:
      inset 0 1px rgba(238,240,234,.2),
      inset 0 -5px 8px #000,
      0 0 0 2px #030403,
      0 0 13px rgba(221,225,215,.24),
      0 0 27px rgba(210,216,205,.12),
      0 5px 9px #000;
    animation: nav-tube-flicker 11.4s steps(1,end) infinite;
  }

  .terminal-nav a:nth-child(2) { animation-duration: 13.1s; animation-delay: -4.7s; }
  .terminal-nav a:nth-child(3) { animation-duration: 15.3s; animation-delay: -8.2s; }
  .terminal-nav a:nth-child(4) { animation-duration: 12.6s; animation-delay: -2.9s; }

  .terminal-nav a:hover,
  .terminal-nav a:focus-visible {
    animation-play-state: paused;
    opacity: 1;
    filter: brightness(1.15);
    color: #f1eee6;
    border-color: rgba(213,217,207,.78);
    box-shadow:
      inset 0 1px rgba(248,249,244,.28),
      inset 0 -5px 8px #000,
      0 0 0 2px #030403,
      0 0 18px rgba(229,232,222,.34),
      0 0 36px rgba(218,224,211,.18),
      0 5px 9px #000;
  }

  .archive-port {
    z-index: 7;
    top: 50%;
    left: 95.18%;
    right: auto;
    width: 5.35%;
    height: 42%;
    transform: translate(-50%,-50%);
    perspective: 1000px;
    pointer-events: none;
  }

  .archive-port::before {
    content: "";
    display: block;
    position: absolute;
    z-index: 0;
    inset: -18% -105%;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,rgba(212,124,37,.4) 0%,rgba(151,75,17,.18) 30%,rgba(92,39,8,.07) 53%,transparent 72%);
    box-shadow: none;
    filter: blur(12px);
    opacity: .62;
    pointer-events: none;
    animation: archive-beacon 3.1s ease-in-out infinite;
  }

  .archive-port::after { display: none; }

  .archive-handle {
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
    transform-origin: right center;
    transform: rotateY(-4deg) translateX(1px);
    transition: opacity .75s ease,transform .28s cubic-bezier(.2,.8,.2,1),filter .24s ease;
  }

  .archive-handle::before {
    content: "";
    display: block;
    position: absolute;
    z-index: 3;
    top: 12.2%;
    left: 30%;
    width: 29%;
    height: 2.2%;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg,#6f3612,#f0ad45 37%,#d78324 72%,#4b220a);
    box-shadow: 0 0 4px rgba(255,184,77,.9),0 0 11px rgba(220,121,31,.66),0 0 22px rgba(176,74,15,.3);
    opacity: .92;
    transform: none;
    pointer-events: none;
    animation: archive-led 2.7s steps(1,end) infinite;
  }

  .archive-handle > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter:
      sepia(.62)
      saturate(1.72)
      brightness(1.16)
      contrast(1.04)
      drop-shadow(8px 10px 12px rgba(0,0,0,.92))
      drop-shadow(0 0 10px rgba(210,124,36,.52))
      drop-shadow(0 0 24px rgba(162,75,17,.3));
    animation: archive-cartridge-breathe 3.1s ease-in-out infinite;
  }

  .archive-title,
  .archive-arrow {
    display: block;
    position: absolute;
    z-index: 2;
    left: 43%;
    color: #efb45a;
    text-shadow: 0 0 4px rgba(255,186,78,.9),0 0 11px rgba(225,132,39,.62),0 0 23px rgba(177,80,19,.34);
    pointer-events: none;
    animation: archive-copy-pulse 3.1s ease-in-out infinite;
  }

  .archive-title {
    top: 50%;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: translate(-50%,-50%);
    font-size: clamp(8px,.62vw,11px);
    line-height: 1;
    letter-spacing: .18em;
  }

  .archive-arrow {
    bottom: 10.5%;
    transform: translateX(-50%);
    font-size: clamp(7px,.52vw,9px);
  }

  .is-booting .archive-handle {
    opacity: 0;
    transform: rotateY(-4deg) translateX(22px);
  }

  .archive-handle:hover,
  .archive-handle:focus-visible {
    outline: none;
    transform: rotateY(-2deg) translateX(-9px);
    filter: brightness(1.08);
  }

  .system-rail {
    position: absolute;
    z-index: 8;
    right: 1.8%;
    bottom: 1.25%;
    left: 1.8%;
    width: auto;
    height: 5.05%;
    margin: 0;
    padding-block: .42%;
    grid-template-columns: auto minmax(160px,1fr) auto;
    border-radius: 4px 4px 2px 2px;
  }

  .signal-trace::before,
  .signal-trace i { display: none; }

  .signal-trace canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

@keyframes nav-tube-flicker {
  0%,5.7%,6.45%,29%,47.7%,49.4%,73%,81.7%,82.75%,100% { opacity: 1; filter: brightness(1); }
  5.9% { opacity: .28; filter: brightness(.38); }
  6.12% { opacity: .82; filter: brightness(.76); }
  6.28% { opacity: .12; filter: brightness(.22); }
  48% { opacity: .08; filter: brightness(.16); }
  48.24% { opacity: .68; filter: brightness(.7); }
  48.46% { opacity: .16; filter: brightness(.24); }
  48.78% { opacity: .9; filter: brightness(.88); }
  81.92% { opacity: .42; filter: brightness(.5); }
  82.08% { opacity: .1; filter: brightness(.18); }
  82.34% { opacity: .72; filter: brightness(.72); }
  82.51% { opacity: .2; filter: brightness(.3); }
}

@keyframes archive-beacon {
  0%,100% { opacity: .46; transform: scale(.94); }
  48% { opacity: .83; transform: scale(1.04); }
  56% { opacity: .68; transform: scale(1); }
}

@keyframes archive-cartridge-breathe {
  0%,100% {
    filter: sepia(.62) saturate(1.72) brightness(1.13) contrast(1.04) drop-shadow(8px 10px 12px rgba(0,0,0,.92)) drop-shadow(0 0 8px rgba(210,124,36,.42)) drop-shadow(0 0 20px rgba(162,75,17,.22));
  }
  48% {
    filter: sepia(.68) saturate(1.88) brightness(1.24) contrast(1.04) drop-shadow(8px 10px 12px rgba(0,0,0,.92)) drop-shadow(0 0 13px rgba(239,153,58,.72)) drop-shadow(0 0 30px rgba(181,87,19,.4));
  }
}

@keyframes archive-copy-pulse {
  0%,100% { opacity: .76; filter: brightness(.92); }
  48% { opacity: 1; filter: brightness(1.16); }
}

@keyframes archive-led {
  0%,42%,47%,100% { opacity: .94; }
  44% { opacity: .38; }
  45% { opacity: 1; }
  46% { opacity: .58; }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-nav a,
  .archive-port::before,
  .archive-handle::before,
  .archive-handle > img,
  .archive-title,
  .archive-arrow { animation: none !important; }
}

@media (max-width: 1100px) {
  .terminal-nav a {
    color: #d0cec7;
    border-color: rgba(158,163,155,.58);
    text-shadow: 0 0 5px rgba(224,226,219,.34);
    box-shadow:
      inset 0 1px rgba(238,240,234,.2),
      inset 0 -5px 8px #000,
      0 0 0 2px #030403,
      0 0 12px rgba(221,225,215,.22),
      0 4px 8px #000;
    animation: nav-tube-flicker 11.4s steps(1,end) infinite;
  }

  .terminal-nav a:nth-child(2) { animation-duration: 13.1s; animation-delay: -4.7s; }
  .terminal-nav a:nth-child(3) { animation-duration: 15.3s; animation-delay: -8.2s; }
  .terminal-nav a:nth-child(4) { animation-duration: 12.6s; animation-delay: -2.9s; }

  .signal-trace::before,
  .signal-trace > i { display: none; }

  .signal-trace canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 1100px) and (orientation: portrait),
       (max-width: 900px) and (orientation: landscape) {
  .terminal-home { height: 100svh; }

  .home-console {
    width: 100vw;
    height: 100svh;
    margin: 0;
    padding: 6px;
    gap: 6px;
  }

  .screen-well {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    isolation: isolate;
    background: #010201;
    box-shadow: none;
  }

  .screen-well::before { display: none; }

  .bezel-layer {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    user-select: none;
  }

  .bezel-overlay {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,.84));
  }

  .master-screen {
    position: absolute;
    z-index: 1;
    width: auto;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 5px;
    background: #020302;
    box-shadow: inset 0 0 64px #000;
  }

  .master-screen::before { display: none; }
  .master-screen::after {
    background:
      radial-gradient(ellipse at 50% 48%,transparent 43%,rgba(0,0,0,.6) 100%),
      linear-gradient(90deg,rgba(0,0,0,.3),transparent 13% 87%,rgba(0,0,0,.38));
    box-shadow: inset 0 0 20px rgba(0,0,0,.9);
  }

  .screen-index,
  .screen-footer { display: none; }

  .archive-port {
    z-index: 7;
    right: auto;
    bottom: auto;
    transform: translate(-50%,-50%);
    perspective: 800px;
    pointer-events: none;
  }

  .archive-port::before {
    content: "";
    display: block;
    position: absolute;
    z-index: 0;
    inset: -18% -90%;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,rgba(212,124,37,.42),rgba(151,75,17,.16) 34%,transparent 70%);
    box-shadow: none;
    filter: blur(10px);
    opacity: .64;
    pointer-events: none;
    animation: archive-beacon 3.1s ease-in-out infinite;
  }

  .archive-port::after { display: none; }

  .archive-handle {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
    transform-origin: right center;
    transform: rotateY(-4deg) translateX(1px);
  }

  .archive-handle::before {
    content: "";
    display: block;
    position: absolute;
    z-index: 3;
    top: 12.2%;
    left: 30%;
    width: 29%;
    height: 2.2%;
    inset-inline-end: auto;
    bottom: auto;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg,#6f3612,#f0ad45 37%,#d78324 72%,#4b220a);
    box-shadow: 0 0 4px rgba(255,184,77,.9),0 0 11px rgba(220,121,31,.66),0 0 22px rgba(176,74,15,.3);
    opacity: .92;
    transform: none;
    animation: archive-led 2.7s steps(1,end) infinite;
  }

  .archive-handle > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: sepia(.62) saturate(1.72) brightness(1.16) contrast(1.04) drop-shadow(7px 9px 10px rgba(0,0,0,.92)) drop-shadow(0 0 10px rgba(210,124,36,.52)) drop-shadow(0 0 22px rgba(162,75,17,.28));
    animation: archive-cartridge-breathe 3.1s ease-in-out infinite;
  }

  .archive-title,
  .archive-arrow {
    display: block;
    position: absolute;
    z-index: 2;
    left: 43%;
    color: #efb45a;
    text-shadow: 0 0 4px rgba(255,186,78,.9),0 0 11px rgba(225,132,39,.62),0 0 21px rgba(177,80,19,.34);
    pointer-events: none;
    animation: archive-copy-pulse 3.1s ease-in-out infinite;
  }

  .archive-title {
    top: 50%;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: translate(-50%,-50%);
    line-height: 1;
    letter-spacing: .16em;
  }

  .archive-arrow {
    bottom: 10.5%;
    transform: translateX(-50%);
  }

  .is-booting .archive-handle {
    opacity: 0;
    transform: rotateY(-4deg) translateX(18px);
  }

  .archive-handle:hover,
  .archive-handle:focus-visible {
    outline: none;
    transform: rotateY(-2deg) translateX(-5px);
    filter: brightness(1.08);
  }

  .system-rail {
    margin: 0 2.5%;
    grid-template-columns: auto minmax(80px,1fr) auto;
    border-radius: 4px 4px 2px 2px;
  }

  .rail-model { display: block; }
}

@media (min-width: 561px) and (max-width: 1100px) and (orientation: portrait) {
  .home-console {
    width: calc(100vw + 12px);
    margin-inline: -6px;
    padding: clamp(8px,1.3vw,14px);
    gap: clamp(7px,1vw,11px);
  }

  .master-screen {
    left: 13.2%;
    right: 13.8%;
    top: 10.4%;
    bottom: 11.7%;
  }

  .terminal-header {
    position: absolute;
    top: 4.7%;
    left: 5.5%;
    right: 5.5%;
    height: 8.8%;
    padding: 0;
    display: block;
  }

  .terminal-header::after { display: none; }
  .terminal-nav { width: 100%; height: 100%; gap: clamp(10px,2vw,22px); }
  .terminal-nav a { min-height: 44px; padding: 0 5px; display: grid; place-items: center; font-size: clamp(9px,1.45vw,13px); }

  .boot-copy { top: 53%; width: 84%; }
  .boot-copy h1 { font-size: clamp(92px,16vw,170px); }
  .boot-code { font-size: clamp(8px,1.05vw,11px); }

  .archive-port {
    top: 52%;
    left: 94.2%;
    width: 10.5%;
    height: 34%;
  }

  .archive-title { font-size: clamp(8px,1.05vw,11px); }
  .archive-arrow { font-size: clamp(7px,.9vw,9px); }

  .system-rail {
    flex-basis: clamp(58px,7svh,72px);
    padding: 8px clamp(18px,3.5vw,42px);
    gap: clamp(14px,3vw,36px);
  }

  .rail-power,
  .rail-model { font-size: clamp(7px,1vw,10px); }
  .signal-trace { height: clamp(22px,3svh,31px); }
}

@media (max-width: 560px) and (orientation: portrait) {
  .home-console {
    width: calc(100vw + 10px);
    margin-inline: -5px;
    padding: 4px 3px max(4px,env(safe-area-inset-bottom));
    gap: 5px;
    background:
      linear-gradient(180deg,rgba(245,242,221,.08),transparent 11%,transparent 88%,rgba(0,0,0,.2)),
      radial-gradient(ellipse at 50% 30%,rgba(184,180,158,.16),transparent 55%),
      linear-gradient(90deg,#292a26 0%,#4a4b44 4%,#393a34 10%,#343530 50%,#3d3c35 90%,#4c4b43 96%,#282924 100%);
    box-shadow: none;
  }

  .bezel-layer {
    inset: 0;
  }

  .screen-well {
    background: transparent;
    box-shadow: none;
  }

  .screen-well::before {
    display: none;
  }

  .master-screen {
    left: 11.8%;
    right: 13.2%;
    top: 8.6%;
    bottom: 8.1%;
  }

  .master-screen video { object-position: 54% center; opacity: .17; }

  .terminal-header {
    position: absolute;
    top: 5.4%;
    left: 7.5%;
    right: 9%;
    height: 19%;
    padding: 0;
    display: block;
  }

  .terminal-header::after { display: none; }
  .terminal-nav {
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-template-rows: repeat(2,minmax(42px,1fr));
    gap: clamp(9px,2.8vw,14px);
  }

  .terminal-nav a {
    min-height: 42px;
    padding: 2px 4px;
    display: grid;
    place-items: center;
    font-size: clamp(8px,2.65vw,11px);
    letter-spacing: .055em;
  }

  .boot-copy { left: 46.5%; top: 53%; width: 72%; }
  .boot-copy h1 {
    margin-top: 12px;
    font-size: clamp(44px,14.4vw,60px);
    white-space: nowrap;
  }
  .boot-code { font-size: clamp(6px,1.9vw,8px); letter-spacing: .13em; white-space: nowrap; }

  .archive-port {
    top: 55%;
    left: 91.5%;
    width: 17%;
    height: 34%;
  }

  .archive-title { font-size: clamp(7px,2vw,9px); }
  .archive-arrow { font-size: clamp(6px,1.7vw,8px); }

  .system-rail {
    flex-basis: 56px;
    margin-inline: 2%;
    padding: 6px 10px;
    gap: 8px;
  }

  .rail-power { gap: 6px; font-size: 6px; }
  .rail-power i { width: 8px; height: 8px; }
  .signal-trace { height: 22px; }
  .rail-model { max-width: 74px; font-size: 6px; line-height: 1.2; letter-spacing: .05em; text-align: right; white-space: normal; }
  .rail-model-detail { display: none; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .home-console { padding: 5px 7px; gap: 5px; }

  .master-screen {
    left: 10.96%;
    right: 11.01%;
    top: 13.28%;
    bottom: 13.92%;
  }

  .terminal-header {
    position: absolute;
    top: 3.5%;
    left: 12%;
    right: 12%;
    height: 15%;
    padding: 0;
    display: block;
  }

  .terminal-header::after { display: none; }
  .terminal-nav { width: 100%; height: 100%; gap: 10px; }
  .terminal-nav a { min-height: 32px; padding: 0 4px; display: grid; place-items: center; font-size: clamp(7px,1.35vw,10px); }

  .boot-copy { top: 56%; width: 82%; }
  .boot-copy h1 { font-size: clamp(58px,15vw,128px); }
  .boot-code { font-size: clamp(6px,1.15vw,9px); }

  .archive-port {
    top: 50%;
    left: 95.2%;
    width: 6.4%;
    height: 42%;
  }

  .archive-title { font-size: clamp(6px,1vw,8px); }
  .archive-arrow { font-size: 6px; }

  .system-rail {
    flex-basis: 44px;
    padding: 4px 14px;
    gap: 12px;
  }

  .rail-power,
  .rail-model { font-size: 6px; }
  .signal-trace { height: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-copy, .archive-handle { transition: none; }
  .signal-noise { opacity: .2; }
}
