/* ===================== Design tokens ===================== */
:root {
  --bg: #05070d;
  --bg-1: #070c18;
  --bg-2: #0a1120;
  --panel: #0e1728;
  --panel-2: #121e36;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --silver: #c7cdd6;
  --text: #eaf0fb;
  --text-dim: #93a0b8;
  --text-dimmer: #5c6c86;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --font-head: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --maxw: 1180px;
}

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

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

img { max-width: 100%; display: block; }

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

ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

::selection { background: var(--accent); color: #fff; }

/* ===================== Background canvas ===================== */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 300;
  transition: width 0.1s linear;
}

main, .footer, .nav { position: relative; z-index: 1; }

/* ===================== Nav ===================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(5, 7, 13, 0.75);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
  padding-top: 14px;
  padding-bottom: 14px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__logo { width: 32px; height: 32px; object-fit: contain; }

.nav__brand-text {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.nav__links a { transition: color 0.2s ease; }
.nav__links a:hover { color: var(--text); }

.nav__cta {
  padding: 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text) !important;
}

.nav__cta:hover { border-color: var(--accent-2); background: var(--accent-soft); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ===================== Layout helpers ===================== */
.section { padding: clamp(48px, 6vw, 88px) clamp(20px, 5vw, 64px); position: relative; }
.section__inner { max-width: var(--maxw); margin: 0 auto; }
.section__inner--narrow { max-width: 720px; }

.section__eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-2);
  margin: 0 0 14px;
}

.section__eyebrow--sub { margin-top: 56px; }

.section__title {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  max-width: 20ch;
  margin-bottom: 20px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(36px);
}

/* ===================== Buttons ===================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  font-family: var(--font-body);
}

.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #04101f;
}

.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px rgba(59, 130, 246, 0.55); }

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

.btn--ghost:hover { border-color: var(--accent-2); background: var(--accent-soft); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.btn__spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(4, 16, 31, 0.35);
  border-top-color: #04101f;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading .btn__label { opacity: 0.7; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Hero ===================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 110px clamp(20px, 5vw, 64px) 84px;
  position: relative;
  overflow: hidden;
}

.hero__bg-portrait {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__bg-portrait-img {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: 62% 20%;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(5, 7, 13, 0.94) 0%,
    rgba(5, 7, 13, 0.82) 20%,
    rgba(5, 7, 13, 0.5) 38%,
    rgba(5, 7, 13, 0.12) 58%,
    rgba(5, 7, 13, 0) 72%
  );
}

.hero__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
  padding-bottom: 48px;
}

.hero__copy { max-width: 620px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px 2px var(--accent-2);
}

.hero__title {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
  margin-bottom: 14px;
  background: linear-gradient(120deg, #ffffff 30%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55));
}

.hero__role {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--silver);
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero__lede {
  color: var(--text-dim);
  max-width: 52ch;
  font-size: 1.02rem;
  margin-bottom: 24px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__scrollcue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-dimmer);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 1;
  pointer-events: none;
}

.hero__scrollcue span {
  width: 1px;
  height: 22px;
  background: linear-gradient(var(--accent-2), transparent);
  animation: cue 1.8s ease-in-out infinite;
}

@keyframes cue { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* ===================== About / stats ===================== */
.about__text { color: var(--text-dim); max-width: 68ch; font-size: 1.05rem; margin-bottom: 36px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  background: var(--panel);
  padding: 34px 26px;
  text-align: left;
}

.stat__value {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--accent-2);
  margin: 0 0 10px;
}

.stat__label { color: var(--text-dim); font-size: 0.88rem; margin: 0; }

/* ===================== Skills / tools ===================== */
.tag-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

.tag {
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.86rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tag:hover { transform: translateY(-2px); border-color: var(--accent-2); color: var(--text); }

.tag--accent {
  border-color: rgba(34, 211, 238, 0.4);
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.06);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.tools-group {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.tools-group h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 10px;
}

.tools-group p { color: var(--text-dim); font-size: 0.86rem; margin: 0; }

.tools-group--accent {
  border-color: rgba(34, 211, 238, 0.35);
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.08), var(--panel) 60%);
}

/* ===================== Timeline ===================== */
.timeline { position: relative; margin-top: 28px; }

.timeline__line {
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(var(--accent), transparent 90%);
}

.tl-item {
  position: relative;
  padding-left: 44px;
  margin-bottom: 40px;
}

