/* ==========================================================================
   Kushal Ghimire — design system
   Premium · minimal · technical. No framework, no build step.

   1. Tokens
   2. Reset & base
   3. Layout primitives
   4. Typography
   5. Buttons & controls
   6. Header & navigation
   7. Hero
   8. Sections & cards
   9. Timeline, skills, lab
  10. Forms
  11. Footer
  12. Utilities, motion, print
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  /* Dark is the default identity of the site.
     Midnight / Surface / White / Gray / Electric Blue / Bright Blue.
     Contrast on Midnight: White 18.8, Gray 7.7, Electric 5.4, Bright 7.7 — all AA. */
  --bg:            #080b12;   /* Midnight — main background */
  --bg-raised:     #0c111c;   /* derived lift between bg and surface */
  --surface:       #111827;   /* Surface — cards / sections */
  --surface-hover: #172033;
  --line:          rgba(148, 163, 184, .14);
  --line-strong:   rgba(148, 163, 184, .26);

  --text:          #f8fafc;   /* White — main text */
  --text-soft:     #94a3b8;   /* Gray — secondary text */
  --text-muted:    #7c8ca5;   /* derived tertiary, still AA (5.8) */

  --accent:        #3b82f6;   /* Electric Blue — links, borders, accents */
  --accent-hover:  #60a5fa;   /* Bright Blue — hover / highlights */
  --accent-soft:   rgba(59, 130, 246, .14);
  --accent-line:   rgba(59, 130, 246, .34);
  --accent-text:   #60a5fa;   /* Bright Blue reads better as text (7.7) */

  /* Button fills need white text to pass AA, and #3b82f6 only reaches 3.7.
     One shade deeper gets 5.2 while staying in the same blue family. */
  --accent-solid:       #2563eb;
  --accent-solid-hover: #2e6fdd;

  --ok:            #3fb27f;
  --warn:          #e0a33c;
  --error:         #f2555a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, .7);
  --shadow-lg: 0 32px 64px -24px rgba(0, 0, 0, .8);

  /* Fluid type scale — 320px to 1280px viewport */
  --step--1: clamp(.8125rem, .79rem + .11vw, .875rem);
  --step-0:  clamp(.9375rem, .91rem + .14vw, 1rem);
  --step-1:  clamp(1.0625rem, 1.01rem + .27vw, 1.25rem);
  --step-2:  clamp(1.25rem, 1.14rem + .55vw, 1.625rem);
  --step-3:  clamp(1.5rem, 1.26rem + 1.2vw, 2.25rem);
  --step-4:  clamp(1.875rem, 1.4rem + 2.4vw, 3.25rem);
  --step-5:  clamp(2.375rem, 1.4rem + 4.9vw, 4.75rem);

  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 3rem;    --sp-8: 4rem;
  --sp-9: 6rem;    --sp-10: 8rem;

  --r-sm: 8px;  --r-md: 12px;  --r-lg: 18px;  --r-xl: 26px;  --r-full: 999px;

  --shell: 1180px;
  --shell-narrow: 760px;
  --header-h: 68px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .28s;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: dark;
}

:root[data-theme="light"] {
  /* Same family, shifted for a white ground. Gray #94a3b8 is only 2.6 on
     white, so secondary text steps down to slate-600. */
  --bg:            #ffffff;
  --bg-raised:     #f8fafc;
  --surface:       #f1f5f9;
  --surface-hover: #e2e8f0;
  --line:          rgba(15, 23, 42, .10);
  --line-strong:   rgba(15, 23, 42, .20);

  --text:          #0f172a;
  --text-soft:     #475569;
  --text-muted:    #64748b;

  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-soft:   rgba(37, 99, 235, .09);
  --accent-line:   rgba(37, 99, 235, .28);
  --accent-text:   #1d4ed8;

  --accent-solid:       #2563eb;
  --accent-solid-hover: #1d4ed8;

  --shadow-sm: 0 1px 2px rgba(9, 9, 11, .06);
  --shadow-md: 0 12px 28px -14px rgba(9, 9, 11, .18);
  --shadow-lg: 0 30px 60px -28px rgba(9, 9, 11, .24);

  color-scheme: light;
}

/* 2. Reset & base ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

body.nav-open { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

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

button, input, textarea, select { font: inherit; color: inherit; }

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

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

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--sp-4);
  z-index: 200;
  padding: .7rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* 3. Layout primitives ------------------------------------------------------ */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}

