:root {
  --bg: #08111f;
  --bg-2: #0d1a2e;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f4f7fb;
  --muted: rgba(244, 247, 251, 0.68);
  --cyan: #54e6ff;
  --lime: #b8f36b;
  --coral: #ff7a59;
  --gold: #ffd166;
  --ink: #07101d;
  --font: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(84, 230, 255, 0.24), transparent 30rem),
    radial-gradient(circle at 80% 24%, rgba(255, 122, 89, 0.18), transparent 28rem),
    linear-gradient(145deg, var(--bg), var(--bg-2) 48%, #0a1020);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

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

#networkCanvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.28;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.cursor-spotlight {
  pointer-events: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(84, 230, 255, 0.18), transparent 62%);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease;
}

.scroll-meter {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 70;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.scroll-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime), var(--coral));
}

.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 50;
  display: flex;
  width: min(1120px, calc(100% - 28px));
  transform: translateX(-50%);
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.78);
  padding: 10px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 14px;
  font-weight: 900;
}

.brand span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: var(--ink);
  font-weight: 900;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 12px 14px;
  transition: background 180ms ease, color 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 9px 10px 9px 13px;
}

kbd {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 7px;
  background: rgba(0,0,0,0.22);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 6px;
}

.menu-button {
  display: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,0.105), rgba(255,255,255,0.045));
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms ease, transform 600ms ease, border-color 180ms ease, background 180ms ease;
}

.panel.revealed {
  opacity: 1;
  transform: translateY(0);
}

.hero.panel {
  opacity: 1;
  transform: none;
}

.hero {
  display: grid;
  min-height: calc(100vh - 32px);
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 28px;
  align-items: center;
  margin-top: 16px;
  padding: clamp(96px, 11vw, 150px) clamp(22px, 5vw, 56px) 42px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 7.4vw, 6.9rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.3rem, 5.6vw, 5.2rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.hero-lede {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(84, 230, 255, 0.22);
}

.button.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.signal-row {
  display: grid;
  max-width: 760px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 36px;
}

.signal-row div {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  padding: 18px;
}

.signal-row strong,
.signal-row span {
  display: block;
}

.signal-row strong {
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: clamp(1.1rem, 2.1vw, 1.45rem);
}

.signal-row span {
  color: var(--muted);
  line-height: 1.45;
}

.hero-console {
  position: relative;
  min-height: 620px;
}

.portrait-shell {
  position: absolute;
  top: 0;
  right: 0;
  width: min(82%, 430px);
  overflow: hidden;
  border: 1px solid rgba(84, 230, 255, 0.32);
  border-radius: 28px;
  background: #111;
  box-shadow: 0 30px 110px rgba(84, 230, 255, 0.16);
}

.portrait-shell img {
  display: block;
  width: 100%;
  aspect-ratio: 0.82;
  object-fit: cover;
  object-position: center top;
}

.scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(84, 230, 255, 0.08) 51%);
  background-size: 100% 7px;
  mix-blend-mode: screen;
}

.terminal-card {
  position: absolute;
  left: 0;
  bottom: 12px;
  width: min(92%, 470px);
  border: 1px solid rgba(184, 243, 107, 0.28);
  border-radius: 18px;
  background: rgba(2, 8, 18, 0.88);
  overflow: hidden;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
}

.terminal-top {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 13px 15px;
}

.terminal-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
}

.terminal-top span:nth-child(2) {
  background: var(--gold);
}

.terminal-top span:nth-child(3) {
  background: var(--lime);
}

pre {
  margin: 0;
  overflow: auto;
  padding: 20px;
  color: #d8fff5;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.5vw, 0.92rem);
  line-height: 1.75;
}

.guide {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  display: grid;
  width: min(340px, calc(100vw - 36px));
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(84, 230, 255, 0.32);
  border-radius: 18px;
  background: rgba(8, 17, 31, 0.84);
  padding: 12px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
}

.guide-avatar {
  width: 86px;
  height: 86px;
  align-self: end;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(84, 230, 255, 0.22));
  transform-origin: bottom center;
  animation: avatarFloat 3.4s ease-in-out infinite;
}

