/* ==========================================================================
   John McKinnon — Warm & Approachable Editorial Design System
   Plain CSS with Custom Properties, Light/Dark Themes, and Print Résumé
   ========================================================================== */

:root {
  /* Warm Linen & Terracotta Palette (Light) */
  --bg: #faf7f2;
  --bg-tinted: #f3ede3;
  --surface: #ffffff;
  --surface-subtle: #f7f2ea;

  --ink: #000000;
  --ink-secondary: #4a4a4a;
  --ink-muted: #6e6e6e;

  --accent: #c05a3c;
  --accent-hover: #a2462b;
  --accent-soft: rgba(192, 90, 60, 0.11);

  --sage: #4f6b5b;
  --sage-soft: rgba(79, 107, 91, 0.12);

  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.18);

  /* Hero Background Readability Overlay (left-weighted so centered portrait stays clear) */
  --hero-overlay-strong: rgba(250, 247, 242, 0.9);
  --hero-overlay-mid: rgba(250, 247, 242, 0.68);
  --hero-overlay-soft: rgba(250, 247, 242, 0.12);
  --hero-overlay-mobile: rgba(250, 247, 242, 0.78);

  /* Wave Footer Palette */
  --footer-band-bg: #000000;
  --footer-wave-accent: #9bb8d6;
  --footer-wave-fill: #e9edf3;

  /* Editorial SVG Art Palette */
  --art-bg: #efe7da;
  --art-sun: #e6a98a;
  --art-arch: #e1d4c1;
  --art-inner: #f8f3eb;
  --art-stem: #4f6b5b;
  --art-leaf: #688573;
  --art-leaf-alt: #c8765b;

  /* Typography */
  --font-serif: Arial, Helvetica, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout & Motion */
  --container-max: 1120px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --header-height: 74px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='dark'] {
  --bg: #000000;
  --bg-tinted: #0c0c0c;
  --surface: #141414;
  --surface-subtle: #1d1d1d;

  --ink: #f4efe6;
  --ink-secondary: #c4bbb0;
  --ink-muted: #93897e;

  --accent: #e07a5f;
  --accent-hover: #eb8f76;
  --accent-soft: rgba(224, 122, 95, 0.15);

  --sage: #85a894;
  --sage-soft: rgba(133, 168, 148, 0.16);

  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.72);

  --hero-overlay-strong: rgba(0, 0, 0, 0.9);
  --hero-overlay-mid: rgba(0, 0, 0, 0.72);
  --hero-overlay-soft: rgba(0, 0, 0, 0.28);
  --hero-overlay-mobile: rgba(0, 0, 0, 0.78);

  --footer-band-bg: #000000;
  --footer-wave-accent: #6c8fb4;
  --footer-wave-fill: #14171c;

  --art-bg: #1a1a1a;
  --art-sun: #c86d52;
  --art-arch: #262626;
  --art-inner: #111111;
  --art-stem: #85a894;
  --art-leaf: #6f947f;
  --art-leaf-alt: #d98268;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--ink);
}

