/* ============================================================
   Vaishnavi Gumpi — creative editorial portfolio
   Typography first · content first · decorations second
   ============================================================ */

:root {
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-hand: "Caveat", cursive;

  --bg: #f5f3ee;
  --paper: #fdfcf9;
  --ink: #161616;
  --ink-soft: #585349;
  --ink-faint: #8e887b;
  --line: rgba(22, 22, 22, 0.12);
  --yellow: #e8c547;
  --yellow-soft: rgba(232, 197, 71, 0.4);

  --ease: cubic-bezier(0.22, 0.61, 0.21, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode palette */
body.dark-mode {
  --bg: #0f0e13;
  --paper: #1a1820;
  --ink: #f0ede6;
  --ink-soft: #b5ad9f;
  --ink-faint: #6e6860;
  --line: rgba(245, 243, 238, 0.08);
  --yellow: #f0cf4e;
  --yellow-soft: rgba(240, 207, 78, 0.2);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
}

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

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

.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--ink); color: var(--bg);
  padding: 0.5rem 1rem; z-index: 200;
}
.skip-link:focus { top: 1rem; }

/* ---------- Sun/Moon theme toggle ---------- */

.theme-toggle {
  position: fixed;
  top: -20px;
  right: -20px;
  z-index: 101;
  width: 120px;
  height: 120px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  color: var(--ink);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.5s ease;
  animation: sun-bob 3s ease-in-out infinite;
  view-transition-name: theme-btn;
}

.theme-toggle:hover {
  transform: scale(1.15);
}

.theme-toggle:active {
  transform: scale(0.9);
}

.theme-toggle svg {
  width: 100%;
  height: 100%;
}

/* Sun visible by default, moon hidden — !important to beat .theme-toggle svg specificity */
.theme-toggle__sun { display: block !important; }
.theme-toggle__moon { display: none !important; }

body.dark-mode .theme-toggle__sun { display: none !important; }
body.dark-mode .theme-toggle__moon { display: block !important; }

/* Perpetual bobbing */
@keyframes sun-bob {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  25% { translate: -3px 4px; rotate: -3deg; }
  50% { translate: 2px 7px; rotate: 2deg; }
  75% { translate: -2px 3px; rotate: -1deg; }
}

/* Sun rays spin continuously */
.theme-toggle__sun .sun-rays {
  transform-origin: 60px 60px;
  animation: ray-spin 12s linear infinite;
}

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

/* Moon zzz float */
body.dark-mode .theme-toggle {
  animation: moon-float 4s ease-in-out infinite;
}

@keyframes moon-float {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  33% { translate: -4px 6px; rotate: -4deg; }
  66% { translate: 3px 4px; rotate: 2deg; }
}

body.dark-mode .theme-toggle__moon text {
  animation: zzz-float 2.5s ease-in-out infinite;
}

@keyframes zzz-float {
  0%, 100% { translate: 0 0; opacity: 0.7; }
  50% { translate: 3px -5px; opacity: 0.3; }
}

/* ---------- Page Loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.loader__doodle {
  width: 54px;
  color: var(--yellow);
  animation: loader-wobble 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

@keyframes loader-wobble {
  0%, 100% { transform: scale(0.8) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(5deg); }
}

.loader__text {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  color: var(--ink-soft);
  animation: pulse-soft 1.2s ease-in-out infinite alternate;
}

@keyframes pulse-soft {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* ---------- Floating dark pill nav ---------- */

.pill-nav {
  position: fixed;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem;
  background: rgba(22, 22, 22, 0.82);
  backdrop-filter: blur(14px);
  view-transition-name: nav-bar;
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(22, 22, 22, 0.28);
  white-space: nowrap;
}

.pill-nav a {
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  color: rgba(245, 243, 238, 0.72);
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.25s var(--ease-pop);
}

.pill-nav a:hover {
  color: #f5f3ee;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.pill-nav a.is-active {
  color: #161616;
  background: var(--yellow);
}

body.dark-mode .pill-nav a.is-active {
  color: #0f0e13;
}

.pill-nav a.pill-nav__cta {
  background: var(--yellow);
  color: #161616;
  font-weight: 600;
  margin-left: 0.2rem;
}

body.dark-mode .pill-nav a.pill-nav__cta {
  color: #0f0e13;
}

.pill-nav a.pill-nav__cta:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 5px var(--yellow-soft);
}

