/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg: #05070a;
  --bg-raised: #0b0f16;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e6ebf1;
  --text-dim: #8b96a5;
  --text-dimmer: #5a6473;
  --accent: #4fffb0;
  --accent-dim: rgba(79, 255, 176, 0.14);
  --accent-2: #5da9ff;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

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

.text-accent { color: var(--accent); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 14px;
  text-transform: lowercase;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.section-sub {
  color: var(--text-dim);
  font-size: 16px;
  margin: 0 0 48px;
  max-width: 560px;
}

/* ── Background flourishes ────────────────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  opacity: 0.5;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  z-index: 0;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.16;
}
.bg-glow--one { top: -200px; left: -160px; background: var(--accent); }
.bg-glow--two { top: 400px; right: -220px; background: var(--accent-2); opacity: 0.12; }

/* ── Nav ───────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 7, 10, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav__word {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.nav__links { display: flex; gap: 28px; font-size: 14px; color: var(--text-dim); flex: 1; }
.nav__links a { transition: color 0.15s ease; }
.nav__links a:hover { color: var(--text); }

.nav__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dimmer);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span { width: 20px; height: 1.5px; background: var(--text); border-radius: 2px; }

.nav__mobile {
  display: none;
  flex-direction: column;
  padding: 8px 24px 20px;
  gap: 4px;
  border-top: 1px solid var(--border);
}
.nav__mobile a {
  padding: 12px 4px;
  font-size: 15px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.nav__mobile.is-open { display: flex; }

@media (max-width: 760px) {
  .nav__links, .nav__status { display: none; }
  .nav__toggle { display: flex; }
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--sans);
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #04140d;
}
.btn--primary:hover { background: #6bffc0; }

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--lg { padding: 16px 30px; font-size: 15.5px; font-family: var(--mono); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero { position: relative; z-index: 1; padding: 100px 0 90px; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero__title {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
}

.hero__sub {
  color: var(--text-dim);
  font-size: 16.5px;
  max-width: 480px;
  margin: 0 0 34px;
}

.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

.terminal {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--red { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green { background: #28c840; }

.terminal__title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dimmer);
}

.terminal__body {
  padding: 22px 20px 26px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text-dim);
  min-height: 240px;
}

.terminal__body .prompt { color: var(--accent); margin-right: 8px; }
.terminal__body .ok { color: var(--accent); }
.terminal__body .muted { color: var(--text-dimmer); }
.terminal__body p { margin: 0 0 2px; white-space: pre-wrap; }

.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
}

/* ── About ─────────────────────────────────────────────────────────────── */
.about { position: relative; z-index: 1; padding: 40px 0 100px; }

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.about__card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.about__card:hover { border-color: var(--border-strong); transform: translateY(-3px); }

.about__index {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.about__card h3 { font-size: 18px; margin: 0 0 10px; letter-spacing: -0.01em; }
.about__card p { font-size: 14.5px; color: var(--text-dim); margin: 0; }

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
}

/* ── Work / portfolio ──────────────────────────────────────────────────── */
.work { position: relative; z-index: 1; padding: 40px 0 110px; }

.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.work-card {
  position: relative;
  background: linear-gradient(160deg, var(--bg-raised), #070a10);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.work-card:hover { border-color: var(--border-strong); transform: translateY(-4px); }

.work-card__top { display: flex; align-items: center; justify-content: space-between; }

.work-card__tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.work-card__status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dimmer);
  display: flex;
  align-items: center;
  gap: 6px;
}
.work-card__status::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.work-card h3 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
.work-card p { font-size: 14px; color: var(--text-dim); margin: 0; flex: 1; }

.work-card__stack {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.work-card__stack span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dimmer);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}

.work-card__link {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.work-card--placeholder {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  color: var(--text-dimmer);
}
.work-card--placeholder p { font-family: var(--mono); font-size: 13px; }

/* ── Contact ───────────────────────────────────────────────────────────── */
.contact { position: relative; z-index: 1; padding: 40px 0 120px; }
.contact__inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact .section-sub { margin-left: auto; margin-right: auto; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer__notice {
  font-size: 11.5px;
  color: var(--text-dimmer);
  max-width: 720px;
  line-height: 1.6;
  margin: 0 auto;
  text-align: center;
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dimmer);
}

.footer__links a { color: var(--text-dim); transition: color 0.15s ease; }
.footer__links a:hover { color: var(--accent); }

/* ── Legal pages (privacy / terms) ────────────────────────────────────── */
.legal { position: relative; z-index: 1; padding: 60px 0 100px; }
.legal__wrap { max-width: 720px; }
.legal__updated { font-family: var(--mono); font-size: 12px; color: var(--text-dimmer); margin: 0 0 44px; }
.legal__section { margin-bottom: 30px; }
.legal__section h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 10px; }
.legal__section p { font-size: 14.5px; line-height: 1.75; color: var(--text-dim); margin: 0; }
.legal__section strong { color: var(--text); font-weight: 600; }
.legal__link { color: var(--accent); text-decoration: underline; }

/* ── Reveal-on-scroll ──────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.3,1), transform 0.7s cubic-bezier(.2,.7,.3,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