p {
  margin: 0;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-tinted {
  background-color: var(--bg-tinted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #faf7f2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
  background-color: var(--surface-subtle);
}

.nav-link.is-active {
  color: var(--accent);
  background-color: var(--accent-soft);
}

/* Header Dropdown (Amusements) */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-chevron {
  transition: transform 0.2s var(--ease);
}

.nav-dropdown:hover .nav-chevron,
.nav-dropdown:focus-within .nav-chevron,
.nav-dropdown.is-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  padding-top: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.2s var(--ease), visibility 0.18s ease;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-dropdown-link {
  display: block;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown-link:hover,
.nav-dropdown-link:focus-visible,
.nav-dropdown-link.is-active {
  background: var(--surface-subtle);
  color: var(--accent);
}

.nav-dropdown-link.is-active {
  background: var(--accent-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

[data-theme='light'] .icon-sun,
[data-theme='dark'] .icon-moon {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

.mobile-nav {
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.mobile-nav-inner {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-link {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--ink-secondary);
}

.mobile-nav-link:hover,
.mobile-nav-link.is-active {
  background: var(--surface-subtle);
  color: var(--ink);
}

.mobile-nav-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.mobile-nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  margin-left: 12px;
  border-left: 1px solid var(--border);
}

.mobile-nav-sublink {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

.mobile-nav-sublink:hover,
.mobile-nav-sublink.is-active {
  background: var(--surface-subtle);
  color: var(--accent);
}

.mobile-nav-sublink.is-active {
  background: var(--accent-soft);
  font-weight: 600;
}

/* Buttons & Links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #faf7f2;
  box-shadow: 0 6px 18px rgba(192, 90, 60, 0.22);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 24px rgba(192, 90, 60, 0.28);
}

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

.btn-secondary:hover {
  border-color: var(--ink-muted);
  background: var(--surface-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.85rem;
}

.text-link {
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.2s ease;
}

.text-link:hover {
  opacity: 0.8;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Section Headers */
.section-header {
  margin-bottom: 48px;
  max-width: 680px;
}

.section-header-row {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(2rem, 3.6vw, 2.75rem);
}

.section-subtitle {
  max-width: 420px;
  color: var(--ink-secondary);
  font-size: 0.98rem;
}

/* Hero + About Sticky Scroll Stage */
.hero-stage {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}

.hero-stage-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-stage-sticky {
  position: sticky;
  top: var(--header-height);
  width: 100%;
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  overflow: hidden;
  background-color: #000000;
}

.hero {
  position: relative;
  width: 100%;
  min-height: clamp(460px, calc(100svh - var(--header-height)), 820px);
  display: flex;
  align-items: flex-start;
  padding-top: clamp(28px, 4vw, 56px);
  padding-bottom: 48px;
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
      var(--hero-overlay-strong) 0%,
      var(--hero-overlay-mid) 22%,
      var(--hero-overlay-soft) 40%,
      transparent 58%);
}

.hero-scroll-dim {
  position: absolute;
  inset: 0;
  background: #000000;
  opacity: var(--hero-dim, 0);
  will-change: opacity;
  pointer-events: none;
}

.hero-grid {
  display: block;
  width: 100%;
  max-width: none;
  padding: 0 clamp(20px, 4vw, 56px);
}

.hero-content {
  width: 100%;
  max-width: none;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.6rem, 5.5vw, 5.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  width: 100%;
}

/* About Section Overlaying the Darkened Hero Backdrop */
.about-overlay {
  position: relative;
  background: transparent;
  color: #f4efe6;
  padding-top: 88px;
  padding-bottom: 112px;
}

.about-overlay .eyebrow {
  color: #f09275;
}

.about-overlay .section-title {
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.about-overlay .lead-paragraph {
  color: #f4efe6;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.about-overlay .currently-callout {
  background: rgba(14, 14, 14, 0.62);
  border-color: rgba(255, 255, 255, 0.16);
  border-left-color: #e07a5f;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.about-overlay .caption-label {
  color: #d4cbc0;
}

.about-overlay .currently-callout p {
  color: #ece6dc;
}

.about-overlay .about-photo-card {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* Subpages (AI, History, Amusements) */
.page-hero {
  padding-top: 72px;
  padding-bottom: 56px;
}

.page-hero .section-header {
  margin-bottom: 0;
  max-width: 740px;
}

.page-lead {
  margin-top: 18px;
  font-size: 1.12rem;
  color: var(--ink-secondary);
  max-width: 60ch;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.content-card--bg {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-color: #111111;
  border-color: rgba(255, 255, 255, 0.14);
}

.content-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  z-index: -2;
  pointer-events: none;
  transition: transform 0.45s var(--ease);
}

.content-card--bg:hover .content-card-bg {
  transform: scale(1.03);
}

.content-card--link {
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s ease;
}

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

/* Amusement Detail Subpages */
.amusement-hero {
  position: relative;
  min-height: clamp(280px, 38vh, 420px);
  display: flex;
  align-items: flex-end;
  padding: 80px 0 48px;
  overflow: hidden;
  isolation: isolate;
  background-color: #111111;
}

.amusement-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  z-index: -2;
  pointer-events: none;
}

.amusement-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.34) 0%,
      rgba(0, 0, 0, 0.58) 52%,
      rgba(0, 0, 0, 0.88) 100%);
}

.amusement-hero-content {
  max-width: 780px;
}

.amusement-hero .eyebrow {
  color: #f3b8a6;
}

.amusement-hero .eyebrow a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.amusement-hero .hero-title {
  color: #ffffff;
  font-size: clamp(2.1rem, 4.5vw, 3.5rem);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.amusement-hero .page-lead {
  color: #f2ede6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.amusement-hero--tall {
  min-height: clamp(360px, 54vh, 560px);
}

.amusement-hero--tall .amusement-hero-bg {
  object-position: center center;
}

.amusement-hero--tall .amusement-hero-overlay {
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.2) 0%,
      rgba(0, 0, 0, 0.36) 54%,
      rgba(0, 0, 0, 0.84) 100%);
}

/* Square Artwork Gallery Grid */
.article-sheet + .square-gallery,
.article-sheet + .content-grid {
  margin-top: clamp(32px, 4.5vw, 48px);
}

.square-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.square-gallery-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0d0d10;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s ease;
}

.square-gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.square-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.42s var(--ease);
}

.square-gallery--portraits .square-gallery-item img {
  object-position: center 20%;
}

.square-gallery-item:hover img {
  transform: scale(1.03);
}

.square-gallery-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(12, 12, 14, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s var(--ease);
  pointer-events: none;
}

.square-gallery-item:hover .square-gallery-badge,
.square-gallery-item:focus-visible .square-gallery-badge {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .square-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .square-gallery {
    gap: 10px;
  }
}

/* Closing Feature Banner with Floating Text */
.feature-banner {
  position: relative;
  margin: clamp(44px, 6vw, 68px) 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: #0d0d10;
  aspect-ratio: 4 / 3;
  max-height: 680px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  isolation: isolate;
}

.feature-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  z-index: -2;
  display: block;
}