/* ---------- Doodles (small, supporting only) ---------- */

.doodle {
  position: absolute;
  color: var(--yellow);
  opacity: 0;
  transform: scale(0.4) rotate(-15deg);
  transition: opacity 0.35s ease, transform 0.4s var(--ease-pop);
  pointer-events: none;
}
.doodle svg { display: block; width: 100%; height: 100%; }

.hand-note {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  color: var(--ink-soft);
  transform: rotate(-1.5deg);
}

/* ---------- Hero: typography is the hero ---------- */

.hero {
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 1.25rem;
}

.hero__name {
  position: relative;
  display: inline-block;
  font-size: clamp(4rem, 14.5vw, 11.5rem);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
  cursor: default;
  transition: transform 0.5s var(--ease-pop);
}

.hero__line { display: block; }
.hero__line--last { position: relative; }


.hero__name:hover .doodle { opacity: 1; transform: scale(1) rotate(0deg); }

/* small accents only */
.doodle--star      { width: clamp(20px, 2.6vw, 30px); top: -0.18em; left: -0.45em; }
.doodle--spark     { width: clamp(16px, 2.2vw, 26px); top: 0.05em; right: -0.5em; }
.doodle--underline { width: 72%; height: 0.08em; left: 14%; bottom: -0.12em; }

.hero__name:hover .doodle--star  { animation: wiggle 1.6s ease-in-out infinite; }
.hero__name:hover .doodle--spark { animation: spin-slow 5s linear infinite; }

/* ---------- Hero per-letter hover images ---------- */

.hero__letter {
  position: relative;
  display: inline-block;
  cursor: pointer;
  vertical-align: bottom;
  transition: color 0.3s ease, padding 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero__letter img {
  display: inline-block;
  vertical-align: bottom;
  width: 0;
  height: 1.1em;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0;
  box-shadow: 0 8px 28px rgba(22, 22, 22, 0.25);
  transition:
    width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease,
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.6) rotate(-4deg);
  transform-origin: center bottom;
  pointer-events: none;
}

.hero__letter:hover {
  color: transparent;
}

