/* ===========================================================
   Rhythem Kalra — portfolio
   Two moods: "ink" (dark, glowing) and "paper" (warm notebook).
   All colours live here as variables; the toggle swaps them.
   =========================================================== */

:root,
:root[data-theme="ink"] {
  --bg: #0f0e0c;
  --bg-soft: #171511;
  --card: rgba(255, 248, 235, 0.035);
  --line: rgba(237, 230, 214, 0.1);
  --grid: rgba(237, 230, 214, 0.03);
  --text: #ede6d6;
  --muted: #9a9282;
  --accent: #f2b14a;
  --accent-2: #a78bfa;
  --accent-ink: #1a1307;
  --glow: rgba(242, 177, 74, 0.13);
  --glow-2: rgba(167, 139, 250, 0.1);
  --shadow: 0 0 0 1px var(--line), 0 20px 50px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

:root[data-theme="paper"] {
  --bg: #f4efe4;
  --bg-soft: #ece5d6;
  --card: rgba(255, 255, 255, 0.55);
  --line: rgba(40, 32, 20, 0.12);
  --grid: rgba(70, 110, 170, 0.09);
  --text: #1d1a15;
  --muted: #6b6355;
  --accent: #c2410c;
  --accent-2: #4f46e5;
  --accent-ink: #fff7ef;
  --glow: rgba(194, 65, 12, 0.07);
  --glow-2: rgba(79, 70, 229, 0.05);
  --shadow: 0 0 0 1px var(--line), 0 18px 40px -28px rgba(60, 40, 10, 0.35);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* notebook grid */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
  -webkit-font-smoothing: antialiased;
}

/* soft film grain on top of everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  z-index: 100;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* glow that follows the cursor + two ambient blobs */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(500px circle at var(--mx, 70%) var(--my, 20%), var(--glow), transparent 60%),
    radial-gradient(700px circle at 0% 100%, var(--glow-2), transparent 60%);
  transition: background 0.2s;
}

main, .nav, .footer { position: relative; z-index: 1; }

a { color: inherit; }
em { font-style: italic; }
.mono, .label { font-family: "JetBrains Mono", monospace; }

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

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 5vw, 56px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}

.logo {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font: 500 12px "JetBrains Mono", monospace;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.tt-track {
  position: relative;
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: var(--line);
}
.tt-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: transform 0.35s cubic-bezier(.6, -0.3, .3, 1.4);
}
[data-theme="paper"] .tt-dot { transform: translateX(14px); box-shadow: none; }
[data-theme="ink"] .tt-ink,
[data-theme="paper"] .tt-paper { color: var(--text); }

/* ---------- layout ---------- */
.hero, .section {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding-left: clamp(16px, 5vw, 56px);
  padding-right: clamp(16px, 5vw, 56px);
}

.section { padding-top: 110px; padding-bottom: 20px; }

.label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

h1, h2 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
h1 em, h2 em { color: var(--accent); }
h2 { font-size: clamp(36px, 5.5vw, 60px); margin-bottom: 40px; max-width: 18ch; }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100vh - 70px);
  min-height: calc(100svh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 60px;
  padding-bottom: 60px;
}
.hero h1 { font-size: clamp(44px, 7.4vw, 96px); max-width: 19ch; }
.hero h1 em {
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent);
}
[data-theme="paper"] .hero h1 em { text-shadow: none; }
.hero .then { display: block; color: var(--muted); font-style: italic; }

.margin-note {
  font-family: "Caveat", cursive;
  font-size: 26px;
  color: var(--accent-2);
  transform: rotate(-3deg);
  display: inline-block;
}
.hero-note { margin: 10px 0 0 4px; align-self: flex-start; }

.hero-sub {
  max-width: 46ch;
  margin-top: 28px;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
}

.currently {
  margin-top: 22px;
  font-size: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}
.currently .mono { color: var(--muted); font-size: 13px; }
.rotator {
  color: var(--text);
  border-bottom: 1px dashed var(--accent);
  transition: opacity 0.35s, transform 0.35s;
}
.rotator.out { opacity: 0; transform: translateY(6px); }

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font: 500 15px "Inter", sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 30px -10px var(--accent);
}
.btn-ghost {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}
.about-text h2 { margin-bottom: 28px; }
.about-text p { margin-bottom: 18px; color: var(--muted); max-width: 58ch; }
.about-text p em { color: var(--text); }