.feature-banner-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
      transparent 44%,
      rgba(0, 0, 0, 0.48) 72%,
      rgba(0, 0, 0, 0.86) 100%);
}

.feature-banner-caption {
  position: relative;
  width: 100%;
  max-width: 820px;
  padding: clamp(22px, 4vw, 44px) clamp(20px, 4vw, 40px);
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.8vw, 2.05rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

@media (max-width: 640px) {
  .feature-banner {
    aspect-ratio: 4 / 3;
    min-height: 280px;
  }
}

/* Video Gallery Grid */
.video-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 28px);
}

.video-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s ease;
}

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

.video-card-player {
  background: #0d0d10;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-card-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0d0d10;
}

.video-card-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.video-card-title {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink);
}

.video-card-num {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

@media (max-width: 780px) {
  .video-gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Genealogy Side-by-Side Photo + AI Video Pairs */
.gen-pair-list {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 44px);
}

.gen-pair-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
}

.gen-pair-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.gen-pair-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.gen-pair-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.gen-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
  align-items: stretch;
}

.gen-pair-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gen-pair-tag {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.gen-pair-tag--accent {
  color: var(--accent);
}

.gen-pair-photo,
.gen-pair-video {
  flex: 1 1 auto;
  width: 100%;
  height: clamp(320px, 42vw, 480px);
  background: #0d0d10;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.gen-pair-photo {
  cursor: zoom-in;
  transition: border-color 0.25s ease, transform 0.25s var(--ease);
}

.gen-pair-photo:hover {
  border-color: var(--accent);
}

.gen-pair-photo img,
.gen-pair-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0d0d10;
}

@media (max-width: 760px) {
  .gen-pair-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gen-pair-photo,
  .gen-pair-video {
    height: clamp(280px, 78vw, 420px);
  }
}

/* Interactive CGI Script Runner Card */
.cgi-card {
  max-width: 820px;
}

.cgi-card-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.cgi-card-title {
  margin: 4px 0 0;
}

.cgi-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cgi-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cgi-run-btn.is-loading .cgi-run-icon {
  animation: cgiSpin 0.8s linear infinite;
}

@keyframes cgiSpin {
  to {
    transform: rotate(360deg);
  }
}

.cgi-media {
  margin: 0 0 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d0d10;
  aspect-ratio: 4 / 3;
}

.cgi-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}

.cgi-media img.is-swapping {
  opacity: 0.35;
}

.cgi-output {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: clamp(18px, 2.8vw, 28px);
  min-height: 92px;
  font-size: 1.04rem;
  line-height: 1.7;
  color: var(--ink);
}

.cgi-output-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  animation: stackNoteIn 0.28s var(--ease);
}

.cgi-output--danger {
  border-left-color: #c81e1e;
}

.cgi-output--danger .cgi-output-text {
  font-family: 'Black Ops One', Impact, 'Arial Black', sans-serif;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  line-height: 1.28;
  letter-spacing: 0.03em;
  color: #c81e1e;
}

[data-theme='dark'] .cgi-output--danger {
  border-left-color: #ff3b30;
}

[data-theme='dark'] .cgi-output--danger .cgi-output-text {
  color: #ff3b30;
  text-shadow: 0 0 18px rgba(255, 59, 48, 0.22);
}

.cgi-status {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.cgi-status code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.cgi-error {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}

.cgi-error a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4vw, 48px);
  box-shadow: var(--shadow-sm);
  max-width: 820px;
}

.article-sheet::after {
  content: '';
  display: block;
  clear: both;
}

.article-sheet p:last-child {
  margin-bottom: 0;
}

.article-heading {
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  font-weight: 700;
  line-height: 1.22;
  margin-bottom: 16px;
}

.prose p.story-lead {
  font-size: 1.24rem;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 22px;
}

.story-intro-lead {
  max-width: 860px;
  font-size: clamp(1.3rem, 2.25vw, 1.65rem);
  font-weight: 500;
  line-height: 1.48;
  color: var(--ink);
  margin: 0 0 24px;
}

.story-aside-note {
  max-width: 780px;
  margin: 0 0 36px;
  padding: 6px 0 6px 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink-secondary);
  font-size: 0.98rem;
  line-height: 1.72;
}

.story-aside-note p + p {
  margin-top: 12px;
}

.story-aside-kicker {
  color: var(--ink);
  font-style: italic;
  font-weight: 500;
}

/* Curved Panoramic Photo Carousel (T.RICKS-style concave arch slider) */
.curved-carousel {
  width: 100%;
  margin: 28px 0 8px;
}

.curved-carousel-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.curved-carousel-viewport.is-dragging {
  cursor: grabbing;
}

.curved-carousel-mask {
  position: absolute;
  left: 0;
  width: 100%;
  height: clamp(22px, 3vw, 48px);
  z-index: 4;
  pointer-events: none;
  display: block;
}

