/* =====================================================================
   DESIGN TOKENS
   All colors, fonts, and spacing live here. Change one place, done.
===================================================================== */

:root {
  /* Brand accent colors — same in both modes */
  --color-coral:    #ff6b6b;
  --color-teal:     #00c9a7;
  --color-marigold: #ffd166;
  --color-lavender: #c77dff;
  --color-sky:      #48cae4;
  --color-mint:     #b7e4c7;
  --color-blush:    #ffb3c6;

  /* Light mode surface colors */
  --color-ink:        #1a1a2e;
  --color-paper:      #fdf9f3;
  --color-surface:    #ffffff;
  --color-surface-2:  #f5f0ea;
  --color-nav:        rgba(253, 249, 243, 0.94);  /* light: warm semi-transparent */
  --color-border:     rgba(26, 26, 46, 0.08);
  --color-text-muted: rgba(26, 26, 46, 0.55);

  /* Accent colors used as TEXT need WCAG-AA contrast on the light cream
     surface — the bright brand hues above only pass on dark mode. These
     are darkened variants reused for text; dark mode resets them below. */
  --accent-teal-text:     #00897b;
  --accent-lavender-text: #7b2cbf;
  --accent-coral-text:    #d62828;

  /* Hero eyebrow: muted ink in light mode (teal clashed with the
     warm blush hero); dark mode resets it to teal below. */
  --hero-eyebrow: var(--color-text-muted);

  /* Typography */
  --font-serif: 'Playfair Display', serif;
  --font-mono:  'Jost', sans-serif;
  --font-sans:  'DM Sans', sans-serif;

  /* Spacing */
  --section-padding-y: 120px;
  --section-padding-x: 60px;
  --nav-height: 80px;
}

/* Light mode section backgrounds — defined on :root first so dark mode
   override below wins via cascade order (later = higher priority). */
:root {
  --bg-hero:    #fdf9f3;  /* fallback — gradient applied in CSS */
  --bg-work:    #ffffff;
  --bg-handmade:  #f5f0ff;
  --bg-videos:  #edf5ff;
  --bg-about:   #1a1a2e;
  /* Text that lives on always-dark surfaces (about section, marquee, footer) */
  --color-on-dark:       #f0ece4;
  --color-on-dark-muted: rgba(240, 236, 228, 0.6);
  --color-on-dark-faint: rgba(240, 236, 228, 0.12);
}

/* Dark mode — comes AFTER :root so it takes precedence */
[data-theme="dark"] {
  --color-ink:        #f0ece4;
  --color-paper:      #13111a;
  --color-surface:    #243045;
  --color-surface-2:  #252230;
  --color-nav:        rgba(20, 17, 30, 0.96);  /* dark: warm purple-black, matches hero family */
  --color-border:     rgba(240, 236, 228, 0.1);
  --color-text-muted: rgba(240, 236, 228, 0.45);

  /* On dark surfaces the bright brand hues already pass — reset to them */
  --accent-teal-text:     var(--color-teal);
  --accent-lavender-text: var(--color-lavender);
  --accent-coral-text:    var(--color-coral);
  --hero-eyebrow:         var(--accent-teal-text);

  --bg-hero:    #0f0d16;
  --bg-work:    #1a2535;
  --bg-handmade:  #1a1530;
  --bg-videos:  #0e1a2a;
  --bg-about:   #0d0b14;
  /* These stay the same in dark mode — they're always light-on-dark */
  --color-on-dark:       #f0ece4;
  --color-on-dark-muted: rgba(240, 236, 228, 0.6);
  --color-on-dark-faint: rgba(240, 236, 228, 0.12);
}

/* =====================================================================
   RESET
===================================================================== */

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

/* Global list reset — no bullets, no padding */
ul, ol {
  list-style: none;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-ink);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

/* =====================================================================
   ANIMATIONS
===================================================================== */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

/* Looser drift for the hero bubbles — moves on both axes with a
   slight tilt so each icon reads as independently buoyant. */
@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  30%  { transform: translate(3px, calc(var(--float-amp, 12px) * -1)) rotate(2deg); }
  55%  { transform: translate(-2px, calc(var(--float-amp, 12px) * -0.55)) rotate(-1.5deg); }
  80%  { transform: translate(-3px, calc(var(--float-amp, 12px) * -0.85)) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.3); }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

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

/* SVG logo draw animations */
@keyframes draw-stroke { to { stroke-dashoffset: 0; } }
@keyframes fade-in     { to { opacity: 1; } }

/* Soft glow behind hero logo — calm, breathing */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}