.index-card {
  background: var(--card);
  border-radius: 14px;
  padding: 26px 26px 10px;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
  /* ruled lines like a real index card */
  background-image: repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px);
  background-position: 0 58px;
}
.card-title {
  font-family: "Caveat", cursive;
  font-size: 24px;
  color: var(--accent-2);
  margin-bottom: 10px;
}
.index-card dt {
  font: 400 11px "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.index-card dd { margin-bottom: 16px; font-size: 15px; }
.index-card .loop { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: 13px; }

/* ---------- projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.project {
  background: var(--card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}
.project:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 24px 60px -30px var(--accent);
}
.project.featured { grid-column: 1 / -1; }
.project-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.num { color: var(--accent); }
.tag { color: var(--muted); text-align: right; }
.project h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.1;
  margin-bottom: 12px;
}
.project p { color: var(--muted); max-width: 70ch; }
.project p em { color: var(--text); }

.flow {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  font: 500 13px "JetBrains Mono", monospace;
}
.flow li {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.flow li:not(:last-child)::after { content: " →"; color: var(--accent); }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.chips li {
  font: 400 12px "JetBrains Mono", monospace;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ---------- notebook ---------- */
.notes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.note {
  font-family: "Caveat", cursive;
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.25;
  padding: 28px 28px 28px 34px;
  border-radius: 6px;
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.3s;
}
.note::before {
  /* the red margin line from a school notebook */
  content: "";
  position: absolute;
  left: 18px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--accent);
  opacity: 0.6;
}
.note:nth-child(odd) { transform: rotate(-1deg); }
.note:nth-child(even) { transform: rotate(0.8deg); }
.note:hover { transform: rotate(0) scale(1.02); }

/* ---------- contact ---------- */
.contact { padding-bottom: 80px; }
.contact h2 { max-width: 20ch; margin-bottom: 18px; }
.contact-sub { color: var(--muted); margin-bottom: 30px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 12px; }
.socials {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 28px;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
}
.socials a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.socials a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 28px clamp(16px, 5vw, 56px);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- tablet & phone ---------- */

/* ---------- scroll progress bar ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 60;
}

/* ---------- logo spin ---------- */
.logo { display: inline-block; }
.logo.spin { animation: spin 0.8s cubic-bezier(.5, -0.4, .3, 1.4); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- dance mode ---------- */
.word { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; }
.dancing .ch {
  animation: bob 0.7s ease-in-out infinite;
  animation-delay: calc(var(--i) * -45ms);
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-0.12em) rotate(-4deg); }
  75% { transform: translateY(0.05em) rotate(3deg); }
}
.dancing .sticker { animation: wiggle 0.6s ease-in-out infinite; }
.dancing .note { animation: wiggle 0.9s ease-in-out infinite; }
@keyframes wiggle {
  0%, 100% { rotate: -2deg; }
  50% { rotate: 2deg; }
}

.btn-dance {
  background: transparent;
  color: var(--accent-2);
  border: 1px dashed color-mix(in srgb, var(--accent-2) 60%, transparent);
}
.btn-dance .dance-icon { display: inline-block; margin-right: 6px; }
.dancing .btn-dance { background: var(--accent-2); color: var(--accent-ink); border-style: solid; }
.dancing .btn-dance .dance-icon { animation: bob 0.5s ease-in-out infinite; }

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  position: relative;
  z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 40s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker span {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: clamp(22px, 3vw, 32px);
  white-space: nowrap;
  padding: 0 22px;
  color: var(--muted);
}
.ticker span::after { content: "✦"; font-style: normal; font-size: 0.6em; color: var(--accent); margin-left: 44px; vertical-align: middle; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.stat-num {
  display: block;
  font-family: "Instrument Serif", serif;
  font-size: clamp(44px, 5vw, 64px);
  line-height: 1;
  color: var(--accent);
}
.stat-label { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); max-width: 22ch; }

