/* ── SHARED TOKENS ────────────────────────────────────────
   Colour names use semantic roles, not project-specific names.
   --accent / --accent-light / --accent-muted are overridden
   per page via :root in each HTML file's <style> block.
   ────────────────────────────────────────────────────────── */
:root {
  /* Surface */
  --cream:        #F2EDE4;
  --cream-mid:    #E8E1D6;
  --cream-border: #D8D0C4;

  /* Accent — overridden per page */
  --accent:       #1a1678;

  /* Supporting colours */
  --secondary:    #6B2C3E;
  --highlight:    #C9A050;

  /* Text */
  --text:         #2C2218;
  --text-mid:     #5A4A3E;
  --text-muted:   #8A7A6E;

  /* Tags */
  --tag-bg:       #DDD5C8;
  --tag-text:     #3D2B1F;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* Spacing */
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  6rem;

  /* Layout */
  --max-w:     1100px;
  --nav-h:     64px;

  /* Shape */
  --radius:    6px;
  --radius-lg: 12px;

  /* Motion */
  --ease:      cubic-bezier(0.25, 0.1, 0.25, 1);
  --dur:       0.25s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream:        #18160F;
    --cream-mid:    #22201A;
    --cream-border: #3A3530;
    --secondary:    #D4889A;
    --highlight:    #D4AA60;
    --text:         #EDE8DF;
    --text-mid:     #C8BDB0;
    --text-muted:   #8A8070;
    --tag-bg:       #302A22;
    --tag-text:     #C8BDB0;
  }
}

/* ── BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.7; color: var(--text); background: var(--cream); }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--highlight); outline-offset: 3px; border-radius: var(--radius); }

/* ── SKIP LINK ────────────────────────────────────────── */
.skip-link { position: absolute; top: -100%; left: 1rem; background: var(--accent); color: var(--cream); padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.875rem; z-index: 9999; transition: top var(--dur) var(--ease); }
.skip-link:focus { top: 1rem; }

/* ── NAV ──────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 100; height: var(--nav-h); background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--cream-border); }
.nav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-md); height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--accent); letter-spacing: 0.05em; transition: opacity var(--dur) var(--ease); }
.nav-logo:hover { opacity: 0.7; }
.nav-back { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; transition: color var(--dur) var(--ease); }
.nav-back:hover { color: var(--accent); }
.nav-breadcrumb { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.nav-breadcrumb a { color: var(--accent); transition: opacity var(--dur) var(--ease); }
.nav-breadcrumb a:hover { opacity: 0.7; }
.nav-breadcrumb span { opacity: 0.5; }

/* ── LAYOUT ───────────────────────────────────────────── */
.page-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-md); }

/* ── PROJECT HERO ─────────────────────────────────────── */
.project-hero { max-width: var(--max-w); margin: 0 auto; padding: var(--space-xl) var(--space-md) var(--space-lg); }
.hero-top { display: grid; grid-template-columns: 1fr 360px; gap: var(--space-lg); align-items: start; margin-bottom: var(--space-lg); }
.hero-eyebrow { display: flex; align-items: center; gap: var(--space-sm); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-sm); }
.eyebrow-line { display: block; width: 32px; height: 1px; background: var(--highlight); }
.project-title { font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 300; color: var(--accent); line-height: 1.05; letter-spacing: -0.01em; margin-bottom: var(--space-sm); }
.project-tagline { font-size: 1.125rem; color: var(--text-mid); font-style: italic; line-height: 1.65; max-width: 48ch; }

/* ── META CARD ────────────────────────────────────────── */
.project-meta-card { background: var(--cream-mid); border: 1px solid var(--cream-border); border-top: 3px solid var(--accent); border-radius: var(--radius-lg); padding: 1.75rem; display: flex; flex-direction: column; gap: 1.25rem; }
.meta-row { display: flex; flex-direction: column; gap: 0.2rem; }
.meta-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.meta-value { font-size: 0.9375rem; color: var(--text-mid); }
.meta-link { color: var(--accent); border-bottom: 1px solid var(--accent); transition: opacity var(--dur) var(--ease); display: inline; }
.meta-link:hover { opacity: 0.7; }
.meta-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.25rem; }
.tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; background: var(--tag-bg); color: var(--tag-text); padding: 0.2rem 0.6rem; border-radius: 20px; }
.meta-divider { height: 1px; background: var(--cream-border); }

/* ── HERO VISUAL ──────────────────────────────────────── */
.hero-visual { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--cream-border); box-shadow: 0 8px 40px rgba(0,0,0,0.1); background: var(--cream-mid); }
.hero-visual img { width: 100%; display: block; }
.hero-placeholder { width: 100%; aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; }
.hero-placeholder-text { font-family: var(--font-display); font-size: 1.5rem; font-style: italic; color: rgba(255,255,255,0.5); }
.hero-placeholder-sub { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.3); }
.hero-videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; padding: 0.75rem; }
.hero-videos figure { margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.hero-videos video { width: 100%; border-radius: var(--radius-md); display: block; background: #000; }
.hero-videos figcaption { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); text-align: center; }

/* ── SECTION BASE ─────────────────────────────────────── */
.project-section { padding: var(--space-lg) var(--space-md); max-width: var(--max-w); margin: 0 auto; }
.project-section + .project-section { border-top: 1px solid var(--cream-border); }
.section-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.75rem; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--cream-border); }
.section-heading { font-family: var(--font-display); font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 300; color: var(--accent); line-height: 1.15; margin-bottom: var(--space-sm); }
.section-body { font-size: 1rem; color: var(--text-mid); line-height: 1.8; max-width: 68ch; }
.section-body + .section-body { margin-top: var(--space-sm); }

