/* ==========================================================================
   Girish Soman — Portfolio | Part 1: tokens, themes, reset, type, layout
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Fluid type scale — interpolates with the viewport */
  --fs-display: clamp(2.5rem, 1.2rem + 5vw, 5rem);
  --fs-h1: clamp(2.125rem, 1.4rem + 3.2vw, 3.5rem);
  --fs-h2: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);
  --fs-lead: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;
  --fs-2xs: 0.75rem;

  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-relaxed: 1.7;
  --tracking-tight: -0.016em;
  --tracking-tighter: -0.03em;
  --tracking-widest: 0.14em;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-32: 8rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-2xl: 32px;
  --radius-full: 999px;

  --container: 1080px;
  --header-h: 52px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Motion — the character of the site lives in these curves */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 160ms;
  --dur-base: 260ms;
  --dur-slow: 420ms;
  --dur-slower: 720ms;

  --z-bg: 0;
  --z-content: 1;
  --z-header: 100;
  --z-drawer: 200;
  --z-palette: 300;
  --z-toast: 400;

  color-scheme: light dark;
}

/* Semantic tokens only below here — components never touch a raw hex. */
[data-theme='dark'] {
  --bg: #000000;
  --bg-elevated: #0b0b0c;
  --surface: #161617;
  --surface-solid: #1d1d1f;
  --fill: rgba(255, 255, 255, 0.08);
  --fill-hover: rgba(255, 255, 255, 0.13);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --accent: #2997ff;
  --accent-hover: #47a6ff;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(41, 151, 255, 0.14);
  --accent-ring: rgba(41, 151, 255, 0.45);
  --success: #30d158;
  --glass-bg: rgba(22, 22, 23, 0.72);
  --glass-blur: saturate(180%) blur(20px);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
}

[data-theme='light'] {
  --bg: #ffffff;
  --bg-elevated: #fbfbfd;
  --surface: #f5f5f7;
  --surface-solid: #ffffff;
  --fill: rgba(0, 0, 0, 0.05);
  --fill-hover: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --accent-ring: rgba(0, 113, 227, 0.35);
  --success: #1e9e3a;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-blur: saturate(180%) blur(20px);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 24px 60px -22px rgba(0, 0, 0, 0.2);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-6));
  height: 100%;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  overflow-x: hidden;
  transition: background-color var(--dur-slow) var(--ease-standard),
    color var(--dur-slow) var(--ease-standard);
}

body[data-scroll-locked] { overflow: hidden; }

img, svg, picture, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: none; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: var(--accent-contrast); }

/* Visible for keyboard users, out of the way for pointer users */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
:focus:not(:focus-visible) { outline: none; }

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

.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  transform: translateY(-180%);
  transition: transform var(--dur-base) var(--ease-out-expo);
}
.skip-link:focus-visible { transform: translateY(0); outline-offset: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

.display { font-size: var(--fs-display); font-weight: var(--fw-bold); line-height: 1.05; letter-spacing: var(--tracking-tighter); }
.h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: 1.1; letter-spacing: var(--tracking-tighter); }
.h2 { font-size: var(--fs-h2); font-weight: var(--fw-bold); line-height: 1.08; letter-spacing: var(--tracking-tighter); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.body-text { color: var(--text-secondary); line-height: var(--lh-relaxed); text-wrap: pretty; }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.mono { font-family: var(--font-mono); font-feature-settings: 'liga' 0; }

.text-gradient {
  background: linear-gradient(100deg, #2997ff 0%, #5e5ce6 60%, #bf5af2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--accent);
}

/* Apple-style "Learn more >" text link */
.link-more { display: inline-flex; align-items: center; gap: 0.2em; color: var(--accent); font-weight: var(--fw-medium); }
.link-more::after { content: '\203A'; font-size: 1.25em; line-height: 1; transform: translateY(-0.04em); transition: transform var(--dur-base) var(--ease-out-expo); }
.link-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-more:hover::after { transform: translate(2px, -0.04em); }

.link-underline { position: relative; color: var(--accent); font-weight: var(--fw-medium); }
.link-underline::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out-expo);
}
.link-underline:hover::after, .link-underline:focus-visible::after { transform: scaleX(1); }

