/* ==========================================================================
   divakar.dev — design system
   Graphite + Signal Lime. Single accent, hairline borders, no gradient soup.
   Colour ramps derived in OKLCH; hex declared first as a fallback.
   Legacy pages (full.html, portfolio_edit.html) keep using style.css.
   ========================================================================== */

/* ---------------------------------------------------------- 1. tokens ---- */
:root {
  color-scheme: dark;

  /* --- accent: used sparingly. CTAs, active state, focus, micro-labels. --- */
  --accent: #d4f34a;
  --accent: oklch(0.90 0.176 118);
  --accent-hi: #e2ff6b;
  --accent-hi: oklch(0.94 0.176 118);
  --accent-ink: #10130a;
  /* text that sits ON the accent */
  --accent-ink: oklch(0.18 0.03 118);
  --accent-text: var(--accent);
  /* accent used AS text */
  --accent-soft: rgba(212, 243, 74, .13);
  --accent-line: rgba(212, 243, 74, .34);

  /* --- neutral ramp --- */
  --bg: #09090a;
  --bg: oklch(0.145 0.003 285);
  --bg-soft: #0e0e10;
  --bg-soft: oklch(0.178 0.004 285);
  --surface: #131316;
  --surface: oklch(0.205 0.004 285);
  --surface-2: #1b1b1f;
  --surface-2: oklch(0.245 0.005 285);
  --surface-3: #232328;
  --surface-3: oklch(0.285 0.006 285);

  --border: rgba(255, 255, 255, .08);
  --border-mid: rgba(255, 255, 255, .14);
  --border-hi: rgba(255, 255, 255, .22);

  --text: #fafafa;
  --text: oklch(0.985 0 0);
  --text-mid: #a5a5ad;
  --text-mid: oklch(0.735 0.004 285);
  --text-dim: #808084;
  /* AA (4.5:1) on both bg and surface */
  --text-dim: oklch(0.60 0.006 285);

  --ok: #7fdba0;
  --warn: #f0b866;
  --bad: #f08a8a;

  /* --- elevation: hairline + soft shadow, never glow --- */
  --line: inset 0 0 0 1px var(--border);
  --line-mid: inset 0 0 0 1px var(--border-mid);
  --top-light: inset 0 1px 0 0 rgba(255, 255, 255, .06);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --sh-md: 0 8px 24px -10px rgba(0, 0, 0, .7);
  --sh-lg: 0 28px 60px -24px rgba(0, 0, 0, .85);

  /* --- geometry --- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* --- rhythm --- */
  --shell: 1200px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);

  /* --- type --- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Inter Tight", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* --- motion: short and decisive --- */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-soft: cubic-bezier(.32, .72, 0, 1);
  --t-fast: .16s;
  --t: .24s;
  --t-slow: .5s;
}

[data-theme="light"] {
  color-scheme: light;

  --accent: #cbe94a;
  --accent: oklch(0.875 0.168 118);
  --accent-hi: #bcdb35;
  --accent-hi: oklch(0.835 0.176 118);
  --accent-ink: #14180a;
  --accent-ink: oklch(0.20 0.03 118);
  --accent-text: #5f7a1e;
  /* AA on white */
  --accent-text: oklch(0.545 0.128 120);
  --accent-soft: rgba(151, 181, 40, .16);
  --accent-line: rgba(120, 148, 26, .38);

  --bg: #fbfbfa;
  --bg: oklch(0.985 0.002 110);
  --bg-soft: #ffffff;
  --bg-soft: oklch(1 0 0);
  --surface: #ffffff;
  --surface: oklch(1 0 0);
  --surface-2: #f4f4f3;
  --surface-2: oklch(0.965 0.002 110);
  --surface-3: #eaeae8;
  --surface-3: oklch(0.935 0.003 110);

  --border: rgba(10, 10, 11, .10);
  --border-mid: rgba(10, 10, 11, .16);
  --border-hi: rgba(10, 10, 11, .26);

  --text: #131315;
  --text: oklch(0.205 0.003 285);
  --text-mid: #55555d;
  --text-mid: oklch(0.445 0.006 285);
  --text-dim: #6b6b70;
  /* AA (4.5:1) on both bg and surface */
  --text-dim: oklch(0.53 0.007 285);

  --ok: #1f7a45;
  --warn: #96601a;
  --bad: #a52c2c;

  --top-light: inset 0 1px 0 0 rgba(255, 255, 255, .9);
  --sh-sm: 0 1px 2px rgba(16, 18, 24, .06);
  --sh-md: 0 10px 28px -14px rgba(16, 18, 24, .22);
  --sh-lg: 0 30px 60px -28px rgba(16, 18, 24, .26);
}

