/* ============================================================
   AAHIL DAWOODANI · personal site
   Palette & geometry: Obsidian vault › Theme & Color Palette
   Mood: Wes Anderson symmetry + Arc Raiders stripes + Destiny HUD
   ============================================================ */

:root {
  /* Palette (fixed, theme-independent) */
  --orange: #f88436;
  --orange-ink: #b8501a; /* small orange text on light backgrounds */
  --royal: #3d45aa;
  --red: #da3d20;
  --yellow: #fff19b;
  --forest: #2e5a44;
  --rose: #e4a5a2;
  --terracotta: #b86b67;
  --lavender: #988bc7;
  --plum: #4e3b68;
  --mocha: #8c6d53;
  --sand: #d8c7b5;
  --teal: #4e878c;
  --seafoam: #b2d3d2;

  /* Neutrals: light */
  --bg: #fcfcfc;
  --surface: #ffffff;
  --surface-2: #f6f1ea;
  --border: #e7e7e9;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-2: #52525b;
  --muted: #71717a;
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 24px rgba(24, 24, 27, 0.06);

  /* Project banners: light */
  --haven-bg: var(--seafoam);
  --haven-ink: #17383b;
  --ghostllm-bg: #dcd5ef;
  --ghostllm-ink: var(--plum);
  --statgarden-bg: #d3e2d6;
  --statgarden-ink: #1f3d2e;
  --photobook-bg: #ece2d6;
  --photobook-ink: #4a3a2b;

  /* Geometry */
  --r-card: 12px;
  --r-btn: 8px;
  --r-sm: 6px;
  --r-pill: 9999px;
  --wrap: 1080px;

  /* Type */
  --font-sans: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Jost, Futura, "Century Gothic", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Motion */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
}

:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1c1c20;
  --border: #232326;
  --border-strong: #34343a;
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --muted: #8a8a93;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);

  --haven-bg: #1d3537;
  --haven-ink: var(--seafoam);
  --ghostllm-bg: #2a2138;
  --ghostllm-ink: #d6cdf0;
  --statgarden-bg: #1b2b22;
  --statgarden-ink: #bcd8c4;
  --photobook-bg: #2e271f;
  --photobook-ink: #e6d6c3;
  --orange-ink: var(--orange);
}

/* No-JS fallback: follow the OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b0b0c;
    --surface: #141416;
    --surface-2: #1c1c20;
    --border: #232326;
    --border-strong: #34343a;
    --text: #f4f4f5;
    --text-2: #a1a1aa;
    --muted: #8a8a93;
    --haven-bg: #1d3537;
    --haven-ink: var(--seafoam);
    --ghostllm-bg: #2a2138;
    --ghostllm-ink: #d6cdf0;
    --statgarden-bg: #1b2b22;
    --statgarden-ink: #bcd8c4;
    --photobook-bg: #2e271f;
    --photobook-ink: #e6d6c3;
    --orange-ink: var(--orange);
  }
}

/* ===== BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  margin: 0;
}

p {
  margin: 0;
}

::selection {
  background: var(--orange);
  color: #18181b;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.mono {
  font-family: var(--font-mono);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-btn);
  text-decoration: none;
  transition: top var(--t-fast) ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ===== STARFIELD (dark only) ===== */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

:root[data-theme="dark"] #starfield {
  opacity: 0.55;
}

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

/* ===== ARC RAIDERS STRIPES ===== */
.stripes {
  display: flex;
  height: 6px;
}

.stripes i {
  flex: 1;
}

.stripes i:nth-child(1) { background: var(--red); }
.stripes i:nth-child(2) { background: var(--orange); }
.stripes i:nth-child(3) { background: var(--yellow); }
.stripes i:nth-child(4) { background: var(--seafoam); }
.stripes i:nth-child(5) { background: var(--teal); }
.stripes i:nth-child(6) { background: var(--royal); }

/* ===== TOP BAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.75rem;
}

.monogram {
  text-decoration: none;
  flex-shrink: 0;
}

.monogram-mark {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  border: 1.5px solid var(--text);
  border-radius: var(--r-sm);
  transform: rotate(45deg);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
  /* The real letters are hidden; ::after draws them counter-rotated inside the diamond. */
  color: transparent;
  position: relative;
}

.monogram-mark::after {
  content: "AD";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  transform: rotate(-45deg);
}

.monogram:hover .monogram-mark {
  background: var(--orange);
  border-color: var(--orange);
}

.monogram:hover .monogram-mark::after {
  color: #18181b;
}

.nav-links {
  display: flex;
  gap: clamp(0.75rem, 2.4vw, 1.9rem);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}

@media (min-width: 900px) {
  .nav-links {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-2);
  white-space: nowrap;
  transition: color var(--t-fast) ease;
}

.nav-links .num {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0;
  color: var(--orange-ink);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.theme-toggle {
  position: relative;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  cursor: pointer;
  color: var(--text);
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease;
}

.theme-toggle svg {
  position: absolute;
  transition: transform 0.4s var(--ease-spring), opacity 0.25s ease;
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: none;
  color: var(--yellow);
}

.theme-toggle:hover {
  border-color: var(--border);
  color: var(--orange);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.3rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--r-btn);
  border: 1.5px solid transparent;
  transition: transform var(--t-fast) ease, background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--orange);
  color: #18181b;
}