.curved-carousel-mask--top {
  top: -1px;
}

.curved-carousel-mask--bottom {
  bottom: -1px;
}

.curved-carousel-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #12101a;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  transition: opacity 0.2s ease, transform 0.22s var(--ease);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

[data-theme='dark'] .curved-carousel-cursor {
  background: #ffffff;
  color: #000000;
}

.curved-carousel-viewport.has-cursor {
  cursor: none;
}

.curved-carousel-viewport.has-cursor .curved-carousel-cursor {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.curved-carousel-viewport.is-dragging .curved-carousel-cursor {
  transform: translate(-50%, -50%) scale(0.84);
}

.curved-carousel-track {
  display: flex;
  align-items: stretch;
  gap: clamp(12px, 1.4vw, 20px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 0 clamp(24px, 6vw, 88px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.curved-carousel-track::-webkit-scrollbar {
  display: none;
}

.curved-carousel-track.is-dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.curved-carousel-slide {
  flex: 0 0 clamp(260px, 30vw, 440px);
  height: clamp(340px, 38vw, 500px);
  background: #141414;
  overflow: hidden;
  scroll-snap-align: center;
  position: relative;
}

.curved-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
}

.curved-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.carousel-arrow-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.carousel-arrow-btn:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

@media (hover: none), (pointer: coarse) {
  .curved-carousel-cursor {
    display: none;
  }
}

@media (max-width: 720px) {
  .curved-carousel-slide {
    flex: 0 0 76vw;
    height: clamp(320px, 84vw, 430px);
  }
}

/* Stacking Card Slider Gallery (MM-002 / housesof.world style) */
.stack-slider-band {
  width: 100%;
  overflow-x: clip;
  padding: clamp(44px, 6vw, 68px) 20px 10px;
}

.stack-slider {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
  --stack-x1: 32px;
  --stack-x2: 62px;
  --stack-x3: 90px;
}

.stack-slider-stage {
  position: relative;
  width: min(620px, calc(100vw - 120px));
  height: clamp(390px, 54vw, 520px);
  margin: 0 auto;
  transform: translateX(-18px);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.stack-card {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.22);
  transform-origin: center 65%;
  transition:
    transform 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s ease,
    filter 0.42s ease,
    box-shadow 0.42s ease;
  will-change: transform, opacity;
}

[data-theme='dark'] .stack-card {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72);
}

.stack-card[data-stack-pos='0'] {
  z-index: 40;
  transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  opacity: 1;
  filter: brightness(1);
  cursor: grab;
  pointer-events: auto;
}

.stack-card[data-stack-pos='0']:hover {
  box-shadow: 0 28px 66px rgba(0, 0, 0, 0.28);
}

.stack-card[data-stack-pos='1'] {
  z-index: 30;
  transform: translate3d(var(--stack-x1), 8px, 0) scale(0.95) rotate(2.4deg);
  opacity: 0.94;
  filter: brightness(0.92);
  cursor: pointer;
  pointer-events: auto;
}

.stack-card[data-stack-pos='1']:hover {
  transform: translate3d(calc(var(--stack-x1) + 8px), 6px, 0) scale(0.958) rotate(3deg);
  filter: brightness(0.97);
}

.stack-card[data-stack-pos='2'] {
  z-index: 20;
  transform: translate3d(var(--stack-x2), 16px, 0) scale(0.9) rotate(4.6deg);
  opacity: 0.8;
  filter: brightness(0.84);
  cursor: pointer;
  pointer-events: auto;
}

.stack-card[data-stack-pos='3'] {
  z-index: 10;
  transform: translate3d(var(--stack-x3), 24px, 0) scale(0.85) rotate(6.6deg);
  opacity: 0.54;
  filter: brightness(0.74);
  pointer-events: none;
}

.stack-card[data-stack-pos='hidden'] {
  z-index: 1;
  transform: translate3d(var(--stack-x3), 28px, 0) scale(0.81) rotate(7.5deg);
  opacity: 0;
  pointer-events: none;
}

.stack-card.is-exiting-left,
.stack-card.is-entering-left {
  z-index: 50 !important;
  transform: translate3d(-115%, -14px, 0) rotate(-11deg) scale(0.95) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.34s ease !important;
}

.stack-card.is-dragging {
  transition: none !important;
  cursor: grabbing !important;
}

.stack-card.is-no-transition {
  transition: none !important;
}

.stack-card-media {
  flex: 1 1 auto;
  min-height: 0;
  background: #0f0f12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.stack-card-media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  pointer-events: none;
}

.stack-card-caption {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.stack-card-caption > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}

.stack-card-title {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.stack-card-meta {
  font-size: 0.86rem;
  color: var(--ink-muted);
  font-style: italic;
}

.stack-card-num {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.stack-slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 40px;
}

.stack-slider-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 132px;
}

.stack-slider-counter {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.stack-slider-bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--border-strong);
  overflow: hidden;
}

.stack-slider-bar-fill {
  display: block;
  height: 100%;
  width: 7.14%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.35s var(--ease);
}

.stack-slider-hint {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-align: center;
}

@media (max-width: 720px) {
  .stack-slider-band {
    padding: 36px 16px 8px;
  }

  .stack-slider {
    --stack-x1: 14px;
    --stack-x2: 26px;
    --stack-x3: 36px;
  }

  .stack-slider-stage {
    width: calc(100vw - 64px);
    max-width: 420px;
    height: clamp(340px, 92vw, 440px);
    transform: translateX(-10px);
  }

  .stack-card-caption {
    padding: 12px 15px;
  }

  .stack-card-title {
    font-size: 0.96rem;
  }

  .stack-card-meta {
    font-size: 0.8rem;
  }

  .stack-slider-controls {
    margin-top: 34px;
  }
}

/* Stacking Slider Split Variant (Deck + Synchronized Editorial Note Panel) */
.stack-slider--split {
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'deck'
    'controls'
    'hint';
  justify-items: center;
  align-items: center;
}

.stack-slider--split.has-note {
  grid-template-columns: auto minmax(320px, 450px);
  grid-template-areas:
    'deck note'
    'controls controls'
    'hint hint';
  justify-content: center;
  column-gap: clamp(72px, 7vw, 108px);
}

.stack-slider-deck {
  grid-area: deck;
}

.stack-slider--split .stack-slider-controls {
  grid-area: controls;
}

.stack-slider--split .stack-slider-hint {
  grid-area: hint;
}

.stack-slider-stage--tall {
  width: min(520px, calc(100vw - 120px));
  height: clamp(420px, 54vw, 550px);
}

.stack-note-panel {
  grid-area: note;
  width: 100%;
  max-height: 550px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.8vw, 32px);
  box-shadow: var(--shadow-sm);
  color: var(--ink-secondary);
  font-size: 0.96rem;
  line-height: 1.66;
  animation: stackNoteIn 0.32s var(--ease);
}