/* ------------------------------------------------------------ 2. base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.011em;
  font-feature-settings: "cv11", "ss01";
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* very subtle grain — adds depth without a single gradient blob */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="light"] body::after {
  opacity: .022;
}

img,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.035em;
  margin: 0 0 .6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5.8vw, 4.1rem);
  letter-spacing: -.045em;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.85rem);
  letter-spacing: -.04em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  letter-spacing: -.03em;
}

h4 {
  font-size: 1.06rem;
  letter-spacing: -.022em;
  font-weight: 550;
}

p {
  margin: 0 0 1.05em;
  color: var(--text-mid);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

code {
  font-family: var(--font-mono);
  font-size: .9em;
}

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

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

/* scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: var(--r-pill);
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hi);
}

/* ---------------------------------------------------------- 3. layout ---- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 2;
}

.shell--wide {
  max-width: 1400px;
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--tight {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section--top {
  padding-top: clamp(7rem, 11vw, 9.5rem);
}

.section-head {
  max-width: 700px;
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head p {
  font-size: 1.02rem;
}

/* micro-label — the main place the accent shows up in body copy */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* two-tone headline: second line recedes but keeps presence at display size */
.grad-text {
  color: var(--text-mid);
}

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

.lede {
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  color: var(--text-mid);
}

.rule {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 0;
}

/* --------------------------------------------------------- 4. buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .78rem 1.35rem;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font: 550 .9rem/1 var(--font-sans);
  letter-spacing: -.012em;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast);
}

.btn:hover {
  background: var(--accent-hi);
}

.btn:active {
  transform: scale(.985);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  box-shadow: var(--line-mid);
}

.btn--ghost:hover {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border-hi);
}

.btn--sm {
  padding: .55rem 1rem;
  font-size: .84rem;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 500;
  font-size: .9rem;
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), color var(--t);
}

.link-arrow:hover {
  border-bottom-color: var(--accent-line);
  color: var(--accent-text);
}

.link-arrow svg {
  width: 14px;
  height: 14px;
  transition: transform var(--t) var(--ease);
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ------------------------------------------------------------- 5. nav ---- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  padding-block: .95rem;
  border-bottom: 1px solid transparent;
  transition: padding var(--t) var(--ease), background var(--t), border-color var(--t);
}

.nav.is-stuck {
  padding-block: .55rem;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.04em;
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: .1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  display: block;
  padding: .45rem .8rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 450;
  color: var(--text-dim);
  transition: color var(--t-fast), background var(--t-fast);
}

.nav__links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav__links .is-active a {
  color: var(--text);
}

.nav__links .is-active {
  position: relative;
}

.nav__links .is-active::after {
  content: "";
  position: absolute;
  left: .8rem;
  right: .8rem;
  bottom: -.1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: var(--line);
  color: var(--text-mid);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.icon-btn:hover {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--line-mid);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.theme-toggle .sun {
  display: none;
}

[data-theme="light"] .theme-toggle .sun {
  display: block;
}

[data-theme="light"] .theme-toggle .moon {
  display: none;
}

.nav__burger {
  display: none;
}

@media (max-width: 940px) {

  .nav__links,
  .nav__actions .btn {
    display: none;
  }

  .nav__burger {
    display: grid;
  }

  /* 44px minimum touch target (WCAG 2.5.5) — the burger and theme toggle
     are the only controls in the header on mobile */
  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .icon-btn svg {
    width: 19px;
    height: 19px;
  }

  .drawer {
    position: fixed;
    inset: 0;
    z-index: 99;
    display: grid;
    align-content: start;
    gap: 0;
    padding: 6rem var(--gutter) 2.5rem;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t) var(--ease), visibility var(--t);
  }

  .drawer.is-open {
    opacity: 1;
    visibility: visible;
  }

  /* :not(.btn) matters — `.drawer a` (0,1,1) outranks `.btn` (0,1,0), so
     without it the drawer's `padding: .7rem 0` and `color: var(--text)`
     win over the button's own padding and ink colour, and the label
     spills out of the pill. */
  .drawer a:not(.btn) {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -.04em;
    padding: .7rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }

  .drawer .btn {
    margin-top: 1.75rem;
    justify-self: start;
    padding: .85rem 1.6rem;
    font-size: .95rem;
  }
}