.btn-primary:hover {
  background: #ff9550;
}

.btn-ghost {
  border-color: var(--text);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--text);
  color: var(--bg);
}

.dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

/* ===== HERO ===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(72svh, 600px);
  padding-top: 3rem;
  padding-bottom: 1.5rem;
  text-align: center;
}

/* Less of a gap between the name and the first section. */
.hero + .section {
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.hud-line {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-line .dot {
  color: var(--orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 25%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--orange) 0%, transparent); }
}

.hero-name {
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 1.2rem + 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rule-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.6rem auto 1.1rem;
  max-width: 320px;
  color: var(--orange);
}

.rule-title span {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.rule-title em {
  font-style: normal;
  font-size: 0.7rem;
}

.hero-role {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.15rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-2);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.75rem;
}

.socials a {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-btn);
  color: var(--text-2);
  font-size: 1.05rem;
  text-decoration: none;
  transition: color var(--t-fast) ease, transform var(--t-fast) ease, background-color var(--t-fast) ease;
}

.socials a:hover {
  background: var(--surface-2);
  transform: translateY(-2px);
}

/* Brand colours for each site. */
.socials a[aria-label="Email"]     { color: #0078d4; }
.socials a[aria-label="GitHub"]    { color: var(--text); }
.socials a[aria-label="LinkedIn"]  { color: #0a66c2; }
.socials a[aria-label="YouTube"]   { color: #ff0000; }
.socials a[aria-label="Strava"]    { color: #fc4c02; }
.socials a[aria-label="Instagram"] i {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== SECTIONS & CHAPTER CARDS ===== */
.section {
  padding-top: clamp(4.5rem, 10vw, 7rem);
}

.chapter {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.chapter-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange-ink);
}

.chapter h2 {
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.9rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.1;
}

.chapter h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin: 1rem auto 0;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--orange) 33% 66%, var(--yellow) 66%);
}

/* ===== ABOUT ===== */
.about-copy {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.about-copy p {
  color: var(--text-2);
}

.about-copy p + p {
  margin-top: 1.1rem;
}

.about-copy .about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--text);
}

.about-copy .about-body {
  max-width: 30em;
  margin: 1rem auto 0;
  font-size: 1.05rem;
  line-height: 1.7;
  text-wrap: balance;
}

/* ===== PROJECTS ===== */
.project {
  --p-bg: var(--surface-2);
  --p-ink: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
}

/* One column on phones, two on wider screens. An odd last card spans the full row. */
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

@media (min-width: 761px) {
  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.project:hover {
  border-color: var(--border-strong);
}

.project-haven {
  --p-bg: var(--haven-bg);
  --p-ink: var(--haven-ink);
}

.project-ghostllm {
  --p-bg: var(--ghostllm-bg);
  --p-ink: var(--ghostllm-ink);
}

.project-statgarden {
  --p-bg: var(--statgarden-bg);
  --p-ink: var(--statgarden-ink);
}

.project-photobook {
  --p-bg: var(--photobook-bg);
  --p-ink: var(--photobook-ink);
}

.project-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3.5vw, 2.25rem);
  background: var(--p-bg);
  color: var(--p-ink);
  overflow: hidden;
}

.banner-stripes {
  position: absolute;
  top: 0;
  right: 2.25rem;
  bottom: 0;
  display: flex;
  gap: 0;
  transform: skewX(-18deg);
  opacity: 0.9;
  pointer-events: none;
}

.banner-stripes i {
  width: 14px;
}

.project-haven .banner-stripes i:nth-child(1) { background: var(--orange); }
.project-haven .banner-stripes i:nth-child(2) { background: var(--yellow); }
.project-haven .banner-stripes i:nth-child(3) { background: var(--teal); }

.project-ghostllm .banner-stripes i:nth-child(1) { background: var(--rose); }
.project-ghostllm .banner-stripes i:nth-child(2) { background: var(--lavender); }
.project-ghostllm .banner-stripes i:nth-child(3) { background: var(--royal); }

.project-statgarden .banner-stripes i:nth-child(1) { background: var(--red); }
.project-statgarden .banner-stripes i:nth-child(2) { background: var(--orange); }
.project-statgarden .banner-stripes i:nth-child(3) { background: var(--sand); }

.project-photobook .banner-stripes i:nth-child(1) { background: var(--yellow); }
.project-photobook .banner-stripes i:nth-child(2) { background: var(--rose); }
.project-photobook .banner-stripes i:nth-child(3) { background: var(--royal); }