/* ---------- tilt + spotlight (cards follow the cursor) ---------- */
.tilt {
  --rx: 0deg;
  --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.25s ease, box-shadow 0.3s;
  background-image: radial-gradient(400px circle at var(--px, 50%) var(--py, 50%), color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%);
}
.index-card.tilt {
  background-image:
    radial-gradient(400px circle at var(--px, 50%) var(--py, 50%), color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px);
  background-position: 0 0, 0 58px;
  transform: perspective(900px) rotate(1.2deg) rotateX(var(--rx)) rotateY(var(--ry));
}
.project:hover { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-4px); }

/* ---------- experience tabs ---------- */
.tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  margin-bottom: 22px;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.tab {
  position: relative;
  z-index: 1;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 15px "Inter", sans-serif;
  cursor: pointer;
  transition: color 0.3s;
}
.tab.active { color: var(--accent-ink); }
.tab-indicator {
  position: absolute;
  z-index: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 6px 24px -8px var(--accent);
  transition: all 0.4s cubic-bezier(.5, 0, .2, 1.2);
}
.panel {
  background: var(--card);
  border-radius: 18px;
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow);
  animation: panelIn 0.5s ease;
}
@keyframes panelIn { from { opacity: 0; transform: translateY(12px); } }
.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 20px;
  margin-bottom: 14px;
}
.panel h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(34px, 4.5vw, 48px);
  line-height: 1;
}
.panel-tag { font: 400 12px "JetBrains Mono", monospace; color: var(--accent); }
.panel > p { color: var(--muted); max-width: 70ch; margin-bottom: 22px; }
.bullets { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.bullets li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 15px;
}
.bullets li::before { content: "✦"; position: absolute; left: 0; color: var(--accent); font-size: 12px; top: 3px; }
.bullets b { color: var(--text); font-weight: 600; }
.hl {
  color: var(--text);
  background: linear-gradient(transparent 55%, color-mix(in srgb, var(--accent-2) 40%, transparent) 55%);
  padding: 0 2px;
}
.committees { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.committee {
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-family: "Instrument Serif", serif;
  font-size: 24px;
  line-height: 1.2;
}
.c-role { display: block; margin-top: 10px; font: 400 14px "Inter", sans-serif; color: var(--muted); line-height: 1.5; }
.c-num { display: block; font: 400 12px "JetBrains Mono", monospace; color: var(--accent); margin-bottom: 12px; }

.role {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font: 600 13px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  background: var(--accent-2);
  color: #fff;
  transform: rotate(-4deg) translateY(-4px);
  box-shadow: 0 6px 20px -8px var(--accent-2);
}
.panel-plain { background: none; box-shadow: none; padding: 0; }

/* ---------- project filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 400 13px "JetBrains Mono", monospace;
  cursor: pointer;
  transition: all 0.25s;
}
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.project.hide { display: none; }
.project.pop { animation: panelIn 0.45s ease; }
.project .sub { font-family: "Caveat", cursive; font-size: 22px; color: var(--accent-2); margin: -6px 0 12px; }
.project b { color: var(--text); font-weight: 600; }

/* ---------- sticker board ---------- */
.board-note { margin: -20px 0 18px 4px; }
.board {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: clamp(18px, 4vw, 36px);
  border-radius: 20px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--card) 60%, transparent);
}
.sticker {
  --r: 0deg;
  position: relative;
  padding: 10px 18px;
  border-radius: 999px;
  font: 500 15px "Inter", sans-serif;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--r)) scale(var(--s, 1));
  transition: transform 0.25s cubic-bezier(.4, -0.4, .3, 1.6), box-shadow 0.2s;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.6);
}
.sticker.dragging { cursor: grabbing; transition: none; z-index: 5; --s: 1.08; box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.6); }
.sticker:hover { --s: 1.06; }
.sticker.s1 { background: var(--accent); color: var(--accent-ink); --r: -3deg; }
.sticker.s2 { background: var(--accent-2); color: #fff; --r: 2deg; }
.sticker.s3 { background: var(--text); color: var(--bg); --r: -1.5deg; }
.sticker.s4 { background: transparent; color: var(--text); border: 1px solid var(--text); --r: 2.5deg; box-shadow: none; }
.sticker.s5 { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); color: var(--accent); --r: -2deg; }