@media (min-width: 941px) {
  .drawer {
    display: none;
  }
}

/* ------------------------------------------------------------ 6. hero ---- */
.hero {
  position: relative;
  padding-block: clamp(7.5rem, 14vw, 10rem) clamp(3.5rem, 7vw, 6rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

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

  /* the portrait leads on the home hero only. `.hero__art` is reused inside
     a plain .grid--2 on /about, where hoisting a decorative illustration
     above the page's h1 buries the heading. */
  .hero__grid .hero__art {
    order: -1;
  }

  .hero__art {
    max-width: 320px;
    margin-inline: auto;
  }

  /* the diagram carries 9.5px labels — 320px would shrink them to ~7px */
  .hero__art--diagram {
    max-width: 420px;
  }
}

.hero h1 {
  margin-bottom: 1.15rem;
}

.hero h1 .line {
  display: block;
}

.hero__sub {
  max-width: 54ch;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.9rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem .8rem .35rem .55rem;
  border-radius: var(--r-pill);
  box-shadow: var(--line);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .01em;
  color: var(--text-mid);
  margin-bottom: 1.5rem;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-line);
  animation: pulse 2.6s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(212, 243, 74, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(212, 243, 74, 0);
  }
}

.hero__art {
  position: relative;
}

.hero__art-frame {
  position: relative;
  border-radius: var(--r-xl);
  padding: clamp(.9rem, 2vw, 1.4rem);
  background: var(--surface);
  box-shadow: var(--line), var(--top-light), var(--sh-md);
  overflow: hidden;
}

/* soft accent bloom behind the subject — the one place the lime is allowed
   to be atmospheric rather than functional */
.hero__art-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(62% 48% at 50% 14%, var(--accent-soft), transparent 72%);
}

.hero__art img {
  border-radius: var(--r-md);
  width: 100%;
  position: relative;
}

/* Bleed variant: the portrait fills the card instead of floating inside an
   inset, so only the top keeps a gap. The frame already clips to its own
   radius via overflow:hidden, so the image drops its corner rounding.
   Scoped as a modifier because the About page reuses this frame for the
   stack diagram, which needs its padding. */
.hero__art-frame--bleed {
  padding: 45px 0 0;
}

.hero__art-frame--bleed img {
  border-radius: 0;
}

/* Duotone cut-out of the studio headshot. The subject is light (pale blazer,
   white shirt), so it carries itself on the dark card — blazer 211 vs a card
   of 19. Light mode is the harder case there, hence the correction below:
   untreated, the blazer sits 44 points off pure white. */
