/* =============================================================
   Glen Thomas — personal site
   Design system + components. Build-free, hand-crafted.
   ============================================================= */

/* ----------------------------- Tokens ----------------------- */
:root {
  /* Palette — dark (default) */
  --bg:            #07070c;
  --bg-2:          #0b0b14;
  --surface:       rgba(255, 255, 255, 0.026);
  --surface-2:     rgba(255, 255, 255, 0.05);
  --border:        rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text:          #ecedf5;
  --text-muted:    #a3a6b8;
  --text-faint:    #80849c;

  /* Accent gradient stops */
  --c1: #22d3ee; /* cyan   */
  --c2: #6366f1; /* indigo */
  --c3: #a855f7; /* violet */
  --accent: var(--c2);
  --accent-soft: rgba(99, 102, 241, 0.16);
  --gradient: linear-gradient(120deg, var(--c1), var(--c2) 52%, var(--c3));
  --gradient-text: linear-gradient(110deg, #d6f7ff, var(--c1) 30%, var(--c2) 62%, var(--c3));

  /* Type */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale */
  --step--1: clamp(0.78rem, 0.74rem + 0.2vw, 0.86rem);
  --step-0:  clamp(0.97rem, 0.93rem + 0.2vw, 1.05rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.6rem);
  --step-5:  clamp(3.1rem, 2rem + 5.4vw, 6.6rem);

  /* Layout */
  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 18px;
  --radius-lg: 26px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 0 1px var(--border), 0 30px 80px -40px rgba(99, 102, 241, 0.55);

  color-scheme: dark;
}

/* Light theme */
[data-theme="light"] {
  --bg:            #f6f6fb;
  --bg-2:          #ffffff;
  --surface:       rgba(10, 12, 30, 0.025);
  --surface-2:     rgba(10, 12, 30, 0.05);
  --border:        rgba(10, 12, 30, 0.1);
  --border-strong: rgba(10, 12, 30, 0.2);
  --text:          #15161f;
  --text-muted:    #4d5066;
  --text-faint:    #797d92;
  --accent-soft:   rgba(99, 102, 241, 0.12);
  --gradient-text: linear-gradient(110deg, #0ea5c4, var(--c2) 55%, var(--c3));
  --shadow:        0 24px 60px -30px rgba(40, 40, 90, 0.35);
  --shadow-glow:   0 0 0 1px var(--border), 0 30px 70px -40px rgba(99, 102, 241, 0.4);
  color-scheme: light;
}

/* ----------------------------- Reset ------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@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;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(99, 102, 241, 0.35); color: #fff; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  background: var(--bg-2); color: var(--text);
  padding: 0.6rem 1rem; border-radius: 10px; border: 1px solid var(--border-strong);
  transform: translateY(-160%); transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ----------------------------- Backgrounds ------------------ */
.bg-aurora {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(50% 45% at 18% 12%, rgba(34, 211, 238, 0.18), transparent 70%),
    radial-gradient(45% 45% at 82% 18%, rgba(168, 85, 247, 0.18), transparent 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(99, 102, 241, 0.16), transparent 70%);
  filter: saturate(1.1);
  animation: aurora 22s var(--ease) infinite alternate;
}
[data-theme="light"] .bg-aurora { opacity: 0.6; }
@keyframes aurora {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.02); }
  100% { transform: translate3d(2%, 2%, 0) scale(1.08); }
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
[data-theme="light"] .bg-grain { opacity: 0.5; mix-blend-mode: multiply; }

/* ----------------------------- Layout ----------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(5rem, 10vw, 9rem); position: relative; }

.section__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.6rem; }
.section__num {
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--c1);
  letter-spacing: 0.1em; padding-top: 0.4rem;
}
.section__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-3); line-height: 1; letter-spacing: -0.02em;
}
.section__rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.section__lede { max-width: 60ch; color: var(--text-muted); font-size: var(--step-1); margin-bottom: 3rem; }
.section__lede a { color: var(--text); border-bottom: 1px solid var(--accent); }

/* ----------------------------- Buttons ---------------------- */
.btn {
  --pad-y: 0.8rem; --pad-x: 1.4rem;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px; font-weight: 500; font-size: var(--step-0);
  border: 1px solid transparent; position: relative; isolation: isolate;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
  will-change: transform;
}
.btn svg { transition: transform 0.3s var(--ease); }
.btn--primary {
  color: #06070f; background: var(--gradient); background-size: 160% 160%;
  box-shadow: 0 12px 34px -12px rgba(99, 102, 241, 0.7);
  font-weight: 600;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px -12px rgba(99, 102, 241, 0.85); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--ghost {
  color: var(--text); background: var(--surface);
  border-color: var(--border-strong); backdrop-filter: blur(8px);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--c1); background: var(--surface-2); }
.btn--ghost:hover svg { transform: translate(2px, -2px); }
.btn--lg { --pad-y: 1.05rem; --pad-x: 1.8rem; font-size: var(--step-1); }

/* ----------------------------- Cursor ----------------------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none; mix-blend-mode: difference; }
.cursor__dot, .cursor__ring {
  position: fixed; top: 0; left: 0; border-radius: 50%;
  transform: translate(-50%, -50%); will-change: transform, width, height;
}
.cursor__dot { width: 7px; height: 7px; background: #fff; }
.cursor__ring {
  width: 38px; height: 38px; border: 1.5px solid rgba(255, 255, 255, 0.6);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.cursor.is-hover .cursor__ring { width: 60px; height: 60px; background: rgba(255, 255, 255, 0.1); border-color: transparent; }
.cursor.is-down .cursor__ring { width: 30px; height: 30px; }
body.has-cursor { cursor: none; }
body.has-cursor a, body.has-cursor button { cursor: none; }
@media (hover: none) { .cursor { display: none; } }

/* ----------------------------- Scroll progress -------------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 0%; background: var(--gradient); box-shadow: 0 0 12px rgba(99, 102, 241, 0.8); }

/* ----------------------------- Nav -------------------------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 110; transition: transform 0.4s var(--ease); }
.nav__inner {
  max-width: var(--container); margin-inline: auto; margin-top: 0.85rem;
  padding: 0.55rem 0.7rem 0.55rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: 999px; border: 1px solid transparent;
  width: calc(100% - var(--gutter) * 2);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.nav.is-scrolled .nav__inner {
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  border-color: var(--border); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: var(--shadow);
}
.nav__brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-weight: 600; }
.nav__monogram {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  font-size: 0.95rem; letter-spacing: 0.02em; color: #06070f;
  background: var(--gradient); box-shadow: 0 8px 22px -10px rgba(99, 102, 241, 0.8);
}
.nav__name { font-size: var(--step-0); }
.nav__links { display: flex; gap: 0.3rem; }
.nav__link {
  position: relative; padding: 0.5rem 0.85rem; border-radius: 999px;
  color: var(--text-muted); font-size: var(--step--1); font-weight: 500;
  display: inline-flex; align-items: baseline; gap: 0.4rem;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav__num { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-faint); transition: color 0.25s var(--ease); }
.nav__link:hover { color: var(--text); background: var(--surface); }
.nav__link.is-active { color: var(--text); }
.nav__link.is-active .nav__num { color: var(--c1); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 0.28rem; height: 2px;
  background: var(--gradient); border-radius: 2px;
}
.nav__actions { display: flex; align-items: center; gap: 0.5rem; }
.nav__cta { --pad-y: 0.55rem; --pad-x: 1.1rem; font-size: var(--step--1); }

.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--text-muted); position: relative;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--c1); transform: rotate(18deg); }
.theme-toggle svg { position: absolute; transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
.theme-toggle svg circle, .theme-toggle svg line { stroke: currentColor; stroke-width: 1.8; fill: none; }
.theme-toggle__moon { fill: currentColor; }
.theme-toggle__sun { opacity: 0; transform: scale(0.4) rotate(-90deg); }
.theme-toggle__moon { opacity: 1; transform: scale(1); }
[data-theme="light"] .theme-toggle__sun { opacity: 1; transform: scale(1) rotate(0); }
[data-theme="light"] .theme-toggle__moon { opacity: 0; transform: scale(0.4) rotate(90deg); }

.nav__burger { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-strong); position: relative; }
.nav__burger span {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 1.6px; background: var(--text);
  transform: translate(-50%, -50%); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav__burger span:first-child { transform: translate(-50%, -6px); }
.nav__burger span:last-child { transform: translate(-50%, 6px); }
.nav__burger[aria-expanded="true"] span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 105; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(22px); display: flex; flex-direction: column; justify-content: center; gap: 2rem;
  padding: var(--gutter); opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-menu__link {
  font-family: var(--font-display); font-size: clamp(2rem, 9vw, 3.2rem); font-weight: 600; letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 1rem; opacity: 0; transform: translateY(20px);
  transition: color 0.25s var(--ease);
}
.mobile-menu__link span { font-family: var(--font-mono); font-size: 0.9rem; color: var(--c1); }
.mobile-menu.is-open .mobile-menu__link { animation: menuIn 0.5s var(--ease) forwards; }
.mobile-menu.is-open .mobile-menu__link:nth-child(1) { animation-delay: 0.06s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(2) { animation-delay: 0.12s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(3) { animation-delay: 0.18s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(4) { animation-delay: 0.24s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(5) { animation-delay: 0.30s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(6) { animation-delay: 0.36s; }
@keyframes menuIn { to { opacity: 1; transform: translateY(0); } }
.mobile-menu__socials { display: flex; gap: 1.5rem; color: var(--text-muted); font-size: var(--step--1); }
.mobile-menu__socials a { border-bottom: 1px solid var(--border); padding-bottom: 2px; }

/* ----------------------------- Hero ------------------------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__inner { position: relative; z-index: 2; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); width: 100%; padding-top: 6rem; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(80% 60% at 30% 40%, transparent, var(--bg) 92%);
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono);
  font-size: var(--step--1); color: var(--text-muted); letter-spacing: 0.02em;
  padding: 0.45rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  margin-bottom: 1.6rem;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.hero__title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-5);
  line-height: 1.02; letter-spacing: -0.035em; margin-bottom: 1.4rem;
}
.hero__title span { display: block; }
.hero__title-accent {
  background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: shimmer 8s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

.hero__role { font-size: var(--step-2); font-family: var(--font-display); color: var(--text); margin-bottom: 1.5rem; display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.hero__role-static { color: var(--text-faint); }
.hero__role-rotator { position: relative; display: inline-grid; }
.hero__role-word {
  grid-area: 1 / 1; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 600; opacity: 0; transform: translateY(0.5em) rotateX(-40deg); transform-origin: bottom;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); white-space: nowrap;
}
.hero__role-word.is-active { opacity: 1; transform: none; }
.hero__role-word.is-out { opacity: 0; transform: translateY(-0.5em) rotateX(40deg); }

.hero__lede { max-width: 56ch; color: var(--text-muted); font-size: var(--step-1); margin-bottom: 2.2rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.4rem; }
.hero__socials { display: flex; gap: 0.6rem; }
.hero__socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
}
.hero__socials a:hover { color: var(--text); border-color: var(--c1); transform: translateY(-3px); background: var(--surface-2); }

.hero__scroll { position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; color: var(--text-faint); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; }
.hero__scroll-line { width: 1px; height: 46px; background: linear-gradient(var(--c1), transparent); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--c1); animation: scrollCue 2s var(--ease) infinite; }
@keyframes scrollCue { 0% { top: -50%; } 100% { top: 100%; } }

/* ----------------------------- Reveal ----------------------- */
.reveal { transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal--up { transform: translateY(40px); }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* ----------------------------- About ------------------------ */
.about__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about__photo { position: relative; position: sticky; top: 8rem; }
.about__photo-frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.about__photo-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, transparent 55%, rgba(7, 7, 12, 0.5)); }
.about__photo-frame img { width: 100%; height: auto; filter: grayscale(0.18) contrast(1.02); transition: filter 0.6s var(--ease), transform 0.8s var(--ease); }
.about__photo:hover .about__photo-frame img { filter: grayscale(0); transform: scale(1.03); }
.about__photo::before {
  content: ""; position: absolute; inset: -1px; border-radius: calc(var(--radius-lg) + 1px); padding: 1px;
  background: var(--gradient); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.5; pointer-events: none;
}
.about__badge {
  position: absolute; bottom: 1rem; left: 1rem; right: 1rem; z-index: 2;
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.8rem 1rem; border-radius: 14px; backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg-2) 60%, transparent); border: 1px solid var(--border-strong);
}
.about__badge-k { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--c1); }
.about__badge-v { font-family: var(--font-display); font-weight: 600; }