/* Bubble entrance: fade + tiny pop */
@keyframes bubble-pop {
  0%   { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

/* =====================================================================
   SCROLL-TRIGGERED FADE-IN UTILITY
   Elements start hidden; JS adds .is-visible when they scroll into view.
===================================================================== */

/*
 * Reveal animation: elements start fully visible (no hidden flash),
 * but gently float up when they scroll into the viewport.
 * Using will-change only on transform so opacity is never the
 * thing hiding content if JS is slow or observer doesn't fire.
 */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* JS will add .needs-reveal before the page renders to opt into animation */
.reveal.needs-reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }
.reveal.delay-5 { transition-delay: 0.40s; }

/* =====================================================================
   NAV
===================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  padding: 0 var(--section-padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Always use an explicit dark/light bg — never inherit from the hero */
  background: var(--color-nav);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* Nav right zone: links + toggle pill together */
.nav__right {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Logo mark + brand name */
.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav__logo-img {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

/* Light mode: airy cream tile with a faint border so the mark reads as
   an icon without the heavy dark block. Dark mode keeps the dark tile. */
.nav__logo-bg {
  fill: #fdf9f3;
  stroke: rgba(26, 26, 46, 0.14);
  stroke-width: 1;
}
.nav__logo-stroke { stroke: #1a1a2e; }
.nav__logo-wrap   { stroke: rgba(26, 26, 46, 0.30); }

[data-theme="dark"] .nav__logo-bg {
  fill: #2a2840;
  stroke: none;
}
[data-theme="dark"] .nav__logo-stroke { stroke: #fdf9f3; }
[data-theme="dark"] .nav__logo-wrap   { stroke: rgba(255, 255, 255, 0.34); }

.nav__brand {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--color-ink);
  white-space: nowrap;
}

/* "String" in coral — distinct from the big serif hero heading */
.nav__brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  font-style: italic;
  color: var(--color-coral);
  letter-spacing: 0.04em;
}

/* Nav links */
.nav__links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--color-ink);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.25s ease;
}

.nav__links a:hover {
  border-bottom-color: var(--color-coral);
}

/* Hamburger — desktop hides it; the mobile media query reveals it */
.nav__toggle {
  display: none;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav__toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-ink);
  transition: transform 0.28s ease, opacity 0.2s ease;
}

/* Bars morph into an X while the menu is open */
.nav.is-menu-open .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-menu-open .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav.is-menu-open .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__scrim {
  position: fixed;
  inset: var(--nav-height) 0 0;
  background: rgba(10, 8, 20, 0.45);
  backdrop-filter: blur(2px);
  z-index: 90;
  border: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav.is-menu-open .nav__scrim {
  opacity: 1;
}

/* =====================================================================
   DECORATIVE THREAD LINES (page background)
===================================================================== */

.thread-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
}

/* =====================================================================
   SECTION SHARED
===================================================================== */

.section {
  position: relative;
  z-index: 1;
  padding: var(--section-padding-y) var(--section-padding-x);
}

.section__header {
  text-align: center;
  margin-bottom: 70px;
}

.section__eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-coral);
  margin-bottom: 12px;
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--color-ink);
}

.section__title em {
  font-style: italic;
  color: var(--color-coral);
}

.section__subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-ink);
  opacity: 0.75;  /* bumped from 0.65 — legible on dark backgrounds */
  max-width: 540px;
  margin: 16px auto 0;
}

/* =====================================================================
   HERO
===================================================================== */

.hero {
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 1;
  /* Light mode: warm cream with soft coral top-left & lavender bottom-right */
  background:
    radial-gradient(ellipse 70% 60% at 15% 10%,  rgba(255, 107, 107, 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 90%,  rgba(199, 125, 255, 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 80% 70% at 50% 50%,  rgba(0, 201, 167, 0.04)   0%, transparent 80%),
    var(--bg-hero);
}

[data-theme="dark"] .hero {
  /* Dark mode: deep purple-black with rich glowing accents */
  background:
    radial-gradient(ellipse 65% 55% at 10% 5%,   rgba(255, 107, 107, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 55% 50% at 90% 92%,  rgba(199, 125, 255, 0.20) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 75% 20%,  rgba(0, 201, 167, 0.12)   0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 20% 80%,  rgba(72, 202, 228, 0.10)  0%, transparent 55%),
    var(--bg-hero);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hero-eyebrow);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__eyebrow::before {
  content: '';
  width: 32px;
  height: 2px;
  background: var(--hero-eyebrow);
  flex-shrink: 0;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(3.2rem, 6vw, 5.5rem);
  line-height: 1.05;
  font-weight: 900;
  color: var(--color-ink);
  margin-bottom: 12px;
}

.hero__title em {
  font-style: italic;
  color: var(--color-coral);
}

.hero__tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  font-style: italic;
  color: var(--accent-lavender-text);
  margin-bottom: 28px;
}

.hero__description {
  font-size: 1.05rem;
  line-height: 1.75;
  opacity: 0.75;
  max-width: 640px;
  margin-bottom: 40px;
}

/* Skill tags */
.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 44px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag--coral   { background: rgba(255, 107, 107, 0.12); color: var(--accent-coral-text);    border: 1px solid rgba(255, 107, 107, 0.25); }
.tag--teal    { background: rgba(0, 201, 167, 0.12);   color: var(--accent-teal-text);     border: 1px solid rgba(0, 201, 167, 0.25); }
.tag--lavender{ background: rgba(199, 125, 255, 0.12); color: var(--accent-lavender-text); border: 1px solid rgba(199, 125, 255, 0.25); }
.tag--gold    { background: rgba(255, 209, 102, 0.15); color: #b8860b;               border: 1px solid rgba(255, 209, 102, 0.35); }
.tag--sky     { background: rgba(72, 202, 228, 0.12);  color: #0077b6;               border: 1px solid rgba(72, 202, 228, 0.3); }
.tag--blush   { background: rgba(255, 179, 198, 0.15); color: #c2185b;               border: 1px solid rgba(255, 179, 198, 0.4); }

/* CTA buttons */
.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 36px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--color-ink);
  color: var(--color-paper);
  position: relative;
  overflow: hidden;
}

.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-coral);
  transform: translateX(-101%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn--primary:hover::before {
  transform: translateX(0);
}

.btn--primary span {
  position: relative;
  z-index: 1;
}

.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border: 1.5px solid var(--color-ink);
}

.btn--ghost:hover {
  background: var(--color-marigold);
  border-color: var(--color-marigold);
  /* Marigold is yellow in both themes, so force dark text — otherwise
     dark mode's near-white --color-ink is unreadable on the fill. */
  color: #1a1a2e;
}

/* Hero right: animated SVG logo */
.hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__logo-wrap {
  position: relative;
  width: 380px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__logo-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 107, 107, 0.15),
    rgba(0, 201, 167, 0.15),
    rgba(199, 125, 255, 0.15),
    rgba(255, 209, 102, 0.15),
    rgba(255, 107, 107, 0.15)
  );
  animation: spin 20s linear infinite;
}

