/* ========================================
   המגרש משחקים של סבא ריקרדו
   Design System & Global Styles
   ======================================== */

/* --- SimplerPro Alte (story/memorial section) --- */
@font-face {
  font-family: 'SimplerPro';
  src: url('../fonts/SimplerPro_Alte-Regular.woff2') format('woff2'),
       url('../fonts/SimplerPro_Alte-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SimplerPro';
  src: url('../fonts/SimplerPro_Alte-SemiBold.woff2') format('woff2'),
       url('../fonts/SimplerPro_Alte-SemiBold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SimplerPro';
  src: url('../fonts/SimplerPro_Alte-Bold.woff2') format('woff2'),
       url('../fonts/SimplerPro_Alte-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SimplerPro';
  src: url('../fonts/SimplerPro_Alte-Black.woff2') format('woff2'),
       url('../fonts/SimplerPro_Alte-Black.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* --- Design Tokens --- */
:root {
  /* Colors — warm, inviting, kid-friendly but not childish */
  --color-primary: #2B7A78;       /* teal — radio/sky/sea */
  --color-primary-light: #3AAFA9;
  --color-primary-dark: #17252A;
  --color-secondary: #F2A154;     /* warm orange — creation/energy */
  --color-secondary-light: #F7C59F;
  --color-accent-green: #6BBF59;  /* success/nature */
  --color-accent-red: #E07A5F;    /* soft red — highlight */
  --color-accent-purple: #8B5CF6; /* programming/digital */
  --color-accent-yellow: #F9D923; /* light/photography */

  /* Category colors */
  --cat-radio: #2B7A78;
  --cat-electric: #F2A154;
  --cat-build: #E07A5F;
  --cat-photo: #F9D923;
  --cat-science: #6BBF59;
  --cat-code: #8B5CF6;

  /* Neutrals */
  --color-bg: #FEFCF8;           /* warm off-white */
  --color-bg-alt: #F5F0E8;       /* slightly darker warm */
  --color-surface: #FFFFFF;
  --color-text: #2D2D2D;
  --color-text-light: #6B6B6B;
  --color-text-muted: #9B9B9B;
  --color-border: #E8E2D9;

  /* Typography */
  --font-primary: 'Rubik', 'Heebo', sans-serif;
  --font-display: 'Rubik', sans-serif;
  --font-poem: 'Frank Ruhl Libre', 'David Libre', serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.25rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.06);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;

  /* Serif font alias */
  --font-serif: 'Frank Ruhl Libre', 'David Libre', serif;
}

/* ========================================
   Story Mode — Dark, mature theme
   for memorial/collection/writings pages
   ======================================== */
.story-mode {
  --color-bg: #111111;
  --color-bg-alt: #1a1a1a;
  --color-surface: #222222;
  --color-text: #e0ddd5;
  --color-text-light: #a8a49a;
  --color-text-muted: #777470;
  --color-border: #333330;
  --color-primary: #c9a96e;
  --color-primary-light: #dfc48e;
  --color-primary-dark: #a88a4e;
  --font-story: 'SimplerPro', 'Frank Ruhl Libre', serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.3);
}

.story-mode body,
.story-mode {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-story);
}

/* Story Nav — transparent on dark */
.story-mode .nav {
  background: rgba(17, 17, 17, 0.95);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.story-mode .nav-logo span:first-child {
  color: var(--color-primary);
}

.story-mode .nav-callsign {
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

.story-mode .nav-links a {
  color: var(--color-text-light);
}

.story-mode .nav-links a:hover,
.story-mode .nav-links a.active {
  color: var(--color-primary);
}

.story-mode .nav-cta {
  background: var(--color-primary) !important;
  color: #111 !important;
}

/* Story breadcrumb */
.story-mode .breadcrumb {
  background: var(--color-bg-alt);
  border-bottom-color: var(--color-border);
}

.story-mode .breadcrumb a {
  color: var(--color-text-muted);
}

/* Story footer */
.story-mode .footer {
  background: #0a0a0a;
  border-top: 1px solid var(--color-border);
}

.story-mode .footer-quote {
  color: var(--color-primary);
}

/* Story buttons */
.story-mode .btn-outline {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.story-mode .btn-outline:hover {
  background: var(--color-primary);
  color: #111;
}

/* --- Story Hero (collection/writings landing) --- */
.story-hero-dark {
  padding: var(--space-4xl) 0 var(--space-3xl);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.story-hero-dark h1 {
  font-family: var(--font-story, var(--font-serif));
  font-weight: 400;
  font-size: var(--text-4xl);
  color: var(--color-text);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-md);
}

.story-hero-dark .hero-subtitle {
  font-family: var(--font-story, var(--font-serif));
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  font-weight: 400;
}

.story-hero-dark .hero-count {
  display: inline-block;
  margin-top: var(--space-lg);
  padding: var(--space-xs) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- Chapter Navigation (dark) --- */
.chapter-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border);
}

.chapter-nav a {
  padding: var(--space-sm) var(--space-xl);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.chapter-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* --- Chapter Section --- */
/* Collection bio (story moved into collection) */
.collection-bio {
  padding: var(--space-3xl) 0 var(--space-xl);
}

.collection-bio-text {
  max-width: 700px;
  margin: 0 auto;
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-lg);
  line-height: 2.2;
  color: var(--color-text-light, var(--color-text-muted));
  text-align: center;
}

.collection-bio-text p {
  margin-bottom: var(--space-lg);
}

/* Collection epigraph & intro */
.collection-epigraph {
  padding: var(--space-3xl) 0 var(--space-xl);
}

.collection-epigraph blockquote {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--font-story, var(--font-serif));
  font-style: italic;
  font-size: var(--text-lg);
  line-height: 1.9;
  color: var(--color-text-muted);
  border: none;
  padding: 0;
}

.collection-epigraph blockquote cite {
  display: block;
  margin-top: var(--space-md);
  font-style: normal;
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.collection-intro {
  padding: 0 0 var(--space-3xl);
}

.collection-intro-text {
  max-width: 700px;
  margin: 0 auto;
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-base);
  line-height: 1.9;
  color: var(--color-text-muted);
  text-align: center;
}

.collection-intro-text p {
  margin-bottom: var(--space-lg);
}

.chapter {
  padding: var(--space-4xl) 0 var(--space-2xl);
  border-bottom: 1px solid var(--color-border);
}

.chapter:last-child {
  border-bottom: none;
}

.chapter-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.chapter-label {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.chapter-title {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-xl);
}

/* Chapter description */
.chapter-description {
  max-width: 700px;
  margin: 0 auto var(--space-xl);
  text-align: center;
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-lg);
  line-height: 1.9;
  color: var(--color-text-muted);
}

/* Chapter poem opener */
.chapter-poem {
  max-width: 500px;
  margin: 0 auto var(--space-3xl);
  padding: var(--space-xl) var(--space-2xl);
  border-right: 3px solid var(--color-primary);
  font-family: var(--font-story, var(--font-serif));
  color: var(--color-text-muted);
  line-height: 2;
  font-size: var(--text-base);
}

.chapter-poem-title {
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

.chapter-poem-text {
  font-style: italic;
  margin: 0;
}

.chapter-poem-credit {
  display: block;
  margin-top: var(--space-md);
  font-style: normal;
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.chapter-poem cite {
  display: block;
  margin-top: var(--space-md);
  font-style: normal;
  font-size: var(--text-sm);
  color: var(--color-primary);
}

/* --- Story Entry (blog-post style) --- */
.story-entry {
  max-width: 680px;
  margin: 0 auto var(--space-3xl);
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--color-border);
}

.story-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.story-entry-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.story-entry-author {
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-text);
}

.story-entry-relation {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}

.story-entry-headline {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  font-weight: 400;
}

.story-entry-text {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-base);
  line-height: 2;
  color: var(--color-text-light);
}

.story-entry-text p {
  margin-bottom: var(--space-lg);
}

.story-entry-text p:last-child {
  margin-bottom: 0;
}

.story-entry-text blockquote {
  border-right: 3px solid var(--color-primary);
  padding-right: var(--space-xl);
  margin: var(--space-xl) 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.story-entry-text b,
.story-entry-text strong {
  color: var(--color-text);
  font-weight: 600;
}

/* --- Writing Article (dark) --- */
.story-mode .writing-article-year {
  background: var(--color-primary);
  color: #111;
}

.story-mode .writing-article-body {
  color: var(--color-text-light);
}

.story-mode .writing-article-body blockquote {
  border-right-color: var(--color-primary);
}

.story-mode .writing-nav-link {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
  color: var(--color-primary);
}

.story-mode .writing-nav-link:hover {
  background: var(--color-primary);
  color: #111;
}

/* --- Writings List (dark) --- */
.story-mode .writing-item {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.story-mode .writing-item:hover {
  border-color: var(--color-primary);
}

.story-mode .writing-year {
  color: var(--color-primary);
}

/* --- Homepage Gates --- */
.gates-hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) 0;
}

.gates-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1000px;
  width: 100%;
  min-height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) var(--space-2xl);
  text-align: center;
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
}

