/* ---------- Design tokens ---------- */
:root {
  /* Exact colors sampled from the reference mockup + logo: neutrals are
     pure gray (chroma 0) matching the Figma neumorphism recipe (shadows
     are literally #ffffff and #c7c7c7); --brand-navy and --accent are
     sampled directly from the logo mark and the mockup's subtitle text. */
  --bg: oklch(0.949 0 90);
  --fg: oklch(0.22 0 90);
  --fg-muted: oklch(0.48 0 90);
  --border: oklch(0.89 0 90);
  --pill-bg: oklch(0.90 0.02 266);
  --pill-fg: oklch(0.4 0.07 257);
  --brand-navy: oklch(0.39 0.14 257);
  --accent: oklch(0.56 0.13 266);
  --accent-fg: oklch(0.99 0 0);
  --accent-light: oklch(0.85 0.09 266);
  /* Brighter, more saturated than --accent — used where the blue itself is
     the fill (e.g. the submit button) rather than just text/border color. */
  --btn-blue: oklch(0.62 0.19 266);
  --hover-bg: oklch(0.32 0.08 257);
  --hover-fg: oklch(0.97 0 90);
  /* Accent color shown on top of --hover-bg specifically (e.g. company name
     on a hovered experience card) — here --hover-bg is dark, so this stays
     light, same as --accent-light. */
  --hover-accent: oklch(0.85 0.09 266);
  /* Single source of truth for the experience card + timeline node hover
     speed — tune once here, both stay in sync. */
  --hover-transition: .3s ease-in-out;
  --glass-border: oklch(1 0 0 / 0.55);
  /* Background orb colors — deeper and more saturated than --accent so the
     ambient glow reads as a rich blue instead of a pale, high-lightness one. */
  --orb-1: oklch(0.68 0.19 257);
  --orb-2: oklch(0.72 0.17 266);
  /* Neumorphic surface: exact Figma recipe.
     Raised: drop shadow 1 (20,20,40,#c7c7c7,90%) + drop shadow 2
     (-20,-20,40,#ffffff,90%) + inner shadow 1 (-4,-4,8,#c7c7c7,30%)
     + inner shadow 2 (4,4,8,#ffffff,40%) — all four layers together.
     Pressed: just the two inner-shadow layers. */
  --neu-surface: #eeeeee;
  --neu-raised-shadow:
    20px 20px 40px rgba(199, 199, 199, 0.9),
    -20px -20px 40px rgba(255, 255, 255, 0.9),
    inset -6px -6px 8px rgba(199, 199, 199, 0.6),
    inset 6px 6px 8px rgba(255, 255, 255, 0.6);
  --neu-pressed-shadow:
    inset -4px 4px 8px rgba(255, 255, 255, 0.2),
    inset -6px -6px 8px rgba(255, 255, 255, 0.6),
    inset 4px -4px 8px rgba(199, 199, 199, 0.2),
    inset 6px 6px 8px rgba(199, 199, 199, 0.6);
  /* Both tokens use the same two shadow tones as the shared recipe above,
     just at an offset/blur/opacity scaled for a ~24-28px knob inside a
     28-34px track rather than a 300px+ card. The shared recipe's 20px
     offset/40px blur needs far more surrounding room than either has —
     on the knob it read as an invisible haze instead of a raised edge;
     on the pill-shaped track (999px radius, and the knob fills all but
     ~2px of its height) the default pressed shadow's 4-6px offsets
     barely registered, reading as flat. Kept as their own tokens (rather
     than reusing --neu-raised-shadow/--neu-pressed-shadow directly) so
     the toggle can be retuned independently of every other neumorphic
     element sharing those two. */
  /* Vertical-only offset (no x component), unlike the diagonal
     recipe everything else uses — the knob slides between left/right,
     so a diagonal shadow's visible side flips with it and ends up
     hidden under the knob on one theme and in the empty trough on the
     other. A top/bottom-only groove reads the same regardless of which
     side the knob is currently on. */
  --toggle-track-shadow:
    inset 0 2px 4px rgba(199, 199, 199, 0.8),
    inset 0 -2px 3px rgba(255, 255, 255, 0.9),
    inset 0 0 3px rgba(199, 199, 199, 0.4);
  /* Outer pair only reproduces half of --neu-raised-shadow's recipe (its
     drop shadows), missing the inset pair that gives every other raised
     element its inner bevel — added back here at a scale that fits a
     24-28px circle instead of the full 6px/8px used at card scale. */
  --toggle-knob-shadow:
    3px 3px 6px rgba(199, 199, 199, 0.9),
    -3px -3px 6px rgba(255, 255, 255, 0.9),
    inset -2px -2px 3px rgba(199, 199, 199, 0.4),
    inset 2px 2px 3px rgba(255, 255, 255, 0.5);
  /* Icon glyph color for the LinkedIn/email orbs — defaults to --accent,
     overridden per-theme below (dark mode swaps it to --brand-navy, the
     same blue the nav links use, instead of --accent's dimmer blue). */
  --icon-fg: var(--accent);
}