/* ---------- flip cards ---------- */
.hint { font-size: 12px; color: var(--muted); margin: -24px 0 20px; }
.flips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.flip {
  height: 220px;
  border: 0;
  background: transparent;
  perspective: 900px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  padding: 0;
}
.flip-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(.4, .2, .2, 1.2);
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip:hover:not(.flipped) .flip-inner { transform: rotateY(12deg); }
.flip-front, .flip-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  text-align: left;
}
.flip-front { background: var(--card); box-shadow: var(--shadow); }
.flip-back {
  transform: rotateY(180deg);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "Caveat", cursive;
  font-size: 26px;
  line-height: 1.2;
  justify-content: center;
}
.flip:nth-child(even) .flip-back { background: var(--accent-2); color: #fff; }
.flip-icon { font-size: 30px; color: var(--accent); }
.flip-word { font-family: "Instrument Serif", serif; font-size: 30px; line-height: 1.05; }

/* ---------- sparkles on copy ---------- */
.spark {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  font-size: 14px;
  color: var(--accent);
  animation: spark 0.9s ease-out forwards;
}
@keyframes spark {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(180deg); opacity: 0; }
}

kbd {
  font: 500 11px "JetBrains Mono", monospace;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
}

/* ---------- tablet & phone ---------- */
@media (max-width: 960px) {
  .flips { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .index-card.tilt { transform: none; }
  .projects, .notes { grid-template-columns: 1fr; }
  .bullets, .committees { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .section { padding-top: 80px; }
  .project { padding: 22px; }
  .project-head { flex-direction: column; gap: 4px; }
  .tag { text-align: left; }
  .tt-ink, .tt-paper { display: none; }
  .footer { flex-direction: column; }
  .tab { padding: 9px 14px; font-size: 14px; }
  .tabs { border-radius: 18px; }
  .tab, .tab-indicator { border-radius: 12px; }
  .flips { gap: 12px; }
  .flip { height: 180px; }
  .flip-front, .flip-back { padding: 16px; }
  .flip-word { font-size: 24px; }
  .flip-back { font-size: 21px; }
  .sticker { font-size: 14px; padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ===========================================================
   THE "RHYTHM" LAYER: sound waves, aurora, vinyl, equalizer,
   giant outlined name and a cursor that talks.
   =========================================================== */

:root, :root[data-theme="ink"] { --accent-3: #ff5d8f; --blend: screen; --aurora-o: 0.5; }
:root[data-theme="paper"] { --accent-3: #db2777; --blend: multiply; --aurora-o: 0.28; }

/* drifting colour blobs */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora span {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  opacity: var(--aurora-o);
  mix-blend-mode: var(--blend);
  animation: drift 28s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { top: -35vmax; left: -25vmax; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, transparent), transparent 62%); }
.aurora span:nth-child(2) { top: 10vh; right: -35vmax; background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 38%, transparent), transparent 62%); animation-duration: 34s; animation-delay: -8s; }
.aurora span:nth-child(3) { bottom: -40vmax; left: 20vw; background: radial-gradient(circle, color-mix(in srgb, var(--accent-3) 26%, transparent), transparent 62%); animation-duration: 40s; animation-delay: -16s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12vw, 8vh) scale(1.15); }
  100% { transform: translate(-6vw, 14vh) scale(0.95); }
}


/* equalizer next to the logo */
.brand { display: flex; align-items: center; gap: 14px; }
.eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.eq span {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: bottom;
  animation: eq 1.1s ease-in-out infinite;
}
.eq span:nth-child(2) { animation-delay: -0.3s; animation-duration: 0.9s; }
.eq span:nth-child(3) { animation-delay: -0.6s; animation-duration: 1.3s; background: var(--accent-2); }
.eq span:nth-child(4) { animation-delay: -0.2s; animation-duration: 0.8s; }
.eq span:nth-child(5) { animation-delay: -0.5s; animation-duration: 1.2s; background: var(--accent-3); }
.dancing .eq span { animation-duration: 0.32s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }

/* hero: giant outlined name + vinyl */
.hero { position: relative; overflow-x: clip; }
.hero > *:not(.bigname):not(.vinyl) { position: relative; z-index: 1; }
.bigname {
  position: absolute;
  left: 50%;
  bottom: -0.08em;
  transform: translateX(calc(-50% + var(--shift, 0px)));
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 26vw;
  line-height: 0.8;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.2px color-mix(in srgb, var(--text) 24%, transparent);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.vinyl {
  position: absolute;
  right: clamp(16px, 5vw, 56px);
  bottom: 15%;
  width: clamp(170px, 20vw, 270px);
  aspect-ratio: 1;
  z-index: 0;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45));
}
.vinyl svg { width: 100%; height: 100%; animation: spin 16s linear infinite; }
.dancing .vinyl svg { animation-duration: 1.6s; }
.v-disc { fill: #0c0b0a; stroke: rgba(255, 255, 255, 0.08); }
.v-groove { fill: none; stroke: rgba(255, 255, 255, 0.07); }
.v-label { fill: var(--accent); }
.v-hole { fill: #0c0b0a; }
.v-text { font: 500 9.4px "JetBrains Mono", monospace; letter-spacing: 1.6px; fill: #ede6d6; }
.vinyl-rk {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: italic 400 clamp(18px, 2.2vw, 30px) "Instrument Serif", serif;
  color: var(--accent-ink);
  pointer-events: none;
}

/* hand-drawn squiggle under the coloured words in headings */
h2 em {
  padding-bottom: 0.1em;
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 22px 7px;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='7' viewBox='0 0 22 7'><path d='M0 3.5 Q5.5 0 11 3.5 T22 3.5' fill='none' stroke='%23f2b14a' stroke-width='1.4' stroke-linecap='round'/></svg>");
}
[data-theme="paper"] h2 em {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='7' viewBox='0 0 22 7'><path d='M0 3.5 Q5.5 0 11 3.5 T22 3.5' fill='none' stroke='%23c2410c' stroke-width='1.4' stroke-linecap='round'/></svg>");
}

/* a cursor ring that grows and says what things do (desktop only) */
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 300;
  display: none;
  place-items: center;
  transition: width 0.25s, height 0.25s, margin 0.25s, background 0.25s, border-color 0.25s;
}
.has-cursor .cursor-ring { display: grid; }
.cursor-ring.big {
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  backdrop-filter: blur(2px);
}
.cursor-ring.link { width: 54px; height: 54px; margin: -27px 0 0 -27px; border-color: var(--accent-2); }
.cursor-text { font: 500 11px "JetBrains Mono", monospace; color: var(--accent); opacity: 0; transition: opacity 0.2s; }
.cursor-ring.big .cursor-text { opacity: 1; }

/* hero headline: the coloured word shimmers between the three accents */
.hero h1 em .ch { animation: shimmer 6s ease-in-out infinite; animation-delay: calc(var(--i) * 80ms); }
@keyframes shimmer {
  0%, 100% { color: var(--accent); }
  33% { color: var(--accent-3); }
  66% { color: var(--accent-2); }
}
.dancing .hero h1 em .ch { animation: bob 0.7s ease-in-out infinite, shimmer 1.5s linear infinite; animation-delay: calc(var(--i) * -45ms); }

@media (max-width: 860px) {
  .vinyl {
    position: relative;
    right: auto;
    bottom: auto;
    align-self: flex-end;
    width: 150px;
    margin-top: 36px;
  }
  .bigname { font-size: 34vw; bottom: 0; }
}


/* ===========================================================
   PHOTOS & FILM: polaroid collage, taped snapshot, film strip
   =========================================================== */

main { overflow-x: clip; }

/* soft dark edges, like an old lens */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
}
[data-theme="paper"] .vignette { background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(90, 60, 20, 0.14) 100%); }