/* Layout primitives */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; z-index: var(--z-content); padding-block: clamp(var(--space-16), 9vw, 7.5rem); }
.section--tight { padding-block: clamp(var(--space-10), 6vw, var(--space-16)); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 46rem;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}

.divider { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--border), transparent); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* ==========================================================================
   Part 2: buttons, badges, cards, header, nav, drawer, command palette
   ========================================================================== */

.btn {
  --btn-bg: var(--fill);
  --btn-fg: var(--text);
  --btn-border: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.62rem 1.2rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-full);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    color var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-spring),
    box-shadow var(--dur-base) var(--ease-standard);
}
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 80ms; }
.btn__icon { width: 1.05em; height: 1.05em; flex: none; }

.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-hover); }


.btn--ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--text-secondary); }
.btn--ghost:hover { color: var(--text); background: var(--fill); }
.btn--lg { padding: 0.8rem 1.55rem; font-size: var(--fs-body); }
.btn--sm { padding: 0.32rem 0.85rem; font-size: var(--fs-xs); }
.btn--icon { width: 38px; height: 38px; padding: 0; color: var(--text-secondary); }
.btn--icon:hover { color: var(--text); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--fill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  letter-spacing: 0;
}
.badge--accent { background: var(--accent-soft); color: var(--accent); }

.pulse-dot { position: relative; display: inline-flex; width: 7px; height: 7px; flex: none; }
.pulse-dot::before, .pulse-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--success); }
.pulse-dot::before { animation: ping 1.9s var(--ease-out-expo) infinite; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--fill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  letter-spacing: -0.005em;
  transition: color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard);
}
a.chip:hover { color: var(--text); background: var(--fill-hover); }

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  padding: 0.15em 0.4em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--fill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-tertiary);
}

/* Materials */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
}

.card {
  position: relative;
  padding: clamp(var(--space-6), 3.2vw, 2.5rem);
  border-radius: var(--radius-xl);
  background: var(--surface);
  isolation: isolate;
  overflow: hidden;
}


/* Header */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-slow) var(--ease-standard),
    border-color var(--dur-slow) var(--ease-standard),
    box-shadow var(--dur-slow) var(--ease-standard);
}

/* Condenses into frosted glass once the user leaves the top of the page */
.header[data-condensed='true'] {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); width: 100%; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.015em;
  color: var(--text);
}

.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 45%, #a855f7));
  color: #fff;
  font-size: 0.8rem;
  font-weight: var(--fw-bold);
  letter-spacing: -0.05em;
  transition: transform var(--dur-base) var(--ease-spring);
}
/* GitHub photo sits over the "G", which stays as the fallback if it fails to load */
.brand__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.brand:hover .brand__mark { transform: scale(1.06); }

/* Nav with a sliding pill indicator behind the active link */
.nav {
  position: relative;
  display: none;
  align-items: center;
  gap: 0;
}

.nav__indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: var(--radius-full);
  background: var(--fill-hover);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--dur-slow) var(--ease-out-expo),
    width var(--dur-slow) var(--ease-out-expo),
    opacity var(--dur-base) var(--ease-standard);
}

.nav__link {
  position: relative;
  z-index: 1;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-secondary);
  transition: color var(--dur-base) var(--ease-standard);
}
.nav__link:hover, .nav__link[aria-current='true'] { color: var(--text); }

.header__actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.header__cta { display: none; }

.palette-trigger {
  display: none;
  align-items: center;
  gap: var(--space-3);
  padding: 0.32rem 0.4rem 0.32rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--fill);
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  transition: color var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard);
}
.palette-trigger:hover { color: var(--text); background: var(--fill-hover); }

/* Theme toggle — three-state segmented control */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--radius-full);
  background: var(--fill);
}

.theme-toggle__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-slow) var(--ease-spring);
}

.theme-toggle__option {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  transition: color var(--dur-base) var(--ease-standard);
}
.theme-toggle__option svg { width: 15px; height: 15px; }
.theme-toggle__option:hover { color: var(--text-secondary); }
.theme-toggle__option[aria-checked='true'] { color: var(--text); }