.gate::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gate:hover::after {
  opacity: 1;
}

.gate-story {
  background: #111;
  color: #e0ddd5;
}

.gate-story::after {
  background: rgba(201, 169, 110, 0.05);
}

.gate-story .gate-title {
  font-family: var(--font-story, var(--font-serif));
  font-weight: 400;
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
  color: #e0ddd5;
}

.gate-story .gate-desc {
  font-family: var(--font-story, var(--font-serif));
  color: #777470;
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-xl);
  max-width: 320px;
}

.gate-story .gate-cta {
  padding: var(--space-sm) var(--space-xl);
  border: 1px solid #c9a96e;
  border-radius: var(--radius-full);
  color: #c9a96e;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.gate-story:hover .gate-cta {
  background: #c9a96e;
  color: #111;
}

.gate-playground {
  background: var(--color-bg);
  color: var(--color-text);
}

.gate-playground::after {
  background: rgba(43, 122, 120, 0.03);
}

.gate-playground .gate-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
  color: var(--color-primary-dark);
}

.gate-playground .gate-desc {
  color: var(--color-text-light);
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-xl);
  max-width: 320px;
}

.gate-playground .gate-cta {
  padding: var(--space-sm) var(--space-xl);
  background: var(--color-primary);
  border-radius: var(--radius-full);
  color: white;
  font-size: var(--text-sm);
  border: 1px solid var(--color-primary);
  transition: all var(--transition-fast);
}