.project-id {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.project-ghost {
  width: 26px;
  height: 26px;
}

.project-glyph {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid currentColor;
  border-radius: var(--r-btn);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
}

/* StatGarden's four-square logo sits on the page colour, so the green square still shows on the green banner */
.project-statgarden .project-glyph {
  background: var(--bg);
}

/* Haven's mountain is black on Warm Sand in both themes, same as its app icon */
.project-haven .project-glyph {
  background: var(--sand);
  border-color: #0b0b0c;
}

.project-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.project-banner h3 {
  font-family: var(--font-display);
  font-weight: 500;
  /* Sized to the card, so every title is the same size and long names stay on one line. */
  font-size: clamp(1.15rem, 5.4cqi, 1.9rem);
  white-space: nowrap;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.status {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Narrow cards (phones): the pill goes back into the flow so it can't cover the title. */
@container (max-width: 440px) {
  .project-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .status {
    position: relative;
    top: auto;
    right: auto;
  }
}

.status-live .dot { color: #3fae6a; }
.status-wip .dot { color: var(--orange); }
.status-planned .dot { color: var(--lavender); }

.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3.5vw, 2.25rem);
}

.project-summary {
  max-width: 68ch;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  color: var(--text-2);
}

/* ===== PHOTOS: a table of polaroids ===== */
.table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.table-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.table-buttons {
  display: flex;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) ease;
}

.chip:hover {
  border-color: var(--orange);
  color: var(--orange-ink);
  transform: translateY(-2px);
}

.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.photo-table {
  --card-w: 200px;
  position: relative;
  height: 620px;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  background-image:
    radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  overflow: hidden;
  transition: height 0.5s var(--ease-spring);
  touch-action: pan-y;
}

/* Slightly smaller cards when tidy, so 15 photos sit as a 5 × 3 grid. */
.photo-table.is-tidy {
  --card-w: 168px;
}

.polaroid {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-w);
  margin: 0;
  padding: 10px 10px 0;
  background: #fdfcf8;
  border: 0;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 16px rgba(0, 0, 0, 0.12);
  cursor: grab;
  transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--r, 0deg));
  transition: transform 0.6s var(--ease-spring), box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  font: inherit;
  text-align: left;
  color: #3a3a3f;
}

.polaroid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #e9e5dc;
  pointer-events: none;
  -webkit-user-drag: none;
}

.polaroid .cap {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.1rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: #6b6b72;
}

.polaroid:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 12px 28px rgba(0, 0, 0, 0.16);
}

.polaroid.is-dragging {
  cursor: grabbing;
  transition: box-shadow 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.16), 0 24px 48px rgba(0, 0, 0, 0.24);
}

.polaroid:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

:root[data-theme="dark"] .polaroid {
  background: #f2efe7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 20px rgba(0, 0, 0, 0.45);
}

/* Small screens: a pile you tap through */
.photo-table.is-pile .polaroid {
  cursor: pointer;
  touch-action: manipulation;
}

.polaroid.is-tossed {
  transition: transform 0.35s ease-in;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(0.75rem, 3vw, 2rem);
  background: rgba(11, 11, 12, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: lb-in 0.25s ease;
}

.lightbox[hidden] {
  display: none;
}

@keyframes lb-in {
  from { opacity: 0; }
}

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.lb-figure img {
  max-width: 100%;
  max-height: calc(100svh - 7rem);
  object-fit: contain;
  border: 8px solid #fdfcf8;
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lb-figure figcaption {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: #a1a1aa;
}

.lb-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}

.lb-btn:hover {
  background: var(--orange);
  color: #18181b;
}

.lb-close {
  position: absolute;
  top: clamp(0.75rem, 3vw, 1.5rem);
  right: clamp(0.75rem, 3vw, 1.5rem);
}

/* ===== CONTACT ===== */
.contact {
  text-align: center;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* ===== FOOTER ===== */
.footer {
  margin-top: clamp(4.5rem, 10vw, 7rem);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.konami-hint {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--border-strong);
  user-select: none;
}

/* ===== REVEAL ===== */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .nav-links .num {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav {
    height: auto;
    flex-wrap: wrap;
    padding-top: 0.6rem;
    padding-bottom: 0.4rem;
    row-gap: 0.25rem;
  }

  .nav-links {
    order: 3;
    width: 100%;
    gap: 1rem;
    padding-bottom: 0.2rem;
  }

  .nav-links a {
    font-size: 0.74rem;
    letter-spacing: 0.1em;
  }

  .nav-links li:last-child {
    padding-right: 2rem;
  }

  .hero-name {
    font-size: clamp(2.1rem, 11vw, 2.6rem);
    letter-spacing: 0.03em;
  }

  .photo-table {
    --card-w: 210px;
    height: 400px;
  }

  .photo-table.is-tidy {
    --card-w: 140px;
  }

  .photo-table.is-tidy .polaroid {
    padding: 7px 7px 0;
  }

  .photo-table.is-tidy .cap {
    font-size: 0.58rem;
  }

  .lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .lb-figure {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .lb-prev,
  .lb-next {
    grid-row: 2;
    justify-self: center;
  }

  .banner-stripes {
    right: 1rem;
    opacity: 0.5;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

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

  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }

  .polaroid,
  .photo-table {
    transition: none;
  }

  .hud-line .dot {
    animation: none;
  }

  .btn,
  .socials a,
  .theme-toggle,
  .project {
    transition: none;
  }
}