[data-theme="dark"] {
  /* Same hue family as the light theme's --brand-navy/--accent (257/266,
     sampled from the logo), not an independent palette — neutrals carry
     a faint navy tint instead of light mode's pure gray so the dark
     surface still reads as "the same site", just inverted. */
  --bg: oklch(0.19 0.03 257);
  --fg: oklch(0.93 0.008 257);
  --fg-muted: oklch(0.66 0.014 257);
  --border: oklch(0.34 0.02 257);
  --pill-bg: oklch(0.33 0.045 266);
  --pill-fg: oklch(0.87 0.045 266);
  --brand-navy: oklch(0.8 0.09 257);
  --accent: oklch(0.72 0.13 266);
  --accent-fg: oklch(0.99 0 0);
  --accent-light: oklch(0.8 0.09 266);
  --hover-bg: oklch(0.78 0.06 257);
  --hover-fg: oklch(0.18 0.02 257);
  --hover-accent: oklch(0.3 0.1 266);
  --glass-border: oklch(1 0 0 / 0.14);
  --orb-1: oklch(0.42 0.16 257);
  --orb-2: oklch(0.48 0.14 266);
  --neu-surface: oklch(0.215 0.032 257);
  /* Same four-layer recipe as light (2 drop shadows + 2 inset), just with
     the light/dark shadow pair swapped for oklch tones lighter/darker
     than --neu-surface instead of light mode's literal white/#c7c7c7. */
  --neu-raised-shadow:
    10px 10px 40px oklch(0.1 0.028 257 / 0.8),
    -10px -10px 40px oklch(0.3 0.038 257 / 0.2),
    inset -6px -6px 8px oklch(0.1 0.028 257 / 0.6),
    inset 6px 6px 8px oklch(0.3 0.038 257 / 0.6);
  --neu-pressed-shadow:
    inset -4px 4px 8px oklch(0.3 0.038 257 / 0.2),
    inset -6px -6px 8px oklch(0.3 0.038 257 / 0.6),
    inset 4px -4px 8px oklch(0.1 0.028 257 / 0.2),
    inset 6px 6px 8px oklch(0.1 0.028 257 / 0.6);
  --toggle-track-shadow:
    inset 0 2px 4px oklch(0.1 0.028 257 / 0.8),
    inset 0 -2px 3px oklch(0.3 0.038 257 / 0.9),
    inset 0 0 3px oklch(0.1 0.028 257 / 0.4);
  --toggle-knob-shadow:
    3px 3px 6px oklch(0.1 0.028 257 / 0.9),
    -3px -3px 6px oklch(0.3 0.038 257 / 0.9),
    inset -2px -2px 3px oklch(0.1 0.028 257 / 0.4),
    inset 2px 2px 3px oklch(0.3 0.038 257 / 0.5);
  --icon-fg: var(--brand-navy);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--fg);
  position: relative;
  overflow-x: hidden;
  transition: background .2s ease, color .2s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }
::selection { background: oklch(0.6 0.15 250 / 0.25); }

/* ---------- Neumorphic surface recipe (also used by the nav) ---------- */
.hero-photo, .glass-card, .exp-card, .contact-form, .contact-success {
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-shadow);
}

/* ---------- Nav (neumorphic: flat surface, no border — depth comes
   purely from a light/dark shadow pair, same recipe as classic
   soft-UI: matched offset + blur, no spread, just tonal variation) ---------- */
.nav {
  position: sticky;
  top: 32px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: calc(100% - 48px);
  max-width: 1250px;
  height: 75px;
  margin: 32px auto 0;
  padding: 10px 40px;
  border-radius: 999px;
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-shadow);
  transition: background .2s ease, box-shadow .2s ease;
}
.nav-logo {
  height: 38px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
/* Two real logo files (a dedicated lighter-blue mark for dark mode,
   not a filter guess on the light-mode navy one) — swap which is
   shown via display, not opacity, so the hidden one doesn't still
   occupy space as a flex item. */
.nav-logo.logo-dark { display: none; }
[data-theme="dark"] .nav-logo.logo-light { display: none; }
[data-theme="dark"] .nav-logo.logo-dark { display: block; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}
.nav-links a {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  /* Cancels this link's own 16px horizontal padding out of the flex
     gap's layout contribution (padding is still rendered, so the
     hover pill/tap target keeps its full size) — otherwise the 16px
     padding on both sides of every link stacks with the flex gap,
     making link-to-link spacing 36px bigger than intended instead of
     exactly 36px, which is what breaks doubling it for the toggle below. */
  margin: 0 -16px;
  border-radius: 999px;
  font-family: 'Open Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-navy);
  transition: opacity var(--hover-transition);
}
.nav-links a:hover {
  opacity: 1;
}
/* Pressed-in neumorphism surface, hidden by default and only shown on
   hover — the resting state stays exactly as before (plain text). */
.nav-links a::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: var(--neu-surface);
  box-shadow: var(--neu-pressed-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hover-transition);
}
.nav-links a:hover::before {
  opacity: 1;
}
/* Suspends transitions during a breakpoint crossing so the mobile menu
   doesn't visibly animate open/closed on its own mid-resize. */
.nav.no-transition,
.nav.no-transition .nav-links,
.nav.no-transition .burger,
.nav.no-transition .burger-line {
  transition: none !important;
}
/* Desktop: invisible/transparent-to-layout — the mobile menu's logo
   and the items wrapper only become real boxes at the phone
   breakpoint below, so .nav-links's flex row still sees the plain
   anchors directly on desktop. */
.mobile-menu-logo { display: none; }
.nav-links-items { display: contents; }
.nav-backdrop { display: none; }
/* Track is a constant pressed groove (like the form fields), knob is a
   raised disc riding inside it — same shadow language as the rest of the
   site, just used to build a switch instead of a button/card. */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: var(--neu-surface);
  border: none;
  box-shadow: var(--toggle-track-shadow);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background .2s ease, box-shadow .2s ease;
}
.theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neu-surface);
  box-shadow: var(--toggle-knob-shadow);
  color: var(--accent);
  transition: transform .3s ease, background .2s ease, box-shadow .2s ease;
}
[data-theme="dark"] .theme-toggle-knob { transform: translateX(24px); }
.theme-icon {
  position: absolute;
  width: 14px;
  height: 14px;
  transition: opacity .2s ease;
}
.theme-icon-moon { opacity: 0; }
[data-theme="dark"] .theme-icon-sun { opacity: 0; }
[data-theme="dark"] .theme-icon-moon { opacity: 1; }

/* ---------- Burger menu (mobile nav toggle) ---------- */
/* Hidden on desktop — only shown below the mobile breakpoint, where it
   replaces the inline nav links with a toggleable dropdown. */