.menu-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--fill);
  color: var(--text);
}
.menu-btn__bars { position: relative; width: 16px; height: 10px; }
.menu-btn__bars span {
  position: absolute;
  left: 0;
  width: 100%; height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur-base) var(--ease-out-expo);
}
.menu-btn__bars span:nth-child(1) { top: 0; }
.menu-btn__bars span:nth-child(2) { bottom: 0; }
.menu-btn[aria-expanded='true'] .menu-btn__bars span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.menu-btn[aria-expanded='true'] .menu-btn__bars span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); visibility: hidden; }
.drawer[data-open='true'] { visibility: visible; }

.drawer__scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-standard);
}
.drawer[data-open='true'] .drawer__scrim { opacity: 1; }

.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(86vw, 340px);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: calc(var(--header-h) + var(--space-6)) var(--space-6) var(--space-8);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out-expo);
}
.drawer[data-open='true'] .drawer__panel { transform: translateX(0); }

.drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border);
  font-size: 1.0625rem;
  font-weight: var(--fw-medium);
  color: var(--text);
  transition: color var(--dur-fast) var(--ease-standard), padding-left var(--dur-base) var(--ease-out-expo);
}
.drawer__link:hover { color: var(--accent); padding-left: var(--space-4); }
.drawer__link svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.drawer__footer { margin-top: auto; padding-top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }

/* Command palette */
.palette {
  position: fixed;
  inset: 0;
  z-index: var(--z-palette);
  display: grid;
  place-items: start center;
  padding: clamp(var(--space-8), 12vh, 8rem) var(--space-4) var(--space-4);
  visibility: hidden;
}
.palette[data-open='true'] { visibility: visible; }

.palette__scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-standard);
}
.palette[data-open='true'] .palette__scrim { opacity: 1; }

.palette__panel {
  position: relative;
  width: min(100%, 560px);
  max-height: min(60vh, 460px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  transition: opacity var(--dur-base) var(--ease-out-expo), transform var(--dur-base) var(--ease-out-expo);
}
.palette[data-open='true'] .palette__panel { opacity: 1; transform: translateY(0) scale(1); }

.palette__search { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); flex: none; }
.palette__search svg { width: 17px; height: 17px; color: var(--text-tertiary); flex: none; }
.palette__input { flex: 1; min-width: 0; font-size: var(--fs-body); color: var(--text); }
.palette__input::placeholder { color: var(--text-tertiary); }

.palette__list { overflow-y: auto; overscroll-behavior: contain; padding: var(--space-2); scroll-padding-block: var(--space-2); }
.palette__group-label {
  padding: var(--space-3) var(--space-3) var(--space-2);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
}

.palette__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.palette__item svg { width: 16px; height: 16px; flex: none; color: var(--text-tertiary); }
.palette__item[data-active='true'] { background: var(--accent-soft); color: var(--text); }
.palette__item[data-active='true'] svg { color: var(--accent); }
.palette__item-hint { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-tertiary); }

.palette__empty { padding: var(--space-8) var(--space-4); text-align: center; font-size: var(--fs-sm); color: var(--text-tertiary); }
.palette__footer {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  flex: none;
}
.palette__footer span { display: inline-flex; align-items: center; gap: var(--space-2); }

/* ==========================================================================
   Part 3: sections, floating UI, animations, responsive, a11y, print
   ========================================================================== */

/* Hero: centred and portrait-led */
.hero {
  position: relative;
  z-index: var(--z-content);
  padding-top: calc(var(--header-h) + clamp(var(--space-12), 9vh, 6.5rem));
  padding-bottom: clamp(var(--space-12), 8vw, var(--space-20));
  overflow: hidden;
}
/* One soft pool of light behind the portrait: the only ornament on the page */
.hero::before {
  content: '';
  position: absolute;
  top: -10%; left: 50%;
  width: min(1100px, 140vw);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-soft), transparent 72%);
  pointer-events: none;
  z-index: -1;
}
.hero__inner { display: flex; flex-direction: column; align-items: center; gap: var(--space-6); text-align: center; }
.hero__photo {
  width: clamp(104px, 12vw, 132px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border), 0 24px 48px -16px rgba(0, 0, 0, 0.45);
}
.hero__title { max-width: 14ch; }
.hero__lead { max-width: 40rem; text-wrap: balance; }
.hero__actions { justify-content: center; margin-top: var(--space-2); }
.hero__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-8); font-size: var(--fs-body); }
.hero__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-6); font-size: var(--fs-xs); color: var(--text-tertiary); }
.hero__meta li { display: inline-flex; align-items: center; gap: var(--space-2); }
.hero__meta svg { width: 14px; height: 14px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8) 0; padding-block: var(--space-8); border-block: 1px solid var(--border); }
.stat { padding-inline: var(--space-4); text-align: center; }
.stat__value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.05em;
  font-size: clamp(2.5rem, 1.6rem + 3vw, 4rem);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tighter);
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat__suffix { font-size: 0.6em; font-weight: var(--fw-semibold); color: var(--text-secondary); }
.stat__label { max-width: 16ch; margin: var(--space-2) auto 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--text-secondary); }