.hero__logo-ring {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1.5px dashed rgba(26, 26, 46, 0.12);
  animation: spin 30s linear infinite reverse;
}

[data-theme="dark"] .hero__logo-ring {
  border-color: rgba(240, 236, 228, 0.10);
}

.hero__logo-svg {
  position: relative;
  width: 300px;
  height: 300px;
}

/* SVG path drawing classes */
.logo-path {
  fill: none;
  stroke: var(--color-ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--path-len, 800);
  stroke-dashoffset: var(--path-len, 800);
  animation: draw-stroke var(--duration, 1s) cubic-bezier(0.4, 0, 0.2, 1) var(--delay, 0s) both;
}

/* Note-head fill: invisible until the strand "winds" it into being */
.yarn-fill {
  opacity: 0;
  animation: fade-in 0.45s ease var(--fill-delay, 0.95s) forwards;
}

/* Floating emoji bubbles — three pillars: code, music, handmade work.
   Appear after the SVG logo finishes drawing, then float gently. */
.hero__bubble {
  position: absolute;
  border-radius: 50%;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.28);
  opacity: 0;
  animation:
    bubble-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--bubble-delay, 0s) + 3.5s) forwards,
    drift var(--float-dur, 5s) ease-in-out infinite var(--float-delay, 4.1s);
}

[data-theme="dark"] .hero__bubble {
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.55);
}

.hero__bubble--code  { top: 18%;    right: 8px; background: var(--color-sky);
  --float-dur: 6.8s; --float-delay: 4.2s; --float-amp: 13px; }
.hero__bubble--music { bottom: 14%; right: 6%;    background: var(--color-lavender);
  --float-dur: 5.2s; --float-delay: 5.1s; --float-amp: 10px; }
.hero__bubble--handmade { bottom: 22%; left: -14px;  background: var(--color-marigold);
  --float-dur: 7.6s; --float-delay: 4.6s; --float-amp: 16px; }
.hero__bubble--video { top: 16%;    left: 4%;     background: var(--color-teal);
  --float-dur: 4.4s; --float-delay: 5.5s; --float-amp: 12px; }

/* =====================================================================
   MARQUEE STRIP
===================================================================== */

.marquee {
  background: var(--color-ink);
  color: var(--color-paper);
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.marquee__track {
  display: inline-flex;
  animation: marquee 22s linear infinite;
}

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

.marquee__item {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 40px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.marquee__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* =====================================================================
   WORK SECTION
===================================================================== */

.work {
  /* Gentle base wash so no part of the section reads as an empty void —
     a soft lavender glow centred behind the header ties it together */
  background:
    radial-gradient(90% 55% at 50% 16%, rgba(199, 125, 255, 0.10), transparent 70%),
    var(--bg-work);
  overflow: hidden;
}

/* Two large, very soft color blobs slowly drifting behind the content */
.work::before,
.work::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
  z-index: 0;
  pointer-events: none;
}

.work::before {
  width: 680px; height: 680px;
  top: -60px; left: 4%;
  background: radial-gradient(circle, rgba(255, 107, 107, 0.55), rgba(255, 209, 102, 0.35) 45%, transparent 70%);
  animation: aurora-drift-a 19s ease-in-out infinite alternate;
}

.work::after {
  width: 720px; height: 720px;
  bottom: -120px; right: 2%;
  background: radial-gradient(circle, rgba(72, 202, 228, 0.5), rgba(199, 125, 255, 0.4) 45%, transparent 70%);
  animation: aurora-drift-b 24s ease-in-out infinite alternate;
}

/* Keep all section content above the aurora */
.work > * {
  position: relative;
  z-index: 1;
}

@keyframes aurora-drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(50px, 30px) scale(1.08); }
}

@keyframes aurora-drift-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-45px, -30px) scale(1.06); }
}

