/* tjo.sh — phosphor terminal / network landing */

:root {
  --bg: #0a0e14;
  --bg-elevated: #0f141c;
  --bg-panel: #121820;
  --border: #1e2a38;
  --border-soft: #16202c;
  --text: #c8d1dc;
  --text-dim: #6b7a8d;
  --text-muted: #4a5868;
  --accent: #34d399;
  --accent-dim: #1a9a6a;
  --accent-glow: rgba(52, 211, 153, 0.35);
  --cyan: #5eead4;
  --amber: #fbbf24;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code",
    "Consolas", "Liberation Mono", ui-monospace, monospace;
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --shell-max: 920px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ambient base gradient */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(52, 211, 153, 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(94, 234, 212, 0.05), transparent 50%),
    radial-gradient(ellipse 50% 35% at 10% 70%, rgba(52, 211, 153, 0.04), transparent 50%),
    var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* CRT / film overlays */
.scanlines,
.vignette,
.net-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.scanlines {
  z-index: 40;
  opacity: 0.33;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.45) 2px,
    rgba(0, 0, 0, 0.45) 3px
  );
}

.vignette {
  z-index: 39;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}

.net-canvas {
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

/* main shell chrome */
.shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(0.75rem, 2.5vw, 1.5rem);
}

.titlebar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 0.9rem;
  background: linear-gradient(180deg, #161d27 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.04) inset;
}

.titlebar-label,
.titlebar-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-label .brand {
  color: var(--accent);
  font-weight: 600;
}

.titlebar-label .prompt-user {
  color: var(--cyan);
}

.titlebar-label .sep {
  color: var(--text-muted);
  margin: 0 0.25rem;
}

.titlebar-meta {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background:
    linear-gradient(180deg, rgba(18, 24, 32, 0.92) 0%, rgba(12, 16, 22, 0.96) 100%);
  border: 1px solid var(--border);
  border-top-color: var(--border-soft);
  outline: none;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(52, 211, 153, 0.03) inset,
    0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.hero {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dim);
}

.brand-mark {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(2.75rem, 10vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.brand-glow {
  color: var(--accent);
  text-shadow:
    0 0 12px var(--accent-glow),
    0 0 40px rgba(52, 211, 153, 0.25),
    0 0 80px rgba(52, 211, 153, 0.12);
  animation: brand-pulse 6s ease-in-out infinite;
}

@keyframes brand-pulse {
  0%, 100% {
    text-shadow:
      0 0 12px var(--accent-glow),
      0 0 40px rgba(52, 211, 153, 0.25),
      0 0 80px rgba(52, 211, 153, 0.12);
  }
  50% {
    text-shadow:
      0 0 18px var(--accent-glow),
      0 0 56px rgba(52, 211, 153, 0.35),
      0 0 100px rgba(52, 211, 153, 0.18);
  }
}

.tagline {
  margin: 1rem auto 0;
  max-width: 34rem;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--text);
  font-weight: 450;
}

.tagline-sub {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.tagline code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--cyan);
  background: rgba(94, 234, 212, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid rgba(94, 234, 212, 0.12);
}

/* terminal panel */
.terminal {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 14rem;
  background: #080c11;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 12px 40px rgba(0, 0, 0, 0.35);
}

.term-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: #0e141c;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.term-label.muted {
  opacity: 0.75;
}

.term-body,
.static-term {
  flex: 1;
  padding: 1rem 1.1rem 1.15rem;
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  line-height: 1.65;
  color: var(--text);
  overflow: auto;
}

.line {
  margin: 0 0 0.15rem;
  word-break: break-word;
}

.line.out {
  color: var(--text-dim);
  padding-left: 0.1rem;
}

.line.out.accent {
  color: var(--accent);
}

.line.comment {
  color: var(--text-muted);
}

.ps1 {
  color: var(--cyan);
  margin-right: 0.45rem;
}

.ps1 .host {
  color: var(--accent);
}

.cmd {
  color: var(--text);
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.05em;
  vertical-align: text-bottom;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: blink 1.05s steps(1) infinite;
}

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

/* status strip */
.status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  background: rgba(8, 12, 17, 0.65);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  min-width: 0;
}

.stat-k {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-v {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer {
  padding: 0.65rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: center;
}

.footer p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.footer .brand {
  color: var(--accent-dim);
}

.footer .sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .brand-glow {
    animation: none;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }

  .scanlines {
    display: none;
  }
}

/* responsive */
@media (max-width: 640px) {
  .titlebar {
    grid-template-columns: 1fr;
  }

  .titlebar-meta {
    display: none;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 400px) {
  .status-strip {
    grid-template-columns: 1fr 1fr;
  }
}

/* print: keep it readable */
@media print {
  .scanlines,
  .vignette,
  .net-canvas {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  .brand-glow,
  .stat-v,
  .titlebar-label .brand {
    color: #0a7a4f;
    text-shadow: none;
  }
}