/* Experience timeline */
.timeline { display: flex; flex-direction: column; gap: var(--space-4); }
.timeline__item { position: relative; }

.role__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.role__company { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-secondary); }
.role__company svg { width: 14px; height: 14px; flex: none; }
.role__meta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.role__list { display: grid; gap: var(--space-5); }
.role__list li { position: relative; padding-left: var(--space-5); font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; }

.role__list li::before {
  content: '';
  position: absolute;
  left: 2px; top: 0.62em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
}
.role__list strong { display: block; margin-bottom: 2px; color: var(--text); font-weight: var(--fw-semibold); }
.role__stack { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border); }

/* Capabilities bento */
.bento { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.bento__cell { display: flex; flex-direction: column; gap: var(--space-3); }

.icon-tile {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
  transition: transform var(--dur-base) var(--ease-spring);
}
.icon-tile svg { width: 21px; height: 21px; }

.bento__title { font-size: 1.3125rem; font-weight: var(--fw-semibold); color: var(--text); }
.bento__text { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.55; }
.bento__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; padding-top: var(--space-4); }


/* Proficiency: label left, level right, hairline between rows */
.levels { display: grid; margin-top: var(--space-1); }
.level { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-3); border-bottom: 1px solid var(--border); }
.level:last-child { border-bottom: 0; }
.level dt { font-size: var(--fs-sm); color: var(--text); }
.level dd { font-size: var(--fs-xs); color: var(--text-secondary); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.project { display: flex; flex-direction: column; gap: var(--space-4); }
.project__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.project__arrow {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--fill);
  color: var(--text-secondary);
  flex: none;
  transition: transform var(--dur-base) var(--ease-out-expo),
    color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    background-color var(--dur-base) var(--ease-standard);
}
.project__arrow svg { width: 15px; height: 15px; }

.project__title { font-size: 1.5rem; font-weight: var(--fw-semibold); letter-spacing: -0.02em; }
.project__kind { margin-top: var(--space-1); font-size: var(--fs-sm); color: var(--text-tertiary); }
.oss-card .project__kind { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0; }
.project__text { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; }
.project__impact { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.project__impact > div { display: flex; flex-direction: column; gap: 2px; }
.project__impact dt { font-size: var(--fs-2xs); color: var(--text-tertiary); }
.project__impact dd { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text); }

/* Repo / live-demo links on project cards */
.project__links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.project__links .chip { gap: var(--space-1); }
.project__links .chip { color: var(--accent); background: var(--accent-soft); }
.project__links .chip:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.project__links .chip svg { width: 11px; height: 11px; }

/* Work has four content-heavy cards: two columns reads better than 3 + 1 */
@media (min-width: 768px) {
  .projects--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Showcase: one unit per plugin. Tabs on top, the film, then that plugin's panel */
.showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

/* One tile per plugin: the film on top, its details below. The hairline and
   shadow belong to the tile, so film and panel read as a single object. */
.showcase__unit {
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
}
[data-theme='dark'] .showcase__unit {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 40px 120px -48px rgba(41, 151, 255, 0.3);
}
[data-theme='light'] .showcase__unit {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 34px 80px -44px rgba(0, 0, 0, 0.28);
}

/* The film's own stage colour fills the frame */
.showcase__frame { position: relative; width: 100%; aspect-ratio: 16 / 10; }
[data-theme='dark'] .showcase__frame { background: #000; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
[data-theme='light'] .showcase__frame { background: #f5f5f7; }
/* Two stacked layers; the back one fades in once its first frame is ready */
.showcase__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 420ms var(--ease-standard);
}
.showcase__video.is-back { opacity: 0; pointer-events: none; }

.showcase__controls { display: flex; align-items: center; justify-content: center; gap: var(--space-3); }

/* Segmented control, in the style of the theme toggle */
.showcase__tabs {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-full);
  background: var(--fill);
}
.showcase__tabs-thumb {
  position: absolute;
  top: 4px; bottom: 4px; left: 0;
  border-radius: var(--radius-full);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-slow) var(--ease-out-expo), width var(--dur-slow) var(--ease-out-expo);
}
.showcase__tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1.1rem 0.5rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  color: var(--text-secondary);
  transition: color var(--dur-base) var(--ease-standard);
}
.showcase__tab:hover, .showcase__tab[aria-selected='true'] { color: var(--text); }
.showcase__tab-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  opacity: 0.55;
  filter: saturate(0.4);
  transition: opacity var(--dur-base) var(--ease-standard), filter var(--dur-base) var(--ease-standard);
}
.showcase__tab:hover .showcase__tab-icon,
.showcase__tab[aria-selected='true'] .showcase__tab-icon { opacity: 1; filter: none; }
.showcase__tab-short { display: none; }