.work__grid {
  /* Flex wrap keeps every card the same size and centers any
     partially-filled last row instead of leaving an empty slot.
     Wide enough that a 4-card (Projects) or 5-card (Experience)
     group sits on a single row on laptop/desktop. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  max-width: 1560px;
  margin: 0 auto;
}

/* Per-card accent is set inline on each card (--card-accent /
   --card-accent-rgb) so it stays correct across the two separate
   grids — drives strip, glow, icon, pills, link and hover shadow. */

/* Sub-group label: a quiet mono caption with a fading rule, so the
   Experience / Projects split reads clearly and no row feels orphaned */
.work__group + .work__group { margin-top: 72px; }

.work__group-label {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto 34px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-ink);
  opacity: 0.5;
}

.work__group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--color-border), transparent);
}

.work-card {
  /* Cards flex down so a whole group fits one row on wide screens,
     then wrap (and stay centered) as the viewport narrows */
  flex: 1 1 260px;
  max-width: 360px;
  /* Column layout + a baseline height so a card that's alone on its
     row (or has short copy) keeps the same presence as a full row */
  display: flex;
  flex-direction: column;
  min-height: 432px;
  /* Accent-tinted surface + a soft glow blooming from the top-left */
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(var(--card-accent-rgb), 0.14), transparent 60%),
    linear-gradient(180deg, rgba(var(--card-accent-rgb), 0.06), transparent 45%),
    var(--color-surface);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(var(--card-accent-rgb), 0.22);
  /* Uses the standalone rotate/translate props so the scroll-reveal's
     `transform: ... !important` can't clobber the hover lift. */
  transition: rotate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              translate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative;
  /* Resting shadow so cards lift off the background */
  box-shadow: 0 2px 16px rgba(26, 26, 46, 0.07);
}

/* Glowing color accent strip along the top of each card */
.work-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg,
    var(--card-accent),
    rgba(var(--card-accent-rgb), 0.55));
  box-shadow: 0 0 18px rgba(var(--card-accent-rgb), 0.55);
  /* Lets the accent strip "draw" itself in from the left on reveal */
  transform-origin: left center;
}

.work-card:hover {
  /* Clean vertical lift on hover — no tilt, for a sleeker feel */
  translate: 0 -6px;
  rotate: 0deg;
  z-index: 2;
  border-color: rgba(var(--card-accent-rgb), 0.5);
  box-shadow:
    0 24px 60px rgba(var(--card-accent-rgb), 0.28),
    0 8px 24px rgba(26, 26, 46, 0.12);
}

.work-card__header {
  padding: 32px 32px 0;
  position: relative;
}

.work-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  /* Accent-tinted chip with a hairline ring and a soft inner highlight —
     reads as a polished glyph rather than a flat colored square */
  color: var(--card-accent);
  background:
    linear-gradient(160deg, rgba(var(--card-accent-rgb), 0.16), rgba(var(--card-accent-rgb), 0.07));
  border: 1px solid rgba(var(--card-accent-rgb), 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 4px 12px rgba(var(--card-accent-rgb), 0.14);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease;
}

.work-card:hover .work-card__icon {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 20px rgba(var(--card-accent-rgb), 0.28);
}

.work-card__icon svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.work-card__role {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ink);
  opacity: 0.55;  /* 0.4 was too dim in dark mode */
  margin-bottom: 6px;
}

.work-card__title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-ink);
  margin-bottom: 0;
  transition: color 0.3s ease;
}

.work-card:hover .work-card__title {
  color: var(--card-accent);
}

.work-card__body {
  padding: 20px 32px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.work-card__description {
  font-size: 0.92rem;
  line-height: 1.75;
  opacity: 0.7;
  margin-bottom: 20px;
}

.work-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.stack-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  /* Use border instead of background fill — works in both modes */
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-ink);
  opacity: 0.8;
}

/* Inside work cards, tint pills with the card's accent */
.work-card .stack-pill {
  background: rgba(var(--card-accent-rgb), 0.1);
  border-color: rgba(var(--card-accent-rgb), 0.35);
  color: var(--card-accent);
  opacity: 1;
}

.work-card__link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--card-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  border-bottom: 1.5px solid rgba(var(--card-accent-rgb), 0.4);
  transition: color 0.2s ease, gap 0.2s ease, border-color 0.2s ease;
}

.work-card__link:hover {
  color: var(--card-accent);
  border-bottom-color: var(--card-accent);
  gap: 14px;
}

/* Row holding the live-site link plus an optional source link */
.work-card__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  /* Pin the CTA row to the bottom so it lines up across cards
     regardless of how long each description runs */
  margin-top: auto;
}

/* Secondary "source" link — quieter than the primary live link,
   leads with a GitHub mark, and warms to the card accent on hover */
.work-card__link--git {
  border-bottom: none;
  color: var(--color-ink);
  opacity: 0.55;
}

.work-card__link--git:hover {
  color: var(--card-accent);
  border-bottom-color: transparent;
  opacity: 1;
  gap: 8px;
}

.work-card__link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* =====================================================================
   DELIGHTFUL CARD ENTRANCE
   Each card springs up + settles when it scrolls into view, then its
   insides cascade in: strip draws across, icon pops, copy rises, the
   tech pills bounce in one-by-one, and a light sheen sweeps over once.
   Driven by the existing .needs-reveal / .is-visible observer.
===================================================================== */

/* Card container: springy overshoot instead of a flat fade-up.
   Uses `transform` only (hover uses translate/rotate), so the lift
   on hover still composes cleanly after the entrance settles. */