.art--portrait {
  -webkit-mask-image: linear-gradient(to bottom, #000 74%, rgba(0, 0, 0, .38) 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 74%, rgba(0, 0, 0, .38) 90%, transparent 100%);
}

[data-theme="light"] .art--portrait {
  filter: brightness(.90) contrast(1.12);
}

/* --- artwork authored for light backgrounds -------------------------------
   Black line-art on a transparent background vanishes on graphite, so it is
   inverted for dark and left alone for light.                              */
.art {
  display: block;
  width: 100%;
}

:root:not([data-theme="light"]) .art--line {
  filter: invert(1);
  opacity: .94;
}

/* --- stack diagram (templates/partials/stack_diagram.html) ----------------
   Theme-native rather than theme-corrected: every stroke is currentColor and
   every highlight is var(--accent), so both themes fall out of the cascade
   with no filters and no second asset. */
.stackviz {
  color: var(--text);
  line-height: 0;
}

.stackviz svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.sv-grid {
  opacity: .10;
}

.sv-plate {
  fill: var(--surface-2);
  stroke: currentColor;
  stroke-opacity: .14;
  stroke-width: 1.25;
}

.sv-hair {
  stroke: currentColor;
  stroke-opacity: .14;
  stroke-width: 1.25;
}

.sv-chip {
  fill: currentColor;
  opacity: .22;
}

.sv-block {
  fill: currentColor;
  opacity: .13;
}

.sv-stroke {
  stroke: currentColor;
  stroke-opacity: .42;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sv-accent {
  fill: var(--accent);
}

.sv-label {
  fill: var(--text-mid);
  font: 500 13px/1 var(--font-mono);
  letter-spacing: .1em;
}

.sv-label--sm {
  font-size: 9.5px;
  letter-spacing: .14em;
  fill: var(--text-dim);
}

.sv-link {
  stroke: currentColor;
  stroke-opacity: .18;
  stroke-width: 1.5;
  fill: none;
}

.sv-flow {
  stroke: var(--accent);
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 16 150;
  animation: sv-flow 2.8s linear infinite;
}

@keyframes sv-flow {
  to {
    stroke-dashoffset: -166;
  }
}

.sv-layer {
  animation: sv-drift 7s var(--ease-soft) infinite;
}

.sv-layer--a {
  animation-delay: 0s;
}

.sv-layer--b {
  animation-delay: -1.6s;
}

.sv-layer--c {
  animation-delay: -3.2s;
}

.sv-layer--d {
  animation-delay: -4.6s;
}

@keyframes sv-drift {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.sv-orb {
  fill: var(--accent);
  animation: sv-orb 4.5s ease-in-out infinite;
}

@keyframes sv-orb {

  0%,
  100% {
    opacity: .18;
  }

  50% {
    opacity: .75;
  }
}

/* --------------------------------------------------------- 7. marquee ---- */
.marquee {
  position: relative;
  overflow: hidden;
  padding-block: 1.15rem;
  border-block: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  gap: 2.75rem;
  animation: slide 48s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 2.75rem;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color var(--t);
}

.marquee__item::after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-hi);
}

.marquee:hover .marquee__item {
  color: var(--text);
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

/* ----------------------------------------------------------- 8. cards ---- */
.card {
  position: relative;
  padding: clamp(1.3rem, 2.4vw, 1.75rem);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--line), var(--top-light);
  overflow: hidden;
  transition: box-shadow var(--t) var(--ease), background var(--t), transform var(--t) var(--ease);
}

.card::before {
  /* neutral cursor spotlight, --mx/--my set in JS */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow);
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .045), transparent 60%);
}

[data-theme="light"] .card::before {
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(10, 10, 11, .035), transparent 60%);
}

.card:hover {
  box-shadow: var(--line-mid), var(--top-light), var(--sh-sm);
}

.card:hover::before {
  opacity: 1;
}

.card__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  margin-bottom: 1rem;
  background: var(--surface-2);
  box-shadow: var(--line);
  color: var(--text);
  font-size: .82rem;
  transition: background var(--t), color var(--t);
}

.card:hover .card__icon {
  background: var(--accent);
  color: var(--accent-ink);
}

.card__icon svg {
  width: 19px;
  height: 19px;
}

.card h3,
.card h4 {
  margin-bottom: .45rem;
}

.card p {
  font-size: .91rem;
  line-height: 1.6;
  margin: 0;
}

.grid {
  display: grid;
  gap: clamp(.9rem, 1.6vw, 1.15rem);
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 370px), 1fr));
}

.bento {
  display: grid;
  gap: clamp(.9rem, 1.6vw, 1.15rem);
  grid-template-columns: repeat(6, 1fr);
}

.bento>* {
  grid-column: span 6;
}

@media (min-width: 760px) {
  .bento>* {
    grid-column: span 3;
  }

  .bento .span-2 {
    grid-column: span 2;
  }

  .bento .span-4 {
    grid-column: span 4;
  }

  .bento .span-6 {
    grid-column: span 6;
  }
}

/* ----------------------------------------------------------- 9. stats ---- */
.stat {
  position: relative;
  padding-left: 1rem;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: .35rem;
  bottom: .35rem;
  width: 2px;
  border-radius: 2px;
  background: var(--border-mid);
}

.stat:first-child::before {
  background: var(--accent);
}

.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  font-weight: 600;
  letter-spacing: -.05em;
  line-height: 1;
  color: var(--text);
}

