/* ============================================================
   KATARINA MUSLADIN — PORTFOLIO
   Design system: "Soft Luxe"

   1. Tokens
   2. Themes
   3. Reset & base
   4. Layout primitives
   5. Decor (background wash, butterflies)
   6. Header & navigation
   7. Buttons & chips
   8. Hero
   9. About
   10. Tech stack
   11. Projects
   12. Contact
   13. Footer
   14. Motion preferences
   ============================================================ */

/* ---------- 1. TOKENS ---------- */

:root {
  /* Type families */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Inconsolata", ui-monospace, "SF Mono", Consolas, monospace;

  /* Fluid type scale */
  --step--2: 0.75rem;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  --step-3: clamp(2rem, 1.5rem + 2.4vw, 3rem);
  --step-4: clamp(2.75rem, 2rem + 3.6vw, 4.5rem);

  /* Spacing — 8px base */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 2.5rem;
  --s-8: 3rem;
  --s-10: 4rem;
  --s-12: 5rem;

  /* Radii */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;

  /* Layout */
  --container: 1140px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-pad: clamp(2.75rem, 5vw, 4.5rem);
  --header-h: 74px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 320ms;
}

/* ---------- 2. THEMES ---------- */

/* Light (default) */
:root {
  color-scheme: light;

  --bg: #fbfaff;
  --wash-a: rgba(170, 142, 238, 0.22);
  --wash-b: rgba(255, 172, 202, 0.2);
  --wash-c: rgba(196, 224, 255, 0.16);

  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2: rgba(246, 243, 255, 0.85);

  --ink: #2a2438;
  --ink-muted: #625978;
  --ink-faint: #877ea0;

  --accent: #6b4fb0;
  --accent-strong: #553d8f;
  --accent-soft: #efe9ff;

  --blush: #b84a73;
  --blush-soft: #ffe7ef;

  --border: rgba(90, 70, 140, 0.14);
  --border-strong: rgba(90, 70, 140, 0.26);

  --shadow-sm: 0 1px 2px rgba(42, 36, 56, 0.06);
  --shadow-md: 0 1px 2px rgba(42, 36, 56, 0.05),
    0 10px 28px -12px rgba(90, 70, 140, 0.3);
  --shadow-lg: 0 1px 3px rgba(42, 36, 56, 0.06),
    0 26px 60px -22px rgba(90, 70, 140, 0.4);

  --grad-primary: linear-gradient(135deg, #7d5fc6 0%, #a97fd8 50%, #eda2c0 100%);
  --grad-ring: linear-gradient(140deg, #c7b2f5, #ffc6da 55%, #bfd9ff);

  --icon-plate: rgba(255, 255, 255, 0.8);
  --icon-plate-border: rgba(90, 70, 140, 0.1);
  --noise-opacity: 0.035;
}

/* Dark — explicit choice */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #141221;
  --wash-a: rgba(140, 108, 220, 0.28);
  --wash-b: rgba(196, 96, 140, 0.2);
  --wash-c: rgba(80, 120, 190, 0.18);

  --surface: rgba(38, 33, 56, 0.66);
  --surface-solid: #1e1b2e;
  --surface-2: rgba(46, 40, 68, 0.7);

  --ink: #edeaf6;
  --ink-muted: #b0a8c8;
  --ink-faint: #8b83a5;

  --accent: #c4aeff;
  --accent-strong: #d9caff;
  --accent-soft: rgba(150, 120, 230, 0.18);

  --blush: #ffa9c4;
  --blush-soft: rgba(230, 120, 160, 0.16);

  --border: rgba(190, 172, 255, 0.14);
  --border-strong: rgba(190, 172, 255, 0.28);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.4), 0 28px 64px -24px rgba(0, 0, 0, 0.8);

  --grad-primary: linear-gradient(135deg, #8e6fe0 0%, #b98fe8 50%, #f0a9c8 100%);
  --grad-ring: linear-gradient(140deg, #8f6fe0, #e07fa8 55%, #6f9fe0);

  --icon-plate: rgba(255, 255, 255, 0.92);
  --icon-plate-border: rgba(255, 255, 255, 0.5);
  --noise-opacity: 0.05;
}

/* Dark — system preference, when no explicit choice is stored (no-JS fallback) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #141221;
    --wash-a: rgba(140, 108, 220, 0.28);
    --wash-b: rgba(196, 96, 140, 0.2);
    --wash-c: rgba(80, 120, 190, 0.18);

    --surface: rgba(38, 33, 56, 0.66);
    --surface-solid: #1e1b2e;
    --surface-2: rgba(46, 40, 68, 0.7);

    --ink: #edeaf6;
    --ink-muted: #b0a8c8;
    --ink-faint: #8b83a5;

    --accent: #c4aeff;
    --accent-strong: #d9caff;
    --accent-soft: rgba(150, 120, 230, 0.18);

    --blush: #ffa9c4;
    --blush-soft: rgba(230, 120, 160, 0.16);

    --border: rgba(190, 172, 255, 0.14);
    --border-strong: rgba(190, 172, 255, 0.28);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.35),
      0 12px 32px -14px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.4),
      0 28px 64px -24px rgba(0, 0, 0, 0.8);

    --grad-primary: linear-gradient(135deg, #8e6fe0 0%, #b98fe8 50%, #f0a9c8 100%);
    --grad-ring: linear-gradient(140deg, #8f6fe0, #e07fa8 55%, #6f9fe0);

    --icon-plate: rgba(255, 255, 255, 0.92);
    --icon-plate-border: rgba(255, 255, 255, 0.5);
    --noise-opacity: 0.05;
  }
}

/* ---------- 3. RESET & BASE ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

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

/* Typography roles */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin-top: var(--s-4);
  border-radius: var(--r-pill);
  background: var(--grad-primary);
}

.section-head {
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.card-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- 4. LAYOUT PRIMITIVES ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-pad);
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

@supports (backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px)) {
  .card {
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .card {
    background: var(--surface-solid);
  }
}

/* ---------- 5. DECOR ---------- */

/* Global soft gradient wash + grain, painted behind everything */
.page-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -5%, var(--wash-a), transparent 60%),
    radial-gradient(50rem 36rem at 92% 8%, var(--wash-b), transparent 62%),
    radial-gradient(46rem 40rem at 50% 105%, var(--wash-c), transparent 60%);
  transition: background var(--dur) var(--ease);
}