.shell-narrow { max-width: var(--shell-narrow); }

/* Every page keeps the same .shell so the left edge never shifts between
   sections; content that wants a shorter line length caps itself instead. */
.about-measure { max-width: var(--shell-narrow); }

.section { padding-block: clamp(3.5rem, 9vw, var(--sp-9)); }
.section-tight { padding-block: clamp(2.5rem, 6vw, var(--sp-8)); }
.section + .section { padding-top: 0; }

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
}

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }

/* 4. Typography ------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.028em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -.018em; }
h4 { font-size: var(--step-0); letter-spacing: -.012em; }

p { text-wrap: pretty; }

.display {
  font-size: var(--step-5);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.042em;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 62ch;
}

.muted { color: var(--text-muted); }
.soft  { color: var(--text-soft); }

.mono {
  font-family: var(--font-mono);
  font-size: .82em;
  letter-spacing: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.section-head > div { max-width: 62ch; }
.section-head h2 { margin-top: .6rem; }
.section-head p  { margin-top: .75rem; color: var(--text-soft); }

.page-head {
  padding-top: clamp(3rem, 8vw, 5.5rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
}
.page-head h1 { margin-top: .8rem; }
.page-head .lede { margin-top: 1.1rem; }

.prose p + p { margin-top: 1.05em; }
.prose h2,
.prose h3 { margin-top: 2.2em; margin-bottom: .6em; }
.prose .prose-sub { font-size: var(--step-1); letter-spacing: -.018em; }
.prose ul { margin: 1em 0; padding-left: 1.15rem; }
.prose li { margin-block: .4em; color: var(--text-soft); }
.prose li::marker { color: var(--accent); }
.prose a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-line);
}
.prose a:hover { text-decoration-color: currentColor; }

/* 5. Buttons & controls ----------------------------------------------------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.35rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-full);
  font-size: var(--step-0);
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease),
              color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --btn-bg: var(--accent-solid);
  --btn-fg: #fff;
  --btn-bd: var(--accent-solid);
  box-shadow: 0 6px 20px -8px var(--accent);
}
.btn-primary:hover { --btn-bg: var(--accent-solid-hover); --btn-bd: var(--accent-solid-hover); }

.btn-ghost:hover { --btn-bg: var(--surface-hover); --btn-bd: var(--line-strong); }

.btn-sm { padding: .5rem 1rem; font-size: var(--step--1); }

.btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  cursor: pointer;
  color: var(--text-soft);
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
.icon-btn svg {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 1.7; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Only one theme glyph at a time: the sun means "switch to light". */
#themeToggle .icon-sun,
#themeToggle .icon-moon { grid-area: 1 / 1; }
:root[data-theme="dark"]  #themeToggle .icon-moon { display: none; }
:root[data-theme="light"] #themeToggle .icon-sun  { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .02em;
  color: var(--text-soft);
  white-space: nowrap;
}
.pill-accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(63, 178, 127, .18);
}
.dot-live { animation: pulse 2.4s var(--ease) infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(63, 178, 127, .18); }
  50%      { box-shadow: 0 0 0 6px rgba(63, 178, 127, 0); }
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 550;
  color: var(--text);
}
.arrow-link svg {
  width: 16px; height: 16px;
  stroke: currentColor; stroke-width: 1.9; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .22s var(--ease);
}
.arrow-link:hover { color: var(--accent-text); }
.arrow-link:hover svg { transform: translateX(3px); }