/* No background/shadow of its own — .nav-links is the only element
   that's ever visually rendered as a shape (circle, then rectangle).
   The burger is just an invisible hit-target holding the icon lines,
   layered on top of it via z-index so there is genuinely one shape
   morphing, not a static button sitting on a separate growing panel. */
.burger {
  display: none;
  position: relative;
  z-index: 41;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}
.burger-line {
  position: absolute;
  z-index: 1;
  left: 50%;
  width: 24px;
  height: 2px;
  background: var(--brand-navy);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: top .25s ease, transform .25s ease, opacity .25s ease;
}
.burger-line:nth-child(1) { top: 19px; }
.burger-line:nth-child(2) { top: 26px; }
.burger-line:nth-child(3) { top: 33px; }
.burger.is-open .burger-line:nth-child(1) {
  top: 26px;
  transform: translateX(-50%) rotate(45deg);
}
.burger.is-open .burger-line:nth-child(2) {
  opacity: 0;
}
.burger.is-open .burger-line:nth-child(3) {
  top: 26px;
  transform: translateX(-50%) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 64px 40px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
}
.hero-photo {
  width: 340px;
  height: 340px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in-up .7s ease forwards;
  opacity: 0;
}
.hero-photo-inner {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  overflow: hidden;
}
.hero-photo-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-text { animation: fade-in-up .7s ease .16s forwards; opacity: 0; }
.hero-text h1 { font-size: 72px; font-weight: 900; letter-spacing: -0.035em; line-height: 1.02; margin: 0 0 14px; color: var(--brand-navy); }
.hero-text h2 { font-size: 26px; font-weight: 500; color: var(--accent); letter-spacing: -0.01em; margin: 0; }

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-indicator {
  width: 40px;
  height: 40px;
  color: var(--fg-muted);
}
.scroll-indicator svg {
  width: 100%;
  height: 100%;
}
.scroll-wheel {
  transform-origin: center;
  animation: scroll-bounce 2s ease-in-out infinite;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  z-index: 1;
  padding: 100px 40px;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}
.section-numeral {
  position: absolute;
  top: -64px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 180px;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.eyebrow {
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  position: relative;
  z-index: 2;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  text-align: center;
}
#experience .section-title, #skills .section-title, #contact .section-title { margin-bottom: 56px; }

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
[data-reveal].reveal-left { transform: translateX(-32px); }
[data-reveal].reveal-right { transform: translateX(32px); }
[data-reveal].reveal-up { transform: translateY(24px); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; padding: 6px 0; }
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, var(--accent) 8%, var(--accent) 92%, transparent);
  opacity: 0.25;
  filter: blur(3px);
}
.timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  align-items: center;
  margin-bottom: 36px;
}
.timeline-side { display: flex; }
.timeline-side-left { justify-content: flex-end; }
.timeline-side-right { justify-content: flex-start; }
.timeline-node {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--neu-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Ring is an outline (not box-shadow) so outline-offset can put real
     space between it and the circle — box-shadow rings always sit flush
     against the edge with no way to offset the start point. */
  outline: 3px solid transparent;
  outline-offset: 4px;
  transition: outline-color var(--hover-transition);
}
.timeline-node span {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}
/* Same raised/pressed cross-fade pattern as .exp-card. */
.timeline-node::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: var(--neu-raised-shadow);
  opacity: 1;
  pointer-events: none;
  transition: opacity var(--hover-transition);
}
.timeline-node::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: var(--neu-pressed-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hover-transition);
}
.timeline-row:has(.exp-card:hover) .timeline-node {
  outline-color: color-mix(in oklch, var(--accent) 30%, transparent);
}
.timeline-row:has(.exp-card:hover) .timeline-node::before {
  opacity: 0;
}
.timeline-row:has(.exp-card:hover) .timeline-node::after {
  opacity: 1;
}