.work-card.reveal {
  /* Keep the base card's hover transitions (rotate/translate/shadow/
     border) intact while adding the springy entrance transform. */
  transition: opacity 0.7s ease,
              transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1),
              rotate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              translate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease, border-color 0.35s ease;
}

.work-card.reveal.needs-reveal {
  opacity: 0;
  transform: translateY(56px) scale(0.9) rotate(-2.5deg);
}

/* One-time light sheen that sweeps diagonally across the card */
.work-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.07) 49%,
    transparent 60%);
  opacity: 0;
}

/* Children rest in their normal spot; the cascade only plays on reveal */
.work-card.reveal.is-visible::before {
  animation: strip-draw 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s backwards;
}

.work-card.reveal.is-visible::after {
  animation: card-sheen 1.1s ease 0.35s backwards;
}

.work-card.reveal.is-visible .work-card__icon {
  animation: icon-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.18s backwards;
}

.work-card.reveal.is-visible .work-card__title {
  animation: copy-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.26s backwards;
}

.work-card.reveal.is-visible .work-card__role {
  animation: copy-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.22s backwards;
}

.work-card.reveal.is-visible .work-card__description {
  animation: copy-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.34s backwards;
}

.work-card.reveal.is-visible .work-card__link {
  animation: copy-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.6s backwards;
}

