:root {
  --bg: #04050a;
  --fg: #eef1f7;
  --muted: #8b93a7;
  --dim: #737c92;
  --line: rgba(255, 255, 255, .08);
  --a: #7dd3fc;
  --b: #a78bfa;
  --ok: #34d399;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html, body { height: 100%; background: var(--bg); }

body {
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }

/* ---------- background layers ---------- */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  opacity: 0;
  transition: opacity 1.6s ease;
}
#scene.ready { opacity: 1; }

.veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 52%, rgba(4, 5, 10, .55), transparent 70%),
    radial-gradient(ellipse at center, transparent 45%, rgba(4, 5, 10, .9) 100%);
}

.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  opacity: .05;
  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)'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(env(safe-area-inset-top) + 20px) var(--gutter) calc(env(safe-area-inset-bottom) + 20px);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(6px);
  animation: reveal 1.1s var(--d, 0s) cubic-bezier(.2, .7, .2, 1) forwards;
}
@keyframes reveal { to { opacity: 1; transform: none; filter: none; } }

/* ---------- header ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: .02em;
  font-size: 1.02rem;
}
.logo b { font-weight: 600; color: var(--a); margin-left: .15em; }

.status {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .72rem;
  color: var(--muted);
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .02);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.status i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: ping 2s infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  80%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- hero ---------- */
.hero {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6vh 0;
}

.eyebrow {
  font-size: .78rem;
  color: var(--dim);
  letter-spacing: .06em;
  margin-bottom: 1.4rem;
}

h1 {
  font-weight: 300;
  font-size: clamp(2.6rem, 9vw, 6.2rem);
  line-height: 1;
  letter-spacing: -.045em;
  text-shadow: 0 2px 40px rgba(4, 5, 10, .6);
}

.grad {
  font-weight: 600;
  background: linear-gradient(100deg, var(--a) 0%, var(--b) 45%, #f0abfc 60%, var(--a) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.lead {
  margin-top: 1.6rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
  font-weight: 300;
}
.lead strong { color: var(--fg); font-weight: 500; }

/* ---------- terminal ---------- */
.term {
  margin-top: 2.4rem;
  width: min(420px, 100%);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 12, 20, .55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--line);
}
.term-bar span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.term-bar em {
  margin-left: auto;
  font-style: normal;
  font-size: .66rem;
  color: var(--dim);
}
.term-body {
  padding: .85rem .95rem;
  font-size: .85rem;
  color: var(--fg);
  min-height: 2.9em;
  white-space: nowrap;
  overflow: hidden;
}
.prompt { color: var(--a); }
.caret {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -.15em;
  background: var(--a);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.progress { position: relative; height: 2px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, var(--a), var(--b), transparent);
  animation: slide 2.4s cubic-bezier(.6, 0, .4, 1) infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------- footer ---------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .72rem;
  color: var(--dim);
}
.areas { list-style: none; display: flex; gap: 1.2rem; }
.areas li::before { content: "#"; color: var(--a); opacity: .7; margin-right: .15em; }

.social { display: flex; gap: .5rem; }
.social a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, .02);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color .25s, border-color .25s, box-shadow .25s, transform .25s;
}
.social a:hover,
.social a:focus-visible {
  color: var(--fg);
  border-color: rgba(125, 211, 252, .45);
  box-shadow: 0 0 18px -4px rgba(125, 211, 252, .45);
  transform: translateY(-1px);
  outline: none;
}
.social svg { flex: none; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .status { font-size: .66rem; padding: .4rem .65rem; }
  .foot { flex-direction: column-reverse; gap: .8rem; }
  .social { order: 1; }
  .term-body { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; filter: none; }
  .grad, .status i, .progress span, .caret { animation: none; }
  .progress span { transform: translateX(90%); }
  #scene { transition: none; }
}