/* Pause / play sits beside the tabs, as a sibling control */
.showcase__toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--fill);
  color: var(--text);
  transition: background-color var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-spring);
}
.showcase__toggle:hover { background: var(--fill-hover); }
.showcase__toggle:active { transform: scale(0.94); }
.showcase__toggle svg { width: 15px; height: 15px; }

/* Phones only: a small pill over the film */
.showcase__hint {
  display: none;
  position: absolute;
  left: var(--space-3); bottom: var(--space-3);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  color: #fff;
  pointer-events: none;
}

/* Phones: short labels, and the film opens full screen on tap, where it is legible */
@media (max-width: 640px) {
  .showcase__tab { padding: 0.45rem 0.8rem 0.45rem 0.45rem; gap: 0.4rem; font-size: var(--fs-xs); }
  .showcase__tab-icon { width: 20px; height: 20px; }
  .showcase__tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .showcase__tab-short { display: inline; }
  .showcase__unit { border-radius: var(--radius-lg); }
  .showcase__frame { cursor: zoom-in; }
  .showcase__hint { display: block; }
}

/* The selected plugin's details. All three panels share one grid cell, so the
   block is always as tall as the tallest and switching never moves the page. */
.reel-panels { display: grid; width: 100%; }
.reel-panel {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-6) clamp(var(--space-8), 5vw, var(--space-16));
  align-items: start;
  padding: clamp(var(--space-6), 3.5vw, 2.75rem);
  transition: opacity var(--dur-slow) var(--ease-standard), visibility 0s linear 0s;
}
.reel-panel[aria-hidden='true'] {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-standard), visibility 0s linear var(--dur-base);
}
.reel-panel__story { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.reel-panel__head { display: flex; align-items: center; gap: var(--space-4); }
.reel-panel__icon { width: 48px; height: 48px; flex: none; border-radius: 12px; }
.reel-panel__title { font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem); font-weight: var(--fw-semibold); letter-spacing: -0.025em; line-height: 1.15; }
.reel-panel__pkg { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.reel-panel__pkg code { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-tertiary); }
.reel-panel__text { font-size: var(--fs-body); line-height: 1.6; color: var(--text-secondary); }
.reel-panel .oss-card__install { margin-top: 0; }
.reel-panel__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.reel-panel__meta .oss-card__downloads { min-height: 0; }
.reel-panel__features { gap: var(--space-4); padding-top: var(--space-1); }
.reel-panel__features li { font-size: var(--fs-sm); line-height: 1.55; }

@media (max-width: 767px) {
  .reel-panel { grid-template-columns: minmax(0, 1fr); }
}

