:root {
  color-scheme: dark;
  --background: #020906;
  --surface: #0a130f;
  --surface-raised: #0f1b15;
  --line: rgba(105, 245, 165, 0.15);
  --line-strong: rgba(105, 245, 165, 0.28);
  --primary: #00f076;
  --mint: #69f5a5;
  --text: #f3faf6;
  --secondary: #a0b4a9;
  --muted: #698077;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% 42%, rgba(0, 240, 118, 0.075), transparent 29rem),
    linear-gradient(150deg, #020906 12%, #04100a 58%, #020906 100%);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(105, 245, 165, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 245, 165, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
  animation: grid-drift 18s linear infinite;
}

.ambient {
  position: fixed;
  top: 18%;
  right: 8%;
  z-index: -1;
  width: min(46rem, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(0, 240, 118, 0.055);
  filter: blur(110px);
  animation: ambient-breathe 7s ease-in-out infinite;
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 104px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand img {
  filter: drop-shadow(0 0 15px rgba(0, 240, 118, 0.35));
}

.build-state {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.build-state > span,
.status-dot,
.secure > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(0, 240, 118, 0.8);
}

.build-state > span,
.status-dot {
  animation: status-pulse 1.8s ease-in-out infinite;
}

main {
  display: grid;
  min-height: calc(100svh - 184px);
  place-items: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: center;
  width: 100%;
  padding-block: 72px 96px;
}

.hero-copy {
  max-width: 650px;
  animation: copy-enter 0.85s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--mint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.7rem, 7vw, 7rem);
  font-weight: 650;
  letter-spacing: -0.072em;
  line-height: 0.94;
}

h1 em {
  color: var(--primary);
  font-style: normal;
  text-shadow: 0 0 36px rgba(0, 240, 118, 0.15);
}

.intro {
  max-width: 565px;
  margin: 34px 0 0;
  color: var(--secondary);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.7;
}

.coming-soon {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  margin-top: 38px;
  padding: 14px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(10, 19, 15, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
}

.coming-soon strong {
  font-size: 0.95rem;
  animation: coming-soon-text-breathe 2.6s ease-in-out infinite;
}

.coming-soon > span:last-child {
  padding-left: 13px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.terminal-wrap {
  position: relative;
  transform: perspective(1100px) rotateY(-4deg) rotateX(1deg);
  animation: terminal-enter 0.7s 0.12s ease-out both;
}

.terminal-glow {
  position: absolute;
  inset: 16% 8% -3%;
  z-index: -1;
  border-radius: 38px;
  background: rgba(0, 240, 118, 0.19);
  filter: blur(50px);
  opacity: 0.4;
}

.terminal {
  position: relative;
  overflow: hidden;
  min-height: 455px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(7, 16, 11, 0.93);
  box-shadow:
    0 36px 90px rgba(0, 0, 0, 0.48),
    inset 0 1px rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(18px);
}

.terminal-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 58px;
  padding-inline: 19px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
}

.terminal-controls {
  display: flex;
  gap: 7px;
}

.terminal-controls i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #264034;
}

.secure {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-self: end;
}

.secure > span {
  width: 5px;
  height: 5px;
  box-shadow: none;
}

.terminal-body {
  padding: 30px 35px 34px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.84rem, 1.2vw, 0.98rem);
  line-height: 1.68;
}

.terminal-line {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
}

.terminal-body.is-playing .terminal-line:not(.terminal-gap) {
  animation: type-line var(--type-duration) steps(var(--characters), end) var(--type-delay) forwards;
}

.line-one { --type-delay: 0.25s; --type-duration: 0.6s; --characters: 11; }
.line-two { --type-delay: 0.95s; --type-duration: 0.85s; --characters: 37; }
.line-three { --type-delay: 1.95s; --type-duration: 0.5s; --characters: 13; }
.line-four { --type-delay: 2.55s; --type-duration: 0.7s; --characters: 29; }
.line-five { --type-delay: 3.35s; --type-duration: 1.05s; --characters: 49; }
.line-six { --type-delay: 4.55s; --type-duration: 0.65s; --characters: 17; }
.line-eight { --type-delay: 5.45s; --type-duration: 0.7s; --characters: 20; }
.line-nine { --type-delay: 6.25s; --type-duration: 0.8s; --characters: 39; }
.line-ten { --type-delay: 7.15s; --type-duration: 0.9s; --characters: 44; }
.line-eleven { --type-delay: 8.15s; --type-duration: 0.95s; --characters: 49; }
.line-twelve { --type-delay: 9.25s; --type-duration: 0.85s; --characters: 42; }
.line-thirteen { --type-delay: 10.2s; --type-duration: 0.95s; --characters: 48; }
.line-fourteen { --type-delay: 11.25s; --type-duration: 1s; --characters: 51; }
.line-fifteen { --type-delay: 12.35s; --type-duration: 0.9s; --characters: 41; }

.prompt,
.success {
  color: var(--primary);
}

.pairing-link,
.log-info {
  color: var(--mint);
}

.log-debug {
  color: #7dd3fc;
}

.muted {
  color: var(--muted);
}

.terminal-gap {
  line-height: 0.8;
}

.timestamp {
  color: #60756b;
}

.compact-copy {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  min-height: 80px;
  color: #577066;
  font-size: 0.8rem;
}

.error-page {
  min-height: 100svh;
}

.error-page::before {
  animation: none;
}

.error-layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: min(100% - 48px, 680px);
  min-height: 100svh;
  padding-block: clamp(72px, 12vh, 132px);
}

