/* ============================================================================
   Karim Balayev — Portfolio
   Style: Modern Dark / Cinematic.  Tokens first, then components.
   You should not need to edit this file to change content — see js/content.js
   ========================================================================== */

/* ------------------------------------------------------------------ TOKENS */
:root {
  /* Surface ramp — never pure black (avoids OLED smear + gives depth) */
  --bg:            #0B1120;
  --bg-deep:       #070C16;
  --surface:       #111A2E;
  --surface-2:     #16203A;
  --border:        #1E2B47;
  --border-bright: #2C3D63;

  /* Ink */
  --fg:            #F8FAFC;
  --fg-muted:      #94A3B8;
  --fg-dim:        #64748B;

  /* Accent — "code dark + run green" */
  --accent:        #22C55E;
  --accent-dim:    #16A34A;
  --accent-glow:   rgba(34, 197, 94, .22);

  /* Type */
  --font:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Fluid type scale */
  /* Sized so the whole statement reads in one glance rather than filling the
     screen with a name. Roughly half the old display size. */
  --t-hero:  clamp(2.5rem, 7vw, 6rem);
  --t-h2:    clamp(2.25rem, 5.5vw, 4.5rem);
  --t-h3:    clamp(1.35rem, 2.4vw, 2rem);
  --t-lead:  clamp(1.0625rem, 1.55vw, 1.375rem);
  --t-body:  clamp(1rem, 1.1vw, 1.0625rem);
  --t-sm:    .8125rem;
  --t-xs:    .6875rem;

  /* Space (density 4/10 — standard). The upper steps are fluid so sections
     do not open up into dead space on small screens. */
  --s-1: .5rem;  --s-2: 1rem;   --s-3: 1.5rem;  --s-4: 2rem;
  --s-5: clamp(2rem, 4vw, 3rem);
  --s-6: clamp(2.5rem, 5.5vw, 4rem);
  --s-7: clamp(3rem, 7vw, 6rem);
  --s-8: clamp(4rem, 9vw, 8rem);

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --maxw:   1440px;

  /* Motion */
  --ease:      cubic-bezier(.16, 1, .3, 1);   /* expo.out */
  --ease-io:   cubic-bezier(.76, 0, .24, 1);
  --dur:       .5s;
  --dur-fast:  .25s;

  --radius:    18px;
  --radius-sm: 10px;

  /* Nav sits above the menu so the close button stays reachable while open. */
  --z-grain: 9000; --z-menu: 850; --z-nav: 900; --z-loader: 9800;
}

/* ------------------------------------------------------------------- RESET */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100dvh;
}
body.is-locked { overflow: hidden; }

img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol, dl { list-style: none; }
.bento__card, .work__item { cursor: default; }
.work__item[href] { cursor: pointer; }

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

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

/* -------------------------------------------------------------- UTILITIES */
.label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.label::before {
  content: attr(data-index);
  color: var(--accent);
}
.label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-bright), transparent);
  max-width: 180px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: var(--s-8) var(--gutter);
  position: relative;
}
.section__head { margin-bottom: var(--s-6); }
.section__title {
  font-size: var(--t-h2);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
  margin-top: var(--s-3);
  max-width: 16ch;
}

/* Wrappers produced by the splitter (js/app.js §1).
   A masked word clips its inner span so the text can rise into view. The
   padding/negative-margin pair keeps descenders (g, y, p) from being cut. */
.split-word { display: inline-block; }
.split-word--mask {
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .16em;
  margin-bottom: -.16em;
}
.split-in, .split-char { display: inline-block; will-change: transform; }

/* ------------------------------------------------------------------ GRAIN */
.grain {
  position: fixed;
  inset: -150%;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 700ms steps(3) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-2%, 1.5%); }
  66%  { transform: translate(1.5%, -2%); }
  100% { transform: translate(0, 0); }
}

/* --------------------------------------------------------------- PRELOADER */
.loader {
  position: fixed; inset: 0;
  z-index: var(--z-loader);
  background: var(--bg-deep);
  display: grid;
  place-items: center;
}
.loader__inner { width: min(440px, 72vw); text-align: left; }
.loader__name {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: var(--s-2);
}
.loader__bar {
  height: 1px;
  background: var(--border);
  overflow: hidden;
}
.loader__bar i {
  display: block; height: 100%; width: 0%;
  background: var(--accent);
}
.loader__count {
  margin-top: var(--s-2);
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--fg);
  display: flex; justify-content: flex-end; gap: 1px;
}
.loader__count em { font-style: normal; color: var(--fg-dim); }

