/* project.css — shared styles for all project pages */

/* ======================================
   RESET (subset)
   box-sizing + zero-out + reduced-motion
====================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ======================================
   FONTS
====================================== */
@font-face {
  font-family: "BobbySoft";
  src: url("../fonts/bobby-jones-soft.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "BobbySoftOutline";
  src: url("../fonts/bobby-jones-soft-outline.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "AccentScript";
  src: url("../fonts/JimmyScript-Rg.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ======================================
   TOKENS
====================================== */
:root {
  --bg:      #f6f1e8;
  --text:    #0b0b0e;
  --muted:   rgba(11, 11, 14, .68);
  --border:  rgba(11, 11, 14, .13);
  --surface: rgba(255, 255, 255, .50);
  --accent:  #ff4d5a;

  --max:    1080px;
  --pad:    clamp(20px, 6vw, 72px);
  --radius: 20px;

  --font-display: "BobbySoft", "Arial Black", "Trebuchet MS", sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-accent:  "AccentScript", "Brush Script MT", "Segoe Script", cursive;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:      #0b0b0e;
  --text:    #f6f1e8;
  --muted:   rgba(246, 241, 232, .70);
  --border:  rgba(246, 241, 232, .15);
  --surface: rgba(255, 255, 255, .06);
  color-scheme: dark;
}

/* ======================================
   BASE
====================================== */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  font-size: 1rem;
}

/* Skip link — keyboard users can jump past the nav */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--bg);
  color: var(--text);
  padding: 10px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: top .1s ease;
}
.skip-link:focus { top: 0; }

/* Screen-reader only — hides text visually but keeps it in the a11y tree */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
a:hover { border-bottom-color: var(--accent); }

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

h1, h2, h3 { font-family: var(--font-display); line-height: 1; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: 0.5em; }
h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: 8px; }
p  { color: var(--muted); line-height: 1.7; margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ======================================
   TOP BAR
====================================== */
#topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#topbarBack {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  border-bottom: none;
  color: var(--muted);
  transition: color .2s ease;
}
#topbarBack:hover { color: var(--accent); border-bottom: none; }
#topbarBack svg { width: 16px; height: 16px; flex-shrink: 0; }

#topbarTitle {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

#themeToggle {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
}
#themeToggle:hover { border-color: var(--accent); }

/* ======================================
   PROJECT HERO
====================================== */
#projectHero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 120px) var(--pad) clamp(40px, 6vw, 80px);
}

#projectEyebrow {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Eyebrow metadata spans — no class needed, direct children do the job */
#projectEyebrow > span {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

#projectEyebrow > span + span::before {
  content: "·";
  margin-right: 12px;
}

#projectTitle {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  line-height: 0.92;
  margin-bottom: 28px;
  max-width: 14ch;
}

#projectLead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 58ch;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Meta tags — structural selector replaces .meta-tag */
#projectMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#projectMeta > span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ======================================
   COVER IMAGE
====================================== */
#projectCover {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Cover image or placeholder div — structural selector replaces .cover-placeholder */
#projectCover img,
#projectCover > div {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

#projectCover > div {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* WRP cover has different text styling — scoped with data attribute */
#projectCover [data-manifesto] {
  font-size: clamp(1rem, 2vw, 1.6rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ======================================
   PROJECT BODY
====================================== */
#projectBody {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 100px) var(--pad);
  display: grid;
  gap: 80px;
}

/* Section row — structural selector replaces .proj-section */
#projectBody > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
}

/* Section label (first p inside each section row) — replaces .proj-section-label */
#projectBody > div > p:first-child {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 6px;
  position: sticky;
  top: 80px;
}

/* Section content wrapper (div inside each section row) — replaces .proj-section-content */
#projectBody > div > div { min-width: 0; }

/* ======================================
   PROCESS STEPS
   [data-steps] replaces .process-steps
   [data-step]  replaces .process-step
====================================== */
[data-steps] {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

[data-step] {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: start;
}

/* Step number — first span inside a [data-step], replaces .step-num */
[data-step] > span:first-child {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
}

/* ======================================
   DECISION CARDS
   [data-decisions] replaces .decisions
   [data-card]      replaces .decision-card
====================================== */
[data-decisions] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

[data-card] {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
}

/* Card label — first span inside a [data-card], replaces .label */
[data-card] > span:first-child {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

[data-card] p { font-size: 0.95rem; }

/* ======================================
   SKILL CLOUD
   [data-cloud] replaces .skill-cloud
   [data-cloud] > span replaces .skill-tag
====================================== */
[data-cloud] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* Extra breathing room when immediately after an outcome banner */
.outcome-banner + [data-cloud] { margin-top: 20px; }

[data-cloud] > span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ======================================
   CTA LINK
   [data-cta] replaces .proj-cta
====================================== */
[data-cta] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 24px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
[data-cta]:hover {
  background: var(--accent);
  border-color: var(--accent);
  /* Dark text on red: #0b0b0e on #ff4d5a = 4.7:1, passes WCAG AA */
  color: #0b0b0e;
}
[data-cta] svg { width: 14px; height: 14px; }

/* ======================================
   OUTCOME BANNER
   Kept as a class — one-off component with no reliable structural hook
====================================== */
.outcome-banner {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-top: 24px;
}
.outcome-banner p { color: var(--text); font-size: 1.05rem; }

/* ======================================
   PROJECT NAV
   #projectNav > a replaces .proj-nav-link
   :first-child / :last-child replace .prev / .next
====================================== */
#projectNav {
  border-top: 1px solid var(--border);
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--pad) 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

#projectNav > a {
  display: grid;
  gap: 4px;
  border-bottom: none;
}
#projectNav > a:hover { border-bottom: none; }

/* Direction label — first span inside nav link, replaces .dir */
#projectNav > a > span:first-child {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Project name — last span inside nav link, replaces .name */
#projectNav > a > span:last-child {
  font-family: var(--font-display);
  font-size: 1.4rem;
  transition: color .2s ease;
}
#projectNav > a:hover > span:last-child { color: var(--accent); }

/* Right-aligned "next" link — last anchor, replaces .next */
#projectNav > a:last-child { text-align: right; }

/* ======================================
   SCROLL REVEAL
   Kept as classes — JS-driven state toggle requires a hook
====================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 480ms ease, transform 480ms ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ======================================
   RESPONSIVE
====================================== */
@media (max-width: 700px) {
  #projectBody > div {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  #projectBody > div > p:first-child {
    position: static;
  }
}