.stack-note-panel[hidden] {
  display: none;
}

@keyframes stackNoteIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stack-note-title {
  font-family: var(--font-serif);
  font-size: clamp(1.22rem, 1.9vw, 1.48rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}

.stack-note-lead {
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 500;
  margin: 0 0 16px;
}

.stack-note-lead--solo {
  font-size: 1.16rem;
  margin-bottom: 0;
}

.stack-note-para {
  margin: 0;
}

.stack-note-para + .stack-note-para {
  margin-top: 14px;
}

.stack-note-poem {
  font-size: 0.95rem;
  line-height: 1.62;
  color: var(--ink-secondary);
}

.stack-note-poem p {
  margin: 0;
}

.stack-note-poem p + p {
  margin-top: 4px;
}

.stack-note-poem p.indent {
  padding-left: 1.4em;
  margin-bottom: 10px;
}

.stack-note-poem p.indent:last-child {
  margin-bottom: 0;
}

.stack-note-checks {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 7px;
}

.stack-note-checks li {
  position: relative;
  padding-left: 22px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.stack-note-checks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

.stack-note-kicker {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--ink);
  font-style: italic;
  font-weight: 500;
}

.stack-note-litany {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.stack-note-litany li {
  font-size: 0.92rem;
  line-height: 1.55;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.stack-note-litany li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

@media (max-width: 980px) {
  .stack-slider--split.has-note {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'deck'
      'controls'
      'hint'
      'note';
    column-gap: 0;
  }

  .stack-note-panel {
    max-width: 620px;
    max-height: none;
    margin-top: 26px;
  }
}

@media (max-width: 720px) {
  .stack-slider-stage--tall {
    width: calc(100vw - 64px);
    max-width: 420px;
    height: clamp(360px, 96vw, 460px);
  }
}

/* Lightbox */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 64px;
}

.lightbox-backdrop[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-figure img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 610;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 610;
}

.lightbox-nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

@media (max-width: 640px) {
  .hgallery-item {
    height: clamp(260px, 52vw, 340px);
  }

  .lightbox-backdrop {
    padding: 16px;
  }
}

/* Embedded Story Figures & Images */
.story-figure {
  margin: 26px 0;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}

.story-figure img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) - 5px);
  display: block;
}

.story-figure figcaption {
  padding: 10px 6px 4px;
  font-size: 0.86rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.story-figure--right {
  float: right;
  width: min(320px, 44%);
  margin: 6px 0 18px 28px;
}

.story-figure--left {
  float: left;
  width: min(320px, 44%);
  margin: 6px 28px 18px 0;
}

.story-figure--medium-wide {
  width: min(380px, 48%);
}

.story-finale-prose {
  margin: 44px auto 0;
  max-width: 900px;
}

.finale-two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 3.5vw, 40px);
  align-items: start;
  margin-top: 24px;
}

.finale-media-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.finale-media-col .story-figure {
  margin: 0;
}

.prose p.poem-stanza {
  font-style: italic;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .finale-two-col {
    grid-template-columns: 1fr;
  }
}