/* --------------------------------------------------------------- PROGRESS */
.progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  z-index: var(--z-nav);
  background: transparent;
}
.progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 14px var(--accent-glow);
}

/* -------------------------------------------------------------------- NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--gutter);
  transition: background-color var(--dur) var(--ease),
              backdrop-filter var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(11, 17, 32, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__mark {
  display: flex; align-items: center; gap: .625rem;
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: -.01em;
}
.nav__mark svg {
  width: 22px; height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav__links { display: flex; align-items: center; gap: var(--s-3); }
.nav__links a {
  font-size: .875rem;
  color: var(--fg-muted);
  position: relative;
  padding: .25rem 0;
  transition: color var(--dur-fast) var(--ease);
}
.nav__links a::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after,
.nav__links a.is-current::after { transform: scaleX(1); transform-origin: left; }
.nav__links a.is-current { color: var(--fg); }

.nav__cta {
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  padding: .5rem 1.125rem !important;
  color: var(--fg) !important;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.nav__cta::after { display: none; }
.nav__cta:hover { background: var(--accent); border-color: var(--accent); color: #06210F !important; }

/* Two bars that cross into an X. Both rotate about the button's centre, so
   the motion reads as one object folding rather than two bars sliding. */
.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  position: relative;
  margin-right: -10px;
  z-index: 1;
}
.nav__toggle span {
  position: absolute; left: 10px;
  width: 24px; height: 2px;
  border-radius: 2px;
  background: var(--fg);
  transition: transform .45s var(--ease-io), background-color var(--dur-fast) var(--ease);
}
.nav__toggle span:nth-child(1) { top: 17px; }
.nav__toggle span:nth-child(2) { top: 25px; }

.nav__toggle[aria-expanded="true"] span { background: var(--accent); }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px)  rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* While the menu is open the bar itself must not paint over it. */
.nav.is-menu-open {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom-color: transparent !important;
  transform: none !important;
}

/* ------------------------------------------------------------ MOBILE MENU */
.menu {
  position: fixed; inset: 0;
  z-index: var(--z-menu);
  background: var(--bg-deep);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--s-7) var(--gutter) var(--s-5);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s var(--ease-io);
  visibility: hidden;
}
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; }

.menu__links { display: flex; flex-direction: column; gap: var(--s-2); }
.menu__links a {
  display: flex; align-items: baseline; gap: var(--s-2);
  font-size: clamp(2rem, 11vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -.035em;
  opacity: 0;
  transform: translateY(28px);
}
.menu.is-open .menu__links a { animation: menuIn .6s var(--ease) forwards; }
.menu.is-open .menu__links a:nth-child(1) { animation-delay: .12s; }
.menu.is-open .menu__links a:nth-child(2) { animation-delay: .18s; }
.menu.is-open .menu__links a:nth-child(3) { animation-delay: .24s; }
.menu.is-open .menu__links a:nth-child(4) { animation-delay: .30s; }
.menu.is-open .menu__links a:nth-child(5) { animation-delay: .36s; }
@keyframes menuIn { to { opacity: 1; transform: none; } }

.menu__links em {
  font-family: var(--mono);
  font-style: normal;
  font-size: var(--t-xs);
  color: var(--accent);
}
.menu__foot {
  margin-top: auto;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--fg-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------- HERO */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--s-8) var(--gutter) var(--s-4);
  overflow: hidden;
  isolation: isolate;
}

.hero__media { position: absolute; inset: 0; z-index: -1; will-change: transform; transform-origin: 50% 40%; }
.hero__video, .hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Crossfade pair. The transition duration must match FADE in js/app.js §5,
   or the handover will either cut early or double-expose. Linear, because an
   eased crossfade dips in the middle. */
.hero__video { opacity: 0; transition: opacity .9s linear; }
.hero__video.is-front { opacity: .85; }
.hero__media.has-video .hero__canvas { opacity: .35; }

/* Dark enough to keep the headline at AA contrast, open enough to let the
   footage read. Bottom stop hands off cleanly to the page background. */
.hero__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(130% 100% at 68% 32%, transparent 0%, rgba(11,17,32,.35) 55%, rgba(11,17,32,.8) 100%),
    linear-gradient(180deg, rgba(11,17,32,.65) 0%, rgba(11,17,32,.25) 34%, rgba(11,17,32,.88) 86%, var(--bg) 100%);
}

.hero__body { position: relative; max-width: var(--maxw); width: 100%; margin-inline: auto; }