.exp-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  border-radius: 24px;
  padding: 26px 28px;
  /* Shadow lives entirely on the ::before/::after pair below, not here —
     otherwise this raised shadow would stay visible underneath the pressed
     overlay forever instead of fading out as it fades in. */
  box-shadow: none;
  /* Same ring treatment as the timeline node. */
  outline: 3px solid transparent;
  outline-offset: 4px;
  transition: outline-color var(--hover-transition);
}
.exp-card:hover {
  outline-color: color-mix(in oklch, var(--accent) 30%, transparent);
}
/* Raised and pressed shadows each live on their own overlay and cross-fade
   via opacity on hover — box-shadow itself can't transition smoothly
   between them (see --neu-raised-shadow vs --neu-pressed-shadow: different
   layer count/inset-ness per layer), but opacity interpolates trivially and
   works cleanly in both directions for both layers at once. */
.exp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--neu-raised-shadow);
  opacity: 1;
  pointer-events: none;
  transition: opacity var(--hover-transition);
}
.exp-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--neu-pressed-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hover-transition);
}
.exp-card:hover::before {
  opacity: 0;
}
.exp-card:hover::after {
  opacity: 1;
}
.timeline-side-left .exp-card { margin-right: 24px; }
.timeline-side-right .exp-card { margin-left: 24px; }
.exp-company { font-size: 16px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.exp-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.exp-heading h3 { font-size: 20px; font-weight: 700; margin: 0; }
.exp-tenure { font-size: 14px; font-weight: 600; color: var(--fg-muted); white-space: nowrap; flex-basis: 100%; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  padding: 5px 12px;
  background: var(--pill-bg);
  color: var(--pill-fg);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Skills & tools ---------- */
.skills-grid {
  display: grid;
  /* Widened from the 1.97:1.03 split that fit the old pill lists —
     with the updated Skills/Tools content this ratio is what lands
     both cards at 9 rows each instead of 10 and 8. */
  grid-template-columns: 2.1fr 0.9fr;
  gap: 24px;
}
.glass-card {
  min-width: 260px;
  border-radius: 24px;
  padding: 32px;
}
.card-label {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin: 0 0 20px;
}

/* ---------- Contact ---------- */
.contact-form, .contact-success {
  max-width: 810px;
  margin: 0 auto;
  border-radius: 24px;
  padding: 36px;
}
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.contact-form[hidden] { display: none; }
.form-honeypot { display: none; }
.form-error {
  text-align: center;
  font-size: 15px;
  color: oklch(0.55 0.22 25);
}
.form-error[hidden] { display: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 15px; font-weight: 600; color: var(--fg-muted); }
.form-field input, .form-field textarea {
  padding: 11px 14px;
  border-radius: 14px;
  border: none;
  background: var(--neu-surface);
  box-shadow: var(--neu-pressed-shadow);
  color: var(--fg);
  font-size: 16.5px;
  font-family: inherit;
}
.form-field textarea { resize: vertical; }
/* Chrome/Safari force a white (or yellow, if genuinely autofilled) input
   background as soon as a field's value matches saved data — sometimes
   triggered by plain typing, not just real autofill, which is why the
   flat look appeared "random". The fix is the standard huge-inset-shadow
   trick, painting --neu-surface back in since background-color itself
   can't win against the browser's internal autofill styling. Order
   matters: box-shadow layers stack first-on-top, so --neu-pressed-shadow
   must come FIRST or the opaque 1000px flood (needed to fully cover the
   autofill color) paints over it and hides the groove entirely — which
   is exactly the "flat, solid color" bug this was causing. */
.form-field input:-webkit-autofill,
.form-field input:-webkit-autofill:hover,
.form-field input:-webkit-autofill:focus,
.form-field input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--fg);
  -webkit-box-shadow: var(--neu-pressed-shadow), 0 0 0 1000px var(--neu-surface) inset;
  box-shadow: var(--neu-pressed-shadow), 0 0 0 1000px var(--neu-surface) inset;
  transition: background-color 5000s ease-in-out 0s;
}
.btn-submit {
  position: relative;
  z-index: 0;
  align-self: center;
  padding: 13px 30px;
  background: var(--btn-blue);
  color: var(--accent-fg);
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
}
.btn-submit::before,
.btn-submit::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  transition: opacity var(--hover-transition);
}
.btn-submit::before {
  box-shadow: var(--neu-raised-shadow);
  opacity: 1;
}
.btn-submit::after {
  box-shadow: var(--neu-pressed-shadow);
  opacity: 0;
}
.btn-submit:hover::before {
  opacity: 0;
}
.btn-submit:hover::after {
  opacity: 1;
}
.contact-success {
  text-align: center;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Set to match the form's own rendered height via JS right before
     swapping, so the box doesn't collapse down to fit just the
     message. */
  box-sizing: border-box;
}
.contact-success[hidden] { display: none; }
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--accent);
  outline: 3px solid color-mix(in oklch, var(--accent) 30%, transparent);
  outline-offset: 6px;
}
.success-icon svg { width: 36px; height: 36px; }
.success-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--accent); }
.success-sub { font-size: 16px; color: var(--fg-muted); max-width: 420px; }
#contact-again { margin-top: 28px; }