.stat__label {
  margin-top: .45rem;
  font-size: .84rem;
  color: var(--text-dim);
  letter-spacing: -.005em;
}

/* -------------------------------------------------------- 10. projects --- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1.75rem;
}

.chip {
  padding: .45rem .9rem;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: var(--line);
  color: var(--text-dim);
  font: 450 .83rem/1 var(--font-sans);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.chip:hover {
  color: var(--text);
  background: var(--surface);
}

.chip.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 550;
  box-shadow: none;
}

.search {
  position: relative;
  margin-left: auto;
  min-width: 220px;
  flex: 0 1 280px;
}

.search svg {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-dim);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: .55rem .9rem .55rem 2.3rem;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--line);
  color: var(--text);
  font: 450 .86rem/1.4 var(--font-sans);
}

.search input::placeholder {
  color: var(--text-dim);
}

.search input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent);
}

@media (max-width: 620px) {
  .search {
    margin-left: 0;
    flex-basis: 100%;
  }
}

.work-grid {
  display: grid;
  gap: clamp(.9rem, 1.8vw, 1.25rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.work {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--line), var(--top-light);
  overflow: hidden;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}

.work:hover {
  box-shadow: var(--line-mid), var(--top-light), var(--sh-md);
  transform: translateY(-3px);
}

.work.is-hidden {
  display: none;
}

.work__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--t-slow) var(--ease-soft);
}

.work:hover .work__media img {
  transform: scale(1.04);
}

.work__tag {
  position: absolute;
  left: .7rem;
  bottom: .7rem;
  z-index: 2;
  padding: .26rem .6rem;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--line);
  color: var(--text-mid);
  font: 500 .66rem/1 var(--font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.work__zoom {
  position: absolute;
  top: .7rem;
  right: .7rem;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--line);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t), background var(--t-fast), color var(--t-fast);
}

.work:hover .work__zoom,
.work__zoom:focus-visible {
  opacity: 1;
}

/* touch devices never fire :hover, so the preview button would be
   permanently invisible and the lightbox unreachable on phones */
@media (hover: none) {
  .work__zoom {
    opacity: 1;
  }
}

.work__zoom:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.work__zoom svg {
  width: 14px;
  height: 14px;
}

.work__body {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.15rem 1.2rem;
  flex: 1;
}

.work__body h3 {
  font-size: .99rem;
  font-weight: 550;
  letter-spacing: -.022em;
  margin: 0 0 .35rem;
  line-height: 1.35;
}

.work__body p {
  font-size: .855rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.work__link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .85rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: color var(--t-fast);
}

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

.work__link svg {
  width: 12px;
  height: 12px;
  transition: transform var(--t) var(--ease);
}

.work__link:hover svg {
  transform: translate(2px, -2px);
}

.work-empty {
  display: none;
  padding: 4rem 1rem;
  text-align: center;
  color: var(--text-dim);
}

.work-empty.is-shown {
  display: block;
}

/* --------------------------------------------------------- 11. skills ---- */
.skill+.skill {
  margin-top: 1.05rem;
}

.skill__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .45rem;
}

.skill__top h4 {
  margin: 0;
  font-size: .89rem;
  font-weight: 450;
  font-family: var(--font-sans);
  letter-spacing: -.01em;
}

.skill__top span {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--text-dim);
}

.skill__bar {
  height: 3px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.skill__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 1s var(--ease-soft);
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .5rem;
  bottom: .5rem;
  width: 1px;
  background: var(--border-mid);
}

.timeline__item {
  position: relative;
  padding-bottom: 1.7rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: .45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1.5px var(--border-hi);
}

.timeline__item:first-child::before {
  background: var(--accent);
  box-shadow: none;
}

.timeline__when {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-dim);
  letter-spacing: .05em;
}

.timeline__item h4 {
  margin: .3rem 0 .2rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
}

.timeline__item p {
  font-size: .87rem;
  margin: 0;
}

/* ---------------------------------------------------------- 12. forms ---- */
.field {
  margin-bottom: .9rem;
}

.field label {
  display: block;
  margin-bottom: .35rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-mid);
  letter-spacing: -.005em;
}