/* hero becomes two columns: words + photos */
@media (min-width: 861px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(24px, 4vw, 64px);
  }
}
.hero h1 { font-size: clamp(42px, 5.6vw, 82px); max-width: none; }

.hero-art {
  position: relative;
  height: clamp(440px, 42vw, 580px);
}
.hero-art .vinyl {
  position: absolute;
  top: 0;
  right: -10%;
  bottom: auto;
  width: 66%;
  margin: 0;
  z-index: 0;
}
.pola {
  position: absolute;
  margin: 0;
  cursor: pointer;
  transition: transform 0.7s cubic-bezier(.3, 1.4, .4, 1), top 0.7s cubic-bezier(.3, 1.2, .4, 1), left 0.7s, right 0.7s;
  filter: drop-shadow(0 28px 34px rgba(0, 0, 0, 0.45));
}
.pola img { display: block; width: 100%; height: auto; }
.pola:not(.instax) {
  background: #f6f1e7;
  padding: 10px 10px 42px;
}
.pola:not(.instax) img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 30%; }
.pola figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font: 600 22px "Caveat", cursive;
  color: #2a2520;
}
.instax img { border-radius: 6px; }
.pola-back { width: 50%; left: 2%; top: 12%; transform: rotate(-8deg); z-index: 1; }
.pola-front { width: 58%; left: 36%; top: 30%; transform: rotate(6deg); z-index: 2; }
.hero-art:hover .pola-back { transform: rotate(-11deg) translate(-14px, -10px); }
.hero-art:hover .pola-front { transform: rotate(8deg) translate(12px, 6px); }