.gate-playground:hover .gate-cta {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.gate-divider {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-md);
}

/* Story-mode responsive */
@media (max-width: 768px) {
  .gates-hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .gate {
    padding: var(--space-3xl) var(--space-xl);
  }

  .gate-divider {
    left: 50%;
    top: auto;
    position: relative;
    transform: none;
    margin: calc(-1 * var(--space-lg)) auto;
    z-index: 10;
  }

  .chapter-nav {
    flex-wrap: wrap;
  }

  .chapter-poem {
    padding: var(--space-lg);
  }

  .story-entry {
    padding-bottom: var(--space-2xl);
    margin-bottom: var(--space-2xl);
  }

  .story-hero-dark h1 {
    font-size: var(--text-3xl);
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-light); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-primary-dark);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-lg); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

.poem {
  font-family: var(--font-poem);
  font-size: var(--text-lg);
  line-height: 2;
  color: var(--color-primary-dark);
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  border-radius: var(--radius-lg);
  border-right: 4px solid var(--color-secondary);
  font-style: italic;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(254, 252, 248, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-primary-dark);
}

.nav-logo img {
  width: 40px;
  height: 40px;
}

.nav-callsign {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Nav switcher (2-gate toggle) */
.nav-switcher {
  display: flex;
  gap: 2px;
  background: var(--color-border);
  border-radius: var(--radius-md);
  padding: 2px;
}

.nav-switch {
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: calc(var(--radius-md) - 2px);
  transition: all var(--transition-fast);
}

.nav-switch:hover {
  color: var(--color-text);
}

.nav-switch.active {
  background: var(--color-primary);
  color: var(--color-bg);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
  align-items: center;
}

.nav-links a {
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color var(--transition-fast);
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  background: var(--color-primary);
  color: white !important;
  padding: var(--space-sm) var(--space-lg) !important;
  border-radius: var(--radius-full);
  font-weight: 600 !important;
}

.nav-cta:hover {
  background: var(--color-primary-light);
  color: white !important;
}

.nav-cta::after {
  display: none !important;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: var(--transition-fast);
}

/* --- Hero Section --- */
.hero {
  padding: var(--space-4xl) 0;
  position: relative;
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero-text h1 {
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

.hero-text h1 span {
  color: var(--color-secondary);
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-light);
  margin-bottom: var(--space-2xl);
  line-height: 1.8;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image img {
  max-height: 500px;
  width: auto;
}

/* --- Dual Gate (Homepage two doors) --- */
.dual-gate {
  padding: var(--space-4xl) 0;
}

.dual-gate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
}

.gate-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 2px solid var(--color-border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.gate-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gate-card--playground {
  border-color: var(--color-primary-light);
}

.gate-card--playground:hover {
  border-color: var(--color-primary);
}

.gate-card--story {
  border-color: var(--color-secondary-light);
}

.gate-card--story:hover {
  border-color: var(--color-secondary);
}

.gate-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-xl);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-4xl);
}

