:root {
  --bg: #000106;
  --bg-soft: #030513;
  --bg-deep: #060021;
  --text: #dae6ff;
  --muted: #a5b8dd;
  --accent: #27e6ff;
  --accent-2: #8e7bff;
  --accent-3: #00f0bd;
  --code-cover: max(170vw, 170vh);
  --glass: rgb(255 255 255 / 8%);
  --glass-border: rgb(118 220 255 / 30%);
  --shadow: 0 20px 48px -30px rgb(0 0 0 / 85%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  position: relative;
  font-family: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgb(39 230 255 / 38%), transparent 32%),
    radial-gradient(circle at 88% 12%, rgb(142 123 255 / 30%), transparent 34%),
    radial-gradient(circle at 74% 88%, rgb(0 240 189 / 22%), transparent 36%),
    linear-gradient(168deg, var(--bg), var(--bg-soft) 42%, var(--bg-deep));
  line-height: 1.58;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 88%);
  opacity: 0.22;
}

.landing {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.2rem, 3.6vw, 2.6rem);
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at center, rgb(0 8 24 / 18%) 0%, rgb(0 5 20 / 42%) 58%, rgb(0 2 12 / 68%) 100%),
    linear-gradient(180deg, rgb(0 0 0 / 18%), rgb(0 0 0 / 28%));
}

.code-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
}

#code-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}


.noise-overlay {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgb(255 255 255 / 0%) 0 2px,
      rgb(68 224 255 / 7%) 2px 3px
    ),
    radial-gradient(circle at 25% 20%, rgb(41 233 255 / 14%), transparent 35%),
    radial-gradient(circle at 80% 65%, rgb(118 102 255 / 12%), transparent 32%);
  opacity: 0.08;
  mix-blend-mode: screen;
}

.landing-inner {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: clamp(1.05rem, 2.2vw, 1.45rem);
  animation: rise 700ms ease both;
}

.hero-logo {
  width: min(100%, 22rem);
  max-height: 19vh;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  animation: logo-float 9.5s cubic-bezier(0.37, 0.02, 0.21, 1) infinite;
}

.type-sequence {
  position: relative;
  margin: 0 auto;
  width: min(100%, 74ch);
  min-height: 4.8rem;
}

.terminal-bio {
  margin-top: 0;
}

.typed-line {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  max-width: min(94vw, 78ch);
  padding: 0.72rem 0.9rem;
  border-radius: 0.55rem;
  border: 1px solid rgb(90 148 255 / 26%);
  background: rgb(2 6 14 / 84%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 8%),
    0 14px 30px -24px rgb(0 0 0 / 78%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.92rem, 1.2vw, 1.04rem);
  line-height: 1.45;
  color: #c9ddff;
  text-align: left;
}

.shell-prefix {
  color: #74f0ff;
  opacity: 0.92;
  margin-right: 0.55rem;
  white-space: nowrap;
}

#typed-text {
  white-space: pre-wrap;
}

#typed-cursor {
  color: #7df3ff;
  font-weight: 650;
  animation: cursor-blink 1s steps(1, end) infinite;
}

.type-item {
  display: none;
}

.t1 {
  animation-delay: 0s;
}

.t2 {
  animation-delay: 5s;
}

.t3 {
  animation-delay: 10s;
}

.t4 {
  animation-delay: 15s;
}

.t5 {
  animation-delay: 20s;
}

.t6 {
  animation-delay: 25s;
}

.t7 {
  animation-delay: 30s;
}

.t8 {
  animation-delay: 35s;
}

.hero-actions {
  margin-top: 0;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 1.05rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 560;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.btn-glass {
  color: var(--text);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(125%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 22%),
    0 10px 24px -20px rgb(0 0 0 / 70%);
}

.btn-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgb(255 255 255 / 40%) 50%, transparent 100%);
  transform: translateX(-160%);
  z-index: -1;
}

.btn-glass:hover {
  transform: translateY(-1px);
  border-color: rgb(81 231 255 / 68%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 30%),
    0 16px 28px -22px rgb(0 0 0 / 78%);
}

.btn-glass:hover::before {
  animation: sweep 900ms ease;
}

.footer-note {
  display: block;
  margin-top: 0;
  color: #9fb3d8;
  font-size: 0.84rem;
}

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid #74f0ff;
  outline-offset: 3px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logo-float {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  25% {
    transform: translate3d(0, -4px, 0) rotate(0.25deg);
  }

  50% {
    transform: translate3d(0, -7px, 0) rotate(0deg);
  }

  75% {
    transform: translate3d(0, -3px, 0) rotate(-0.28deg);
  }

  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@keyframes phrase-visibility {
  0% {
    opacity: 0;
  }

  2.2% {
    opacity: 1;
  }

  10.2% {
    opacity: 1;
  }

  11.4% {
    opacity: 0;
  }

  12%,
  100% {
    opacity: 0;
  }
}

@keyframes phrase-type {
  0%,
  1.4% {
    clip-path: inset(0 100% 0 0);
  }

  7.8%,
  10.2% {
    clip-path: inset(0 0 0 0);
  }

  12%,
  100% {
    clip-path: inset(0 100% 0 0);
  }
}

@keyframes cursor-blink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

@keyframes sweep {
  to {
    transform: translateX(160%);
  }
}

@media (max-width: 900px) {
  .type-sequence {
    min-height: 5.8rem;
  }
}

/* iOS Safari fallback: clip-path/typewriter can fail, keep sequence animation stable */
@supports (-webkit-touch-callout: none) {
  .type-sequence {
    min-height: 5.8rem;
  }
}

@media (min-width: 1024px) {
  .noise-overlay {
    opacity: 0.08;
  }
}

@media (max-width: 640px) {
  .landing {
    padding-inline: 1rem;
  }

  .landing-inner {
    gap: 1rem;
  }

  .hero-logo {
    width: min(100%, 16.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .noise-overlay {
    opacity: 0.06;
  }

  .hero-logo,
  #typed-cursor,
  .btn {
    animation: none !important;
    transition: none !important;
  }
}