/* 6. Header & navigation ---------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: .65rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent-solid), var(--accent-hover));
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 600; letter-spacing: -.02em; font-size: .95rem; }
.brand-role { font-size: .72rem; color: var(--text-muted); }

.nav-desktop { display: none; gap: .1rem; }
.nav-link {
  position: relative;
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.is-current { color: var(--text); }
.nav-link.is-current::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: .05rem;
  translate: -50% 0;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-cta { display: none; }

.scroll-progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width .1s linear;
}

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 99;
  background: var(--bg);
  overflow-y: auto;
  animation: fadeIn .22s var(--ease);
}
.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5) clamp(1.15rem, 4vw, 2.5rem) var(--sp-8);
}
.mobile-link {
  padding: .95rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--step-2);
  font-weight: 550;
  letter-spacing: -.025em;
  color: var(--text-soft);
  transition: color .18s var(--ease), padding-left .18s var(--ease);
}
.mobile-link:hover, .mobile-link.is-current { color: var(--text); padding-left: .4rem; }
.mobile-cta { margin-top: var(--sp-5); align-self: flex-start; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .nav-toggle  { display: none; }
  .header-cta  { display: inline-flex; }
  .mobile-nav  { display: none !important; }
}

/* 7. Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(3.5rem, 11vw, 7rem);
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -35%;
  left: 50%;
  translate: -50% 0;
  width: min(1100px, 130vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 62%);
  pointer-events: none;
  z-index: -1;
}
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 72%);
  opacity: .5;
  pointer-events: none;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem .85rem .35rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: var(--step--1);
  color: var(--text-soft);
}

.hero h1 { margin-top: var(--sp-5); }
.hero-role {
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: clamp(.82rem, .6rem + .6vw, 1rem);
  letter-spacing: .02em;
  color: var(--accent-text);
}
.hero-lede { margin-top: var(--sp-4); }
.hero-actions { margin-top: var(--sp-6); }

.credibility {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.4rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.credibility span { display: inline-flex; align-items: center; gap: 1.4rem; }
.credibility span:not(:last-child)::after {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* 8. Sections & cards --------------------------------------------------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color .25s var(--ease), background-color .25s var(--ease),
              transform .25s var(--ease), box-shadow .25s var(--ease);
}
a.card:hover, .card-interactive:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Project card */
.project-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .25s var(--ease), background-color .25s var(--ease),
              transform .25s var(--ease), box-shadow .25s var(--ease);
}
.project-card:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.project-card:hover .project-thumb-inner { transform: scale(1.04); }
.project-card:hover .project-title { color: var(--accent-text); }

.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
}
.project-kicker {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.project-title {
  margin-top: .5rem;
  font-size: var(--step-2);
  transition: color .2s var(--ease);
}
.project-summary { margin-top: .6rem; color: var(--text-soft); max-width: 58ch; }

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface);
}
.project-thumb-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 55%),
    linear-gradient(150deg, var(--surface), var(--bg-raised));
  transition: transform .5s var(--ease);
}
.project-thumb-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;   /* keep the hero, crop the fold */
}
.project-thumb-label {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 3vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--text-muted);
}

.stack-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: var(--sp-4); }

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  margin-top: auto;
  padding-top: var(--sp-4);
  font-size: var(--step--1);
  color: var(--text-muted);
}
.project-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1.1rem;
  margin-left: auto;
}
.project-links .arrow-link { font-size: var(--step--1); }

@media (min-width: 760px) {
  .project-card.is-wide { grid-template-columns: 1.05fr .95fr; align-items: center; gap: var(--sp-6); }
  .project-card.is-wide .project-body { min-width: 0; }
}

/* Stat / fact rows */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.fact { padding: var(--sp-5); background: var(--bg-raised); min-width: 0; }
.fact-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* Long values (URLs, email addresses) must wrap rather than clip. */
.fact-value {
  margin-top: .5rem;
  font-size: var(--step-1);
  font-weight: 550;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

/* Currently list */
.currently { display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.currently-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .2rem;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-raised);
  transition: background-color .2s var(--ease);
}
.currently-row:hover { background: var(--surface); }
.currently-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-text);
}
@media (min-width: 640px) {
  .currently-row { grid-template-columns: 140px 1fr; gap: var(--sp-4); align-items: baseline; }
}

/* CTA band */
.cta-band {
  position: relative;
  padding: clamp(2.5rem, 7vw, 4.5rem);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 12% 0%, var(--accent-soft), transparent 55%),
    var(--bg-raised);
  overflow: hidden;
  text-align: center;
}
.cta-band h2 { max-width: 20ch; margin-inline: auto; }
.cta-band p { margin: var(--sp-4) auto 0; max-width: 52ch; color: var(--text-soft); }
.cta-band .btn-row { justify-content: center; margin-top: var(--sp-6); }

/* Filter bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: var(--sp-6);
}
.filter-btn {
  padding: .45rem 1rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--line-strong); }
.filter-btn[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* Case-study page */
.case-hero { padding-top: clamp(2.5rem, 7vw, 4.5rem); }
.back-link {
  /* Block-level so the eyebrow that follows starts on its own line,
     but only as wide as its own text. */
  display: flex;
  width: fit-content;
  align-items: center;
  gap: .4rem;
  font-size: var(--step--1);
  color: var(--text-muted);
  transition: color .18s var(--ease);
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.9;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }

.case-banner {
  aspect-ratio: 16 / 7;
  margin-top: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 25% 15%, var(--accent-soft), transparent 55%),
    linear-gradient(150deg, var(--surface), var(--bg-raised));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.case-banner img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.case-layout { display: grid; gap: var(--sp-7); align-items: start; }
@media (min-width: 940px) {
  .case-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: var(--sp-8); }
  .case-aside { position: sticky; top: calc(var(--header-h) + var(--sp-5)); }
}

.aside-block { padding-block: var(--sp-4); border-top: 1px solid var(--line); }
.aside-block:first-child { border-top: 0; padding-top: 0; }
.aside-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.aside-value { margin-top: .35rem; color: var(--text); overflow-wrap: anywhere; }

.numbered { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.numbered > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-block: var(--sp-4);
}
.numbered > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .1em;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--accent-text);
}
.numbered h3 { font-size: var(--step-0); margin: 0 0 .2rem; }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--sp-4);
}
.shot {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  text-align: center;
  padding: var(--sp-4);
}

/* 9. Timeline, skills, lab ----------------------------------------------------- */

.timeline { position: relative; padding-left: 1.85rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: .6rem; bottom: .6rem;
  width: 1px;
  background: linear-gradient(var(--accent-line), var(--line) 40%, transparent);
}
.tl-item { position: relative; padding-bottom: var(--sp-7); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: .55rem;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.tl-period {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tl-title { margin-top: .35rem; font-size: var(--step-1); }
.tl-org { margin-top: .2rem; color: var(--accent-text); font-size: var(--step--1); }
.tl-points { margin-top: .8rem; padding-left: 1.05rem; }
.tl-points li { margin-block: .35em; color: var(--text-soft); font-size: var(--step-0); }
.tl-points li::marker { color: var(--line-strong); }

.skill-group { padding: var(--sp-5); }
.skill-group h3 { display: flex; align-items: center; gap: .6rem; }
.skill-note { margin-top: .4rem; font-size: var(--step--1); color: var(--text-muted); }
.skill-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: var(--sp-4); }
.skill-chip {
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--step--1);
  color: var(--text-soft);
  transition: all .2s var(--ease);
}
.skill-chip:hover { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }

.lab-item {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left .25s var(--ease);
}
.lab-item:hover { padding-left: .5rem; }
.lab-top { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.lab-item h3 { font-size: var(--step-1); }
.lab-item p { color: var(--text-soft); max-width: 70ch; }

/* Resume — a real document, not a page of stacked cards ------------------ */
.resume-sheet {
  padding: clamp(1.5rem, 4vw, var(--sp-7));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
}

.resume-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-8);
  padding-bottom: var(--sp-5);
  border-bottom: 2px solid var(--text);
}
.resume-name {
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.resume-role {
  margin-top: .35rem;
  font-size: var(--step-0);
  color: var(--accent-text);
}
/* A tidy 2x2 block rather than a run-on line beside the role. */
.resume-contact {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: end;
  gap: .3rem 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  color: var(--text-soft);
  text-align: right;
}
@media (max-width: 620px) {
  .resume-contact { grid-template-columns: 1fr; justify-content: start; text-align: left; }
}
.resume-contact a { transition: color .18s var(--ease); }
.resume-contact a:hover { color: var(--accent-text); }

.resume-grid {
  display: grid;
  gap: var(--sp-6);
  padding-top: var(--sp-6);
}
@media (min-width: 880px) {
  /* Narrative left, reference right — the layout a recruiter expects. */
  .resume-grid {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
    gap: var(--sp-8);
  }
}

.resume-block + .resume-block { margin-top: var(--sp-6); }
.resume-block > h3 {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-4);
}

.resume-entry + .resume-entry { margin-top: var(--sp-5); }
.resume-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .3rem 1rem;
}
.resume-entry-head h4 {
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: -.012em;
}
.resume-entry-head .mono { font-size: .74rem; white-space: nowrap; }

.resume-org {
  margin-top: .15rem;
  font-size: var(--step--1);
  color: var(--accent-text);
}
.resume-points {
  margin: .6rem 0 0;
  padding-left: 1.05rem;
}
.resume-points li {
  margin-block: .3em;
  font-size: var(--step--1);
  color: var(--text-soft);
}
.resume-points li::marker { color: var(--line-strong); }

.resume-project-summary { margin-top: .35rem; font-size: var(--step--1); }
.resume-stack { margin-top: .4rem; font-size: .72rem; }