.gate-card--playground .gate-icon {
  background: rgba(43, 122, 120, 0.1);
}

.gate-card--story .gate-icon {
  background: rgba(242, 161, 84, 0.1);
}

.gate-card h3 {
  margin-bottom: var(--space-md);
}

.gate-card p {
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-full);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-secondary);
  color: white;
}

.btn-secondary:hover {
  background: #E8923F;
  color: white;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

/* --- Project Cards --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.project-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 1px solid var(--color-border);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-image img {
  max-height: 160px;
  width: auto;
}

.project-card-body {
  padding: var(--space-lg);
}

.project-card-category {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
  color: white;
}

.project-card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--color-primary-dark);
}

.project-card-meta {
  display: flex;
  gap: var(--space-lg);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
}

.project-card-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.project-card-equipment {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* --- Featured Project --- */
.featured-project {
  padding: var(--space-3xl) 0;
}

.featured-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid var(--color-border);
}

.featured-card-image {
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  min-height: 300px;
}

.featured-card-body {
  padding: var(--space-3xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
}

/* --- About Ricardo Strip --- */
.about-strip {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-alt);
}

.about-strip-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  text-align: center;
  flex-direction: column;
}

.about-strip p {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  max-width: 700px;
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-secondary);
  margin: var(--space-md) auto 0;
  border-radius: var(--radius-full);
}

.section-header p {
  color: var(--color-text-light);
  font-size: var(--text-lg);
  margin-top: var(--space-md);
}

/* --- Footer --- */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.7);
  padding: var(--space-3xl) 0;
  text-align: center;
}

.footer-quote {
  font-family: var(--font-poem);
  font-style: italic;
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--space-lg);
}

.footer-callsign {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary-light);
  margin-bottom: var(--space-sm);
}

.footer-copy {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.4);
}

.footer a {
  color: var(--color-primary-light);
}

/* --- Project Page (Single) --- */
.project-hero {
  padding: var(--space-3xl) 0 var(--space-xl);
}

.project-hero-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.project-hero-text {
  flex: 1;
}

.project-hero-image {
  flex: 0 0 300px;
}

.phase {
  padding: var(--space-2xl) 0;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.phase-number {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xl);
  color: white;
  flex-shrink: 0;
}

.phase--yetzia .phase-number { background: var(--color-primary); }
.phase--havaya .phase-number { background: var(--color-secondary); }
.phase--havana .phase-number { background: var(--color-accent-green); }

.phase-title {
  font-size: var(--text-2xl);
}

.equipment-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  list-style: none;
  margin: var(--space-lg) 0;
}

.equipment-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border);
}

.step:last-child {
  border-bottom: none;
}

.step-number {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--color-border);
  margin-bottom: var(--space-sm);
}

.step-text {
  font-size: var(--text-lg);
  line-height: 1.8;
}

.step-image {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Journal section */
.journal {
  background: var(--color-bg-alt);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  margin: var(--space-2xl) 0;
  border: 2px dashed var(--color-border);
}

.journal-prompt {
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
  padding-right: var(--space-lg);
  border-right: 3px solid var(--color-accent-green);
}

/* --- Difficulty Stars --- */
.stars {
  color: var(--color-secondary);
  letter-spacing: 2px;
}

.stars-empty {
  color: var(--color-border);
}

/* --- Radio Page --- */
.radio-hero {
  padding: var(--space-3xl) 0;
}

.radio-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3xl);
}