.error-brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 650;
  text-decoration: none;
}

.error-code {
  margin: 68px 0 14px;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.error-layout h1 {
  font-size: clamp(3.2rem, 9vw, 6.5rem);
}

.error-layout > p:not(.error-code) {
  margin: 28px 0 0;
  color: var(--secondary);
  font-size: 1.08rem;
}

.error-link {
  margin-top: 36px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--primary);
  color: var(--mint);
  font-weight: 650;
  text-decoration: none;
}

@keyframes grid-drift {
  to { background-position: 56px 56px; }
}

@keyframes ambient-breathe {
  50% { opacity: 0.62; transform: translate(-4%, 3%) scale(1.1); }
}

@keyframes type-line {
  from { opacity: 1; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}

@keyframes copy-enter {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes terminal-enter {
  from { opacity: 0; }
}

@keyframes status-pulse {
  50% { opacity: 0.45; box-shadow: 0 0 5px rgba(0, 240, 118, 0.35); }
}

@keyframes coming-soon-text-breathe {
  0%, 100% {
    color: rgba(243, 250, 246, 0.58);
    text-shadow: 0 0 0 rgba(0, 240, 118, 0);
  }
  50% {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(0, 240, 118, 0.48);
  }
}

@media (max-width: 860px) {
  .site-header,
  main,
  footer {
    width: min(100% - 36px, 680px);
  }

  .site-header {
    height: 88px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 58px;
    min-width: 0;
    padding-block: 62px 76px;
  }

  .hero-copy {
    min-width: 0;
  }

  .terminal-wrap {
    width: min(100%, 590px);
    min-width: 0;
    transform: none;
  }

  .terminal {
    width: 100%;
    min-width: 0;
    min-height: 440px;
  }
}

@media (max-width: 520px) {
  .site-header,
  main,
  footer {
    width: calc(100vw - 28px);
    max-width: 680px;
  }

  .build-state {
    font-size: 0;
  }

  .build-state::after {
    content: "Soon";
    font-size: 0.78rem;
  }

  h1 {
    font-size: clamp(3rem, 14.5vw, 4rem);
  }

  .hero,
  .hero-copy,
  .terminal-wrap,
  .terminal {
    width: 100%;
    max-width: 100%;
  }

  .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.09em;
  }

  .coming-soon {
    align-items: center;
    flex-wrap: wrap;
  }

  .coming-soon > span:last-child {
    flex-basis: 100%;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .terminal-bar {
    grid-template-columns: auto 1fr;
  }

  .terminal-bar > span:nth-child(2) {
    justify-self: end;
  }

  .secure {
    display: none;
  }

  .terminal-body {
    padding: 28px 16px 30px;
    font-size: clamp(0.64rem, 2.7vw, 0.74rem);
  }

  .error-layout {
    width: calc(100vw - 40px);
    padding-block: 56px;
  }

  .error-code {
    margin-top: 52px;
  }

  .terminal-line {
    width: 100%;
  }

  .full-copy {
    display: none;
  }

  .compact-copy {
    display: inline;
  }

  footer {
    flex-direction: column;
    gap: 8px;
    justify-content: flex-start;
    padding-bottom: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }

  .terminal-line {
    opacity: 1;
    clip-path: none;
  }
}