.resume-aside .resume-block > h3 { margin-bottom: var(--sp-3); }
.resume-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .45rem;
  font-size: var(--step--1);
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.resume-list a { transition: color .18s var(--ease); }
.resume-list a:hover { color: var(--accent-text); }

.resume-skill + .resume-skill { margin-top: var(--sp-4); }
.resume-skill h4 {
  font-size: var(--step--1);
  font-weight: 600;
  margin-bottom: .2rem;
}
.resume-skill p { font-size: .78rem; line-height: 1.55; }

/* One quiet action, after the document rather than before it. */
.resume-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--sp-5);
}

/* 10. Forms --------------------------------------------------------------------- */

.form { display: grid; gap: var(--sp-4); }
.field { display: grid; gap: .45rem; }
.field label { font-size: var(--step--1); font-weight: 550; color: var(--text-soft); }
.field .req { color: var(--accent-text); }

.input, .textarea, .select {
  width: 100%;
  padding: .8rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--step-0);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--text-muted); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.field-error .input, .field-error .textarea { border-color: var(--error); }
.error-text { font-size: var(--step--1); color: var(--error); }

/* Honeypot — hidden from people, reachable by bots. */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.alert {
  display: flex;
  gap: .7rem;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--step-0);
}
.alert svg { flex: none; width: 19px; height: 19px; margin-top: .15rem;
  stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.alert-ok    { border-color: rgba(63, 178, 127, .4);  background: rgba(63, 178, 127, .1);  color: var(--ok); }
.alert-error { border-color: rgba(242, 85, 90, .4);   background: rgba(242, 85, 90, .1);   color: var(--error); }
.alert strong { display: block; color: var(--text); }
.alert-ok strong, .alert-error strong { color: inherit; }

/* Contact routes — the page's main content now that the form is gone ------ */
.contact-grid {
  display: grid;
  /* Wide enough that a full email address sits on one line rather than
     breaking mid-word; settles to two columns on desktop. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--sp-4);
}

.contact-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  transition: border-color .25s var(--ease), background-color .25s var(--ease),
              transform .25s var(--ease), box-shadow .25s var(--ease);
}
.contact-card:hover {
  border-color: var(--accent-line);
  background: var(--surface);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.contact-card-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.contact-card-icon svg {
  width: 21px; height: 21px;
  stroke: currentColor; stroke-width: 1.7; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
/* WhatsApp keeps its own colour — people recognise it instantly. */
.contact-card--whatsapp .contact-card-icon { background: rgba(37, 211, 102, .14); color: #1faa54; }
:root[data-theme="dark"] .contact-card--whatsapp .contact-card-icon { color: #34d67f; }

.contact-card-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.contact-card-label { font-size: var(--step--1); color: var(--text-muted); }
.contact-card-value {
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: -.012em;
  overflow-wrap: anywhere;
}
.contact-card-note { margin-top: .15rem; font-size: .74rem; color: var(--text-muted); }

.contact-card-arrow {
  flex: none;
  width: 17px; height: 17px;
  margin-left: auto;
  stroke: currentColor; stroke-width: 1.9; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  color: var(--text-muted);
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.contact-card:hover .contact-card-arrow {
  color: var(--accent-text);
  transform: translate(2px, -2px);
}

/* Floating WhatsApp button, bottom-left on every page ---------------------- */
.wa-float {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  flex-direction: row-reverse;   /* label unfurls leftwards, away from the edge */
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 54px;
  padding: 0 16px;
  border-radius: var(--r-full);
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 28px -8px rgba(37, 211, 102, .55), 0 2px 8px rgba(0, 0, 0, .18);
  transition: gap .28s var(--ease), padding .28s var(--ease),
              transform .2s var(--ease), box-shadow .2s var(--ease);
}
.wa-float:hover,
.wa-float:focus-visible {
  gap: 10px;
  padding-left: 22px;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -8px rgba(37, 211, 102, .65), 0 2px 8px rgba(0, 0, 0, .2);
}
.wa-float svg {
  width: 24px; height: 24px;
  flex: none;
  stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
/* The label unfurls on hover rather than taking space permanently. */
.wa-float-text {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: var(--step--1);
  font-weight: 600;
  opacity: 0;
  transition: max-width .28s var(--ease), opacity .2s var(--ease);
}
.wa-float:hover .wa-float-text,
.wa-float:focus-visible .wa-float-text { max-width: 120px; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .wa-float, .wa-float-text { transition: none; }
}

/* Keep clear of the toast on very small screens. */
@media (max-width: 420px) {
  .wa-float { height: 48px; padding: 0 13px; }
  .wa-float svg { width: 22px; height: 22px; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  translate: -50% 0;
  z-index: 300;
  padding: .7rem 1.2rem;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-full);
  font-size: var(--step--1);
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), translate .25s var(--ease);
}
.toast.is-visible { opacity: 1; translate: -50% -6px; }

/* 11. Footer --------------------------------------------------------------------- */

.site-footer {
  /* The preceding .section already carries bottom padding — keep this modest
     so the two do not stack into a large empty band. */
  margin-top: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 6vw, var(--sp-7)) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
}

.footer-top {
  display: grid;
  gap: var(--sp-7);
  padding-bottom: clamp(2rem, 5vw, var(--sp-7));
  align-items: start;
}
@media (min-width: 720px) {
  .footer-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 1020px) {
  /* Brand / pages / contact. The last column is sized to hold six 38px
     icons on one line so they never wrap into a ragged block. */
  .footer-top {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(268px, auto);
    gap: var(--sp-8);
  }
}

.footer-name { font-size: var(--step-1); font-weight: 600; letter-spacing: -.025em; }
.footer-line { margin-top: .25rem; font-size: var(--step--1); color: var(--text-muted); }
.footer-blurb {
  margin-top: var(--sp-4);
  max-width: 42ch;
  font-size: var(--step-0);
  color: var(--text-soft);
}
.footer-status {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: var(--sp-5);
  font-size: var(--step--1);
  color: var(--text-muted);
}

/* Every column head sits on the same baseline. */
.footer-heading {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem var(--sp-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  font-size: var(--step--1);
  color: var(--text-soft);
  transition: color .18s var(--ease);
}
.footer-links a:hover { color: var(--accent-text); }

/* Elsewhere: icon buttons rather than a word list. Each carries an
   aria-label, so removing the visible text costs nothing to screen readers. */
.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.social-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  transition: color .2s var(--ease), border-color .2s var(--ease),
              background-color .2s var(--ease), transform .2s var(--ease);
}
.social-btn:hover {
  color: var(--accent-text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.social-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-bottom {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--text-muted);
  text-align: center;
}

/* 404 */
.error-page {
  min-height: 62vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding-block: var(--sp-8);
}
.error-code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 16vw, 9rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.05em;
  background: linear-gradient(180deg, var(--text) 25%, transparent 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- About page ---------------------------------------------------------
   Section-specific layout only; every colour, radius and step comes from the
   tokens at the top of this file so the page matches the rest of the site.
   ------------------------------------------------------------------------ */

.about-hero {
  padding-top: clamp(2.5rem, 7vw, 5rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}
.about-hero-grid {
  display: grid;
  gap: clamp(2rem, 6vw, var(--sp-8));
  align-items: center;
}
@media (min-width: 900px) {
  .about-hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); }
}
.about-title {
  margin-top: var(--sp-4);
  font-size: var(--step-4);
  line-height: 1.06;
  letter-spacing: -.035em;
  max-width: 16ch;
}
.about-hero-copy .lede { margin-top: var(--sp-5); }

/* Portrait ---------------------------------------------------------------- */
.portrait {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 380px);
}
/* Offset decorative panel behind the frame. */
.portrait::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-xl);
  background: var(--accent-soft);
  z-index: 0;
  pointer-events: none;
}
.portrait-frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .6s var(--ease);
}
.portrait:hover .portrait-frame img { transform: scale(1.03); }

/* Shown until a real photograph is supplied — typography, not stock imagery. */
.portrait-fallback {
  display: grid;
  place-content: center;
  gap: .5rem;
  height: 100%;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%),
    linear-gradient(155deg, var(--surface), var(--bg-raised));
  text-align: center;
}
.portrait-monogram {
  font-size: clamp(3rem, 9vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -.05em;
  color: var(--text-muted);
}
.portrait-fallback-note {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portrait-tag {
  position: absolute;
  z-index: 2;
  padding: .4rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--bg-raised) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-soft);
  white-space: nowrap;
}
.portrait-tag--role  { top: 1.1rem; left: -.9rem; }
.portrait-tag--place { bottom: 1.1rem; right: -.6rem; }
@media (max-width: 480px) {
  .portrait-tag--role  { left: .5rem; }
  .portrait-tag--place { right: .5rem; }
}