.radio-callsign-badge {
  display: inline-block;
  background: var(--color-primary-dark);
  color: var(--color-primary-light);
  font-size: var(--text-3xl);
  font-weight: 700;
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  letter-spacing: 4px;
  font-family: monospace;
}

.radio-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.radio-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.radio-card h4 {
  margin-bottom: var(--space-sm);
}

.radio-card p {
  color: var(--color-text-light);
  margin-bottom: 0;
}

.radio-story-box {
  padding: var(--space-2xl);
  border-right: 4px solid var(--color-accent-red);
}

.radio-story-box h3 {
  color: var(--color-accent-red);
  margin-bottom: var(--space-lg);
}

.radio-friends {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.radio-friend {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--text-sm);
}

/* --- Illustration Placeholders --- */
.illustration-placeholder {
  background: var(--color-bg-alt);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border: 2px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-lg);
}

.illustration-placeholder-sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* --- Projects Page --- */
.projects-hero {
  padding: var(--space-3xl) 0 var(--space-xl);
}

.projects-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xl);
}

.projects-hero-text h1 {
  margin-bottom: var(--space-md);
}

/* Playground opening poem */
.playground-poem {
  padding: 0 0 var(--space-3xl);
}

.playground-poem-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-lg);
  line-height: 2.2;
  color: var(--color-text);
}

.playground-poem-inner p {
  margin-bottom: var(--space-xl);
}

.projects-section {
  padding: var(--space-3xl) 0 var(--space-4xl);
}

.project-card {
  display: block;
  color: inherit;
}

.project-card:hover {
  color: inherit;
}

.project-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

/* Filter Bar */
.filter-section {
  padding: var(--space-lg) 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.filter-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--color-text);
}

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

.filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* How It Works */
.how-it-works {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-alt);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
  text-align: center;
}

.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.how-number {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xl);
  color: white;
}

.how-step p {
  color: var(--color-text-light);
  font-size: var(--text-sm);
}

/* Coming Soon */
.coming-soon {
  padding: var(--space-4xl) 0;
  background: var(--color-bg-alt);
}

/* --- Project Single Page --- */
.breadcrumb {
  padding: var(--space-md) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb-sep {
  margin: 0 var(--space-sm);
}

.concept-box {
  display: flex;
  gap: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
  align-items: flex-start;
}

.concept-box .concept-icon {
  flex-shrink: 0;
}

.concept-box h4 {
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}

.concept-box p {
  color: var(--color-text-light);
  margin-bottom: 0;
}

.step-content {
  flex: 1;
}

.experiment-list {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
}

.experiment-list li {
  padding: var(--space-sm) 0;
  padding-right: var(--space-lg);
  position: relative;
  color: var(--color-text-light);
  line-height: 1.8;
}

.experiment-list li::before {
  content: '?';
  position: absolute;
  right: 0;
  color: var(--color-secondary);
  font-weight: 700;
}

.bonus-challenge {
  background: linear-gradient(135deg, rgba(242, 161, 84, 0.08) 0%, rgba(242, 161, 84, 0.02) 100%);
  border: 2px solid var(--color-secondary-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
}

.bonus-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.bonus-header h4 {
  color: var(--color-secondary);
  margin-bottom: 0;
}

.bonus-challenge p {
  color: var(--color-text-light);
  margin-bottom: 0;
}

.journal-drawing {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl);
  margin-top: var(--space-xl);
  background: white;
}

.concept-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-accent-green);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
}

.concept-summary h4 {
  color: var(--color-accent-green);
  margin-bottom: var(--space-md);
}

.celebration {
  padding: var(--space-3xl) 0;
  text-align: center;
}

.next-project {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-alt);
}

.next-project h3 a {
  color: var(--color-primary);
  font-size: var(--text-2xl);
}

.next-project h3 a:hover {
  color: var(--color-primary-light);
}

/* --- Story Page --- */
.story-hero {
  padding: var(--space-3xl) 0;
}

.story-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3xl);
}

.story-hero-text h1 {
  margin-bottom: var(--space-md);
}