/* Open source */
.oss { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--space-4); }
.oss-card { display: flex; flex-direction: column; gap: var(--space-4); }
.oss-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.oss-card__head .icon-tile { margin: 0; }
.oss-card__version { font-variant-numeric: tabular-nums; }
.oss-card__features { display: grid; gap: var(--space-2); }
.oss-card__features li { display: flex; gap: var(--space-2); font-size: var(--fs-sm); line-height: 1.5; color: var(--text-secondary); }
.oss-card__features svg { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--success); }
.oss-card__install {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--fill);
}
.oss-card__install code {
  flex: 1;
  min-width: 0;
  padding-block: var(--space-1);
  overflow-wrap: anywhere;
  line-height: 1.5;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text);
}
.oss-card__install code span { color: var(--accent); }
.oss-card__install .btn--icon { flex: none; width: 30px; height: 30px; }
.oss-card__foot { display: grid; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
/* Keeps its line even while empty, so every card's footer lines up */
.oss-card__downloads { min-height: 1.5em; font-size: var(--fs-xs); color: var(--text-tertiary); }
.oss-card__downloads strong { color: var(--text); font-weight: var(--fw-semibold); }
.oss__more { margin-top: var(--space-6); text-align: center; font-size: var(--fs-sm); }
.oss__more a { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--accent); }
.oss__more a:hover { text-decoration: underline; text-underline-offset: 3px; }
.oss__more svg { width: 13px; height: 13px; }

/* GitHub activity — one card per account */
.gh-accounts { display: grid; gap: var(--space-4); }
.gh-account { display: flex; flex-direction: column; gap: var(--space-6); }

.gh-account__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
/* Placeholder underneath, photo on top. If the photo fails it is removed and
   the placeholder stays, like GitHub's default avatar. */
.gh-account__avatar {
  position: relative;
  display: grid;
  place-items: end center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: var(--fill-hover);
  color: var(--text-tertiary);
  box-shadow: inset 0 0 0 1px var(--border);
}
.gh-account__avatar svg { width: 34px; height: 34px; margin-bottom: -4px; }
.gh-account__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gh-account__id { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.gh-account__handle { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text); }
.gh-account__role { font-size: var(--fs-2xs); color: var(--text-tertiary); }

.gh-figures { display: flex; flex-wrap: wrap; gap: var(--space-5) var(--space-8); }
.gh-figure { display: flex; flex-direction: column; gap: 2px; }
.gh-figure__value {
  font-size: 1.75rem;
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.gh-figure__label { font-size: var(--fs-xs); color: var(--text-tertiary); }

/* Contribution calendar.
   GitHub's own five-step scale, so the graph reads as familiar rather than
   re-tinted to the site accent. Values lifted from GitHub's published palette. */
[data-theme='dark'] .cal-wrap {
  --cal-0: #161b22;
  --cal-1: #0e4429;
  --cal-2: #006d32;
  --cal-3: #26a641;
  --cal-4: #39d353;
  --cal-edge: rgba(255, 255, 255, 0.04);
}
[data-theme='light'] .cal-wrap {
  --cal-0: #ebedf0;
  --cal-1: #9be9a8;
  --cal-2: #40c463;
  --cal-3: #30a14e;
  --cal-4: #216e39;
  --cal-edge: rgba(27, 31, 35, 0.06);
}

.cal-wrap { display: flex; flex-direction: column; gap: var(--space-3); }
.cal-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: var(--space-2); }
.cal-inner { display: inline-flex; flex-direction: column; gap: 4px; }

/* 53 week columns x 7 day rows, filled column-first like GitHub */
.cal {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 11px);
  grid-auto-columns: 11px;
  gap: 3px;
}

.cal__day {
  width: 11px; height: 11px;
  border-radius: 2px;
  background: var(--cal-0);
  box-shadow: inset 0 0 0 1px var(--cal-edge);
}
.cal__day[data-level='1'] { background: var(--cal-1); }
.cal__day[data-level='2'] { background: var(--cal-2); }
.cal__day[data-level='3'] { background: var(--cal-3); }
.cal__day[data-level='4'] { background: var(--cal-4); }

/* Month labels sit above the week columns they span */
.cal__months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 11px;
  gap: 3px;
  height: 13px;
  font-size: 0.625rem;
  color: var(--text-tertiary);
}
.cal__months span { white-space: nowrap; }

.cal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cal__note { font-size: var(--fs-xs); color: var(--text-tertiary); }
.cal__legend { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-2xs); color: var(--text-tertiary); }
.cal__swatches { display: flex; gap: 3px; }
.cal__swatches i {
  width: 11px; height: 11px;
  border-radius: 2px;
  background: var(--cal-0);
  box-shadow: inset 0 0 0 1px var(--cal-edge);
}
.cal__swatches i[data-level='1'] { background: var(--cal-1); }
.cal__swatches i[data-level='2'] { background: var(--cal-2); }
.cal__swatches i[data-level='3'] { background: var(--cal-3); }
.cal__swatches i[data-level='4'] { background: var(--cal-4); }