/* Identity line — present, legible, deliberately not the loudest thing here. */
.hero__id {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  letter-spacing: -.01em;
}
.hero__id b { font-weight: 600; color: var(--fg); }
.hero__id span { color: var(--fg-muted); font-weight: 400; }
.hero__id span::before { content: '— '; color: var(--fg-dim); }

.hero__title {
  font-size: var(--t-hero);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.02;
  margin: var(--s-2) 0 var(--s-4);
}
.hero__lead { display: block; }

/* The rotating phrase. The shell clips so each phrase can slide in from below
   and the outgoing one leaves through the top. Its own line, so a longer
   phrase never reflows the word above it. */
.rotator {
  display: block;
  overflow: hidden;
  padding-bottom: .12em;
  margin-bottom: -.12em;
}
.rotator__in {
  display: inline-block;
  color: var(--accent);
  will-change: transform;
}

.hero__sub {
  font-size: var(--t-lead);
  color: var(--fg-muted);
  max-width: 52ch;
  line-height: 1.6;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }

.btn {
  display: inline-flex; align-items: center; gap: .625rem;
  padding: .875rem 1.5rem;
  border-radius: 999px;
  font-size: .9375rem;
  font-weight: 500;
  border: 1px solid var(--border-bright);
  position: relative;
  overflow: hidden;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
/* A fixed 2px lift — the button goes exactly where you expect it to. */
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform .45s var(--ease);
  z-index: -1;
}
.btn > * { position: relative; }
.btn:hover { color: #06210F; border-color: var(--accent); }
.btn:hover::before { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Stays green on hover — a white fill read as a different button entirely. */
.btn--solid { background: var(--accent); color: #06210F; border-color: var(--accent); }
.btn--solid::before { background: #4ADE80; }
.btn--solid:hover { color: #06210F; border-color: #4ADE80; }

.hero__foot {
  position: relative;
  max-width: var(--maxw); width: 100%; margin: var(--s-7) auto 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.hero__meta {
  display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.hero__meta b { color: var(--fg-muted); font-weight: 400; }
.hero__meta .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent); margin-right: .5rem; vertical-align: 1px;
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.scroll-hint {
  display: flex; align-items: center; gap: .75rem;
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: .16em; text-transform: uppercase; color: var(--fg-dim);
  white-space: nowrap;
}
.scroll-hint i {
  width: 1px; height: 34px;
  background: linear-gradient(180deg, var(--accent), transparent);
  animation: drop 1.9s var(--ease) infinite;
  transform-origin: top;
}
@keyframes drop {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(34px); opacity: 0; }
}

/* ----------------------------------------------------------------- TICKER */
.ticker {
  border-block: 1px solid var(--border);
  background: var(--bg-deep);
  padding: var(--s-3) 0;
  overflow: hidden;
  position: relative;
}
.ticker::before, .ticker::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 14vw; z-index: 2; pointer-events: none;
}
.ticker::before { left: 0;  background: linear-gradient(90deg, var(--bg-deep), transparent); }
.ticker::after  { right: 0; background: linear-gradient(270deg, var(--bg-deep), transparent); }

.ticker__track { display: flex; width: max-content; will-change: transform; }
.ticker__item {
  display: flex; align-items: center; gap: var(--s-4);
  padding-inline: var(--s-4);
  font-size: clamp(1.125rem, 2.4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--fg-muted);
  white-space: nowrap;
}
.ticker__item::after {
  content: ''; width: 5px; height: 5px; border-radius: 999px; background: var(--accent); flex: none;
}

/* ------------------------------------------------------------------ ABOUT */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .75fr);
  gap: var(--s-6);
  align-items: start;
}
.about__copy p {
  font-size: clamp(1.25rem, 2.3vw, 1.875rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -.02em;
  margin-bottom: var(--s-4);
  text-wrap: pretty;
}
/* Words start dim and brighten as the section scrolls past */
.about__copy .split-in { color: var(--fg-dim); }

.about__portrait {
  aspect-ratio: 4 / 5;
  max-width: 320px;          /* never balloons into an empty slab on mobile */
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, var(--surface-2), var(--surface)),
    var(--surface);
  position: relative;
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }

/* Placeholder note, shown only until a photo is dropped in. */
.about__portrait::after {
  content: 'Add your photo at\A assets/img/portrait.jpg';
  white-space: pre;
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  font-family: var(--mono); font-size: var(--t-xs); line-height: 1.8;
  letter-spacing: .08em; color: var(--fg-dim);
}
.about__portrait.has-img::after { display: none; }

/* Overlay for a photo: fine scanlines plus four corner brackets, drawn as
   eight gradients so they stay crisp at any size and follow --accent. */
.about__portrait.has-img::before {
  content: '';
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
  --b: 16px;                                  /* bracket arm length */
  --t: 1.5px;                                 /* bracket thickness  */
  background:
    /* top-left */
    linear-gradient(var(--accent), var(--accent)) 10px 10px / var(--b) var(--t) no-repeat,
    linear-gradient(var(--accent), var(--accent)) 10px 10px / var(--t) var(--b) no-repeat,
    /* top-right */
    linear-gradient(var(--accent), var(--accent)) calc(100% - 10px) 10px / var(--b) var(--t) no-repeat,
    linear-gradient(var(--accent), var(--accent)) calc(100% - 10px) 10px / var(--t) var(--b) no-repeat,
    /* bottom-left */
    linear-gradient(var(--accent), var(--accent)) 10px calc(100% - 10px) / var(--b) var(--t) no-repeat,
    linear-gradient(var(--accent), var(--accent)) 10px calc(100% - 10px) / var(--t) var(--b) no-repeat,
    /* bottom-right */
    linear-gradient(var(--accent), var(--accent)) calc(100% - 10px) calc(100% - 10px) / var(--b) var(--t) no-repeat,
    linear-gradient(var(--accent), var(--accent)) calc(100% - 10px) calc(100% - 10px) / var(--t) var(--b) no-repeat,
    /* scanlines */
    repeating-linear-gradient(180deg, rgba(34, 197, 94, .07) 0 1px, transparent 1px 3px);
}

.about__portrait.has-img {
  border-color: var(--border-bright);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .12), 0 18px 60px -24px var(--accent-glow);
  transition: box-shadow var(--dur) var(--ease);
}
.about__portrait.has-img:hover {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .3), 0 22px 70px -20px var(--accent-glow);
}