.hero__letter:hover img {
  width: 1.4em;
  opacity: 1;
  transform: scale(1) rotate(0deg);
  animation: card-wobble 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes card-wobble {
  0%   { transform: scale(0.4) rotate(-8deg); }
  40%  { transform: scale(1.08) rotate(3deg); }
  60%  { transform: scale(0.96) rotate(-1.5deg); }
  80%  { transform: scale(1.02) rotate(0.5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.hero__roles {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3.2vw, 2.1rem);
  line-height: 1.4;
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.6em;
  color: var(--ink);
}

.hero__roles em { font-style: italic; }
.hero__roles span:nth-child(3) { color: var(--ink-soft); }

.hero__meta {
  margin-top: 2.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Sections ---------- */

.section {
  max-width: 74rem;
  margin-inline: auto;
  padding: clamp(6rem, 15vh, 10rem) clamp(1.25rem, 5vw, 3rem);
}

.section__title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  margin-bottom: 1rem;
}

.title-dot { color: var(--yellow); }

.section__lede {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  color: var(--ink-soft);
  max-width: 42rem;
  margin-bottom: clamp(3rem, 8vh, 5rem);
}

/* ---------- Work: editorial cards ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  perspective: 1400px;
}

.work-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(22, 22, 22, 0.05);
  transition: box-shadow 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform;
  display: flex;
  flex-direction: column;
}

.work-card:hover { box-shadow: 0 24px 54px rgba(22, 22, 22, 0.13); }

.work-card--wide { grid-column: span 7; }
.work-card--tall { grid-column: span 5; grid-row: span 2; }
.work-card--big  { grid-column: span 7; }

.work-card__art {
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.work-card__art svg { width: 100%; max-width: 380px; height: auto; }

.art--fifa  { background: #ece5d2; transition: background-color 0.5s ease; }
.art--drums { background: #e6e9da; transition: background-color 0.5s ease; }
.art--space { background: #e2e4e9; transition: background-color 0.5s ease; }

body.dark-mode .art--fifa  { background: #2a2518; }
body.dark-mode .art--drums { background: #1e2418; }
body.dark-mode .art--space { background: #1c1e24; }

.work-card--tall .work-card__art { flex: 1; align-content: center; }

.work-card__meta { padding: 1.4rem clamp(1.4rem, 3vw, 2rem) 1.8rem; }

.work-card__meta h3 {
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
  margin-bottom: 0.55rem;
}

.work-card__meta p { color: var(--ink-soft); font-size: 0.97rem; }

.work-card__tags {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.work-card__link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 0.15rem;
  transition: color 0.25s ease;
}

.work-card__link span { display: inline-block; transition: transform 0.3s var(--ease-pop); }
.work-card__link:hover { color: var(--ink-soft); }
.work-card__link:hover span { transform: translate(3px, -3px); }

/* ---------- Story: magazine grid ---------- */

.story-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-auto-flow: dense; /* The holy grail property to eliminate voids! */
  align-items: start;
}

.story-card {
  grid-column: span 4;
  margin-bottom: 0; /* Reset since we use grid gap now */
  border-radius: 16px;
  transition: transform 0.45s var(--ease-pop), box-shadow 0.45s ease;
}

.tilt-l { transform: rotate(-1.6deg); }
.tilt-r { transform: rotate(1.4deg); }

.story-card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 18px 40px rgba(22, 22, 22, 0.12);
}

.story-card--text {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1.6rem 1.7rem 1.8rem;
  box-shadow: 0 6px 20px rgba(22, 22, 22, 0.05);
  font-size: 0.99rem;
  color: var(--ink-soft);
}

.story-card--text strong { color: var(--ink); font-weight: 600; }

.story-card--accent { background: #f3e7bd; transition: background-color 0.5s ease; }
body.dark-mode .story-card--accent { background: #2e2814; }

.story-card__kicker {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.7rem;
}

.story-card__kicker::after {
  content: "";
  display: block;
  width: 2rem;
  height: 3px;
  background: var(--yellow);
  border-radius: 2px;
  margin-top: 0.5rem;
}


/* Polaroids */

.polaroid {
  grid-column: span 4;
  background: white;
  padding: 0.9rem 0.9rem 3.5rem;
  box-shadow: 0 8px 24px rgba(22, 22, 22, 0.08);
  border: 1px solid var(--line);
  position: relative;
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eae5d8;
}

.polaroid.is-empty img { display: none; }

.polaroid.is-empty::before {
  content: attr(data-label);
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--line);
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--ink-faint);
}

.polaroid figcaption {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  text-align: center;
  color: var(--ink-soft);
  padding-top: 0.4rem;
}

/* ---------- TouchGrass feature ---------- */

.feature {
  margin-top: clamp(5rem, 12vh, 8rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(2rem, 5vw, 4rem);
  box-shadow: 0 10px 36px rgba(22, 22, 22, 0.07);
}


/* ---------- Connect ---------- */

.section--connect {
  text-align: center;
  padding-block: clamp(8rem, 20vh, 13rem);
}

.section--connect .hand-note { margin-bottom: 2rem; }

.connect__wrap {
  position: relative;
  display: inline-block;
  padding: 2.25rem;
}

.connect-pill {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6.5vw, 4rem);
  font-style: italic;
  color: var(--bg);
  background: var(--ink);
  padding: clamp(1.1rem, 2.8vw, 1.8rem) clamp(3.25rem, 8vw, 6.5rem);
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(22, 22, 22, 0.3);
  transition: transform 0.45s var(--ease-pop), box-shadow 0.45s ease, color 0.45s ease;
}

.connect__wrap:hover .connect-pill,
.connect-pill:focus-visible {
  color: var(--yellow);
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 0 0 12px var(--yellow-soft), 0 26px 60px rgba(232, 197, 71, 0.45);
}

.doodle--c1 { width: 30px; top: 0.25rem; left: 0; }
.doodle--c2 { width: 96px; bottom: 0; right: -1.75rem; color: var(--ink-soft); }
.doodle--c3 { width: 24px; top: 0.5rem; right: -0.5rem; }

.connect__wrap:hover .doodle { opacity: 1; transform: scale(1) rotate(0deg); }
.connect__wrap:hover .doodle--c1 { animation: wiggle 1.4s ease-in-out infinite; }
.connect__wrap:hover .doodle--c3 { animation: spin-slow 4s linear infinite; }

/* ---------- Footer: rounded bar ---------- */

.footer { padding: 0 clamp(1rem, 4vw, 2.5rem) 1.5rem; }

.footer__bar {
  max-width: 74rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.8rem 1.75rem;
  box-shadow: 0 8px 26px rgba(22, 22, 22, 0.06);
}

.footer__mail {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  color: var(--ink);
  transition: color 0.25s ease;
}
.footer__mail:hover { color: var(--ink-soft); }

.footer__social { display: flex; gap: 0.9rem; }

.footer__social a {
  color: var(--ink-soft);
  display: inline-flex;
  transition: color 0.25s ease, transform 0.3s var(--ease-pop);
}

.footer__social a:hover {
  color: var(--ink);
  transform: translateY(-3px) rotate(-6deg);
}

/* ---------- Motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Inline card expand ---------- */

.story-card[data-expand] {
  cursor: pointer;
}

/* Card grows horizontally and vertically when expanded */
.story-card.is-expanded {
  z-index: 2;
  box-shadow: 0 20px 48px rgba(22, 22, 22, 0.14);
}

/* Default order for all cards so we can swap them dynamically */
.story-card:nth-child(1) { order: 1; }
.story-card:nth-child(2) { order: 2; }
.story-card:nth-child(3) { order: 3; }
.story-card:nth-child(4) { order: 4; }
.story-card:nth-child(5) { order: 5; }
.story-card:nth-child(6) { order: 6; }
.story-card:nth-child(7) { order: 7; }
.story-card:nth-child(8) { order: 8; }

/* Card expands to take over the full width of the grid */
.story-card.is-expanded {
  z-index: 2;
  grid-column: span 12;
  margin-top: clamp(1rem, 3vw, 2rem);
  margin-bottom: clamp(1rem, 3vw, 2rem);
  box-shadow: 0 20px 48px rgba(22, 22, 22, 0.14);
}

body.dark-mode .story-card.is-expanded {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 20px rgba(240, 207, 78, 0.06);
}

/* 
  Allow the summary text to naturally fill the width of the card.
  (This will cause a slight text cross-fade during the View Transition, but
  results in a much better reading experience when the card is full-width).
*/

/* Height reveal */
.story-card__expand {
  display: grid;
  grid-template-rows: 0fr;
  /* transition handled natively by View Transitions API */
}

.story-card__expand-inner {
  overflow: hidden;
}

.story-card.is-expanded .story-card__expand {
  grid-template-rows: 1fr;
}

/* Divider line */
.story-card__divider {
  width: 2.5rem;
  height: 3px;
  background: var(--yellow);
  border-radius: 2px;
  margin: 1.1rem 0 0.9rem;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-pop) 0.1s;
}