/* Tech pills bounce in one after another */
.work-card.reveal.is-visible .stack-pill {
  animation: pill-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.work-card.reveal.is-visible .stack-pill:nth-child(1) { animation-delay: 0.40s; }
.work-card.reveal.is-visible .stack-pill:nth-child(2) { animation-delay: 0.46s; }
.work-card.reveal.is-visible .stack-pill:nth-child(3) { animation-delay: 0.52s; }
.work-card.reveal.is-visible .stack-pill:nth-child(4) { animation-delay: 0.58s; }
.work-card.reveal.is-visible .stack-pill:nth-child(5) { animation-delay: 0.64s; }

@keyframes strip-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes card-sheen {
  0%   { opacity: 0; transform: translateX(-55%); }
  40%  { opacity: 0.55; }
  100% { opacity: 0; transform: translateX(55%); }
}

@keyframes icon-pop {
  0%   { opacity: 0; transform: scale(0.3) rotate(-30deg); }
  55%  { opacity: 1; transform: scale(1.15) rotate(7deg); }
  75%  { transform: scale(0.96) rotate(-2deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes copy-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes pill-in {
  0%   { opacity: 0; transform: translateY(10px) scale(0.7); }
  70%  { transform: translateY(0) scale(1.08); }
  100% { opacity: 1; transform: none; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .work::before,
  .work::after { animation: none; }

  .social-link:hover,
  .social-link:focus-visible { transform: none; }

  .work-card.reveal {
    transition: opacity 0.4s ease;
  }
  .work-card.reveal.needs-reveal {
    transform: none;
  }
  .work-card.reveal.is-visible::before,
  .work-card.reveal.is-visible::after,
  .work-card.reveal.is-visible .work-card__icon,
  .work-card.reveal.is-visible .work-card__role,
  .work-card.reveal.is-visible .work-card__title,
  .work-card.reveal.is-visible .work-card__description,
  .work-card.reveal.is-visible .work-card__link,
  .work-card.reveal.is-visible .stack-pill {
    animation: none;
  }
  .work-card::after { display: none; }
}

/* =====================================================================
   HANDMADE SECTION
===================================================================== */

.handmade {
  /* Keep the lavender base, add the same drifting color bursts the
     Work section uses so the section doesn't read as a flat panel */
  background:
    radial-gradient(90% 55% at 50% 14%, rgba(199, 125, 255, 0.10), transparent 70%),
    var(--bg-handmade);
  overflow: hidden;
}

.handmade::before,
.handmade::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
  z-index: 0;
  pointer-events: none;
}

.handmade::before {
  width: 680px; height: 680px;
  top: -80px; left: 2%;
  background: radial-gradient(circle, rgba(199, 125, 255, 0.5), rgba(255, 179, 198, 0.38) 45%, transparent 70%);
  animation: aurora-drift-a 21s ease-in-out infinite alternate;
}

.handmade::after {
  width: 720px; height: 720px;
  bottom: -140px; right: 3%;
  background: radial-gradient(circle, rgba(72, 202, 228, 0.45), rgba(255, 209, 102, 0.32) 45%, transparent 70%);
  animation: aurora-drift-b 26s ease-in-out infinite alternate;
}

.handmade > * {
  position: relative;
  z-index: 1;
}

.handmade__filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 56px;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 24px;
  border-radius: 100px;
  border: 1.5px solid var(--color-ink);
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  transition: all 0.25s ease;
  opacity: 0.7;
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-paper);
  opacity: 1;
}

/* Per-discipline icon accents. Light mode uses deepened shades so each icon
   clears 3:1 (WCAG 1.4.11) on the pale --bg-handmade; dark mode uses the
   bright palette which clears 3:1 on the dark section background. */
.filter-btn[data-filter="crochet"]      { --ico-accent: #0d7d6b; }
.filter-btn[data-filter="knitting"]     { --ico-accent: #7c3aed; }
.filter-btn[data-filter="cross-stitch"] { --ico-accent: #c2255c; }
.filter-btn[data-filter="sewing"]       { --ico-accent: #0e7490; }
[data-theme="dark"] .filter-btn[data-filter="crochet"]      { --ico-accent: var(--color-teal); }
[data-theme="dark"] .filter-btn[data-filter="knitting"]     { --ico-accent: var(--color-lavender); }
[data-theme="dark"] .filter-btn[data-filter="cross-stitch"] { --ico-accent: var(--color-blush); }
[data-theme="dark"] .filter-btn[data-filter="sewing"]       { --ico-accent: var(--color-sky); }

/* .ico already sets stroke:currentColor, so recoloring `color` recolors
   the icon. On hover/active the button fills with ink, so the icon flips
   to paper to stay high-contrast against that solid fill. */
.filter-btn .ico                         { color: var(--ico-accent); }
.filter-btn:hover .ico,
.filter-btn.is-active .ico               { color: var(--color-paper); }

/*
 * Masonry grid using CSS columns.
 * Cards hidden via JS get display:none; we remove them from the DOM
 * flow while keeping the columns intact by never having 0 visible
 * cards in a column (JS ensures at least some are always visible).
 */
/*
 * True Pinterest-style masonry:
 * - CSS columns with no fixed height — images keep natural aspect ratio
 * - Only the first photo per card shows (extras hidden)
 * - Cards use display:block, not inline-block, for reliable column flow
 */
.handmade__masonry {
  column-count: 4;
  column-gap: 14px;
  max-width: 1400px;
  margin: 0 auto;
}

.handmade-card {
  display: block;        /* block, not inline-block — columns need this */
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
}

.handmade-card:hover {
  transform: scale(1.025);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}

/* Capped height keeps any single image from dominating a column */
.handmade-card img,
.handmade-card-img {
  width: 100%;
  height: auto;
  max-height: 380px;
  display: block;
  object-fit: cover;
}

/* Only show first photo per card */
.handmade-card img ~ img,
.handmade-card .handmade-card-img ~ .handmade-card-img {
  display: none;
}

/* Cards hidden by the Show More limit */
.handmade-card.is-hidden {
  display: none;
}

/* Cards hidden by the active filter */
.handmade-card.is-filtered-out {
  display: none;
}

.handmade__footer {
  text-align: center;
  margin-top: 40px;
}

.show-more-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 40px;
  border-radius: 4px;
  border: 1.5px solid var(--color-ink);
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.show-more-btn:hover {
  background: var(--color-ink);
  color: var(--color-paper);
}

.show-more-btn .btn-count {
  font-size: 0.68rem;
  opacity: 0.55;
}

/* Hover overlay — hidden by default, slides up on hover (desktop) */
.handmade-card__overlay,
.handmade-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 16px;
  background: linear-gradient(transparent, rgba(10, 8, 20, 0.88));
  border-radius: 0 0 10px 10px;
  color: white;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.handmade-card:hover .handmade-card__overlay,
.handmade-card:hover .handmade-overlay {
  opacity: 1;
  transform: translateY(0);
}

.handmade-card__overlay h4,
.handmade-overlay h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.3;
}

.handmade-card__overlay p,
.handmade-overlay p {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* Mobile: always show overlay (no hover on touch screens) */
@media (hover: none) {
  .handmade-card__overlay,
  .handmade-overlay {
    opacity: 1;
    transform: translateY(0);
    /* Slightly smaller so it doesn't dominate the image */
    padding: 28px 12px 10px;
    font-size: 0.85rem;
  }
}

/* =====================================================================
   VIDEOS SECTION
===================================================================== */

.videos {
  /* Keep the sky-blue base, layer in the drifting color bursts */
  background:
    radial-gradient(90% 55% at 50% 14%, rgba(72, 202, 228, 0.10), transparent 70%),
    var(--bg-videos);
  overflow: hidden;
}

.videos::before,
.videos::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
  z-index: 0;
  pointer-events: none;
}

.videos::before {
  width: 700px; height: 700px;
  top: -90px; left: 3%;
  background: radial-gradient(circle, rgba(72, 202, 228, 0.5), rgba(0, 201, 167, 0.34) 45%, transparent 70%);
  animation: aurora-drift-b 23s ease-in-out infinite alternate;
}

.videos::after {
  width: 720px; height: 720px;
  bottom: -130px; right: 2%;
  background: radial-gradient(circle, rgba(199, 125, 255, 0.42), rgba(255, 107, 107, 0.3) 45%, transparent 70%);
  animation: aurora-drift-a 27s ease-in-out infinite alternate;
}

.videos > * {
  position: relative;
  z-index: 1;
}

.videos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.video-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(26, 26, 46, 0.12);
}

.video-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
}

.video-card__label {
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--color-ink);
  opacity: 0.45;
  text-transform: uppercase;
}

/* =====================================================================
   ABOUT SECTION
===================================================================== */

.about {
  /* Dark base kept; richer color bursts (the section is always dark,
     so the blobs get a touch more presence to glow through) */
  background:
    radial-gradient(90% 55% at 50% 14%, rgba(199, 125, 255, 0.14), transparent 70%),
    var(--bg-about);
  color: var(--color-on-dark);
  overflow: hidden;
}

.about::before,
.about::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

.about::before {
  width: 700px; height: 700px;
  top: -100px; left: 2%;
  background: radial-gradient(circle, rgba(255, 107, 107, 0.45), rgba(199, 125, 255, 0.38) 45%, transparent 70%);
  animation: aurora-drift-a 22s ease-in-out infinite alternate;
}

.about::after {
  width: 740px; height: 740px;
  bottom: -150px; right: 2%;
  background: radial-gradient(circle, rgba(72, 202, 228, 0.4), rgba(0, 201, 167, 0.34) 45%, transparent 70%);
  animation: aurora-drift-b 25s ease-in-out infinite alternate;
}

.about > * {
  position: relative;
  z-index: 1;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.about__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-marigold);
  margin-bottom: 16px;
}

.about__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 28px;
}