/* ── OVERVIEW GRID ────────────────────────────────────── */
.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: var(--space-md); }
.overview-card { background: var(--cream-mid); border: 1px solid var(--cream-border); border-radius: var(--radius-lg); padding: 1.5rem; }
.overview-card-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; }
.overview-card-value { font-size: 0.9375rem; color: var(--text-mid); line-height: 1.6; }

/* ── TECH STACK ───────────────────────────────────────── */
.tech-section { background: var(--cream-mid); border-top: 1px solid var(--cream-border); border-bottom: 1px solid var(--cream-border); }
.tech-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: var(--space-md); }
.tech-group { border-top: 2px solid var(--accent); padding-top: 1rem; }
.tech-group-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.tech-list { list-style: none; }
.tech-list li { font-size: 0.9rem; color: var(--text-mid); padding: 0.3rem 0; border-bottom: 1px solid var(--cream-border); }
.tech-list li:last-child { border-bottom: none; }

/* ── INSIGHT BLOCK ────────────────────────────────────── */
.insight-block { background: var(--accent); color: var(--cream); border-radius: var(--radius-lg); padding: var(--space-lg); margin-top: var(--space-md); }
.insight-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; margin-bottom: 1rem; }
.insight-block blockquote { font-family: var(--font-display); font-size: clamp(1.375rem, 3vw, 2rem); font-weight: 300; font-style: italic; line-height: 1.4; }
.insight-block .insight-source { margin-top: 1.25rem; font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.55; }
@media (prefers-color-scheme: dark) {
  .insight-block { color: #ffffff; }
  .insight-label { opacity: 0.7; }
  .insight-block .insight-source { opacity: 0.6; }
}

/* ── IMAGE BLOCKS ─────────────────────────────────────── */
.image-block { margin-top: var(--space-md); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--cream-border); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.image-block img { width: 100%; display: block; }
.image-caption { padding: 0.75rem 1rem; background: var(--cream-mid); font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.03em; }
.image-grid, .image-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: var(--space-md); }
.image-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; margin-top: var(--space-md); }
.img-placeholder { aspect-ratio: 16/9; background: var(--cream-mid); border: 2px dashed var(--cream-border); border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; }
.img-placeholder span { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

/* ── VIDEO ────────────────────────────────────────────── */
.video-section { background: var(--cream-mid); border-top: 1px solid var(--cream-border); border-bottom: 1px solid var(--cream-border); }
.video-wrap { position: relative; width: 100%; border-radius: var(--radius-lg); overflow: hidden; background: #000; box-shadow: 0 8px 40px rgba(0,0,0,0.12); }
.video-wrap video { width: 100%; display: block; }
.video-label { margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.725rem; letter-spacing: 0.06em; color: var(--text-muted); text-align: center; }

/* ── OUTCOMES ─────────────────────────────────────────── */
.outcomes-section { background: var(--cream-mid); border-top: 1px solid var(--cream-border); border-bottom: 1px solid var(--cream-border); }
.outcomes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: var(--space-md); }
.outcome-card { background: var(--cream); border: 1px solid var(--cream-border); border-radius: var(--radius-lg); padding: 1.5rem; }
.outcome-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--accent); margin-bottom: 0.5rem; }
.outcome-desc { font-size: 0.9rem; color: var(--text-mid); line-height: 1.65; }

/* ── BACK BUTTON ──────────────────────────────────────── */
.back-section { padding: var(--space-lg) var(--space-md); max-width: var(--max-w); margin: 0 auto; text-align: center; border-top: 1px solid var(--cream-border); }
.btn-back { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--accent); color: var(--cream); padding: 0.875rem 2rem; border-radius: var(--radius); font-family: var(--font-body); font-size: 0.9375rem; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); }
.btn-back:hover { background: color-mix(in srgb, var(--accent) 80%, #000); transform: translateY(-1px); }
.btn-secondary { display: inline-flex; align-items: center; gap: 0.5rem; background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 0.875rem 2rem; border-radius: var(--radius); font-family: var(--font-body); font-size: 0.9375rem; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); }
.btn-secondary:hover { background: var(--cream-mid); transform: translateY(-1px); }
@media (prefers-color-scheme: dark) {
  .btn-back { color: #ffffff; }
}

/* ── FOOTER ───────────────────────────────────────────── */
.site-footer { background: #1B3054; padding: var(--space-md); }
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.footer-copy { font-size: 0.8125rem; color: rgba(255,255,255,0.6); }
.footer-stack { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.35); }

/* ── ANIMATIONS ───────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .hero-top > * { animation: fadeUp 0.6s cubic-bezier(0,0,0.2,1) both; }
  .hero-top > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-top > *:nth-child(2) { animation-delay: 0.15s; }
  .hero-visual { animation: fadeUp 0.6s cubic-bezier(0,0,0.2,1) 0.1s both; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-top { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .outcomes-grid { grid-template-columns: 1fr; }
  .image-grid, .image-grid-2, .image-grid-3 { grid-template-columns: 1fr; }
  .back-section.flex { flex-direction: column; align-items: stretch; text-align: center; }
  .back-section.flex .btn-back,
  .back-section.flex .btn-secondary { justify-content: center; }
}
@media (max-width: 500px) {
  .overview-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr 1fr; }
  .project-section, .project-hero, .back-section { padding-left: 1rem; padding-right: 1rem; }
}