.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 92px;
  height: 26px;
  z-index: 3;
  background: rgba(250, 236, 200, 0.6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transform: translateX(-50%) rotate(-5deg);
  /* torn tape ends */
  clip-path: polygon(3% 0, 97% 4%, 100% 30%, 96% 55%, 100% 80%, 96% 100%, 4% 96%, 0 70%, 4% 45%, 0 20%);
}
.tape-b { background: rgba(167, 139, 250, 0.55); transform: translateX(-50%) rotate(4deg); }
.tape-c { background: rgba(255, 93, 143, 0.5); }

.art-note { position: absolute; left: 4%; bottom: -4px; z-index: 3; }

/* About: a taped snapshot above the index card */
.about-side { display: flex; flex-direction: column; align-items: center; gap: 34px; }
.about-side .index-card { width: 100%; }
.snap {
  position: relative;
  width: 210px;
  margin: 0;
  padding: 10px 10px 38px;
  background: #f6f1e7;
  transform: rotate(-4deg);
  box-shadow: 0 24px 40px -22px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s cubic-bezier(.3, 1.4, .4, 1);
}
.snap:hover { transform: rotate(1deg) scale(1.04); }
.snap img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 45%; }
.snap figcaption { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font: 600 22px "Caveat", cursive; color: #2a2520; }

/* film strip that rolls across the page */
.film {
  position: relative;
  width: 100vw;
  margin: 10px calc(50% - 50vw) 0;
  padding: 30px 0;
  background: #0e0d0b;
  transform: rotate(-2deg);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.film::before,
.film::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 11px;
  background: repeating-linear-gradient(90deg, transparent 0 12px, rgba(246, 241, 231, 0.85) 12px 24px);
  border-radius: 2px;
  z-index: 1;
}
.film::before { top: 10px; }
.film::after { bottom: 10px; }
.film-track {
  display: flex;
  gap: 14px;
  width: max-content;
  padding-left: 14px;
  animation: ticker 55s linear infinite;
}
.film:hover .film-track { animation-play-state: paused; }
.frame { flex: none; width: 210px; margin: 0; }
.frame img {
  display: block;
  width: 210px;
  height: 270px;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 3px;
  filter: sepia(0.28) saturate(0.85) contrast(1.06) brightness(0.95);
  transition: filter 0.4s, transform 0.4s;
}
.frame:hover img { filter: none; transform: scale(1.03); }
.frame figcaption {
  display: flex;
  justify-content: space-between;
  padding: 7px 2px 0;
  font: 500 10px "JetBrains Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f2b14a;
}
.film-note { font-size: 12px; color: var(--muted); text-align: right; margin: 22px 0 48px; }
.film-note + .hint { margin-top: 0; }

/* the travelling card shows Paris on its back */
.flip-back.photo-back {
  justify-content: flex-end;
  color: #fff;
  font-size: 22px;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 65%),
    url("images/paris.jpg") center 35% / cover;
}

@media (max-width: 860px) {
  .hero-art { width: min(360px, 100%); height: 430px; margin: 40px auto 0; }
  .hero-art .vinyl { width: 62%; right: -6%; top: 0; }
  .snap { width: 190px; }
}
@media (max-width: 480px) {
  .frame, .frame img { width: 160px; }
  .frame img { height: 210px; }
  .hero-art { height: 390px; }
}