.story-card.is-expanded .story-card__divider {
  transform: scaleX(1);
}

/* Detail paragraphs */
.story-card__detail {
  font-size: 0.97rem;
  color: var(--ink-soft);
  line-height: 1.7;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
}

.story-card__detail + .story-card__detail {
  margin-top: 0.65rem;
}

.story-card.is-expanded .story-card__detail {
  opacity: 1;
  transform: translateY(0);
}

.story-carousel {
  display: flex;
  align-items: center; /* Vertically center images of different heights */
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem; /* Small buffer so focus outlines don't clip */
  
  /* Hide scrollbar for a clean, premium look */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Safely center the images if they don't fill the full width, without breaking scroll if they do! */
.story-carousel > :first-child { margin-left: auto; }
.story-carousel > :last-child { margin-right: auto; }

.story-carousel::-webkit-scrollbar {
  display: none;
}

.story-carousel img {
  /* On desktop, take up 35% of width to perfectly fit ~2.8 images side-by-side */
  flex: 0 0 35%;
  height: 320px; /* Fixed uniform height so they line up beautifully like a gallery */
  object-fit: contain; /* Never crop! */
  border-radius: 8px;
  scroll-snap-align: start;
  cursor: zoom-in; /* Hint that it's clickable */
}

/* Stagger */
.story-card.is-expanded .story-card__detail:nth-child(2) { transition-delay: 0.1s; }
.story-card.is-expanded .story-card__detail:nth-child(3) { transition-delay: 0.18s; }
.story-card.is-expanded .story-card__detail:nth-child(4) { transition-delay: 0.25s; }


/* keep tilt cards' rotation when revealed */
.story-card.reveal.is-visible.tilt-l { transform: rotate(-1.6deg); }
.story-card.reveal.is-visible.tilt-r { transform: rotate(1.4deg); }
.story-card.reveal.is-visible:hover,
.story-card.reveal.is-visible.is-expanded { transform: rotate(0deg) translateY(-4px); }

@keyframes wiggle {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.08); }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .doodle { transition: opacity 0.2s ease; transform: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Dark mode transitions for themed elements ---------- */

.work-card,
.story-card--text,
.polaroid,
.feature,
.footer__bar,
.pill-nav,
.connect-pill {
  transition-property: background-color, border-color, box-shadow, color;
  transition-duration: 0.5s;
  transition-timing-function: ease;
}

/* ---------- Enhanced dark mode overrides ---------- */

body.dark-mode ::selection { background: var(--yellow); color: #0f0e13; }

/* Nav gets a subtle glass feel */
body.dark-mode .pill-nav {
  background: rgba(15, 14, 19, 0.85);
  border-color: rgba(240, 207, 78, 0.1);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(240, 207, 78, 0.06);
}

body.dark-mode .pill-nav a.pill-nav__cta {
  box-shadow: 0 0 16px rgba(240, 207, 78, 0.2);
}

/* Hero name gets a subtle warm glow */
body.dark-mode .hero__name {
  text-shadow: 0 0 80px rgba(240, 207, 78, 0.08);
}

/* Cards get a lifted glow in dark mode */
body.dark-mode .work-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

body.dark-mode .work-card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(240, 207, 78, 0.06);
}

/* Story cards */
body.dark-mode .story-card--text {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .story-card:hover {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

/* Story tags glow on hover */
body.dark-mode .story-card__tags span:hover {
  background: var(--yellow);
  color: #0f0e13;
  box-shadow: 0 0 12px rgba(240, 207, 78, 0.3);
}

/* Feature card */
body.dark-mode .feature {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border-color: rgba(240, 207, 78, 0.06);
}

body.dark-mode .feature__visual { background: #16181a; }

/* Polaroids */
body.dark-mode .polaroid {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.dark-mode .polaroid img { background: #1c1a20; }

/* Connect pill glow */
body.dark-mode .connect-pill {
  background: var(--ink);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), 0 0 40px rgba(240, 207, 78, 0.08);
}

body.dark-mode .connect__wrap:hover .connect-pill {
  box-shadow: 0 0 0 12px var(--yellow-soft), 0 26px 60px rgba(240, 207, 78, 0.25), 0 0 60px rgba(240, 207, 78, 0.1);
}

/* Footer */
body.dark-mode .footer__bar {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Yellow accent gets a subtle glow everywhere */
body.dark-mode .title-dot {
  text-shadow: 0 0 16px rgba(240, 207, 78, 0.4);
}

body.dark-mode .work-card__link {
  border-bottom-color: rgba(240, 207, 78, 0.5);
}

body.dark-mode .story-card__kicker::after {
  box-shadow: 0 0 8px rgba(240, 207, 78, 0.3);
}

/* Doodles glow in dark mode */
body.dark-mode .doodle {
  color: var(--yellow);
  filter: drop-shadow(0 0 6px rgba(240, 207, 78, 0.3));
}

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .story-card, .polaroid { grid-column: span 6; }
  .story-carousel img { flex: 0 0 65%; } /* ~1.5 images visible on tablet */
}

@media (max-width: 880px) {
  .work-card--wide, .work-card--tall, .work-card--big { grid-column: span 12; grid-row: auto; }
}

@media (max-width: 620px) {
  .story-card, .polaroid { grid-column: span 12; }
  .story-carousel img { flex: 0 0 90%; } /* ~1 image visible on mobile */

  .pill-nav { gap: 0; padding: 0.3rem; max-width: calc(100vw - 1.5rem); }
  .pill-nav a { font-size: 0.76rem; padding: 0.45rem 0.6rem; }

  .footer__bar { flex-direction: column; padding: 1rem 1.5rem; border-radius: 24px; }
}

/* Prevent View Transition overlay from capturing mouse events and causing hover loops */
::view-transition,
::view-transition-group(*),
::view-transition-image-pair(*),
::view-transition-new(*),
::view-transition-old(*) {
  pointer-events: none !important;
}

/* Slow down the rearrangement animations */
::view-transition-group(*) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: zoom-out;
}

.lightbox.active img {
  transform: scale(1);
}
