:root {
  --bg: #07090d;
  --bg-2: #0d1117;
  --panel: #0b0f15;
  --line: #1f2733;
  --text: #f0f6fc;
  --muted: #9aa7b6;
  --cyan: #22d3ee;
  --blue: #4f8cff;
  --green: #7ee787;
  --yellow: #e3b341;
  --red: #ff7b72;
  --purple: #d2a8ff;
  --orange: #ffa657;
  --grad: linear-gradient(100deg, #8ff3ff 0%, #22d3ee 40%, #4f8cff 100%);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--cyan); color: #00131a; }

/* ---------- backgrounds ---------- */
.glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mx, 70%) var(--my, 10%), rgba(34, 211, 238, .13), transparent 60%),
    radial-gradient(900px circle at 10% 90%, rgba(79, 140, 255, .09), transparent 60%);
}
.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .22;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 64px);
  background: rgba(7, 9, 13, .8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .02em; color: var(--text); }
.brand span { color: var(--blue); font-weight: 500; text-transform: lowercase; margin-left: 2px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav-links a:not(.btn) { color: var(--muted); transition: color .2s; }
.nav-links a:not(.btn):hover { color: var(--cyan); }
.nav-toggle { display: none; background: none; border: 0; width: 36px; height: 36px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 7px; right: 7px; height: 2px; background: var(--text); transition: transform .25s; }
.nav-toggle span:first-child { top: 14px; }
.nav-toggle span:last-child { top: 21px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 10px; border: 1px solid transparent;
  background: var(--grad); color: #00131a; font: 700 14px var(--mono);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  box-shadow: 0 0 0 rgba(34, 211, 238, 0);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(34, 211, 238, .35); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .tab:focus-visible, .copy:focus-visible {
  outline: 2px solid var(--yellow); outline-offset: 3px;
}
.btn-small { padding: 8px 14px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: none; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -.02em; }
h1 { font-size: clamp(40px, 6.4vw, 76px); }
h2 { font-size: clamp(28px, 4vw, 46px); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 17px; max-width: 54ch; margin: 22px 0 32px; }
.eyebrow { color: var(--green); font-size: 13px; letter-spacing: .04em; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.c-green { color: var(--green); }
.caret { color: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(48px, 9vw, 120px) clamp(20px, 5vw, 64px) 64px;
  max-width: 1280px; margin: 0 auto;
}
.cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin-top: 36px; color: var(--muted); font-size: 13px; }

/* ---------- code window ---------- */
.window {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(34, 211, 238, .04);
}
.hero-window { transform-style: preserve-3d; transition: transform .15s ease-out; }
.window-bar {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.d { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.d.r { background: #ff5f56; } .d.y { background: #ffbd2e; } .d.g { background: #27c93f; }
.file { margin-left: 10px; font-size: 12px; color: var(--muted); flex: 1; }
.copy {
  background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px;
  font: 12px var(--mono); padding: 3px 10px; cursor: pointer; transition: .2s;
}
.copy:hover { color: var(--cyan); border-color: var(--cyan); }
.code { padding: 20px 22px; font-size: 13.5px; line-height: 1.75; overflow-x: auto; min-height: 280px; tab-size: 2; }
.code code { font-family: var(--mono); white-space: pre; }
.code.numbered { counter-reset: ln; }
.code.numbered .ln { display: block; }
.code.numbered .ln::before {
  counter-increment: ln; content: counter(ln);
  display: inline-block; width: 2.2em; margin-right: 1.2em; text-align: right; color: #4b5666;
}
.tk-k { color: var(--red); }      /* keywords */
.tk-s { color: var(--green); }    /* strings */
.tk-f { color: var(--purple); }   /* functions */
.tk-n { color: var(--orange); }   /* numbers / constants */
.tk-c { color: #7d8b9c; font-style: italic; } /* comments */
.tk-p { color: var(--cyan); }     /* properties */
.tk-t { color: var(--yellow); }   /* types / classes */

/* ---------- sections ---------- */
.section { max-width: 1280px; margin: 0 auto; padding: clamp(56px, 8vw, 110px) clamp(20px, 5vw, 64px); }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head .muted { margin-top: 16px; }

/* ---------- services ---------- */
.services { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.tabs { display: flex; flex-direction: column; gap: 8px; }
.tab {
  text-align: left; background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px;
  font: 500 14px var(--mono); cursor: pointer; transition: .2s;
  display: flex; align-items: center; gap: 12px;
}
.tab .idx { color: #4b5666; font-size: 12px; }
.tab:hover { color: var(--text); border-color: #324154; }
.tab[aria-selected="true"] {
  color: var(--text); border-color: var(--cyan); background: rgba(34, 211, 238, .07);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.tab[aria-selected="true"] .idx { color: var(--cyan); }
.panel .code { min-height: 300px; }
.panel-desc { padding: 16px 22px 22px; color: var(--muted); border-top: 1px solid var(--line); font-size: 14px; }
.panel-desc b { color: var(--text); }

/* ---------- approach log ---------- */
.log { list-style: none; display: grid; gap: 0; max-width: 860px; position: relative; }
.log::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(var(--cyan), var(--blue), transparent); }
.log li { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 18px 0 18px 28px; position: relative; }
.log li::before {
  content: ""; position: absolute; left: 0; top: 28px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 14px rgba(34, 211, 238, .6);
}
.hash { color: var(--yellow); font-size: 13px; padding-top: 4px; }
.log h3 { font-size: 24px; margin-bottom: 4px; }
.log p { color: var(--muted); }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--bg-2); overflow: hidden; padding: 20px 0; }
.track { display: flex; gap: 14px; width: max-content; animation: scroll 38s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.chip {
  font-size: 13px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); white-space: nowrap; background: var(--panel);
}
.chip:nth-child(5n+1) { color: var(--cyan); } .chip:nth-child(5n+2) { color: var(--green); }
.chip:nth-child(5n+3) { color: var(--yellow); } .chip:nth-child(5n+4) { color: var(--purple); }
.chip:nth-child(5n) { color: var(--orange); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split .muted { margin-top: 18px; max-width: 52ch; }
.split .code { min-height: 260px; }

/* ---------- contact ---------- */
.contact-card {
  border: 1px solid var(--line); border-radius: 20px; padding: clamp(28px, 5vw, 56px);
  background: linear-gradient(180deg, rgba(34, 211, 238, .06), rgba(11, 15, 21, .6));
  position: relative; overflow: hidden;
}
.contact-card::after {
  content: "</>"; position: absolute; right: 24px; top: 10px; font: 700 120px var(--display);
  color: rgba(34, 211, 238, .06); pointer-events: none;
}
.contact-card h2 { margin-bottom: 32px; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 820px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
label span::before { content: "const "; color: var(--red); }
label span::after { content: " ="; color: var(--text); }
input, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px;
  color: var(--green); font: 14px var(--mono); transition: border-color .2s, box-shadow .2s; resize: vertical;
}
input::placeholder, textarea::placeholder { color: #566273; }
input:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
input.invalid, textarea.invalid { border-color: var(--red); }
.full { grid-column: 1 / -1; }
.form-status { min-height: 1.4em; font-size: 14px; }
.form-status.ok { color: var(--green); } .form-status.err { color: var(--red); }

/* ---------- footer ---------- */
.footer {
  display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between;
  padding: 36px clamp(20px, 5vw, 64px); border-top: 1px solid var(--line); font-size: 13px;
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero, .split, .services { grid-template-columns: 1fr; }
  .tabs { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; }
  .nav-links .btn { margin-top: 8px; }
  form { grid-template-columns: 1fr; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .code { font-size: 12.5px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
