/* =============================================================================
   Gleb Pyatkov — Portfolio
   Design language: "terminal / CLI" — JetBrains Mono chrome, Inter prose only,
   single warm amber accent on warm near-black. Hairlines, not glass. Sharp
   corners, mono index tags, shell prompts, dot leaders. No rainbow, no Space
   Grotesk, no round bullet dots, no gradient icon tiles.
   ============================================================================= */

/* ───────────────────────────── Tokens ───────────────────────────── */
:root {
  /* warm amber on warm near-black */
  --bg:            #0b0a09;
  --bg-2:          #100e0c;
  --surface:       #161310;
  --line:          rgba(245, 230, 210, 0.10);
  --line-strong:   rgba(245, 230, 210, 0.20);
  --text:          #ece7df;
  --text-2:        #b3a99b;
  --muted:         #8d8475;
  --accent:        #f5a623;
  --accent-bright: #ffc05a;
  --accent-deep:   #d97a2b;
  --accent-soft:   rgba(245, 166, 35, 0.12);
  --accent-line:   rgba(245, 166, 35, 0.30);
  --ok:            #5fd17e;

  /* type */
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-hero: clamp(2.3rem, 5.5vw, 4.4rem);
  --fs-h2:   clamp(1.5rem, 3vw, 2.3rem);
  --fs-proj: clamp(1.6rem, 3.4vw, 2.6rem);

  /* layout */
  --r: 6px;
  --r-sm: 4px;
  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 40px);
  --section-y: clamp(64px, 9vw, 132px);
  --nav-h: 64px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ───────────────────────────── Reset / base ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, dt, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, video, picture, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-150%);
  background: var(--accent);
  color: #1a1206;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--r);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ───────────────────────────── Background ───────────────────────────── */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg);
}
.bg__grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(to right, rgba(245, 166, 35, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 166, 35, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
}
.bg__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 40% at 50% -8%, rgba(245, 166, 35, 0.10), transparent 70%),
    radial-gradient(40% 30% at 85% 4%, rgba(217, 122, 43, 0.06), transparent 70%);
}
.bg__scan {
  position: absolute;
  inset: 0;
  opacity: 0.018;
  background-image: repeating-linear-gradient(
    to bottom, #fff 0px, #fff 1px, transparent 1px, transparent 3px
  );
}