.about__lead { font-size: var(--step-1); margin-bottom: 1.2rem; }
.about__body p { color: var(--text-muted); margin-bottom: 1.1rem; }
.about__body strong { color: var(--text); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.4rem; padding-top: 2.2rem; border-top: 1px solid var(--border); }
.stat__num { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { display: block; margin-top: 0.5rem; font-size: var(--step--1); color: var(--text-faint); line-height: 1.4; }

/* ----------------------------- Cards ------------------------ */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card {
  position: relative; padding: 1.8rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); overflow: hidden; transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.card__glow {
  position: absolute; width: 320px; height: 320px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  left: var(--mx, 50%); top: var(--my, 0%); transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.card:hover .card__glow { opacity: 1; }
.card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1.2rem;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--c1);
  transition: transform 0.4s var(--ease), color 0.4s var(--ease);
}
.card__icon svg { width: 26px; height: 26px; }
.card:hover .card__icon { transform: translateY(-2px) scale(1.05); }
.card__title { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; margin-bottom: 0.6rem; letter-spacing: -0.01em; }
.card__text { color: var(--text-muted); font-size: var(--step-0); }
.card--cta { background: linear-gradient(155deg, var(--accent-soft), transparent); border-color: var(--border-strong); justify-content: space-between; }
.card__link { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.2rem; color: var(--text); font-weight: 600; }
.card--cta:hover .card__link svg { transform: translateX(4px); }
.card__link svg { transition: transform 0.3s var(--ease); }