.stats { margin-top: var(--s-4); display: grid; gap: var(--s-3); }
.stats > div { border-top: 1px solid var(--border); padding-top: var(--s-2); }
.stats dt {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800; letter-spacing: -.04em; line-height: 1;
  color: var(--fg);
}
.stats dd {
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-dim); margin-top: .5rem;
}

/* ------------------------------------------------------------- EXPERIENCE */
.timeline { position: relative; padding-left: clamp(1.5rem, 4vw, 3.5rem); }
.timeline__rail {
  position: absolute; left: 0; top: .5rem; bottom: .5rem;
  width: 1px; background: var(--border);
}
.timeline__rail i {
  display: block; width: 100%; height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  box-shadow: 0 0 12px var(--accent-glow);
}
.timeline__items { display: grid; gap: var(--s-6); }

.job { position: relative; }
.job::before {
  content: '';
  position: absolute;
  left: calc(clamp(1.5rem, 4vw, 3.5rem) * -1);
  top: .6rem;
  width: 9px; height: 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  transform: translateX(-4px);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.job.is-live::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-glow); }

.job__top {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem var(--s-2);
  margin-bottom: var(--s-2);
}
.job__period {
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  flex: none;
}
.job__role { font-size: var(--t-h3); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.job__company { color: var(--fg-muted); font-weight: 400; }
.job__company::before { content: '— '; color: var(--fg-dim); }

.job__summary { color: var(--fg-muted); max-width: 62ch; margin-bottom: var(--s-2); }
.job__points { display: grid; gap: .625rem; max-width: 66ch; margin-bottom: var(--s-3); }
.job__points li {
  position: relative; padding-left: 1.5rem;
  color: var(--fg-muted); font-size: .9375rem; line-height: 1.6;
}
.job__points li::before {
  content: ''; position: absolute; left: 0; top: .6em;
  width: 12px; height: 1px; background: var(--accent); opacity: .7;
}

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: .06em;
  padding: .3rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.job:hover .chip, .bento__card:hover .chip { border-color: var(--border-bright); color: var(--fg); }

/* ----------------------------------------------------------------- SKILLS */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s-2);
}
.bento__card {
  grid-column: span 3;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.bento__card[data-size="lg"] { grid-column: span 6; }   /* full width  */
.bento__card[data-size="md"] { grid-column: span 3; }   /* half        */
.bento__card[data-size="sm"] { grid-column: span 2; }   /* one third   */

/* Cursor-tracked glow */
.bento__card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--accent-glow), transparent 62%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.bento__card:hover { border-color: var(--border-bright); }
.bento__card:hover::before { opacity: 1; }

.bento__card h3 {
  font-size: var(--t-h3);
  font-weight: 700; letter-spacing: -.025em;
  margin-bottom: .625rem;
}
/* pre-line lets a tile body carry its own line breaks (e.g. two degrees). */
.bento__card p {
  color: var(--fg-muted);
  max-width: 52ch;
  margin-bottom: var(--s-3);
  font-size: .9375rem;
  white-space: pre-line;
}
.bento__card p:last-child { margin-bottom: 0; }
.bento__card .chips { position: relative; }