/* ───────────────────────────── Shared chrome ───────────────────────────── */
.brand {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.brand__cur {
  color: var(--accent);
  animation: blink 1.1s steps(1, end) infinite;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--accent);
  margin-left: 0.2em;
  vertical-align: -0.16em;
  animation: blink 1.05s steps(1, end) infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* prompt eyebrow ("> AI AUTOMATION ENGINEER ▋") */
.prompt {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(0.72rem, 1.4vw, 0.84rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 0.55ch;
}
.prompt__sign { color: var(--accent); font-weight: 700; }

/* section heading block */
.shead { margin-bottom: clamp(36px, 5vw, 60px); }
.shead--center { text-align: center; }
.kicker {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 14px;
}
.h2 {
  font-family: var(--mono);
  font-weight: 800;
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
}
.shead__sub {
  margin-top: 16px;
  max-width: 60ch;
  color: var(--text-2);
  font-size: 1rem;
}
.shead--center .shead__sub { margin-inline: auto; }
.shead__sub--prose { max-width: 72ch; }

/* ───────────────────────────── Buttons ───────────────────────────── */
.btn {
  --b-bg: transparent;
  --b-fg: var(--text);
  --b-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.4ch;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--b-fg);
  background: var(--b-bg);
  border: 1px solid var(--b-bd);
  border-radius: var(--r);
  padding: 11px 18px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn--bracket::before { content: "["; color: var(--accent); opacity: 0.7; }
.btn--bracket::after  { content: "]"; color: var(--accent); opacity: 0.7; }

.btn--primary {
  --b-bg: var(--accent);
  --b-fg: #1a1206;
  --b-bd: var(--accent);
}
.btn--primary.btn--bracket::before,
.btn--primary.btn--bracket::after { color: #1a1206; opacity: 0.55; }
.btn--primary:hover { --b-bg: var(--accent-bright); --b-bd: var(--accent-bright); }

.btn--outline:hover { --b-bd: var(--accent); --b-fg: var(--accent-bright); }
.btn--ghost {
  --b-bd: var(--line);
  --b-fg: var(--text-2);
}
.btn--ghost:hover { --b-bd: var(--accent-line); --b-fg: var(--text); }

/* ───────────────────────────── Chips / tokens ───────────────────────────── */
.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  white-space: nowrap;
}
.chip--metric {
  color: var(--accent-bright);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tok {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.tok:hover { border-color: var(--accent-line); color: var(--text); }

/* badges */
.badge {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  align-self: center;
}
.badge--flagship {
  color: #1a1206;
  background: var(--accent);
}
.badge--current {
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

/* status dot */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.dot--ok {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(95, 209, 126, 0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(95, 209, 126, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(95, 209, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 209, 126, 0); }
}

/* generic dot-leader (flex-grows, dotted) */
.leader {
  flex: 1 1 2rem;
  min-width: 1.5rem;
  align-self: center;
  height: 0;
  border-bottom: 1px dotted var(--line-strong);
  margin: 0 0.9rem;
}

/* ───────────────────────────── Navbar ───────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              backdrop-filter 0.25s var(--ease);
}
.nav.scrolled {
  background: rgba(11, 10, 9, 0.78);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--nav-h);
}
.nav__brand { display: inline-flex; align-items: center; }
.nav__links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.nav__links a {
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 4px 0;
  position: relative;
  transition: color 0.18s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  transition: right 0.22s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { right: 0; }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: 6px;
}

/* lang segmented */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
}
.lang__btn {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  padding: 2px;
  transition: color 0.18s var(--ease);
}
.lang__btn.is-active { color: var(--accent); }
.lang__btn:hover { color: var(--text); }
.lang__sep { color: var(--line-strong); font-size: 0.8rem; }

.nav__contact { padding: 8px 14px; font-size: 0.82rem; }

.nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  position: relative;
}
.nav__burger span {
  position: absolute;
  left: 9px; right: 9px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav__burger span:nth-child(1) { top: 13px; }
.nav__burger span:nth-child(2) { top: 19px; }
.nav__burger span:nth-child(3) { top: 25px; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* mobile overlay menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(11, 10, 9, 0.97);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}
.mobile-menu.is-open { opacity: 1; }
.mobile-menu__links {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 clamp(28px, 9vw, 64px);
}
.mobile-menu__links a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  color: var(--text);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.mm__idx {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
}
.mobile-menu__links a:hover { color: var(--accent-bright); }

/* ───────────────────────────── Hero ───────────────────────────── */
.hero {
  padding-top: clamp(40px, 7vw, 80px);
  padding-bottom: var(--section-y);
  scroll-margin-top: var(--nav-h);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero__content { min-width: 0; }
.hero__name {
  font-family: var(--mono);
  font-weight: 800;
  font-size: var(--fs-hero);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-top: 22px;
  color: var(--text);
}
.hero__title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.1vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-top: 16px;
}
.hero__tagline {
  font-family: var(--sans);
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 56ch;
  margin-top: 22px;
}
.hero__location {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 18px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.hero__chips { margin-top: 26px; }

/* photo terminal panel */
.hero__photo { justify-self: center; width: 100%; max-width: 380px; }
.panel {
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  padding: 12px;
  border-radius: var(--r);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.panel__media {
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg);
}
.panel__img {
  width: 100%;
  height: auto;
  filter: contrast(1.05) saturate(0.92) brightness(1.02) sepia(0.06);
}
.panel__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 10px;
}
.panel__loc { color: var(--accent); opacity: 0.85; }
.panel__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 6px;
}
/* corner crosshair ticks */
.panel__tick {
  position: absolute;
  width: 12px;
  height: 12px;
  z-index: 1;
}
.panel__tick::before, .panel__tick::after {
  content: "";
  position: absolute;
  background: var(--accent);
}
.panel__tick::before { width: 12px; height: 1px; top: 0; left: 0; }
.panel__tick::after  { width: 1px; height: 12px; top: 0; left: 0; }
.panel__tick--tl { top: -1px; left: -1px; }
.panel__tick--tr { top: -1px; right: -1px; transform: scaleX(-1); }
.panel__tick--bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.panel__tick--br { bottom: -1px; right: -1px; transform: scale(-1, -1); }

/* ───────────────────────────── Stats ───────────────────────────── */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.stats__row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 4vw, 52px) clamp(24px, 5vw, 64px);
  padding-top: clamp(28px, 4vw, 44px);
  padding-bottom: clamp(28px, 4vw, 44px);
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.stat__num {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
}

/* ───────────────────────────── Sections ───────────────────────────── */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  scroll-margin-top: var(--nav-h);
}
.section--alt { background: var(--bg-2); }

/* ───────────────────────────── Projects ───────────────────────────── */
.projects { display: flex; flex-direction: column; }
.project {
  padding: clamp(30px, 4vw, 48px) 0;
  border-top: 1px solid var(--line);
}
.project:first-child { border-top: none; padding-top: 0; }

.project__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.project__idx {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  color: var(--accent);
}
.project__name {
  font-family: var(--mono);
  font-weight: 800;
  font-size: var(--fs-proj);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}
.project__sub {
  font-family: var(--sans);
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 64ch;
  margin-top: 14px;
}

/* expand toggle */
.project__toggle {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 18px;
  padding: 6px 0;
  transition: color 0.18s var(--ease);
}
.project__toggle::before { content: "[\00a0"; color: var(--accent); opacity: 0.7; }
.project__toggle::after  { content: "\00a0]"; color: var(--accent); opacity: 0.7; }
.project__toggle:hover { color: var(--accent-bright); }

.project__details {
  overflow: hidden;
  transition: height 0.36s var(--ease), opacity 0.3s var(--ease);
}
.project__bullets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  max-width: 72ch;
}
.project__bullets li {
  font-family: var(--sans);
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 1.6;
  padding-left: 24px;
  position: relative;
}
.project__bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-family: var(--mono);
}
.project__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.project__stack {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 22px;
}
.project__stack-k {
  color: var(--accent);
  opacity: 0.8;
  margin-right: 0.6ch;
}
.project__stack-k::after { content: " ›"; }