.tl-item:last-child { margin-bottom: 0; }

.tl-item__marker {
  position: absolute;
  left: 0;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.tl-item__card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
}

.tl-item__date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.tl-item__role { font-size: 1.2rem; margin-bottom: 4px; }
.tl-item__org { color: var(--silver); font-size: 0.95rem; margin: 0 0 16px; }

.tl-item__card ul { display: flex; flex-direction: column; gap: 10px; }

.tl-item__card li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.94rem;
}

.tl-item__card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ===================== AI demo ===================== */
.ai-demo__intro { color: var(--text-dim); max-width: 70ch; font-size: 1.02rem; margin-bottom: 28px; }

.ai-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 44px);
}

.ai-panel__input label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.ai-panel__input textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.ai-panel__input textarea:focus { border-color: var(--accent-2); }

.ai-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.ai-panel__count { color: var(--text-dimmer); font-family: var(--font-mono); font-size: 0.78rem; }

.ai-panel__error {
  margin-top: 14px;
  color: #ff8a8a;
  font-size: 0.88rem;
  background: rgba(255, 90, 90, 0.08);
  border: 1px solid rgba(255, 90, 90, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.ai-panel__result {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 36px;
  align-items: start;
}

.score-ring { position: relative; width: 140px; height: 140px; margin: 0 auto; }
.score-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }

.score-ring__track {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 8;
}

.score-ring__fill {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-ring__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--text);
}

.ai-panel__breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.ai-panel__col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  margin-bottom: 14px;
}

.ai-panel__col ul { display: flex; flex-direction: column; gap: 10px; }

.ai-panel__col li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.ai-panel__col li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.ai-panel__pitch {
  grid-column: 1 / -1;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
}

.ai-panel__pitch h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  margin-bottom: 10px;
}

.ai-panel__pitch p { margin: 0; color: var(--text); font-size: 0.98rem; }

.ai-demo__note { margin-top: 22px; color: var(--text-dimmer); font-size: 0.82rem; }

/* ===================== Contact ===================== */
.contact__text { color: var(--text-dim); margin-bottom: 28px; font-size: 1.02rem; }

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.contact__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--panel);
  transition: background 0.2s ease, padding-left 0.2s ease;
}

a.contact__link:hover { background: var(--panel-2); padding-left: 30px; }

.contact__link-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dimmer);
}

.contact__link-value { color: var(--text); font-size: 0.98rem; }

/* ===================== Footer ===================== */
.footer {
  padding: 40px clamp(20px, 5vw, 64px) 60px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-dimmer);
  font-size: 0.82rem;
}

.footer__logo { width: 26px; height: 26px; object-fit: contain; opacity: 0.8; }

/* ===================== Responsive ===================== */
@media (max-width: 980px) {
  .hero__grid { text-align: center; padding-top: 52vh; }
  .hero__copy { max-width: 560px; margin: 0 auto; }
  .hero__lede { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
  .hero__bg-portrait-img {
    right: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    object-position: 50% 20%;
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
  }
  .hero__scrim {
    background: linear-gradient(to bottom, rgba(5, 7, 13, 0) 0%, rgba(5, 7, 13, 0.55) 42%, rgba(5, 7, 13, 0.95) 55%);
  }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-panel__result { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .ai-panel__breakdown { grid-template-columns: 1fr; width: 100%; }
  .section__eyebrow--sub { margin-top: 56px; }
}

@media (max-width: 720px) {
  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(280px, 80vw);
    background: rgba(6, 10, 20, 0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 1px solid var(--border);
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__toggle { display: flex; }
  .nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .section { padding: 56px 18px; }
  .section__title { margin-bottom: 20px; }
  .stats { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .tools-group { padding: 18px; }
  .stat { padding: 22px 18px; }
  .tag-grid { gap: 8px; }
  .tag { padding: 8px 14px; font-size: 0.8rem; }
  .timeline { margin-top: 24px; }
  .tl-item { margin-bottom: 28px; padding-left: 34px; }
  .tl-item__card { padding: 20px 18px; }
  .ai-panel { padding: 20px; }
  .ai-panel__result { margin-top: 28px; padding-top: 28px; gap: 24px; }
  .contact__link { padding: 16px 18px; }
  .footer { padding: 24px 18px 32px; }
  .hero { padding-top: 96px; padding-bottom: 48px; }
  .hero__actions { gap: 12px; }
  .hero__lede { margin-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__scrollcue span { animation: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