/* Timeline */
.timeline-section {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-alt);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  right: 80px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
  position: relative;
}

.timeline-year {
  flex: 0 0 80px;
  text-align: left;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-primary);
  position: relative;
}

.timeline-year::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 3px solid var(--color-bg-alt);
}

.timeline-item--dark .timeline-year {
  color: var(--color-accent-red);
}

.timeline-item--dark .timeline-year::after {
  background: var(--color-accent-red);
}

.timeline-content {
  flex: 1;
  padding-right: var(--space-xl);
}

.timeline-content h4 {
  margin-bottom: var(--space-sm);
}

.timeline-content p {
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

/* Story Grid (sections) */
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.story-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}

.story-card h3 {
  margin-bottom: 0;
}

.story-card p {
  color: var(--color-text-light);
  font-size: var(--text-sm);
  margin-bottom: 0;
}

.story-card-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
  margin-top: auto;
}

/* --- Collection Page --- */
.collection-chapter {
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-border);
}

.collection-chapter:last-child {
  border-bottom: none;
}

.collection-chapter h2 {
  color: var(--color-primary);
}

.collection-entries {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.collection-entry {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-2xl);
  margin-bottom: var(--space-md);
}

.collection-entry-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary-light);
}

.collection-entry-header h4 {
  margin-bottom: 0;
  color: var(--color-primary-dark);
  font-size: var(--text-xl);
}

.collection-relation {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

.collection-headline {
  color: var(--color-primary);
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
}

.collection-text {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-base);
  line-height: 1.9;
  color: var(--color-text);
}

.collection-text p {
  margin-bottom: var(--space-md);
}

.collection-text p:last-child {
  margin-bottom: 0;
}

.collection-text blockquote {
  border-right: 3px solid var(--color-primary-light);
  padding-right: var(--space-lg);
  margin: var(--space-lg) 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.collection-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-3xl);
}

.collection-nav-link {
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-primary);
  transition: all var(--transition-fast);
}

.collection-nav-link:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.collection-placeholder {
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 0;
}

/* --- Collection Grid (pyramid of square tiles, x.company-style) --- */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(var(--pyramid-cols, 4), 1fr);
  gap: 20px;
  margin-top: var(--space-2xl);
}

.collection-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: clip;
  cursor: pointer;
  background: var(--color-surface);
}

.collection-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.collection-tile-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.4;
  background: var(--color-bg-alt);
  font-family: var(--font-story, var(--font-serif));
  transition: transform 0.3s ease;
}

/* Fill-up overlay (hidden by default, reveals on hover) */
.collection-tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 15px;
  background: var(--color-primary);
  clip-path: inset(100% 0% 0%);
  transition: clip-path 0.25s ease-out;
}

.collection-tile:hover .collection-tile-overlay {
  clip-path: inset(0% 0% 0%);
}

.collection-tile:hover .collection-tile-img,
.collection-tile:hover .collection-tile-placeholder {
  transform: scale(1.05);
}

.collection-tile-name {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-base);
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}

.collection-tile-relation {
  font-size: var(--text-xs);
  color: rgba(17, 17, 17, 0.6);
  margin-top: 2px;
}

/* --- Collection Modal / Popup --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: var(--text-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

/* Modal image side */
.modal-image-side {
  position: relative;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  overflow: hidden;
}

.modal-carousel {
  width: 100%;
  height: 100%;
  position: relative;
}

.modal-carousel-track {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform var(--transition-base);
}

.modal-carousel-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-carousel-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.3;
  font-family: var(--font-story, var(--font-serif));
}

.modal-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: var(--text-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-carousel-btn:hover {
  background: rgba(0,0,0,0.8);
  border-color: rgba(255,255,255,0.6);
}

.modal-carousel-prev {
  right: var(--space-md);
}

.modal-carousel-next {
  left: var(--space-md);
}

.modal-carousel-dots {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-sm);
}

.modal-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.modal-carousel-dot.active {
  background: var(--color-primary);
}

/* Modal text side */
.modal-text-side {
  padding: var(--space-2xl) var(--space-2xl) var(--space-xl);
  overflow-y: auto;
  max-height: 90vh;
}