/* ---------- Social / contact icons ---------- */
.contact-icons {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.social-orb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--neu-surface);
  border: none;
  padding: 0;
  font: inherit;
  color: var(--icon-fg);
  outline: 3px solid transparent;
  outline-offset: 6px;
  cursor: pointer;
  transition: outline-color var(--hover-transition);
}
.social-orb.is-open {
  outline-color: color-mix(in oklch, var(--accent) 30%, transparent);
}
/* Scoped to real hover-capable pointers — on touch devices, tapping a
   button triggers :hover with no "pointer left" event to ever clear it,
   so it reads as stuck on until the next unrelated tap somewhere else.
   .is-open (above) already drives the same look correctly via JS on
   every device, so touch never needs :hover for this at all. */
@media (hover: hover) {
  .social-orb:hover {
    outline-color: color-mix(in oklch, var(--accent) 30%, transparent);
  }
}
/* Same raised/pressed cross-fade pattern as .exp-card / .timeline-node. */
.social-orb::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: var(--neu-raised-shadow);
  opacity: 1;
  pointer-events: none;
  transition: opacity var(--hover-transition);
}
.social-orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: var(--neu-pressed-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hover-transition);
}
.social-orb.is-open::before { opacity: 0; }
.social-orb.is-open::after { opacity: 1; }
@media (hover: hover) {
  .social-orb:hover::before { opacity: 0; }
  .social-orb:hover::after { opacity: 1; }
}
.social-orb svg { position: relative; z-index: 1; }
.linkedin-icon { width: 16px; height: 16px; fill: var(--icon-fg); }
.email-icon { width: 20px; height: 20px; }

/* Smoothly animates open/closed via grid-template-rows (0fr <-> 1fr) —
   unlike max-height, this doesn't need a guessed/measured pixel value
   and works cleanly for both directions, so collapsing is just as
   fluid as expanding instead of vanishing instantly via [hidden]. */
.contact-form-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
  transition: grid-template-rows .5s ease, margin-top .5s ease, opacity .4s ease;
}
.contact-form-wrapper.is-open {
  grid-template-rows: 1fr;
  margin-top: 56px;
  opacity: 1;
  pointer-events: auto;
}
/* overflow:hidden is required for the grid-row trick to actually
   collapse the content, but it also clips the neumorphic raised
   shadow's natural bleed (offset 20px + blur 40px, so up to ~60px
   beyond the card's own edge). A fixed padding buffer only postpones
   the problem to a narrower breakpoint, since the card's own
   container eventually shrinks to match it exactly (e.g. once Skills
   & Tools stacks). Instead, this element "breaks out" to span the
   full viewport width — decoupling the clipping boundary's width
   from the section's content width entirely, so there's ~50vw of
   clearance on each side regardless of screen size. The form/success
   card inside still centers normally via its own max-width + auto
   margins. Vertical keeps a fixed padding/negative-margin pair since
   that's the dimension actually being animated/collapsed. */