.about__title em {
  font-style: italic;
  color: var(--color-coral);
}

.about__text {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-on-dark);
  opacity: 0.82;
  margin-bottom: 18px;
}

.about__links {
  margin-top: 40px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.about__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-on-dark);
  text-decoration: none;
  padding: 11px 20px;
  border: 1px solid rgba(240, 236, 228, 0.35);
  border-radius: 4px;
  transition: all 0.25s ease;
}

.about__link:hover {
  background: var(--color-coral);
  border-color: var(--color-coral);
}

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.skill-block {
  padding: 24px;
  border: 1px solid var(--color-on-dark-faint);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  transition: background 0.3s ease, transform 0.3s ease;
}

.skill-block:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-4px);
}

.skill-block__icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.skill-block__name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  font-style: italic;
  color: var(--color-on-dark);
  margin-bottom: 6px;
}

.skill-block__detail {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 300;
  color: var(--color-on-dark);
  opacity: 0.65;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.skill-since {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--color-on-dark-muted);
}
.skill-since__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

/* Fun facts row */
.about__stats {
  grid-column: 1 / -1;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 48px;
  border-top: 1px solid var(--color-border);
}

.stat {
  flex: 1;
  min-width: 140px;
  text-align: center;
}

.stat__number {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  margin-bottom: 6px;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-on-dark);
  opacity: 0.55;
}

/* =====================================================================
   FOOTER
===================================================================== */

.footer {
  background: var(--bg-about);
  color: var(--color-on-dark);
  border-top: 1px solid color-mix(in srgb, var(--color-on-dark) 12%, transparent);
  padding: 28px var(--section-padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  z-index: 1;
}

/* Brief grow-then-settle when the hero "Say Hello" button is clicked,
   so the footer draws attention as the page scrolls to it. */
@keyframes footer-greet {
  0%   { transform: scale(1); }
  /* Grow quickly to the peak in the first ~20% of the timeline... */
  20%  { transform: scale(1.45); }
  /* ...then take the remaining ~80% easing slowly back to normal. */
  100% { transform: scale(1); }
}

/* Only the social circles pulse — grows fast, settles slow. They
   stagger left-to-right so it reads as a little wave hello. */
.footer--greet .social-link {
  animation: footer-greet 1.6s ease-out;
}
.footer--greet .social-link:nth-child(2) { animation-delay: 0.07s; }
.footer--greet .social-link:nth-child(3) { animation-delay: 0.14s; }
.footer--greet .social-link:nth-child(4) { animation-delay: 0.21s; }
.footer--greet .social-link:nth-child(5) { animation-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
  .footer--greet .social-link { animation: none; }
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-on-dark);
  border: 1px solid color-mix(in srgb, var(--color-on-dark) 28%, transparent);
  transition: color 0.22s ease, border-color 0.22s ease,
              background 0.22s ease, transform 0.22s ease;
}

.social-link svg {
  width: 17px;
  height: 17px;
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--color-coral);
  border-color: var(--color-coral);
  transform: translateY(-2px);
  outline: none;
}

.footer__brand {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  opacity: 0.45;
}

.footer__heart {
  color: var(--color-coral);
  display: inline-block;
  animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.2); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  56% { transform: scale(1); }
}

/* Theme toggle pill — sits after the nav links */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle:hover {
  background: var(--color-border);
}

/* Show/hide sun and moon icons based on current mode */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }

[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Inline line-icons (replace emoji) */
.ico {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.theme-toggle           { color: var(--color-ink); }
.theme-toggle .ico       { width: 1.15rem; height: 1.15rem; stroke: var(--color-ink); }
.skill-block__icon .ico  { width: 1.7rem; height: 1.7rem; stroke-width: 1.5; }
.hero__bubble            { color: rgba(20, 18, 28, 0.78); }
.hero__bubble .ico       { width: 1.55rem; height: 1.55rem; }
.filter-btn              { display: inline-flex; align-items: center; gap: 8px; }
.ico--hook               { width: 1.3em; height: 1.3em; vertical-align: -0.32em; margin: -0.15em 0; }
.tag .ico                { opacity: 0.9; }
.work-card__role .ico    {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.28em;
  margin-right: 5px;
  color: var(--color-marigold);
}

/* =====================================================================
   RESPONSIVE — TABLET (≤ 900px)
===================================================================== */

@media (max-width: 900px) {
  :root {
    --section-padding-y: 80px;
    --section-padding-x: 28px;
  }

  .nav {
    padding: 0 24px;
    gap: 16px;
  }

  .nav__right {
    gap: 20px;
  }

  .nav__links {
    gap: 18px;
  }

  .nav__links a {
    font-size: 0.7rem;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__eyebrow {
    justify-content: center;
  }

  .hero__description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__tags {
    justify-content: center;
  }

  .hero__cta {
    justify-content: center;
  }

  .hero__visual {
    margin-top: 16px;
  }

  .hero__logo-wrap {
    width: 300px;
    height: 300px;
  }

  .hero__logo-svg {
    width: 230px;
    height: 230px;
  }

  .work__grid,
  .work__group-label {
    max-width: 760px;
  }

  .handmade__masonry {
    column-count: 3;
    column-gap: 12px;
  }

  .videos__grid {
    grid-template-columns: 1fr;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
}

/* =====================================================================
   RESPONSIVE — MOBILE (≤ 600px)
===================================================================== */

@media (max-width: 600px) {
  :root {
    --section-padding-y: 70px;
    --section-padding-x: 20px;
    --nav-height: 64px;
  }

  /* Nav: brand + theme toggle + hamburger on one line; links drop down */
  .nav {
    height: var(--nav-height);
    min-height: 0;
    padding: 0 16px;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
  }

  .nav__logo {
    gap: 9px;
    min-width: 0;
  }

  .nav__logo-img {
    width: 34px;
    height: 34px;
  }

  .nav__brand {
    font-size: 0.74rem;
    white-space: normal;
    line-height: 1.2;
    max-width: 130px;
  }

  .nav__brand-subtitle {
    display: block;
    margin-top: 0;
  }

  .nav__right {
    flex: 0 0 auto;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
  }

  .nav__toggle {
    display: flex;
  }

  .theme-toggle {
    flex: 0 0 auto;
    padding: 8px 12px;
  }

  /* Links become a full-width panel that drops from under the bar */
  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 95;
    flex-direction: column;
    gap: 0;
    background: var(--color-nav);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    padding: 8px 0 14px;
    /* Hidden until the hamburger opens it */
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.22s ease, visibility 0.28s;
  }

  .nav.is-menu-open .nav__links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav__links li {
    width: 100%;
  }

  .nav__links a {
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    padding: 16px 24px;
    border-bottom: none;
    white-space: nowrap;
  }

  .nav__links a:hover,
  .nav__links a:active {
    background: rgba(255, 107, 107, 0.08);
    border-bottom-color: transparent;
  }

  .hero__title {
    font-size: 2.8rem;
  }

  .hero__tagline {
    font-size: 1.2rem;
  }

  .work__grid,
  .work__group-label {
    max-width: 420px;
  }

  .work-card {
    max-width: none;
  }

  /* Tighter card padding so copy isn't squeezed into a narrow column */
  .work-card__header {
    padding: 26px 22px 0;
  }

  .work-card__body {
    padding: 16px 22px 26px;
  }

  /* Section headers: less dead space above the content on phones */
  .section__header {
    margin-bottom: 44px;
  }

  .section__subtitle {
    font-size: 0.95rem;
  }

  /* Hero: full-bleed stacked buttons are easier to tap one-handed */
  .hero {
    padding-top: calc(var(--nav-height) + 28px);
    padding-bottom: 56px;
    gap: 36px;
  }

  .hero__description {
    font-size: 1rem;
  }

  .hero__cta {
    width: 100%;
  }

  .hero__cta .btn {
    flex: 1 1 100%;
    text-align: center;
    padding: 16px 24px;
  }

  .handmade__masonry {
    column-count: 2;
    column-gap: 10px;
  }

  .handmade-card img,
  .handmade-card-img {
    height: 240px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .about__stats {
    gap: 20px;
  }

  .stat__number {
    font-size: 2.4rem;
  }

  .about__links {
    gap: 10px;
  }

  .about__link {
    font-size: 0.68rem;
    padding: 10px 14px;
  }

  .section__title {
    font-size: 1.9rem;
  }

  .marquee__item {
    font-size: 0.7rem;
    padding: 0 20px;
  }

  /* Slot the logo between the eyebrow and the title on mobile.
     display: contents lifts .hero__content's children up to be flex
     items of .hero so they can be reordered alongside .hero__visual. */
  .hero {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .hero__content {
    display: contents;
  }

  .hero__eyebrow     { order: 1; }
  .hero__visual      { order: 2; margin-top: 0; margin-bottom: 24px; }
  .hero__title       { order: 3; }
  .hero__tagline     { order: 4; }
  .hero__description { order: 5; }
  .hero__tags        { order: 6; }
  .hero__cta         { order: 7; }
}

/* =====================================================================
   RESPONSIVE — SMALL PHONES (≤ 380px)
===================================================================== */

@media (max-width: 380px) {
  .nav__brand {
    font-size: 0.66rem;
  }

  .hero__title {
    font-size: 2.4rem;
  }

  .handmade__masonry {
    column-count: 1;
  }

  .hero__logo-wrap {
    width: 250px;
    height: 250px;
  }

  .hero__logo-svg {
    width: 185px;
    height: 185px;
  }
}