.guide p {
  margin: 0;
  color: rgba(244, 247, 251, 0.84);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

.section-rail {
  position: fixed;
  left: 18px;
  top: 50%;
  z-index: 44;
  display: grid;
  gap: 8px;
  transform: translateY(-50%);
}

.section-rail a {
  display: grid;
  width: 86px;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(244, 247, 251, 0.48);
  font-size: 0.76rem;
  font-weight: 900;
  padding: 7px 9px;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.section-rail a:hover,
.section-rail a.active {
  border-color: rgba(84, 230, 255, 0.24);
  background: rgba(8, 17, 31, 0.66);
  color: var(--text);
  transform: translateX(4px);
}

.section-rail span {
  color: var(--cyan);
  font-family: var(--mono);
}

.story-section,
.projects-section,
.proof-section {
  padding: 118px 0 0;
}

.section-intro {
  margin-bottom: 20px;
  padding: clamp(24px, 4vw, 42px);
}

.story-rail {
  display: grid;
  gap: 18px;
}

.chapter {
  display: grid;
  min-height: 330px;
  grid-template-columns: 0.8fr 1.3fr 0.4fr;
  gap: 24px;
  align-items: end;
  padding: clamp(24px, 5vw, 46px);
}

.chapter span,
.case-card small {
  color: var(--cyan);
  font-family: var(--mono);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapter p,
.case-card p,
.proof-card li,
.availability-card p,
.contact-section p {
  color: var(--muted);
  line-height: 1.75;
}

.chapter b {
  justify-self: end;
  color: var(--gold);
  font-family: var(--mono);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.case-card {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  padding: 26px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.case-card:hover,
.panel.in-view {
  border-color: rgba(84, 230, 255, 0.42);
  background: linear-gradient(145deg, rgba(84, 230, 255, 0.13), rgba(255,255,255,0.055));
}

.case-card:hover {
  transform: translateY(-4px);
}

.case-card.featured {
  border-color: rgba(184, 243, 107, 0.36);
}

.case-card h3 {
  margin-top: 24px;
}

.case-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}

.case-card span,
.stack-cloud span {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: rgba(244, 247, 251, 0.88);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 10px;
}

.stack-section {
  display: grid;
  grid-template-columns: 0.76fr 1.24fr;
  gap: 34px;
  margin-top: 118px;
  padding: clamp(26px, 5vw, 50px);
}

.stack-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: start;
}

.proof-section {
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  gap: 18px;
}

.proof-card,
.availability-card,
.contact-section {
  padding: clamp(26px, 5vw, 50px);
}

.proof-card ul {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.proof-card li {
  border-left: 3px solid var(--lime);
  padding-left: 16px;
}

.proof-card strong {
  color: var(--text);
}

.availability-card {
  align-self: stretch;
  text-align: center;
}

.availability-card img {
  width: min(220px, 100%);
  aspect-ratio: 1;
  border: 1px solid rgba(84, 230, 255, 0.34);
  border-radius: 24px;
  object-fit: cover;
  object-position: center top;
}

.availability-card h3 {
  margin-top: 22px;
}

.availability-card a {
  display: block;
  margin-top: 12px;
  color: var(--cyan);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-section {
  margin: 118px 0 24px;
  text-align: center;
}

.contact-section h2 {
  max-width: 920px;
  margin-inline: auto;
}

.contact-section .hero-actions {
  justify-content: center;
}

.top-button {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 17, 31, 0.84);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.top-button.show {
  opacity: 1;
  transform: translateY(0);
}

.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 8, 18, 0.68);
  backdrop-filter: blur(10px);
}

.command-palette {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 90;
  width: min(840px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(84, 230, 255, 0.32);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(8, 17, 31, 0.98), rgba(13, 26, 46, 0.98));
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.52);
  padding: clamp(18px, 4vw, 30px);
}

.palette-header {
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.palette-header h2 {
  font-size: clamp(2rem, 4.5vw, 3.8rem);
}

.palette-header button {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 1.8rem;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.command-grid a,
.command-grid button {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.055);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 16px;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.command-grid a:hover,
.command-grid button:hover {
  transform: translateY(-2px);
  border-color: rgba(84, 230, 255, 0.45);
  background: rgba(84, 230, 255, 0.1);
}

.command-grid span {
  grid-row: span 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 900;
}

.command-grid strong,
.command-grid small {
  display: block;
}

.command-grid strong {
  font-weight: 900;
}

.command-grid small {
  color: var(--muted);
  line-height: 1.4;
}

@keyframes avatarFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

@media (max-width: 1060px) {
  .hero,
  .stack-section,
  .proof-section {
    grid-template-columns: 1fr;
  }

  .hero-console {
    min-height: 590px;
  }

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

@media (max-width: 760px) {
  .menu-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
  }

  .menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
  }

  .menu-button span + span {
    margin-top: -13px;
  }

  .palette-trigger {
    display: none;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(8, 17, 31, 0.96);
    padding: 8px;
  }

  .site-nav.open {
    display: flex;
  }

  .hero {
    padding-top: 108px;
  }

  .signal-row,
  .chapter,
  .case-grid {
    grid-template-columns: 1fr;
  }

  .chapter {
    min-height: auto;
  }

  .chapter b {
    justify-self: start;
  }

  .guide {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .top-button {
    display: none;
  }

  .section-rail {
    display: none;
  }
}

@media (max-width: 540px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .brand strong {
    display: none;
  }

  .hero-console {
    min-height: 500px;
  }

  .portrait-shell {
    width: 92%;
  }

  .terminal-card {
    width: 100%;
  }

  .guide {
    grid-template-columns: 48px 1fr;
  }

  .guide-avatar {
    width: 58px;
    height: 58px;
  }

  .command-grid {
    grid-template-columns: 1fr;
  }
}