.page-decor::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Butterflies — ambient layer, never in the way */
.decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.butterfly {
  position: absolute;
  width: clamp(48px, 6vw, 96px);
  opacity: 0.42;
  filter: saturate(0.9);
  will-change: transform;
}

.butterfly--1 {
  top: 4%;
  right: 6%;
  animation: drift-a 22s var(--ease) infinite;
}

.butterfly--2 {
  bottom: 6%;
  right: 16%;
  width: clamp(36px, 4.2vw, 68px);
  opacity: 0.34;
  animation: drift-b 26s var(--ease) infinite;
}

/* Tucked below the text column, so it reads as part of the composition */
.butterfly--3 {
  bottom: 14%;
  left: 6%;
  width: clamp(30px, 3.6vw, 58px);
  opacity: 0.3;
  animation: drift-c 30s var(--ease) infinite;
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(8deg);
  }
  50% {
    transform: translate3d(-14px, 22px, 0) rotate(-6deg);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-12deg);
  }
  50% {
    transform: translate3d(18px, -20px, 0) rotate(6deg);
  }
}

@keyframes drift-c {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(14deg);
  }
  50% {
    transform: translate3d(12px, 26px, 0) rotate(-4deg);
  }
}

/* ---------- 6. HEADER & NAVIGATION ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: var(--surface);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

@supports (backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px)) {
  .site-header.is-scrolled {
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
  }
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .site-header.is-scrolled {
    background: var(--surface-solid);
  }
}

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

.wordmark {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color var(--dur) var(--ease);
}

.wordmark:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nav-links a {
  display: block;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  transition: color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* Theme toggle */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  background: var(--surface);
  transition: color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Each icon shows the theme you'd switch *to* */