/* Editorial intro --------------------------------------------------------- */
.editorial-lead {
  margin-top: var(--sp-4);
  font-size: var(--step-3);
  line-height: 1.22;
  letter-spacing: -.028em;
  max-width: 24ch;
}
.editorial-body { margin-top: var(--sp-5); max-width: 62ch; }

/* How I work -------------------------------------------------------------- */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.approach-card {
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  transition: border-color .25s var(--ease), background-color .25s var(--ease),
              transform .25s var(--ease);
}
.approach-card:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-3px);
}
.approach-num {
  display: block;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--accent-text);
}
.approach-card h3 {
  margin-top: .75rem;
  font-size: var(--step-1);
  letter-spacing: -.02em;
}
.approach-card p { margin-top: .5rem; font-size: var(--step--1); }

/* What I do --------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}
/* Four cards read better as a balanced 2x2 than as 3 + 1 orphan. */
@media (min-width: 760px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.service-card {
  position: relative;
  display: block;
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  overflow: hidden;
  transition: border-color .25s var(--ease), background-color .25s var(--ease),
              transform .25s var(--ease), box-shadow .25s var(--ease);
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.service-card:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.service-card:hover::before { transform: scaleX(1); }
.service-num {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--text-muted);
}
.service-card h3 {
  margin-top: .6rem;
  font-size: var(--step-2);
  letter-spacing: -.025em;
  transition: color .2s var(--ease);
}
.service-card:hover h3 { color: var(--accent-text); }
.service-card p { margin-top: .6rem; max-width: 44ch; }
.service-arrow {
  width: 18px; height: 18px;
  margin-top: var(--sp-5);
  stroke: currentColor; stroke-width: 1.9; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  color: var(--text-muted);
  transition: transform .25s var(--ease), color .25s var(--ease);
}
.service-card:hover .service-arrow { color: var(--accent-text); transform: translateX(4px); }

/* Technologies ------------------------------------------------------------ */
.tech-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: var(--sp-5);
}
.tech-group-title {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-4);
}
.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Currently exploring ----------------------------------------------------- */
.exploring-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: var(--sp-5) 0 0;
  padding: 0;
  list-style: none;
}
.exploring-item {
  padding: .6rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--bg-raised);
  font-size: var(--step--1);
  color: var(--text-soft);
  transition: color .22s var(--ease), border-color .22s var(--ease),
              background-color .22s var(--ease), transform .22s var(--ease);
}
.exploring-item:hover {
  color: var(--accent-text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* Beyond code ------------------------------------------------------------- */
.beyond-grid { display: grid; gap: var(--sp-6); align-items: start; }
@media (min-width: 880px) {
  .beyond-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-8); }
}
.beyond-statement {
  font-size: var(--step-3);
  line-height: 1.16;
  letter-spacing: -.03em;
  max-width: 18ch;
}