.story-banner {
  width: 100%;
  margin: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.story-banner img {
  width: 100%;
  height: auto;
  display: block;
}

.construction-banner {
  margin: 0 auto 36px;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px 14px;
  box-shadow: var(--shadow-sm);
}

.construction-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
  margin-bottom: 12px;
}

.construction-banner img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-lg) - 8px);
  display: block;
}

.story-sticky-stage {
  position: relative;
  margin: 44px 0 36px;
}

.story-pullquote-band {
  width: 100%;
  margin: 44px 0;
  padding: clamp(48px, 6.5vw, 84px) 0;
  background: #000000;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
}

.story-pullquote-band--accent {
  background: var(--accent);
  border-top: 3px solid #000000;
  border-bottom: 3px solid #000000;
}

.story-pullquote-band--sticky {
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  margin: 0;
  padding: clamp(28px, 4.2vw, 52px) 0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.story-pullquote {
  margin: 0 auto;
  max-width: 960px;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  color: #ffffff;
}

.story-slide-under {
  position: relative;
  z-index: 1;
  padding: 28px 24px 0;
}

.story-themed-figure {
  margin: 0 auto 28px;
  max-width: 300px;
}

.story-themed-figure img {
  width: 100%;
  height: auto;
  display: block;
}

[data-theme='light'] .theme-img-dark,
[data-theme='dark'] .theme-img-light {
  display: none;
}

/* Reusable Sticky Story Swap (N cards stick at top and crossfade sequentially on scroll) */
.story-swap-stage {
  position: relative;
}

.story-swap-sticky {
  position: sticky;
  top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  padding: 20px 0;
  display: grid;
  grid-template-areas: 'slot';
  align-items: center;
  justify-items: center;
}

.story-swap-panel {
  grid-area: slot;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.story-swap-panel:first-child {
  opacity: 1;
  pointer-events: auto;
}

.story-swap-panel.is-active {
  z-index: 2;
  pointer-events: auto;
}

.story-swap-stage .article-sheet {
  max-width: 900px;
  margin: 0 auto;
}

.story-swap-image-card {
  padding: clamp(10px, 1.5vw, 18px);
}

.story-swap-image-card img {
  width: 100%;
  height: auto;
  max-height: calc(100svh - var(--header-height) - 90px);
  object-fit: contain;
  border-radius: calc(var(--radius-lg) - 8px);
  display: block;
}

.story-swap-stage + .content-grid {
  margin-top: clamp(36px, 5vw, 56px);
}

.story-swap-stage .card-photo-pair {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.story-swap-stage .card-photo-main {
  width: auto;
  max-width: 100%;
  max-height: calc(100svh - var(--header-height) - 210px);
}

/* Greeting Card Showcase (2 overlapping photos: main inside + smaller cover) */
.card-showcase-stack {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.card-showcase {
  max-width: 900px;
}

.card-showcase--split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 3.5vw, 44px);
  align-items: center;
}

.card-showcase--split .card-showcase-header {
  margin-bottom: 0;
}

.card-showcase-media img {
  width: 100%;
  height: auto;
  max-height: calc(100svh - var(--header-height) - 140px);
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: block;
}

@media (max-width: 760px) {
  .card-showcase--split {
    grid-template-columns: 1fr;
  }

  .card-showcase-media img {
    max-height: 44vh;
    width: auto;
    margin: 0 auto;
  }
}

/* Turning-Point Feature Card (floating bold caption over full-card photo) */
.card-showcase--feature {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
  min-height: clamp(360px, 58vh, 540px);
  display: flex;
  align-items: flex-end;
  background-color: #111111;
}

.card-feature-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  z-index: -2;
  pointer-events: none;
}

.card-feature-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.08) 0%,
      rgba(0, 0, 0, 0.18) 50%,
      rgba(0, 0, 0, 0.72) 100%);
}