.theme-toggle .when-dark {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .when-light {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .when-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .when-light {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .when-dark {
    display: block;
  }
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--ink);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile sheet */
.mobile-sheet {
  display: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 420ms var(--ease);
}

.mobile-sheet.is-open {
  max-height: 360px;
}

.mobile-sheet ul {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin: 0 var(--gutter) var(--s-4);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
}

.mobile-sheet a {
  display: block;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  font-weight: 600;
  color: var(--ink);
  transition: background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.mobile-sheet a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- 7. BUTTONS & CHIPS ---------- */

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.8rem 1.6rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--font-text);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 6px 20px -8px rgba(120, 90, 200, 0.7);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px rgba(120, 90, 200, 0.8);
  color: #fff;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

/* Chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
  transition: transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.chip:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.chip img {
  width: 26px;
  height: 26px;
  padding: 3px;
  border-radius: 7px;
  object-fit: contain;
  background: var(--icon-plate);
  border: 1px solid var(--icon-plate-border);
}

/* Text-only chips (project tech tags) */
.chip--tag {
  padding: 0.3rem 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

.chip--tag:hover {
  transform: none;
  box-shadow: none;
}

/* ---------- 8. HERO ---------- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem) var(--section-pad);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.hero-name {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 50, "WONK" 1;
  font-size: var(--step-4);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-block: var(--s-3) var(--s-4);
}

.hero-name .accent {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink);
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.hero-location::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blush);
}

.hero .btn-group {
  margin-top: var(--s-6);
}

.socials {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-6);
}

.socials a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 1.15rem;
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.socials a:hover {
  transform: translateY(-3px);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

/* Avatar */
.hero-media {
  display: flex;
  justify-content: center;
}

.avatar {
  position: relative;
  width: min(380px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 10px;
  background: var(--grad-ring);
  box-shadow: var(--shadow-lg);
  animation: float 7s ease-in-out infinite;
}

.avatar::before {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: var(--grad-ring);
  filter: blur(46px);
  opacity: 0.4;
  z-index: -1;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-solid);
}

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

/* ---------- 9. ABOUT ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.prose p {
  max-width: 62ch;
  color: var(--ink-muted);
  line-height: 1.8;
}

.prose p + p {
  margin-top: var(--s-5);
}

.prose p:first-child {
  font-size: var(--step-1);
  color: var(--ink);
}

.prose p:last-child {
  padding-left: var(--s-5);
  border-left: 3px solid var(--accent);
  font-style: italic;
}

/* Education timeline */
.education {
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.timeline {
  position: relative;
  margin-top: var(--s-5);
  padding-left: var(--s-6);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: var(--r-pill);
  background: linear-gradient(var(--accent), transparent);
}

.timeline li {
  position: relative;
}

.timeline li + li {
  margin-top: var(--s-5);
}

/* Dot sits out in the gutter, centred on the vertical rule */
.timeline li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: calc(-1 * var(--s-6) + 6px);
  width: 12px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}

.timeline h4 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40;
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.timeline .degree {
  margin-top: 2px;
  font-weight: 600;
  color: var(--accent);
}

.timeline .meta {
  margin-top: var(--s-1);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

/* ---------- 10. TECH STACK ---------- */

/* One panel, one row per category. Rows size to their own
   content, so a short category never leaves an empty void the
   way three equal-height cards did. */

.stack-panel {
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.75rem);
}

.stack-row {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) 1fr;
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2rem);
}

.stack-row + .stack-row {
  border-top: 1px solid var(--border);
}

.stack-row:first-child {
  padding-top: var(--s-2);
}

.stack-row:last-child {
  padding-bottom: var(--s-2);
}

.stack-row-label .name {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Large faint serif numeral — the editorial touch */
.stack-row-label .count {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40;
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  opacity: 0.15;
}

/* ---------- 11. PROJECTS ---------- */

.projects {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.project {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: center;
  gap: clamp(1.5rem, 3.5vw, 3rem);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  overflow: hidden;
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* Most of the demos are portrait phone recordings, so the panel
   centres them and caps their height rather than letting them
   stretch the whole card. */
.project-media {
  grid-column: 1;
  display: grid;
  place-items: center;
  padding: var(--s-4);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}

.project-body {
  grid-column: 2;
}

/* Alternate sides */
.project:nth-child(even) .project-media {
  grid-column: 2;
  grid-row: 1;
}

.project:nth-child(even) .project-body {
  grid-column: 1;
  grid-row: 1;
}

.project-media video,
.project-media img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 420px;
  border-radius: var(--r-sm);
}

.project-index {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--blush);
}

.project-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 45, "WONK" 1;
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-block: var(--s-1) var(--s-4);
}

.project-desc {
  margin-block: var(--s-4) var(--s-5);
  color: var(--ink-muted);
  line-height: 1.75;
}

/* Video controls reveal on hover */
.project-media video::-webkit-media-controls-panel {
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.project-media:hover video::-webkit-media-controls-panel {
  opacity: 1;
}

/* ---------- 12. CONTACT ---------- */

.contact-panel {
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}

.contact-panel .section-title::after {
  margin-inline: auto;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-4);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.contact-card {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
  transition: transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.contact-card .contact-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 1.2rem;
}

.contact-card .label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.contact-card .value {
  display: block;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---------- 13. FOOTER ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--s-6);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.site-footer p {
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.to-top {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.to-top:hover {
  color: var(--accent);
}

/* ---------- 14. MOTION PREFERENCES ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .avatar,
  .butterfly {
    animation: none;
  }

  .btn:hover,
  .card:hover,
  .chip:hover,
  .socials a:hover,
  .contact-card:hover,
  .project:hover {
    transform: none;
  }
}