.input,
.textarea {
  width: 100%;
  padding: .78rem 1rem;
  border: 0;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  box-shadow: var(--line-mid);
  color: var(--text);
  font: 450 .91rem/1.5 var(--font-sans);
  transition: box-shadow var(--t-fast), background var(--t-fast);
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-dim);
}

.input:focus,
.textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 .9rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

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

.alert {
  padding: .75rem 1rem;
  border-radius: var(--r-md);
  font-size: .87rem;
  margin-bottom: .9rem;
  box-shadow: var(--line);
  background: var(--surface-2);
}

.alert.success,
.alert.info {
  color: var(--ok);
}

.alert.error {
  color: var(--bad);
}

.panel {
  max-width: 440px;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--line), var(--top-light), var(--sh-md);
}

.panel h1 {
  font-size: clamp(1.65rem, 3.2vw, 2.05rem);
  margin-bottom: .35rem;
}

.panel .muted {
  font-size: .88rem;
}

.panel-foot {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: .86rem;
  color: var(--text-dim);
  text-align: center;
}

.panel-foot a {
  color: var(--accent-text);
  font-weight: 500;
}

/* ------------------------------------------------------------ 13. cta ---- */
.cta {
  position: relative;
  padding: clamp(2.5rem, 5.5vw, 4rem);
  border-radius: var(--r-xl);
  overflow: hidden;
  text-align: center;
  background: var(--surface);
  box-shadow: var(--line), var(--top-light);
}

.cta::before {
  /* single hairline accent arc at the top edge */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 70%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.cta h2 {
  margin-bottom: .7rem;
}

.cta p {
  max-width: 52ch;
  margin-inline: auto;
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: center;
  margin-top: 1.9rem;
}

.contact-split {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}

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

.contact-cards {
  display: grid;
  gap: .75rem;
}

.contact-card {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  padding: 1.05rem 1.15rem;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--line);
  transition: box-shadow var(--t);
}

.contact-card:hover {
  box-shadow: var(--line-mid);
}

.contact-card .card__icon {
  margin: 0;
  width: 36px;
  height: 36px;
  flex: none;
}

.contact-card:hover .card__icon {
  background: var(--surface-2);
  color: var(--text);
}

.contact-card h4 {
  margin: 0 0 .1rem;
  font-size: .92rem;
  font-family: var(--font-sans);
  font-weight: 550;
}

.contact-card p {
  font-size: .845rem;
  color: var(--text-dim);
  margin: 0;
}

.contact-card a {
  color: var(--text-mid);
  transition: color var(--t-fast);
}

.contact-card a:hover {
  color: var(--accent-text);
}

.map-frame {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--line);
  line-height: 0;
}

.map-frame iframe {
  width: 100%;
  height: 400px;
  border: 0;
  filter: grayscale(1) contrast(1.05);
}

:root:not([data-theme="light"]) .map-frame iframe {
  filter: grayscale(1) invert(.93) contrast(.85);
}

/* ------------------------------------------------------ 14. newsletter --- */
.newsletter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.6rem, 3.5vw, 2.5rem);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--line), var(--top-light);
}

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

.newsletter h3 {
  margin-bottom: .3rem;
}

.newsletter p {
  font-size: .9rem;
  margin: 0;
}

.subscribe-block {
  min-width: min(100%, 380px);
}

.subscribe-row {
  display: flex;
  gap: .5rem;
}

.subscribe-row .input {
  flex: 1;
}

@media (max-width: 460px) {
  .subscribe-row {
    flex-direction: column;
  }
}

.form-note {
  min-height: 1.15rem;
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--accent-text);
}

/* ---------------------------------------------------------- 15. footer --- */
.footer {
  margin-top: var(--section-y);
  padding-top: clamp(3rem, 6vw, 4rem);
  border-top: 1px solid var(--border);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, minmax(0, .75fr)) 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

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

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

.footer h5 {
  font-family: var(--font-mono);
  font-size: .69rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .9rem;
  font-weight: 500;
}

.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.footer__list a,
.footer__list li {
  font-size: .875rem;
  color: var(--text-mid);
}

.footer__list a {
  transition: color var(--t-fast);
}

.footer__list a:hover {
  color: var(--text);
}

.footer__blurb {
  font-size: .875rem;
  max-width: 33ch;
  margin-top: .9rem;
}

