/* n30sk.cc — CRT terminal landing stub. See specs/001-landing-stub/spec.md */

:root {
  --bg: #04060a;
  --ink: #b9cbdd;
  --ink-dim: #8fa3b8;
  --ink-bright: #eafcff;
  --neon: #00eaff;
  --neon-2: #ff2e8a;
  --line: rgba(0, 234, 255, 0.16);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "DejaVu Sans Mono", "Liberation Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 3rem 1rem;
  overflow-x: hidden;
  font-family: var(--mono);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(0, 234, 255, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 112%, rgba(255, 46, 138, 0.07), transparent 70%),
    var(--bg);
}

::selection { background: var(--neon); color: #00171c; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- the glass: scanlines, vignette, roll ---------- */

.crt { position: fixed; inset: 0; z-index: 50; pointer-events: none; }

.crt::before,
.crt::after { content: ""; position: absolute; inset: 0; }

.crt::before {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0 1.5px,
      rgba(0, 0, 0, 0.18) 1.5px 3px
    ),
    radial-gradient(ellipse 85% 75% at 50% 50%, transparent 42%, rgba(0, 0, 0, 0.5) 100%);
}

.crt::after {
  height: 26vh;
  inset: auto 0 auto 0;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(0, 234, 255, 0.04) 38%,
    rgba(255, 255, 255, 0.055) 50%,
    rgba(0, 234, 255, 0.04) 62%,
    transparent
  );
  animation: roll 7.5s linear infinite;
}

@keyframes roll {
  from { transform: translateY(-30vh); }
  to   { transform: translateY(126vh); }
}

/* ---------- layout ---------- */

.screen {
  display: grid;
  justify-items: center;
  gap: 1.9rem;
  width: 100%;
  max-width: 34rem;
  text-align: center;
}

.head { display: grid; justify-items: center; gap: 0.9rem; margin: 0; }

/* ---------- wordmark: neon sign on bad wiring ---------- */

.wordmark {
  margin: 0;
  font-size: clamp(3rem, 16vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.wordmark-text {
  position: relative;
  display: inline-block;
  color: var(--ink-bright);
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.85),
    0 0 10px var(--neon),
    0 0 26px var(--neon),
    0 0 54px rgba(0, 234, 255, 0.5),
    0 0 100px rgba(0, 234, 255, 0.3);
  animation:
    boot 1.7s steps(1, end) both,
    hum 5s ease-in-out 1.7s infinite;
}

/* chromatic fringe — the tube never quite converges */
.wordmark-text::before,
.wordmark-text::after {
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  text-shadow: none;
  mix-blend-mode: screen;
  pointer-events: none;
}

.wordmark-text::before { color: var(--neon-2); transform: translateX(-2px); opacity: 0.42; }
.wordmark-text::after  { color: var(--neon);   transform: translateX(2px);  opacity: 0.32; }

@keyframes boot {
  0%, 3%   { opacity: 0;    filter: brightness(0.2); }
  4%       { opacity: 0.85; filter: brightness(1.7); }
  6%       { opacity: 0.04; filter: brightness(0.2); }
  9%       { opacity: 0.7;  filter: brightness(1.2); }
  11%      { opacity: 0.08; filter: brightness(0.3); }
  15%      { opacity: 1;    filter: brightness(1.9); }
  17%      { opacity: 0.22; filter: brightness(0.4); }
  20%      { opacity: 0.92; filter: brightness(1.1); }
  22%      { opacity: 0.35; filter: brightness(0.6); }
  27%      { opacity: 1;    filter: brightness(1.35); }
  31%      { opacity: 0.68; filter: brightness(0.9); }
  36%, 100% { opacity: 1;   filter: brightness(1); }
}

/* barely-there instability once it has settled */
@keyframes hum {
  0%, 100% { filter: brightness(1); }
  45%      { filter: brightness(0.94); }
  70%      { filter: brightness(1.04); }
}

/* JS adds .is-glitching now and then */
.is-glitching::before { animation: glitch-a 0.3s steps(2, end) 1; }
.is-glitching::after  { animation: glitch-b 0.3s steps(2, end) 1; }

@keyframes glitch-a {
  0%, 100% { clip-path: inset(0 0 0 0);     transform: translateX(-2px); }
  20%      { clip-path: inset(10% 0 62% 0); transform: translate(-8px, -1px); }
  45%      { clip-path: inset(56% 0 16% 0); transform: translate(5px, 1px); }
  70%      { clip-path: inset(28% 0 44% 0); transform: translateX(-5px); }
  90%      { clip-path: inset(74% 0 4% 0);  transform: translate(7px, -1px); }
}

@keyframes glitch-b {
  0%, 100% { clip-path: inset(0 0 0 0);     transform: translateX(2px); }
  20%      { clip-path: inset(66% 0 8% 0);  transform: translate(8px, 1px); }
  45%      { clip-path: inset(14% 0 58% 0); transform: translate(-6px, -1px); }
  70%      { clip-path: inset(40% 0 30% 0); transform: translateX(6px); }
  90%      { clip-path: inset(6% 0 76% 0);  transform: translate(-7px, 1px); }
}

/* ---------- tagline: types itself ---------- */

.tagline-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.6ch;
  margin: 0;
  font-size: clamp(0.78rem, 3.1vw, 1.05rem);
  letter-spacing: 0.01em;
}