/* ------------------------------------------------------------------- WORK */
.work__list { border-top: 1px solid var(--border); }

.work__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: padding-inline var(--dur) var(--ease);
}
.work__item:hover { padding-inline: var(--s-2); }
.work__item::after {
  content: '';
  position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease);
}
.work__item:hover::after { transform: scaleX(1); }

.work__year {
  font-family: var(--mono); font-size: var(--t-xs);
  color: var(--fg-dim); letter-spacing: .1em;
}
.work__main { min-width: 0; }
.work__title {
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  font-weight: 700; letter-spacing: -.035em; line-height: 1.1;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .75rem;
  transition: color var(--dur) var(--ease);
}
.work__item:hover .work__title { color: var(--accent); }
.work__type {
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-dim);
}
.work__blurb { color: var(--fg-muted); margin-top: .625rem; max-width: 58ch; font-size: .9375rem; }
.work__chips { margin-top: var(--s-2); }

.work__arrow {
  width: 46px; height: 46px; flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: grid; place-items: center;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.work__arrow svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.work__item:hover .work__arrow {
  background: var(--accent); border-color: var(--accent); color: #06210F;
  transform: rotate(45deg);
}

/* ---------------------------------------------------------------- CONTACT */
.contact { text-align: left; padding-block: var(--s-8); }
.contact .label { margin-bottom: var(--s-3); }
.contact__title {
  font-size: var(--t-h2);
  font-weight: 800; letter-spacing: -.04em; line-height: 1.02;
  max-width: 14ch;
}
.contact__body {
  color: var(--fg-muted);
  font-size: var(--t-lead);
  max-width: 48ch;
  margin-top: var(--s-3);
}

.magnet {
  display: inline-block;
  margin-top: var(--s-5);
  font-size: clamp(1.5rem, 5.5vw, 4rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  word-break: break-word;
  position: relative;
}
.magnet span {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  transition: background-size .55s var(--ease);
  padding-bottom: .06em;
}
.magnet:hover span { background-size: 100% 2px; }

.contact__links {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  margin-top: var(--s-6);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.contact__links a {
  font-family: var(--mono); font-size: var(--t-sm);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-muted);
  display: inline-flex; align-items: center; gap: .5rem;
  transition: color var(--dur-fast) var(--ease);
}
.contact__links a::after {
  content: '↗'; color: var(--accent);
  transition: transform var(--dur-fast) var(--ease);
}
.contact__links a:hover { color: var(--fg); }
.contact__links a:hover::after { transform: translate(2px, -2px); }

/* ------------------------------------------------------------------- FOOT */
.foot {
  max-width: var(--maxw); margin-inline: auto;
  padding: var(--s-4) var(--gutter) var(--s-5);
  display: flex; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap;
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim);
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------ RESPONSIVE */
@media (max-width: 1024px) {
  .about__grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .about__side { display: grid; grid-template-columns: minmax(0, 240px) 1fr; gap: var(--s-4); align-items: start; }
  .stats { margin-top: 0; }
}

@media (max-width: 1024px) {
  .bento__card[data-size="sm"] { grid-column: span 3; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .bento__card[data-size="md"] { grid-column: span 6; }
  .work__item { grid-template-columns: 1fr auto; align-items: start; }
  .work__year { grid-row: 1; grid-column: 1; }
  .work__main { grid-column: 1 / -1; }
  .work__arrow { grid-row: 1; grid-column: 2; }
}

@media (max-width: 560px) {
  /* Portrait sits above a 3-up stat row rather than stacking everything, which
     is what was leaving a tall empty gap under the image. */
  .about__side { grid-template-columns: 1fr; gap: var(--s-3); }
  .about__portrait { max-width: 260px; aspect-ratio: 1 / 1; }
  .bento__card[data-size="sm"] { grid-column: span 6; }
  .hero__foot { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  .stats { grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
  .stats > div { padding-top: var(--s-1); }
  .stats dt { font-size: 1.625rem; }
  .stats dd { font-size: 10px; letter-spacing: .08em; }
}

/* ------------------------------------------------- REDUCED MOTION / PRINT */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .grain { animation: none; }
  .about__copy .split-word { color: var(--fg) !important; }
  .hero__video { display: none; }
}

@media print {
  .grain, .loader, .nav, .menu, .progress, .hero__media { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 1rem 0; }
}