.card-feature-callout {
  width: 100%;
  margin: clamp(16px, 3vw, 28px);
  padding: clamp(20px, 3vw, 28px) clamp(22px, 3.2vw, 32px);
  background: rgba(12, 12, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.card-feature-text {
  font-family: var(--font-serif);
  font-size: clamp(1.22rem, 2.3vw, 1.65rem);
  font-weight: 600;
  line-height: 1.38;
  color: #ffffff;
  margin: 0;
}

.card-feature-text em {
  color: #f3a68e;
  font-style: italic;
}

.card-showcase-header {
  margin-bottom: 18px;
}

.card-showcase-title {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  margin-bottom: 6px;
}

.card-showcase-desc {
  font-size: 1rem;
  color: var(--ink-secondary);
}

.card-photo-pair {
  position: relative;
  padding: 0 22px 24px 0;
}

.card-photo-main {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: block;
}

.card-photo-cover {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 31%;
  max-width: 230px;
  height: auto;
  border-radius: var(--radius-sm);
  border: 4px solid var(--surface);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  transform: rotate(2deg);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.card-photo-cover:hover {
  transform: rotate(0deg) scale(1.06);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}

.card-photo-pair--left {
  padding: 0 0 24px 22px;
}

.card-photo-pair--left .card-photo-cover {
  left: 0;
  right: auto;
  transform: rotate(-2deg);
}

.card-photo-pair--left .card-photo-cover:hover {
  transform: rotate(0deg) scale(1.06);
}

@media (max-width: 560px) {
  .card-photo-pair {
    padding: 0 12px 18px 0;
  }

  .card-photo-pair--left {
    padding: 0 0 18px 12px;
  }

  .card-photo-cover {
    width: 38%;
    border-width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-swap-stage {
    min-height: auto !important;
  }

  .story-swap-sticky {
    position: static;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 0;
  }

  .story-swap-panel {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .story-swap-stage .card-photo-main {
    max-height: none;
    width: 100%;
  }
}

/* Closing Scroll-Crossfade Finale (Story fades into full-width closing image) */
.story-section-flush-bottom {
  padding-bottom: 0;
  border-bottom: none;
}

.story-finale-stage {
  position: relative;
  height: 165vh;
  margin-top: 24px;
  --finale-progress: 0;
}

.story-finale-sticky {
  position: sticky;
  top: var(--header-height);
  width: 100%;
  min-height: clamp(380px, 36.23vw, 580px);
  padding: 36px 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.story-finale-content {
  position: relative;
  z-index: 2;
  width: 100%;
  opacity: max(0, calc(1 - var(--finale-progress) * 1.45));
  transform: translateY(calc(var(--finale-progress) * -28px));
  will-change: opacity, transform;
}

.story-finale-image-layer {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 1;
  background: var(--bg-tinted);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: var(--finale-progress);
  will-change: opacity;
  pointer-events: none;
}

.story-finale-stage.is-revealed .story-finale-content {
  pointer-events: none;
}

.story-finale-stage.is-revealed .story-finale-image-layer {
  z-index: 3;
  pointer-events: auto;
}

.story-finale-image-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(calc(1.04 - var(--finale-progress) * 0.04));
  will-change: transform;
  display: block;
}

@media (max-width: 960px) {
  .story-finale-image-layer img {
    height: auto;
    object-fit: contain;
  }
}

.story-finale-back {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 4;
  opacity: max(0, calc((var(--finale-progress) - 0.6) * 2.5));
}

.story-finale-back .btn {
  background: rgba(255, 255, 255, 0.92);
  color: #000000;
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.story-finale-back .btn:hover {
  background: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .story-finale-stage {
    height: auto;
  }

  .story-finale-sticky {
    position: static;
    height: auto;
    display: block;
  }

  .story-finale-content {
    opacity: 1;
    transform: none;
    margin-bottom: 32px;
  }

  .story-finale-image-layer {
    position: relative;
    opacity: 1;
    pointer-events: auto;
  }

  .story-finale-image-layer img {
    height: auto;
    transform: none;
  }

  .story-finale-back {
    opacity: 1;
  }
}

@media (max-width: 680px) {

  .story-figure--right,
  .story-figure--left {
    float: none;
    width: 100%;
    margin: 22px 0;
  }
}

.content-card-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.38) 0%,
      rgba(0, 0, 0, 0.62) 48%,
      rgba(0, 0, 0, 0.92) 100%);
}

.content-card--bg .caption-label {
  color: #f3b8a6;
}

.content-card--bg .content-card-title {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.content-card--bg p {
  color: #f5f2ed;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

.content-card-title {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.content-card p {
  color: var(--ink-secondary);
  font-size: 0.96rem;
}

.page-back-row {
  margin-top: 36px;
}

.portrait-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.portrait-art {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}

.portrait-caption {
  padding: 4px 6px 6px;
}

.caption-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.portrait-caption p {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 44px;
  align-items: start;
  margin-bottom: 0;
}

.lead-paragraph {
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 18px;
}

.about-bio p+p {
  color: var(--ink-secondary);
}

.currently-callout {
  margin-top: 22px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.currently-callout p {
  font-size: 0.94rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.currently-callout p+p {
  margin-top: 12px;
}

.about-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.about-photo-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-md);
}

.about-photo {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-lg) - 8px);
  object-fit: cover;
  display: block;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

.resume-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

.resume-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.subsection-title {
  font-size: 1.5rem;
}

.muted-note {
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:first-child {
  padding-top: 4px;
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--ink-muted);
  padding-top: 3px;
}

.timeline-role {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.timeline-company {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.timeline-summary {
  color: var(--ink-secondary);
  font-size: 0.96rem;
}

/* Projects Showcase */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.filter-btn.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s ease;
}

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

.project-card.is-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.project-thumb {
  position: relative;
  min-height: 230px;
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.project-card.is-featured .project-thumb {
  min-height: 310px;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

.project-thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.project-category {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.project-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.project-desc {
  color: var(--ink-secondary);
  font-size: 0.96rem;
  margin-bottom: 20px;
}

.project-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Writing / Blog List */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 30px;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.24s var(--ease), border-color 0.24s ease, box-shadow 0.24s ease;
}

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

.article-date-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.article-readtime {
  font-size: 0.8rem;
  color: var(--sage);
  font-weight: 600;
}

.article-title {
  font-size: 1.35rem;
  margin-bottom: 6px;
  transition: color 0.2s ease;
}

.article-card:hover .article-title {
  color: var(--accent);
}

.article-excerpt {
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.article-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.article-card:hover .article-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: #faf7f2;
  transform: translateX(3px);
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: start;
}

.direct-email-card {
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.email-link {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--ink);
  transition: color 0.2s ease;
}

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

.social-links {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.social-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] {
  border-color: #c93b2b;
}

.field-error {
  font-size: 0.82rem;
  color: #c93b2b;
  min-height: 1em;
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.form-note {
  font-size: 0.9rem;
  color: var(--sage);
  font-weight: 500;
}

/* Footer (Black Social Band + Organic Wave Divider) */
.site-footer {
  background: var(--footer-band-bg);
  color: var(--ink);
  overflow: hidden;
}

.footer-band {
  padding: 36px 0 22px;
}

.footer-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-social-tile {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  background: #ffffff;
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s var(--ease), background-color 0.2s ease, box-shadow 0.2s ease;
}

.footer-social-tile:hover {
  transform: translateY(-3px);
  background: #f2f5f9;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.footer-social-tile:focus-visible {
  outline: 2px solid var(--footer-wave-accent);
  outline-offset: 3px;
}

.footer-wave {
  position: relative;
  width: 100%;
  line-height: 0;
  margin-bottom: -1px;
  background: var(--footer-band-bg);
}

.footer-wave svg {
  width: 100%;
  height: clamp(46px, 5.5vw, 76px);
  display: block;
}

.footer-bottom {
  background: var(--footer-wave-fill);
  padding: 14px 0 24px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.back-to-top {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

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

/* Modal (Case Study & Article Reader) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: min(88vh, 920px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.25s var(--ease);
}

.modal-backdrop.is-open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 3;
  transition: width 0.08s linear;
}

.modal-topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.modal-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.modal-body {
  padding: 32px 36px 40px;
  overflow-y: auto;
}

.modal-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  margin-bottom: 14px;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.prose p {
  color: var(--ink-secondary);
  margin-bottom: 18px;
  font-size: 1.03rem;
  line-height: 1.8;
}

.prose h3 {
  font-size: 1.35rem;
  margin-top: 28px;
  margin-bottom: 12px;
}

.prose ul {
  margin: 0 0 20px;
  padding-left: 20px;
  color: var(--ink-secondary);
}

.prose li {
  margin-bottom: 8px;
}

.prose blockquote {
  margin: 24px 0;
  padding: 16px 22px;
  border-left: 3px solid var(--accent);
  background: var(--surface-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--ink);
}

.modal-footer-actions {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 960px) {

  .about-grid,
  .contact-grid,
  .project-card.is-featured {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 440px;
  }

  .project-card.is-featured .project-thumb {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 240px;
  }

  .projects-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 68px 0;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .article-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px;
  }

  .article-date-col {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .article-arrow {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .resume-block,
  .contact-form {
    padding: 24px;
  }

  .modal-body {
    padding: 24px 22px 30px;
  }

  /* Mobile Polish for Sticky Story & Greeting Card Pages */
  .story-pullquote-band--sticky {
    padding: 20px 0;
  }

  .story-pullquote {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }

  .story-finale-stage {
    height: 135vh;
  }

  .story-swap-sticky {
    padding: 12px 0;
  }

  .story-swap-stage .article-sheet {
    padding: 20px;
  }

  .story-swap-stage .prose p {
    font-size: 0.94rem;
    line-height: 1.62;
    margin-bottom: 12px;
  }

  .story-swap-stage .prose p.story-lead {
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 14px;
  }

  .story-swap-stage .card-photo-main {
    max-height: calc(100svh - var(--header-height) - 235px);
  }
}

/* Clean Print / PDF Résumé Layout */
@media print {

  .site-header,
  .hero-stage-media,
  .hero-bg-image,
  .hero-bg-overlay,
  .hero-visual,
  .hero-actions,
  .about-actions,
  .filter-bar,
  #projects,
  #writing,
  #contact,
  .site-footer,
  .modal-backdrop,
  .toast {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #111111;
    font-size: 11pt;
  }

  .section,
  .section-tinted {
    padding: 18pt 0;
    background: transparent;
    border: none;
  }

  .resume-block,
  .about-photo-card {
    box-shadow: none;
    border: 1px solid #dddddd;
    break-inside: avoid;
  }

  .about-overlay,
  .about-overlay .section-title,
  .about-overlay .lead-paragraph,
  .about-overlay .currently-callout p,
  .about-overlay .caption-label {
    color: #111111 !important;
    text-shadow: none !important;
  }

  .about-overlay .currently-callout {
    background: #ffffff !important;
    border-color: #dddddd !important;
  }

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