.socials {
  display: flex;
  gap: .4rem;
  margin-top: 1.1rem;
}

.socials a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  box-shadow: var(--line);
  color: var(--text-dim);
  transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.socials a:hover {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--line-mid);
}

.socials svg {
  width: 16px;
  height: 16px;
}

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.4rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-dim);
}

.footer__bar a {
  transition: color var(--t-fast);
}

.footer__bar a:hover {
  color: var(--text);
}

.visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .75rem;
  border-radius: var(--r-pill);
  box-shadow: var(--line);
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--text-dim);
}

.visitor-badge b {
  color: var(--text);
  font-weight: 500;
}

/* -------------------------------------------------------- 16. lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 80vh;
  width: auto;
  border-radius: var(--r-md);
  box-shadow: var(--line-mid), var(--sh-lg);
  transform: scale(.985);
  transition: transform var(--t) var(--ease);
}

.lightbox.is-open img {
  transform: scale(1);
}

.lightbox__cap {
  margin-top: .9rem;
  text-align: center;
  color: var(--text-mid);
  font-size: .87rem;
}

.lightbox__close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast);
}

.lightbox__close:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* --------------------------------------------------------- 17. reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s var(--ease-soft), transform .55s var(--ease-soft);
  transition-delay: var(--delay, 0ms);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.scroll-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 90;
  background: var(--surface);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t), transform var(--t) var(--ease), visibility var(--t);
}

.scroll-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ------------------------------------------------------ 18. utilities ---- */
.muted {
  color: var(--text-dim);
}

.center {
  text-align: center;
}

.mt-1 {
  margin-top: .5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2.2rem;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.stack--center {
  justify-content: center;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .9rem;
}

.tag {
  padding: .24rem .55rem;
  border-radius: var(--r-xs);
  box-shadow: var(--line);
  font: 450 .715rem/1.4 var(--font-mono);
  color: var(--text-dim);
  letter-spacing: .015em;
}

/* Logo row.
   The four source logos were a mix of transparent PNG, white-boxed and
   black-boxed raster, at wildly different aspect ratios — nothing rendered
   consistently. They are pre-processed into white-on-transparent silhouettes,
   optically weighted to equal ink area and centred on one shared 360x132
   canvas (media/img/brands/mono/). Because every file now has identical
   dimensions, the cells need no per-logo sizing and one filter serves both
   themes. */
.logo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--line);
}

.logo-row div {
  display: grid;
  place-items: center;
  padding: 1.1rem .9rem;
  background: var(--bg);
  transition: background var(--t);
}

.logo-row div:hover {
  background: var(--surface);
}

.logo-row img {
  width: 100%;
  max-width: 128px;
  height: auto;
  opacity: .5;
  transition: opacity var(--t);
}

.logo-row div:hover img {
  opacity: .95;
}

/* silhouettes ship white; flip them to ink for the light theme */
[data-theme="light"] .logo-row img {
  filter: invert(1);
  opacity: .55;
}

[data-theme="light"] .logo-row div:hover img {
  opacity: 1;
}

/* ----------------------------------------------------- 19. small screens - */
/* On a 375x667 viewport the desktop rhythm eats the fold: --section-y floors
   at 72px and .section--top at 112px (17% of the screen) under a ~60px fixed
   nav, and a 40px h1 pushes long headings like the /about one past 6 lines. */
@media (max-width: 560px) {
  :root {
    --section-y: clamp(3.25rem, 12vw, 4.5rem);
  }

  .section--top {
    padding-top: 5.5rem;
  }

  .section-head {
    margin-bottom: 2rem;
  }

  h1 {
    font-size: clamp(2.1rem, 8.5vw, 2.6rem);
    letter-spacing: -.035em;
  }

  h2 {
    font-size: clamp(1.7rem, 6.5vw, 2.1rem);
  }

  .hero {
    padding-block: 6.5rem 3rem;
  }

  .cta {
    padding: 2rem 1.35rem;
  }

  .panel {
    padding: 1.5rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------ 20. print -- */
@media print {

  .nav,
  .footer,
  .scroll-top,
  .lightbox,
  .marquee,
  .drawer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  body::after {
    display: none;
  }
}