/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --blueprint-dark: #0f2e3d;
  --blueprint-darker: #0a2029;
  --blueprint-mid: #123449;
  --blueprint-line: #4fa8c9;
  --blueprint-line-soft: rgba(79, 168, 201, 0.28);
  --gold: #c9973e;
  --gold-bright: #e0b563;
  --paper: #f7f4ee;
  --paper-line: #e3ddcf;
  --ink: #16232b;
  --ink-soft: #37474f;
  --mute: #5c7079;
  --mute-light: rgba(247, 244, 238, 0.62);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --max: 1120px;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 56px);
  background: rgba(15, 46, 61, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--blueprint-line-soft);
}

.nav__mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 18px;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav__dot { color: var(--gold); }

.nav__links {
  display: flex;
  gap: 28px;
}
.nav__links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mute-light);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--gold-bright); }

.nav__cta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blueprint-darker);
  background: var(--gold);
  padding: 8px 16px;
  border-radius: 3px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
}
.nav__cta:hover { background: var(--gold-bright); }

@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  background: var(--blueprint-dark);
  color: var(--paper);
  padding: 140px clamp(20px, 4vw, 56px) 90px;
  overflow: hidden;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--blueprint-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint-line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.22;
  mask-image: radial-gradient(ellipse at 30% 20%, black 10%, transparent 75%);
}

.hero__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  margin: 0 0 18px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 7vw, 84px);
  line-height: 0.98;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

.hero__subtitle {
  font-size: 17px;
  color: var(--mute-light);
  max-width: 46ch;
  margin: 0 0 34px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.btn {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn--gold {
  background: var(--gold);
  color: var(--blueprint-darker);
  font-weight: 600;
}
.btn--gold:hover { background: var(--gold-bright); transform: translateY(-1px); }
.btn--ghost {
  border: 1px solid var(--blueprint-line-soft);
  color: var(--paper);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-bright); }

.hero__meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mute-light);
}
.hero__meta .dot { margin: 0 8px; color: var(--blueprint-line); }

/* Terminal */
.terminal {
  background: var(--blueprint-darker);
  border: 1px solid var(--blueprint-line-soft);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--blueprint-line-soft);
}
.terminal__btn {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}
.terminal__btn--r { background: #e0645a; }
.terminal__btn--y { background: #e0b563; }
.terminal__btn--g { background: #6cbf84; }
.terminal__title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute-light);
  margin-left: 8px;
}
.terminal__body {
  padding: 22px 20px 28px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.9;
  color: #cfe8f2;
  min-height: 230px;
}
.terminal__body .line { white-space: pre-wrap; }
.terminal__body .prompt { color: var(--gold-bright); }
.terminal__body .dim { color: var(--mute-light); }
.terminal__body .ok { color: #7fd28c; }
.terminal__body .cursor {
  display: inline-block;
  width: 8px; height: 15px;
  background: var(--gold-bright);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   SECTIONS - shared
   ============================================================ */
.section {
  padding: 100px clamp(20px, 4vw, 56px);
}
.section--paper { background: var(--paper); }
.section--blueprint {
  background: var(--blueprint-mid);
  color: var(--paper);
}
.section--dark {
  background: var(--blueprint-darker);
  color: var(--paper);
}

.sheet__tag {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--mute);
  margin: 0 0 12px;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}
.sheet__tag--light { color: var(--gold-bright); }

.section__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 600;
  margin: 0 auto 48px;
  max-width: var(--max);
}
.section__title--light { color: var(--paper); }

/* ============================================================
   ABOUT
   ============================================================ */
.sheet {
  max-width: var(--max);
  margin: 0 auto;
}
.about__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  margin-top: 20px;
}
.about__copy p {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 20px;
  max-width: 62ch;
}
.about__facts {
  border-left: 1px solid var(--paper-line);
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.fact__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 4px;
}
.fact__value {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
}

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__facts { border-left: none; border-top: 1px solid var(--paper-line); padding-left: 0; padding-top: 24px; }
  .hero__inner { grid-template-columns: 1fr; }
}

/* ============================================================
   EXPERIENCE / STAGES
   ============================================================ */
.stage {
  max-width: var(--max);
  margin: 0 auto 64px;
}
.stage__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--blueprint-line-soft);
  padding-bottom: 14px;
  margin-bottom: 22px;
}
.stage__co {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold-bright);
}
.stage__role {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mute-light);
}
.stage__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute-light);
  margin-left: auto;
}

.stage__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.stage__cards--wide { grid-template-columns: 1fr; }

.card {
  background: rgba(247, 244, 238, 0.05);
  border: 1px solid var(--blueprint-line-soft);
  border-radius: 6px;
  padding: 22px;
}
.card--highlight { border-color: var(--gold); background: rgba(201, 151, 62, 0.08); }
.card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--paper);
}
.card__kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--gold-bright);
  margin: 0 0 10px;
}
.card p {
  font-size: 14.5px;
  color: var(--mute-light);
  margin: 0;
}

.stage__more {
  max-width: var(--max);
  margin: 0 auto;
  font-size: 14px;
  color: var(--mute-light);
}
.stage__more a { color: var(--gold-bright); }

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

/* ============================================================
   RESULTS / METRICS
   ============================================================ */
.metrics {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.metric {
  text-align: center;
  padding: 30px 12px;
  border: 1px solid var(--blueprint-line-soft);
  border-radius: 8px;
}
.metric__before {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--mute-light);
  text-decoration: line-through;
  text-decoration-color: rgba(224, 100, 90, 0.7);
  margin: 0;
}
.metric__arrow {
  color: var(--gold);
  font-size: 20px;
  margin: 6px 0;
}
.metric__after {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  color: var(--gold-bright);
  margin: 0 0 10px;
}
.metric__label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--mute-light);
  margin: 0;
}

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

/* ============================================================
   STACK
   ============================================================ */
.stackgrid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px 40px;
}
.stackgroup h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 12px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags span {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--paper-line);
  border-radius: 3px;
  color: var(--ink-soft);
  background: #fff;
}

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

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--blueprint-darker);
  color: var(--paper);
  padding: 80px clamp(20px, 4vw, 56px) 40px;
  border-top: 1px solid var(--blueprint-line-soft);
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: left;
}
.footer__prompt {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--gold-bright);
  margin: 0 0 22px;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin-bottom: 40px;
}
.footer__links a {
  font-family: var(--font-mono);
  font-size: 14px;
  text-decoration: none;
  color: var(--paper);
  border-bottom: 1px solid var(--blueprint-line-soft);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.footer__links a:hover { color: var(--gold-bright); border-color: var(--gold); }
.footer__fine {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute-light);
}

/* ============================================================
   ERROR PAGE (404)
   ============================================================ */
.hero--error {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 100px;
}
.error__inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.terminal--error {
  text-align: left;
  margin-bottom: 40px;
}
.error__code {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  margin: 0 0 14px;
}
.error__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 44px);
  margin: 0 0 16px;
  line-height: 1.1;
}
.error__subtitle {
  font-size: 16px;
  color: var(--mute-light);
  max-width: 44ch;
  margin: 0 auto 34px;
}
.error__inner .hero__actions {
  justify-content: center;
}

@media (max-width: 720px) {
  .hero--error { padding-top: 130px; }
}

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