/* ── Ribbon (per-project media rail) ── */
.ribbon { margin-top: 26px; }
.rail-wrap { position: relative; }
.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.rail::-webkit-scrollbar { width: 0; height: 0; display: none; }

.card {
  flex: 0 0 clamp(260px, 78vw, 520px);
  scroll-snap-align: start;
  min-width: 0;
}
.media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-2);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-2);
}
.media__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-bright);
  background: rgba(11, 10, 9, 0.78);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.card__cap {
  display: flex;
  align-items: baseline;
  gap: 0.7ch;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 10px;
  line-height: 1.4;
}
.cap__tag {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}
.cap__tag::before { content: "// "; opacity: 0.6; }

/* manual play button (reduced motion) */
.rail-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(11, 10, 9, 0.6);
  border: 1px solid var(--accent-line);
  border-radius: 50%;
}
.rail-play svg { width: 22px; height: 22px; }
.rail-play:hover { background: rgba(11, 10, 9, 0.78); }

/* rail arrows (desktop) */
.rail-arrow {
  position: absolute;
  top: calc(50% - 26px);
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(11, 10, 9, 0.82);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  z-index: 3;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), opacity 0.18s var(--ease);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.rail-arrow svg { width: 18px; height: 18px; }
.rail-arrow:hover { border-color: var(--accent); color: var(--accent-bright); }
.rail-arrow:disabled { opacity: 0; pointer-events: none; }
.rail-arrow[hidden] { display: none; }
.rail-arrow--prev { left: -8px; }
.rail-arrow--next { right: -8px; }

/* rail footer: progress + swipe hint */
.rail-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}
.rail-progress {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.rail-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent);
  transition: width 0.12s linear;
}
.rail-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ───────────────────────────── Approach ───────────────────────────── */
.approach { display: flex; flex-direction: column; }
.approach__row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  column-gap: 16px;
  padding: clamp(20px, 3vw, 30px) 0;
  border-top: 1px solid var(--line);
}
.approach__row:first-child { border-top: none; padding-top: 0; }
.approach__idx {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--accent);
}
.approach__dash { color: var(--muted); font-family: var(--mono); }
.approach__title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  letter-spacing: 0.04em;
  color: var(--text);
}
.approach__desc {
  font-family: var(--sans);
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 1.6;
  margin-top: 8px;
  max-width: 66ch;
}