.contact-form-wrapper-inner {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  overflow: hidden;
  min-height: 0;
  /* Horizontal padding matches .section's own side padding at each
     breakpoint (see the two overrides below), so the form/success
     card keeps the same minimum gap to the viewport edge as the
     Skills & Tools cards, instead of going fully edge-to-edge now
     that this wrapper ignores the section's padding entirely. */
  padding: 64px 40px;
  margin-top: -64px;
  margin-bottom: -64px;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  padding: 32px 40px;
  text-align: center;
  border-top: 1px solid var(--glass-border);
}
.footer-copy {
  font-size: 13px;
  color: var(--fg-muted);
}

/* ---------- Responsive ---------- */
/* Tablet: moderate spacing/sizing reductions, nav still shows inline
   links (burger only takes over at the phone breakpoint below). */
@media (max-width: 1024px) {
  .hero { padding: 56px 32px; }
  .hero-photo { width: 260px; height: 260px; }
  .hero-photo-inner { width: 240px; height: 240px; }
  .hero-text h1 { font-size: 58px; }
  .section { padding: 84px 32px; }
  .section-numeral { font-size: 140px; top: -50px; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-form-wrapper-inner { padding-left: 32px; padding-right: 32px; }
}

/* Phone: the nav bar itself is replaced by a standalone burger button
   (not housed inside any bar/pill), fixed to the top-right corner. */
@media (max-width: 720px) {
  .nav {
    position: fixed;
    top: 20px;
    left: auto;
    right: 20px;
    width: auto;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
  }
  /* The dark-theme override further up (`[data-theme="dark"] .nav-logo.
     logo-dark { display: block; }`) has higher specificity than a plain
     `.nav-logo` rule and doesn't care that it's outside this media query
     — so without this matching-specificity rule, the dark logo variant
     was winning back onto the page here regardless of viewport width,
     poking out from behind the burger button in dark mode only. */
  .nav-logo { display: none; }
  [data-theme="dark"] .nav-logo.logo-dark { display: none; }
  /* Fixed independently of .nav (rather than relying on nav's own
     box for position) so it can animate to a new inset on open,
     moving in sync with the panel's own growth instead of sitting
     frozen at a fixed pixel spot while the shape morphs around it. */
  .burger {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 20px;
    right: 20px;
    transition: top .4s ease, right .4s ease;
  }
  /* Same inset the icon effectively had within the closed circle
     (20px gap + 26px to the circle's center), so it reads as staying
     just as clear of the edge once the shape is a much larger,
     flatter-cornered rectangle. */
  .nav.is-open .burger {
    top: 36px;
    right: 36px;
  }
  /* Blurs the page content behind the menu so it doesn't visually
     compete with it through the gaps around the panel. */
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: color-mix(in oklch, var(--bg) 55%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
  }
  .nav.is-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  /* Cards are edge-to-edge at this width, so the horizontal reveal-left/
     reveal-right slide-in would push them past the viewport edge before
     they're visible — use the same vertical fade as reveal-up instead. */
  [data-reveal].reveal-left:not(.is-visible), [data-reveal].reveal-right:not(.is-visible) { transform: translateY(24px); }
  /* This is the ONLY element with a visible shape — background and
     shadow are constant across both states, never faded, so what
     changes is purely size/radius. That's what makes it read as one
     shape morphing rather than a button sitting on a separate panel.
     Closed: a plain circle at the burger's position. Open: grows from
     that exact same top-right corner into the full panel. Position is
     against the viewport, not the nav, since the nav itself no longer
     has a box wide enough to anchor a full-width panel to. */
  .nav-links {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    /* 26px, not 50% — transitioning a %-radius to a px-radius makes
       the browser interpolate a hybrid calc(% + px) that resolves to
       a hugely oversized radius partway through (since the % portion
       is still evaluated against the box's early, much smaller size),
       curving the corner in far past where the icon sits. A plain px
       value (identical to 50% for this exact square) keeps it a
       simple, well-behaved px-to-px interpolation. */
    border-radius: 26px;
    background: var(--neu-surface);
    box-shadow: var(--neu-raised-shadow);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 40;
    transition: width .4s ease, height .4s ease, border-radius .4s ease;
  }
  .nav.is-open .nav-links {
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    border-radius: 24px;
    pointer-events: auto;
  }
  .mobile-menu-logo {
    display: block;
    position: relative;
    z-index: 1;
    height: 40px;
    width: auto;
    flex-shrink: 0;
  }
  .mobile-menu-logo.logo-dark { display: none; }
  [data-theme="dark"] .mobile-menu-logo.logo-light { display: none; }
  [data-theme="dark"] .mobile-menu-logo.logo-dark { display: block; }
  /* Real flex container at this breakpoint (desktop keeps it as
     display:contents). Content fades in with a slight delay so it
     only appears once the panel has mostly finished growing, rather
     than looking cramped inside the still-small circle. */
  .nav-links-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    opacity: 0;
    transition: opacity .2s ease;
  }
  .nav.is-open .nav-links-items {
    opacity: 1;
    transition-delay: .15s;
  }
  .nav-links a { text-align: center; }
  /* Each link's own 9px top/bottom padding (needed for a comfortably
     sized hover/tap target) would otherwise stack with the flex gap,
     making the visual gap between links BIGGER than the gap at the
     logo/toggle ends instead of equal to it. Canceling it with a
     matching negative margin means the flex gap alone is the full
     visual gap everywhere — logo-to-Home, link-to-link, and Contact-
     to-toggle all come out equal. */
  .nav-links a { margin: -9px 0; }
  /* Sized up from the desktop toggle since it reads as too small/
     fiddly as a standalone menu item rather than a small corner
     control in the nav bar. */
  .theme-toggle {
    width: 64px;
    height: 34px;
  }
  .theme-toggle-knob {
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
  }
  [data-theme="dark"] .theme-toggle-knob { transform: translateX(30px); }
  .theme-icon { width: 16px; height: 16px; }
  /* The mobile nav is position:fixed (out of flow, reserves no space),
     unlike the desktop sticky nav the base 100vh-130px height assumes,
     so without this override the hero comes up short and the next
     section peeks into view on load. */
  .hero { height: 100vh; padding-top: 96px; }
  .hero-photo { width: 220px; height: 220px; }
  .hero-photo-inner { width: 200px; height: 200px; }
  .hero-text h1 { font-size: 44px; }
  .section { padding: 72px 20px; }
  .contact-form-wrapper-inner { padding-left: 20px; padding-right: 20px; }
  .section-numeral { font-size: 100px; top: -38px; }
  .section-title { font-size: 32px; }
  /* Stacked layout, but keep the timeline itself: node column pinned to
     the left, card column to the right — both timeline-side-left and
     timeline-side-right map to the same grid area since only one of
     them holds a card per row, regardless of which side it came from. */
  .timeline-row {
    grid-template-columns: 44px 1fr;
    grid-template-areas: "node card";
    column-gap: 16px;
    row-gap: 0;
    margin-bottom: 24px;
  }
  .timeline-node { grid-area: node; }
  .timeline-side-left, .timeline-side-right {
    grid-area: card;
    justify-content: flex-start;
  }
  .timeline-side-left .exp-card, .timeline-side-right .exp-card { margin: 0; max-width: 100%; }
  .timeline-line { left: 22px; transform: none; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
/* Collapses every animation/transition to effectively instant instead of
   hand-picking which ones to touch — covers the scroll-bounce loop, the
   reveal-on-scroll slide/fade, the hero's entrance animation, and the
   burger menu's morph alike. Content still appears/updates, just without
   the motion itself, which is what prefers-reduced-motion asks for. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