/* Skeleton shimmer for values still in flight */
.is-loading {
  color: transparent !important;
  min-width: 3ch;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--fill-hover) 25%, var(--border) 50%, var(--fill-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* Contact */
.contact {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  padding: clamp(var(--space-12), 8vw, 6rem) var(--gutter);
  border-radius: var(--radius-2xl);
  background: var(--surface);
  text-align: center;
  overflow: hidden;
}
.contact__title { max-width: 24ch; }
.contact__text { max-width: 48ch; }

.copy-field {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: 0.3rem 0.3rem 0.3rem 1rem;
  border-radius: var(--radius-full);
  background: var(--fill);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.copy-field > span,
.copy-field > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-field > a { transition: color var(--dur-fast) var(--ease-standard); }
.copy-field > a:hover { color: var(--accent); }
.copy-field > svg { width: 14px; height: 14px; flex: none; color: var(--text-tertiary); }

.contact__details { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }

/* Footer */
.footer { position: relative; z-index: var(--z-content); padding-block: var(--space-12); border-top: 1px solid var(--border); background: var(--bg); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-6); }
.footer__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); }
.footer__note { margin-top: var(--space-1); font-size: var(--fs-2xs); color: var(--text-tertiary); }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.social {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--fill);
  color: var(--text-secondary);
  transition: color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-spring);
}
.social svg { width: 16px; height: 16px; }
.social:hover { color: var(--text); background: var(--fill-hover); }

/* Floating UI */
.to-top {
  position: fixed;
  right: var(--gutter); bottom: var(--gutter);
  z-index: calc(var(--z-header) - 1);
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-spring),
    color var(--dur-base) var(--ease-standard);
}
.to-top svg { width: 17px; height: 17px; }
.to-top[data-visible='true'] { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.to-top:hover { color: var(--accent); }

.toast-region {
  position: fixed;
  left: 50%; bottom: var(--space-8);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text);
  animation: toast-in var(--dur-slow) var(--ease-spring);
}
.toast[data-leaving='true'] { animation: toast-out var(--dur-base) var(--ease-standard) forwards; }
.toast svg { width: 16px; height: 16px; color: var(--success); flex: none; }

/* Scroll reveals */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slower) var(--ease-out-expo), transform var(--dur-slower) var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal='left'] { transform: translateX(-22px); }
[data-reveal='right'] { transform: translateX(22px); }
[data-reveal='scale'] { transform: scale(0.96); }
[data-reveal].is-visible { opacity: 1; transform: none; }

@keyframes ping { 0% { transform: scale(1); opacity: 0.8; } 75%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.96); } }

/* Responsive — mobile-first escalation */
@media (min-width: 640px) {
  .header__cta { display: inline-flex; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat + .stat { border-left: 1px solid var(--border); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento__cell--wide { grid-column: span 2; }
  .role__head { align-items: center; }
  .role__meta { align-items: flex-end; }
}


@media (min-width: 1024px) {
  .nav, .palette-trigger { display: flex; }
  .menu-btn { display: none; }
}

/* Honour the OS setting: keep the state changes, drop the movement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* Print — collapses the page into a clean one-column CV */
@media print {
  :root {
    --bg: #fff; --bg-elevated: #fff; --text: #000;
    --text-secondary: #333; --text-tertiary: #555;
    --accent: #0055aa; --border: #ccc; --border-strong: #999;
    --surface: transparent; --fill: transparent; --fill-hover: transparent;
  }
  .header, .drawer, .palette, .to-top, .toast-region, .contact,
  .showcase__controls, .showcase__frame, .showcase__hint,
  .cal-wrap, .skip-link { display: none !important; }

  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .section { padding-block: 1rem !important; break-inside: avoid; }
  .hero { min-height: auto !important; padding-top: 0 !important; }
  .card { border: 1px solid #ccc !important; box-shadow: none !important; break-inside: avoid; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 8pt; color: #555; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .reel-panels { display: block; }
  .reel-panel, .reel-panel[aria-hidden='true'] { visibility: visible !important; opacity: 1 !important; transition: none !important; margin-bottom: 1rem; }
}