.modal-author {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.modal-relation {
  font-size: var(--text-sm);
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}

.modal-headline {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-lg);
  color: var(--color-primary);
  font-weight: 400;
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.modal-body {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-base);
  line-height: 2;
  color: var(--color-text-light);
}

.modal-body p {
  margin-bottom: var(--space-lg);
}

.modal-body p:last-child {
  margin-bottom: 0;
}

/* Modal navigation (prev/next entry) */
.modal-entry-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-2xl);
  border-top: 1px solid var(--color-border);
  grid-column: 1 / -1;
  background: var(--color-bg-alt);
}

.modal-entry-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: none;
  color: var(--color-text-muted);
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-entry-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.modal-entry-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.modal-entry-counter {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Modal responsive */
@media (max-width: 768px) {
  .modal-container {
    grid-template-columns: 1fr;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-overlay {
    padding: 0;
  }

  .modal-image-side {
    min-height: 250px;
    max-height: 40vh;
  }

  .modal-text-side {
    padding: var(--space-xl);
    max-height: 55vh;
  }

  .modal-entry-nav {
    padding: var(--space-md);
  }

  .collection-grid {
    --pyramid-cols: 3 !important;
    gap: 10px;
  }

  /* Reset pyramid placement on mobile — just flow naturally */
  .collection-tile {
    grid-row: auto !important;
    grid-column: auto !important;
  }
}

@media (max-width: 480px) {
  .collection-grid {
    --pyramid-cols: 2 !important;
  }
}

/* --- Writings Page --- */
.writings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.writing-item {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: inherit;
  transition: all var(--transition-fast);
}

.writing-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  color: inherit;
}

.writing-year {
  flex: 0 0 60px;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-primary);
}

.writing-content h4 {
  margin-bottom: var(--space-xs);
}

.writing-content p {
  margin-bottom: 0;
  font-size: var(--text-sm);
}

/* --- Writing Article Page --- */
.writing-article {
  padding: var(--space-3xl) 0;
}

.writing-article-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-xl);
  border-bottom: 2px solid var(--color-border);
}

.writing-article-year {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: var(--space-xs) var(--space-lg);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
}

.writing-article-header h1 {
  margin-bottom: var(--space-sm);
}

.writing-article-author {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

.writing-article-body {
  font-family: var(--font-story, var(--font-serif));
  font-size: var(--text-lg);
  line-height: 2;
  color: var(--color-text);
}

.writing-article-body p {
  margin-bottom: var(--space-lg);
}

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

.writing-article-body blockquote {
  border-right: 4px solid var(--color-primary-light);
  padding-right: var(--space-xl);
  margin: var(--space-xl) 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.writing-article-body strong,
.writing-article-body b {
  color: var(--color-primary-dark);
}

.writing-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 2px solid var(--color-border);
}

.writing-nav-link {
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  max-width: 45%;
}

.writing-nav-link:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.writing-nav-next {
  margin-right: auto;
}

.writing-nav-prev {
  margin-left: auto;
}

/* --- Photos Page --- */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.photo-placeholder {
  aspect-ratio: 4/3;
  background: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2.25rem;
    --text-4xl: 1.875rem;
    --text-3xl: 1.5rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    max-height: 300px;
  }

  .dual-gate-grid {
    grid-template-columns: 1fr;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .project-hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .step {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    right: 0;
    left: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .projects-hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .story-hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .how-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .story-grid {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    right: 60px;
  }

  .timeline-year {
    flex: 0 0 60px;
    font-size: var(--text-base);
  }

  .concept-box {
    flex-direction: column;
  }

  .radio-hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .writing-item {
    gap: var(--space-md);
  }

  .writing-year {
    flex: 0 0 45px;
    font-size: var(--text-base);
  }

  .collection-entry {
    padding: var(--space-lg);
  }

  .collection-entry-header {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .collection-text {
    font-size: var(--text-sm);
    line-height: 1.8;
  }

  .collection-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .writing-article-body {
    font-size: var(--text-base);
    line-height: 1.85;
  }

  .writing-nav {
    flex-direction: column;
    gap: var(--space-md);
  }

  .writing-nav-link {
    max-width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .gate-card {
    padding: var(--space-xl);
  }

  .project-card-meta {
    flex-wrap: wrap;
  }
}