/* Education (deliberately understated) ------------------------------------ */
.edu-block {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
}
.edu-title { margin-top: .6rem; font-size: var(--step-1); letter-spacing: -.02em; }
.edu-meta  { margin-top: .35rem; font-size: var(--step--1); }

/* 12. Utilities, motion, print ------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .07s; }
.reveal[data-delay="2"] { transition-delay: .14s; }
.reveal[data-delay="3"] { transition-delay: .21s; }
.reveal[data-delay="4"] { transition-delay: .28s; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.center { text-align: center; }

[hidden] { display: none !important; }

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

@media print {
  .site-header, .site-footer, .mobile-nav, .toast, .skip-link,
  .btn-row, .hero-grid, .cta-band, .page-head,
  .resume-actions { display: none !important; }

  body { background: #fff; color: #000; font-size: 10.5pt; }
  .section, .section-tight { padding-block: 0; }
  .shell { max-width: none; padding-inline: 0; }

  .resume-sheet { border: 0; padding: 0; background: none; }
  .resume-grid { grid-template-columns: 1fr 210px; gap: 1.6rem; padding-top: 1rem; }
  .resume-header { border-bottom: 1.5pt solid #000; }
  .resume-name { font-size: 20pt; }
  .resume-role, .resume-org, .resume-list a { color: #333 !important; }
  .resume-block > h3 { color: #555 !important; border-color: #ccc !important; }

  a { text-decoration: none; color: #000; }
  .resume-entry, .resume-block { break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
