/*
  Themes. Each block sets color tokens, fonts and a few feel knobs, then the
  structural overrides below it reshape the site for that theme: how photos
  are framed, how the hero is laid out, how the menu and buttons look.

  To add a theme: copy a block, give it a new data-theme name, then add it
  to the themes list in src/site.config.ts (with its Google Fonts query).
  Admin pages always use Midnight, so overrides here never touch the admin.
*/

/* ================================================================
   Midnight: dark editorial (the base look, defined in main.css)
   ================================================================ */
:root,
[data-theme="midnight"] {
  --bg: #0b0b10;
  --bg-2: #13131b;
  --surface: #1a1a24;
  --text: #f2efe9;
  --muted: #8d8a99;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff6b4a;
  --accent-2: #ffb36b;
  --on-accent: #120a06;
  --glow: rgba(255, 107, 74, 0.35);
  --grain-opacity: 0.07;
  --radius: 14px;
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-body: "Inter Tight", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

/* ================================================================
   Paper: a light gallery wall with matted prints
   ================================================================ */
[data-theme="paper"] {
  --bg: #f4f1ea;
  --bg-2: #ebe6db;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6c6860;
  --line: rgba(0, 0, 0, 0.12);
  --accent: #1d1d1f;
  --accent-2: #b4472a;
  --on-accent: #f4f1ea;
  --glow: rgba(0, 0, 0, 0.12);
  --grain-opacity: 0;
  --radius: 0px;
  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

/* Hero: text on the wall, one framed print instead of a full bleed photo */
[data-theme="paper"] .hero {
  align-items: center;
}
[data-theme="paper"] .hero-stage {
  inset: 120px var(--gutter) 64px 52%;
  overflow: hidden;
  border: 14px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 30px 60px -20px rgba(0, 0, 0, 0.35);
}
[data-theme="paper"] .hero-stage::after {
  display: none;
}
[data-theme="paper"] .hero-copy {
  max-width: 46%;
}
[data-theme="paper"] .hero-title {
  font-weight: 400;
  letter-spacing: -0.01em;
}
[data-theme="paper"] .hero-title .italic {
  color: var(--accent-2);
}
[data-theme="paper"] .hero-intro {
  color: var(--muted);
}
@media (max-width: 800px) {
  [data-theme="paper"] .hero {
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
  }
  [data-theme="paper"] .hero-stage {
    position: relative;
    inset: auto;
    order: -1;
    height: 52svh;
    margin-bottom: 28px;
    border-width: 10px;
  }
  [data-theme="paper"] .hero-copy {
    max-width: none;
  }
}

/* Photos hang as prints: white mat, soft wall shadow, lift on hover */
[data-theme="paper"] .tile-link,
[data-theme="paper"] .album-cover,
[data-theme="paper"] .about-photo {
  border: 10px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 14px 30px -14px rgba(0, 0, 0, 0.3);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
[data-theme="paper"] .tile-link:hover,
[data-theme="paper"] .album-card:hover .album-cover {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 26px 40px -18px rgba(0, 0, 0, 0.4);
}
[data-theme="paper"] .tile-link:hover .thumb.is-loaded {
  transform: none;
}
[data-theme="paper"] .masonry[data-size="s"] .tile-link {
  border-width: 5px;
}
[data-theme="paper"] .tile figcaption {
  background: none;
  color: var(--text);
  position: static;
  opacity: 1;
  transform: none;
  padding: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
}
/* Wall label under each album */
[data-theme="paper"] .album-meta h3 {
  font-style: italic;
}

/* Menu: plain words with an underline, like a gallery's sign */
[data-theme="paper"] .nav {
  border: 0;
  background: none;
}
[data-theme="paper"] .nav a,
[data-theme="paper"] .nav-drop-btn {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
}
[data-theme="paper"] .nav a.active::before,
[data-theme="paper"] .nav-drop-btn.active::before {
  inset: auto 16px 2px;
  height: 1px;
  background: var(--text);
}
[data-theme="paper"] .brand-mark {
  border-radius: 0;
}
[data-theme="paper"] .btn {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  padding: 15px 26px;
}
[data-theme="paper"] .chip,
[data-theme="paper"] .seg,
[data-theme="paper"] .seg button {
  border-radius: 0;
}
[data-theme="paper"] .topbar.is-scrolled {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
@media (hover: hover) and (pointer: fine) {
  [data-theme="paper"] .cursor {
    mix-blend-mode: normal;
    background: var(--text);
  }
}

/* ================================================================
   Film: a darkroom contact sheet
   ================================================================ */
[data-theme="film"] {
  --bg: #15110d;
  --bg-2: #1e1913;
  --surface: #262017;
  --text: #f1e6d2;
  --muted: #a8977b;
  --line: rgba(241, 230, 210, 0.14);
  --accent: #e8b04a;
  --accent-2: #d9653b;
  --on-accent: #15110d;
  --glow: rgba(232, 176, 74, 0.3);
  --grain-opacity: 0.16;
  --radius: 2px;
  --font-display: "Bebas Neue", "Impact", sans-serif;
  --font-body: "Courier Prime", "Courier New", monospace;
  --font-mono: "Courier Prime", "Courier New", monospace;
  color-scheme: dark;
}
[data-theme="film"] body {
  font-size: 16px;
}
[data-theme="film"] .display,
[data-theme="film"] .hero-title,
[data-theme="film"] .album-meta h3,
[data-theme="film"] .project-main h3,
[data-theme="film"] .photo-title {
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
[data-theme="film"] .hero-title .italic {
  font-style: normal;
}

/* Hero: letterboxed like a projected frame, warm and a little faded */
[data-theme="film"] .hero-stage {
  inset: 9svh 0;
  overflow: hidden;
}
[data-theme="film"] .hero-stage img:not(.lqip) {
  filter: sepia(0.25) contrast(1.05) saturate(0.9);
}
[data-theme="film"] .hero-copy::before {
  content: "KODAK 400TX  ▸  24";
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font: 700 12px var(--font-mono);
  letter-spacing: 0.2em;
}

/* Contact sheet: every photo sits in a strip with sprocket holes and a frame number */
[data-theme="film"] .masonry {
  counter-reset: frame;
}
[data-theme="film"] .tile {
  counter-increment: frame;
}
[data-theme="film"] .tile-link,
[data-theme="film"] .album-cover {
  padding: 16px 0;
  background:
    radial-gradient(circle, var(--bg) 2.6px, transparent 3px) 0 3px / 13px 10px repeat-x,
    radial-gradient(circle, var(--bg) 2.6px, transparent 3px) 0 calc(100% - 3px) / 13px 10px repeat-x,
    #0a0806;
  aspect-ratio: auto;
}
[data-theme="film"] .tile-link img,
[data-theme="film"] .album-cover img {
  position: relative;
  inset: auto;
  height: auto;
  aspect-ratio: var(--ar, 4 / 5);
}
[data-theme="film"] .album-cover img {
  aspect-ratio: 4 / 5;
}
[data-theme="film"] .tile-link .lqip,
[data-theme="film"] .album-cover .lqip {
  position: absolute;
  inset: 16px 0;
  height: calc(100% - 32px);
}
[data-theme="film"] .masonry[data-layout="grid"] .tile-link img {
  aspect-ratio: 1;
}
[data-theme="film"] .masonry[data-layout="grid"] .tile-link {
  aspect-ratio: auto;
}
[data-theme="film"] .tile-link::after {
  content: counter(frame) "A";
  position: absolute;
  right: 8px;
  bottom: 1px;
  color: var(--accent);
  font: 700 10px var(--font-mono);
  letter-spacing: 0.1em;
}
[data-theme="film"] .tile .thumb.is-loaded {
  filter: sepia(0.15) saturate(0.85);
  transition: opacity 0.8s ease, transform 1.2s var(--ease-out), filter 0.6s;
}
[data-theme="film"] .tile-link:hover .thumb.is-loaded {
  filter: none;
  transform: none;
}
/* Red grease pencil circle on hover, like marking a keeper */
[data-theme="film"] .tile-link::before {
  content: "";
  position: absolute;
  inset: 22px 6px;
  z-index: 2;
  border: 2px solid #d9653b;
  border-radius: 46% 54% 48% 52% / 52% 46% 54% 48%;
  opacity: 0;
  transform: scale(1.06) rotate(-2deg);
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
  pointer-events: none;
}
[data-theme="film"] .tile-link:hover::before {
  opacity: 0.9;
  transform: none;
}
[data-theme="film"] .tile figcaption {
  bottom: 16px;
}

[data-theme="film"] .nav,
[data-theme="film"] .btn,
[data-theme="film"] .chip,
[data-theme="film"] .seg,
[data-theme="film"] .seg button,
[data-theme="film"] .nav a,
[data-theme="film"] .nav-drop-btn {
  border-radius: 2px;
}
[data-theme="film"] .nav a,
[data-theme="film"] .nav-drop-btn,
[data-theme="film"] .btn {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
[data-theme="film"] .brand-mark {
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 18px;
}

/* ================================================================
   Neon: sharp, glowing, all caps
   ================================================================ */
[data-theme="neon"] {
  --bg: #06050c;
  --bg-2: #0d0b19;
  --surface: #131026;
  --text: #eae8ff;
  --muted: #7d78a8;
  --line: rgba(0, 240, 255, 0.18);
  --accent: #00f0ff;
  --accent-2: #ff2bd6;
  --on-accent: #06050c;
  --glow: rgba(0, 240, 255, 0.45);
  --grain-opacity: 0.05;
  --radius: 0px;
  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  color-scheme: dark;
}
/* Scanlines over everything */
[data-theme="neon"] .grain {
  inset: 0;
  opacity: 1;
  animation: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
}
[data-theme="neon"] .display,
[data-theme="neon"] .hero-title,
[data-theme="neon"] .album-meta h3,
[data-theme="neon"] .project-main h3,
[data-theme="neon"] .photo-title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
[data-theme="neon"] .display {
  font-size: clamp(36px, 7vw, 96px);
}
[data-theme="neon"] .hero-title {
  font-size: clamp(40px, 7vw, 104px);
  text-shadow: -2px 0 rgba(255, 43, 214, 0.7), 2px 0 rgba(0, 240, 255, 0.7);
}
[data-theme="neon"] .hero-title .italic {
  font-style: normal;
  color: var(--accent);
  text-shadow: 0 0 24px var(--glow), 0 0 2px var(--accent);
}
[data-theme="neon"] .hero-stage img:not(.lqip) {
  filter: saturate(1.3) contrast(1.1) hue-rotate(-8deg);
}
[data-theme="neon"] .hero-stage::after {
  background:
    linear-gradient(to top, var(--bg) 2%, transparent 60%),
    linear-gradient(120deg, rgba(255, 43, 214, 0.25), transparent 40%, rgba(0, 240, 255, 0.2));
}
[data-theme="neon"] body,
[data-theme="neon"] .nav a,
[data-theme="neon"] .nav-drop-btn,
[data-theme="neon"] .btn,
[data-theme="neon"] .chip,
[data-theme="neon"] .eyebrow {
  text-transform: uppercase;
}
[data-theme="neon"] .hero-intro,
[data-theme="neon"] .prose,
[data-theme="neon"] .lede,
[data-theme="neon"] .photo-caption,
[data-theme="neon"] .lb-caption {
  text-transform: none;
}

/* Photos: hard edges, cool until hovered, then a glowing outline */
[data-theme="neon"] .tile-link,
[data-theme="neon"] .album-cover,
[data-theme="neon"] .about-photo {
  outline: 1px solid var(--line);
  transition: outline-color 0.3s, box-shadow 0.3s;
}
[data-theme="neon"] .tile .thumb.is-loaded,
[data-theme="neon"] .album-cover .thumb.is-loaded {
  filter: grayscale(0.55) contrast(1.08);
  transition: opacity 0.8s ease, transform 1.2s var(--ease-out), filter 0.4s;
}
[data-theme="neon"] .tile-link:hover,
[data-theme="neon"] .album-card:hover .album-cover {
  outline-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 30px var(--glow);
}
[data-theme="neon"] .tile-link:hover .thumb.is-loaded,
[data-theme="neon"] .album-card:hover .thumb.is-loaded {
  filter: none;
}

/* Menu and buttons: brackets and glow */
[data-theme="neon"] .nav {
  border-radius: 0;
  border-color: var(--line);
}
[data-theme="neon"] .nav a,
[data-theme="neon"] .nav-drop-btn {
  border-radius: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
}
[data-theme="neon"] .nav a.active::before,
[data-theme="neon"] .nav-drop-btn.active::before {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 16px var(--glow);
}
[data-theme="neon"] .btn {
  border-radius: 0;
  letter-spacing: 0.1em;
  font-size: 13px;
}
[data-theme="neon"] .btn-solid {
  box-shadow: 0 0 24px var(--glow);
}
[data-theme="neon"] .btn-ghost {
  border-color: var(--accent);
  color: var(--accent);
}
[data-theme="neon"] .brand-mark {
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 16px var(--glow);
}
[data-theme="neon"] .chip,
[data-theme="neon"] .seg,
[data-theme="neon"] .seg button {
  border-radius: 0;
}

/* ================================================================
   Forest: soft, rounded, organic
   ================================================================ */
[data-theme="forest"] {
  --bg: #0f1a14;
  --bg-2: #14231b;
  --surface: #1a2c22;
  --text: #e7efe6;
  --muted: #8aa293;
  --line: rgba(231, 239, 230, 0.12);
  --accent: #9ed9a0;
  --accent-2: #e6d38a;
  --on-accent: #0f1a14;
  --glow: rgba(158, 217, 160, 0.3);
  --grain-opacity: 0.06;
  --radius: 28px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  color-scheme: dark;
}

/* Hero: centered, framed in a big rounded window */
[data-theme="forest"] .hero {
  justify-content: center;
  text-align: center;
}
[data-theme="forest"] .hero-stage {
  inset: 88px var(--gutter) 24px;
  border-radius: 40px;
  overflow: hidden;
}
[data-theme="forest"] .hero-copy {
  margin: 0 auto;
}
[data-theme="forest"] .hero-intro {
  margin-left: auto;
  margin-right: auto;
}
[data-theme="forest"] .hero-cta {
  justify-content: center;
}
[data-theme="forest"] .hero-title {
  font-weight: 400;
  letter-spacing: -0.02em;
}
[data-theme="forest"] .hero-title .italic {
  color: var(--accent-2);
}

/* Photos: soft corners and a slow drift, like leaves on water */
[data-theme="forest"] .tile-link {
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.6);
}
@media (prefers-reduced-motion: no-preference) {
  [data-theme="forest"] .tile.is-in .tile-link {
    animation: forest-drift 7s ease-in-out infinite alternate;
    animation-delay: calc(var(--d, 0ms) * -12);
  }
}
@keyframes forest-drift {
  from {
    translate: 0 -3px;
  }
  to {
    translate: 0 4px;
  }
}
[data-theme="forest"] .tile-link:hover .thumb.is-loaded {
  transform: scale(1.03);
}
[data-theme="forest"] .album-cover {
  border-radius: 999px 999px var(--radius) var(--radius);
}
[data-theme="forest"] .about-photo {
  border-radius: 999px 999px 40px 40px;
}
[data-theme="forest"] .display,
[data-theme="forest"] .album-meta h3 {
  font-weight: 400;
  font-style: italic;
}
[data-theme="forest"] .eyebrow {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 14px;
  color: var(--accent);
}
[data-theme="forest"] .eyebrow::before {
  content: "❧ ";
}
[data-theme="forest"] .btn {
  padding: 15px 28px;
}