/* ----------------------------- Timeline --------------------- */
.timeline { position: relative; margin-left: 0.5rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(var(--c1), var(--c2), var(--c3), transparent); opacity: 0.5; }
.timeline__item { position: relative; padding-left: 2.6rem; padding-bottom: 2.4rem; display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; }
.timeline__marker { position: absolute; left: 0; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 2px solid var(--c2); }
.timeline__marker::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--gradient); opacity: 0; transform: scale(0.4); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
.timeline__item.in-view .timeline__marker::after { opacity: 1; transform: scale(1); }
.timeline__meta { display: flex; flex-direction: column; gap: 0.2rem; padding-top: 0.1rem; }
.timeline__period { font-family: var(--font-mono); font-size: var(--step--1); color: var(--c1); }
.timeline__company { color: var(--text-faint); font-size: var(--step--1); }
.timeline__card { }
.timeline__role { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; margin-bottom: 0.5rem; }
.timeline__role span { color: var(--text-faint); font-weight: 400; }
.timeline__card p { color: var(--text-muted); max-width: 62ch; }

.education { margin-top: 2rem; padding-top: 3rem; border-top: 1px solid var(--border); }
.education__title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; margin-bottom: 1.6rem; }
.education__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.education__item { padding: 1.6rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.education__inst { display: block; font-family: var(--font-mono); font-size: var(--step--1); color: var(--c1); margin-bottom: 0.3rem; }
.education__qual { display: block; font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; margin-bottom: 0.6rem; }
.education__item p { color: var(--text-muted); font-size: var(--step-0); }

/* ----------------------------- Skills ----------------------- */
.skills__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.skill-group { padding: 1.6rem 1.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.skill-group:nth-child(1) { grid-column: 1 / -1; }
.skill-group__title { font-family: var(--font-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); margin-bottom: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chips li {
  padding: 0.5rem 0.95rem; border-radius: 999px; font-size: var(--step--1); font-weight: 500;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.chips li:hover { transform: translateY(-3px); border-color: var(--c1); color: #fff; box-shadow: 0 10px 24px -14px rgba(34, 211, 238, 0.9); }
[data-theme="light"] .chips li:hover { color: var(--accent); }

.marquee { margin-top: 4rem; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 1.6rem; width: max-content; animation: marquee 32s linear infinite; font-family: var(--font-display); font-size: clamp(1.4rem, 3.5vw, 2.4rem); font-weight: 600; color: var(--text-faint); }
.marquee__track span:nth-child(odd) { color: var(--text); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ----------------------------- Writing ---------------------- */
.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; min-height: 160px; }
.posts__loading, .posts__error { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 0.8rem; color: var(--text-faint); padding: 3rem; font-style: italic; }
.posts__error { flex-direction: column; text-align: center; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--border-strong); border-top-color: var(--c1); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.post {
  position: relative; display: flex; flex-direction: column; gap: 0.8rem; padding: 1.7rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.post::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--gradient); transform: scaleY(0); transform-origin: top; transition: transform 0.4s var(--ease); }
.post:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.post:hover::before { transform: scaleY(1); }
.post__head { display: flex; align-items: center; gap: 0.8rem; font-family: var(--font-mono); font-size: 0.72rem; }
.post__cat { color: var(--c1); text-transform: uppercase; letter-spacing: 0.08em; }
.post__date { color: var(--text-faint); }
.post__title { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.post__excerpt { color: var(--text-muted); font-size: var(--step-0); flex: 1; }
.post__more { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text); font-weight: 600; font-size: var(--step--1); margin-top: auto; }
.post__more svg { transition: transform 0.3s var(--ease); }
.post:hover .post__more svg { transform: translateX(4px); }

.writing__footer { margin-top: 2.4rem; display: flex; justify-content: center; }

/* ----------------------------- Contact ---------------------- */
.contact__inner {
  position: relative; text-align: center; max-width: 760px; margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 5rem); border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: linear-gradient(160deg, var(--surface-2), transparent);
  overflow: hidden;
}
.contact__inner::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 70% at 50% 0%, var(--accent-soft), transparent 70%);
}
.contact__eyebrow { font-family: var(--font-mono); font-size: var(--step--1); color: var(--c1); letter-spacing: 0.08em; }
.contact__title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-4); line-height: 1.04; letter-spacing: -0.03em; margin: 1rem 0 1.2rem; }
.contact__title span { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact__lede { color: var(--text-muted); font-size: var(--step-1); max-width: 50ch; margin: 0 auto 2.2rem; }
.contact__actions { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.copy-btn { padding: 0.7rem 1rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-muted); font-size: var(--step--1); transition: color 0.25s var(--ease), border-color 0.25s var(--ease); }
.copy-btn:hover { color: var(--text); border-color: var(--c1); }
.copy-btn.is-copied { color: #34d399; border-color: #34d399; }
.contact__meta { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; margin-top: 2.6rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.contact__meta-item { display: flex; flex-direction: column; gap: 0.4rem; text-align: left; }
.contact__meta-k { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-faint); }
.contact__meta-v { color: var(--text); font-weight: 500; }
.contact__socials { display: flex; gap: 1rem; flex-wrap: wrap; }
.contact__socials a { color: var(--text-muted); border-bottom: 1px solid var(--border); transition: color 0.25s var(--ease), border-color 0.25s var(--ease); }
.contact__socials a:hover { color: var(--text); border-color: var(--c1); }

/* ----------------------------- Footer ----------------------- */
.footer { border-top: 1px solid var(--border); padding-block: 2.2rem; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer__note { color: var(--text-faint); font-size: var(--step--1); }
.footer__top { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: var(--step--1); transition: color 0.25s var(--ease); }
.footer__top:hover { color: var(--text); }
.footer__top svg { transition: transform 0.3s var(--ease); }
.footer__top:hover svg { transform: translateY(-3px); }

/* ----------------------------- Responsive ------------------- */
@media (max-width: 940px) {
  .nav__links { display: none; }
  .nav__name { display: none; }
  .nav__cta { display: none; }
  .nav__burger { display: block; }
  .about__grid { grid-template-columns: 1fr; }
  .about__photo { position: relative; top: 0; max-width: 380px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .timeline__item { grid-template-columns: 1fr; gap: 0.5rem; }
  .education__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: 1fr; }
  .posts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 1.4rem; text-align: left; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
  .contact__meta { gap: 1.6rem; }
  .footer__inner { justify-content: center; text-align: center; }
}