/* ───────────────────────────── Skills ───────────────────────────── */
.skills { display: flex; flex-direction: column; }
.skill {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px 28px;
  align-items: start;
  padding: clamp(18px, 2.6vw, 26px) 0;
  border-top: 1px solid var(--line);
}
.skill:first-child { border-top: none; padding-top: 0; }
.skill__label {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
  padding-top: 4px;
}
.skill__label::before { content: "› "; color: var(--muted); }
.skill__tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ───────────────────────────── Experience + Education ───────────────────────────── */
.exp-edu {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.xp {
  border-left: 1px solid var(--line-strong);
  padding-left: clamp(20px, 3vw, 30px);
  position: relative;
}
.xp::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
}
.xp__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.xp__company {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  letter-spacing: -0.02em;
  color: var(--text);
}
.xp__role {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--accent);
}
.xp__meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
}
.xp__tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 2px;
}
.xp__bullets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}
.xp__bullets li {
  font-family: var(--sans);
  color: var(--text-2);
  font-size: 0.96rem;
  line-height: 1.6;
  padding-left: 22px;
  position: relative;
}
.xp__bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}

.side { display: flex; flex-direction: column; gap: 18px; }
.side__card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  background: var(--surface);
}
.side__title {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.side__title::before { content: "// "; color: var(--accent); opacity: 0.7; }
.side__school {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 6px;
}
.side__line {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* ───────────────────────────── Contact ───────────────────────────── */
.contact__closing {
  margin-top: 14px;
  max-width: 20ch;
  margin-inline: auto;
}
.contact__rows {
  max-width: 640px;
  margin: clamp(40px, 6vw, 60px) auto 0;
  display: flex;
  flex-direction: column;
}
.crow {
  display: flex;
  align-items: baseline;
  font-family: var(--mono);
  padding: 18px 4px;
  border-top: 1px solid var(--line);
  transition: color 0.18s var(--ease);
}
.crow:last-child { border-bottom: 1px solid var(--line); }
.crow__k {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
}
.crow__k::before { content: "$ "; color: var(--muted); }
.crow__dots {
  flex: 1 1 2rem;
  min-width: 1.5rem;
  align-self: center;
  height: 0;
  border-bottom: 1px dotted var(--line-strong);
  margin: 0 0.9rem;
}
.crow__v {
  color: var(--text);
  font-size: 0.92rem;
  transition: color 0.18s var(--ease);
}
.crow:hover .crow__v { color: var(--accent-bright); }

/* ───────────────────────────── Footer ───────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 26px;
  padding-bottom: 26px;
}
.footer__copy {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-left: auto;
}
.footer__top {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-2);
  transition: color 0.18s var(--ease);
}
.footer__top:hover { color: var(--accent); }

/* ───────────────────────────── Reveal animation ───────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* No-JS / failed-module resilience: never blank the page. */
.no-js [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}
.no-js .caret,
.no-js .brand__cur,
.no-js .panel,
.no-js .dot--ok { animation: none !important; }

/* ───────────────────────────── Reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .caret, .brand__cur { opacity: 1; }
  .panel, .dot--ok { animation: none; }
}

/* ───────────────────────────── Responsive ───────────────────────────── */
@media (max-width: 980px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero__photo {
    order: -1;
    justify-self: start;
    max-width: 300px;
  }
  .exp-edu { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__contact { display: none; }
  .nav__burger { display: block; }
  .nav__actions { margin-left: auto; }
}

@media (max-width: 720px) {
  .skill { grid-template-columns: 1fr; gap: 12px; }
  .skill__label { padding-top: 0; }
  .rail-arrow { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .stat__label { white-space: nowrap; }
  .project__head { gap: 10px; }
  .leader { display: none; }
  .badge { order: 3; }
}