.prompt {
  color: var(--neon);
  text-shadow: 0 0 10px rgba(0, 234, 255, 0.7);
  animation: fade-in 0.5s ease 1.45s both;
}

.tagline {
  --ch: 26.2ch; /* "Systems that check claims." — 26 glyphs; keep in sync with steps() */
  display: inline-block;
  width: var(--ch);
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  color: var(--ink);
  border-right: 0.09em solid var(--neon);
  animation:
    type 1.5s steps(26, end) 1.55s both,
    caret 1.05s step-end 3.05s infinite;
}

@keyframes type { from { width: 0; } to { width: var(--ch); } }

@keyframes caret {
  0%, 100% { border-right-color: var(--neon); }
  50%      { border-right-color: transparent; }
}

/* ---------- prose ---------- */

.lede {
  margin: 0;
  max-width: 44ch;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--ink-dim);
  animation: fade-up 0.7s ease 3.2s both;
}

/* ---------- project rows ---------- */

.rows {
  display: grid;
  gap: 0.6rem;
  width: 100%;
  animation: fade-up 0.7s ease 3.45s both;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.85rem;
  padding: 0.85rem 1rem;
  text-align: left;
  background: rgba(0, 234, 255, 0.03);
  border: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.row-name {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-bright);
  transition: text-shadow 0.18s ease;
}

.row-desc { flex: 1 1 auto; font-size: 0.8rem; color: var(--ink-dim); }

.row-go {
  margin-left: auto;
  color: var(--neon);
  transition: transform 0.18s ease;
}

.row:hover,
.row:focus-visible {
  background: rgba(0, 234, 255, 0.07);
  border-left-color: var(--neon);
}

.row:hover .row-name,
.row:focus-visible .row-name { text-shadow: 0 0 16px rgba(0, 234, 255, 0.8); }

.row:hover .row-go,
.row:focus-visible .row-go { transform: translateX(4px); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  font-size: 0.78rem;
  color: var(--ink-dim);
  animation: fade-up 0.7s ease 3.7s both;
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.social:hover { color: var(--neon); text-shadow: 0 0 14px rgba(0, 234, 255, 0.6); }

.icon { flex: none; }

.dot { opacity: 0.45; }

/* ---------- shared ---------- */

/* A keyboard user must never focus an element still waiting out its fade-in delay. */
.rows:focus-within,
.foot:focus-within { animation: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 26rem) {
  .row-desc { flex-basis: 100%; }
  .row-go { display: none; }
}

/* ---------- no motion: show the finished state ---------- */

@media (prefers-reduced-motion: reduce) {
  .crt::after { display: none; }

  .wordmark-text,
  .wordmark-text::before,
  .wordmark-text::after,
  .prompt,
  .tagline,
  .lede,
  .rows,
  .foot {
    animation: none !important;
    opacity: 1;
    filter: none;
    transform: none;
  }

  /* keep the fringe, drop only the movement */
  .wordmark-text::before { opacity: 0.42; transform: translateX(-2px); }
  .wordmark-text::after  { opacity: 0.32; transform: translateX(2px); }

  .tagline { width: auto; }

  /* transitions are motion as well — FR-008 */
  .row,
  .row-name,
  .row-go,
  .social { transition: none !important; }

  .row:hover .row-go,
  .row:focus-visible .row-go { transform: none; }
}
