:root {
  --cream: #ffffff;
  --cream-deep: #efefea;
  --ink: #32404f;
  --ink-soft: #61707f;
  --line: #e1e5e8;
  --accent: #e65f2e;
  --card: #fffdf7;
  --radius: 18px;
  --serif: "Libre Baskerville", Georgia, serif;
  --sans: "Inter", -apple-system, sans-serif;
  --sidebar-w: 252px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle paper grain over everything */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .3; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px; background-repeat: repeat;
}

::selection { background: var(--accent); color: var(--cream); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -0.03em; }
h1 em, h2 em { font-style: italic; }

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- sidebar ---------- */
.sidebar {
  padding: 30px clamp(20px, 5vw, 64px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 15px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.side-nav { display: flex; gap: 28px; font-size: 15px; font-weight: 500; }
.side-nav a { opacity: .65; transition: opacity .2s; display: inline-flex; align-items: center; gap: 8px; }
.side-nav a:hover { opacity: 1; }
.side-nav a.active { opacity: 1; }
.side-nav a.active::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex: none;
}
.side-foot { display: none; }

@media (min-width: 1024px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
    flex-direction: column; align-items: flex-start; justify-content: flex-start;
    padding: 40px 34px; border-bottom: none; border-right: 1px solid var(--line);
    z-index: 60;
  }
  .side-nav { flex-direction: column; gap: 14px; margin-top: 52px; font-size: 15.5px; }
  .side-foot {
    display: block; margin-top: auto; font-size: 13.5px; color: var(--ink-soft); line-height: 1.7;
  }
  .side-foot a { border-bottom: 1px solid var(--line); }
  .side-foot a:hover { border-color: var(--accent); color: var(--accent); }
  .page { margin-left: var(--sidebar-w); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-weight: 600; transition: transform .2s, box-shadow .2s;
}
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-dark:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(33,29,21,.22); }
.btn-sm { padding: 10px 22px; font-size: 14px; }
.btn-lg { padding: 16px 40px; font-size: 17px; }

/* ---------- hero ---------- */
.hero {
  padding: clamp(48px, 7vw, 96px) clamp(20px, 5vw, 64px) clamp(36px, 4vw, 56px);
  max-width: 1180px; margin: 0 auto;
}
.hero h1 { font-size: clamp(40px, 5.2vw, 72px); max-width: 26ch; }
@media (max-width: 640px) { .hero-br { display: none; } }
.hero-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px;
  margin-top: clamp(36px, 4vw, 52px); max-width: 860px;
}
.hero-cols .kicker { margin-bottom: 10px; }
.hero-cols p { font-size: 15.5px; color: var(--ink-soft); max-width: 34ch; }
.hero-cols p strong { color: var(--ink); font-weight: 600; }

/* ---------- work ---------- */
.work { padding: 8px clamp(20px, 5vw, 64px) clamp(80px, 9vw, 130px); max-width: 1180px; margin: 0 auto; }
.section-head { margin-bottom: 42px; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 54px); }
.section-head p { color: var(--ink-soft); margin-top: 10px; font-size: 16.5px; }

.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 46px 34px; }
.card-img {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3;
  background: var(--cream-deep);
}
.card-img img { transition: transform .6s cubic-bezier(.2,.6,.2,1); }
.card:hover .card-img img { transform: scale(1.04); }
.card h3 { font-size: 27px; margin: 18px 2px 4px; }
.cap-meta { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); letter-spacing: 0; }
.card p { color: var(--ink-soft); margin: 0 2px; font-size: 15.5px; }

/* ---------- about ---------- */
.about {
  background: var(--ink); color: var(--cream);
  border-radius: 30px;
  margin: 0 clamp(12px, 3vw, 40px);
  padding: clamp(64px, 9vw, 120px) clamp(24px, 6vw, 96px);
}
.about-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.kicker {
  text-transform: uppercase; letter-spacing: .18em; font-size: 12px;
  font-weight: 600; opacity: .6; margin-bottom: 18px;
}
.about h2 { font-size: clamp(40px, 6vw, 76px); margin-bottom: 24px; }
.about-text { font-size: clamp(16px, 1.8vw, 20px); opacity: .82; max-width: 60ch; margin: 0 auto; }
.facts { display: flex; justify-content: center; gap: clamp(28px, 6vw, 80px); margin-top: 48px; }
.fact { display: flex; flex-direction: column; }
.fact strong { font-family: var(--serif); font-size: 44px; font-weight: 400; }
.fact span { font-size: 14px; opacity: .65; }

/* ---------- cta ---------- */
.cta { text-align: center; padding: clamp(90px, 12vw, 160px) 20px; }
.cta h2 { font-size: clamp(52px, 9vw, 120px); margin-bottom: 20px; }
.cta p { color: var(--ink-soft); font-size: 18px; margin-bottom: 36px; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 56px clamp(20px, 5vw, 64px) 36px;
  max-width: 1180px; margin: 0 auto;
}
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-bottom: 48px; }
.footer-grid a { border-bottom: 1px solid transparent; }
.footer-grid a:hover { border-color: var(--accent); color: var(--accent); }
.footer p { font-size: 15px; }
.copyright { font-size: 13px; opacity: .55; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.6,.2,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- custom cursor label ---------- */
#cursor-label {
  position: fixed; left: 0; top: 0; z-index: 3000; pointer-events: none;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: .01em;
  padding: 8px 15px; border-radius: 999px; white-space: nowrap;
  opacity: 0; transform: translate(-50%, -150%) scale(.85);
  transition: opacity .18s ease, transform .18s ease;
}
#cursor-label.on { opacity: 1; transform: translate(-50%, -150%) scale(1); }

/* ---------- project detail ---------- */
.project { max-width: 920px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) clamp(20px, 5vw, 64px) 40px; }
.back-link { display: inline-block; font-size: 15px; font-weight: 500; opacity: .7; margin-bottom: 28px; }
.back-link:hover { opacity: 1; color: var(--accent); }
.crumb-sep { opacity: .45; margin: 0 3px; }
.crumb-cur { color: var(--ink-soft); }
.project-hero { border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--cream-deep); margin-bottom: 8px; }
.project-hero.natural { aspect-ratio: auto; display: flex; align-items: center; justify-content: center; }
.project-hero.natural img { width: auto; height: auto; max-width: 100%; max-height: 540px; }
.project .kicker { margin-bottom: 12px; color: var(--accent); opacity: 1; }
.project h1 { font-size: clamp(40px, 6vw, 72px); margin-bottom: 16px; }
.lede { font-size: clamp(17px, 2vw, 21px); color: var(--ink-soft); max-width: 56ch; }
.meta-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 26px 0; margin: 44px 0;
}
.meta-grid .kicker { margin-bottom: 8px; color: inherit; opacity: .6; }
.meta-grid p { font-size: 15px; }
.p-section { border-top: 1px solid var(--line); padding-top: 46px; margin: 46px 0 60px; scroll-margin-top: 24px; }
.p-section .sec-label {
  text-transform: uppercase; letter-spacing: .18em; font-size: 12px;
  font-weight: 600; color: var(--ink-soft); opacity: .8; margin-bottom: 12px; max-width: none;
}
.p-section h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 18px; max-width: 24ch; }
.p-section p { font-size: 17px; color: var(--ink-soft); max-width: 68ch; }
.impact-list { padding-left: 22px; }
.impact-list li { font-size: 17px; color: var(--ink-soft); margin-bottom: 12px; max-width: 68ch; }
.process-step { margin-bottom: 28px; }
.process-step h4 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin-bottom: 8px; }
.process-step p { font-size: 16px; color: var(--ink-soft); max-width: 68ch; }
.p-img { margin: 44px 0; }
.p-img img { border-radius: 16px; height: auto; background: var(--cream-deep); }
.p-img.md { max-width: 680px; margin-left: auto; margin-right: auto; }
.project .p-cap { font-size: 13.5px; color: var(--ink-soft); margin-top: 10px; line-height: 1.5; }
.p-collage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 40px 0; }
.p-collage-media { border-radius: 10px; overflow: hidden; background: var(--cream-deep); }
.p-collage-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-collage img { object-position: top center; }
.impact-split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: start; }
.impact-split .p-img { margin: 4px 0 0; }
@media (max-width: 860px) { .impact-split { grid-template-columns: 1fr; } .p-collage { gap: 10px; margin: 28px 0; } }
.next-project { display: block; border-top: 1px solid var(--line); margin-top: 80px; padding: 44px 0 20px; }
.next-project .kicker { color: var(--accent); opacity: 1; }
.next-project h3 { font-size: clamp(32px, 5vw, 56px); transition: transform .25s; }
.next-project:hover h3 { transform: translateX(10px); }
.finding { margin-bottom: 40px; }
.finding h4 { font-family: var(--serif); font-weight: 400; font-size: 27px; margin-bottom: 10px; }
.finding p { font-size: 16.5px; color: var(--ink-soft); max-width: 68ch; margin-bottom: 10px; }
.finding p strong { color: var(--ink); }
.retro {
  font-family: var(--serif); font-size: clamp(16px, 1.7vw, 18px); font-style: italic;
  color: var(--ink-soft); border-left: 3px solid var(--accent); padding-left: 26px;
  max-width: 64ch; line-height: 1.55;
}
.card-link { display: block; color: inherit; }
.card-link:hover .card-img img { transform: scale(1.04); }

/* ---------- participant quotes + inline video ---------- */
.p-quote {
  margin: 18px 0 8px; padding: 18px 22px; max-width: 62ch;
  background: var(--cream-deep); border-radius: 14px;
  font-family: var(--serif); font-size: 17px; line-height: 1.55; color: var(--ink);
}
.p-quote cite {
  display: block; margin-top: 10px; font-family: var(--sans); font-style: normal;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}
.p-img video { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--cream-deep); }
.card-img video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.6,.2,1); }
.card:hover .card-img video, .card-link:hover .card-img video { transform: scale(1.04); }
.project-hero video { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-img.sm { max-width: 460px; }

/* ---------- project TOC sidebar + slim footer ---------- */
.footer.slim {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px 28px; flex-wrap: wrap; padding-top: 30px; padding-bottom: 34px;
}
.slim-links { display: flex; gap: 22px; font-size: 14.5px; }
.slim-links a:hover { color: var(--accent); }
@media (max-width: 1023px) {
  .sidebar.toc-side { flex-wrap: wrap; row-gap: 12px; }
  .toc-side .toc { flex-wrap: wrap; gap: 10px 18px; font-size: 14px; }
}

@media (max-width: 860px) {
  .meta-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .side-nav { gap: 18px; font-size: 14px; }
  .hero-cols { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .facts { flex-wrap: wrap; }
}

/* ---------- boxed media: image + caption separated from text ---------- */
.p-img { border: 1px solid var(--line); background: #fbfbf9; border-radius: 18px; padding: 14px; }
.p-img img, .p-img video { border-radius: 10px; }
.p-img .p-cap { margin-top: 10px; padding: 0 4px; }
.p-collage figure { border: 1px solid var(--line); background: #fbfbf9; border-radius: 18px; padding: 12px; }
.p-collage figure .p-cap { padding: 0 4px; }

/* ---------- side-by-side portrait videos ---------- */
.p-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; gap: 18px; margin: 26px 0 6px; }
.p-videos .p-img { margin: 0; }
@media (max-width: 640px) { .p-videos { gap: 10px; } }

/* ---------- split sections and steps: text beside media ---------- */
.p-section.split-sec { display: grid; grid-template-columns: 1.08fr .92fr; gap: 30px; align-items: start; }
.split-sec .p-img { margin: 0; }
.step-split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.step-split .p-img { margin: 0; }
@media (max-width: 760px) { .p-section.split-sec, .step-split { grid-template-columns: 1fr; } }
.p-videos.c3 { grid-template-columns: repeat(3, minmax(0, 250px)); }
.p-videos.wide { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .p-videos.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }

/* ---------- retrospective: lesson pairs + constraints band ---------- */
.retro-pair { display: grid; grid-template-columns: 58px 1fr; gap: 16px; padding: 24px 0 6px; border-top: 1px solid var(--line); margin-top: 22px; }
.retro-num { font-family: "Libre Baskerville", serif; font-size: 30px; line-height: 1; color: var(--accent); }
.retro-pair-body h4 { font-size: 19px; margin-bottom: 6px; }
.retro-constraint { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); border-left: 3px solid var(--accent); padding-left: 12px; }
.retro-constraint span { display: block; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 3px; }
.retro-band { margin-top: 30px; border: 1px solid var(--line); background: #fbfbf9; border-radius: 18px; padding: 20px; }
.retro-band-label { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.retro-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.retro-chip h5 { font-size: 15px; margin-bottom: 4px; }
.retro-chip p { font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 760px) { .retro-chips { grid-template-columns: 1fr 1fr; } .retro-pair { grid-template-columns: 44px 1fr; } .retro-num { font-size: 24px; } }

/* ---------- grouped videos: one box around a video row ---------- */
.p-videos-box { border: 1px solid var(--line); background: #fbfbf9; border-radius: 18px; padding: 14px; margin: 26px 0 6px; }
.p-videos-box .p-videos { margin: 0; }
.p-vid { margin: 0; }
.p-vid video { width: 100%; border-radius: 10px; display: block; }
.p-vid .p-cap { margin-top: 10px; padding: 0 4px; }

/* ---------- about page ---------- */
.about-page { padding: 54px 0 80px; }
.about-col { max-width: 500px; }
.about-bio p { font-size: 15px; line-height: 1.5; margin-bottom: 8px; }
.about-bio a { color: var(--accent); }
.resume-cta { margin-top: 34px; font-size: 15px; }
.text-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--accent); }
.gallery { display: grid; grid-template-columns: .78fr 1.12fr 1.12fr; gap: 26px; max-width: 1060px; align-items: start; margin-top: 44px; }
.gallery-label { font-size: 13px; font-weight: 400; color: var(--ink-soft); margin-bottom: 12px; }
.gallery-label span { color: var(--ink-soft); }
.g-col.off-1 { margin-top: 44px; }
.g-col.off-2 { margin-top: 88px; }
.g-col figure { margin: 0 0 16px; position: relative; }
.g-col figure img { width: 100%; display: block; border-radius: 8px; }
.g-col figcaption { position: absolute; left: 10px; bottom: 10px; background: var(--accent); color: #fff; font-size: 12.5px; padding: 5px 10px; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.g-col figure:hover figcaption { opacity: 1; }
.photo-slot { aspect-ratio: 4 / 5; background: #fbfbf9; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; width: 100%; margin-bottom: 16px; }
.photo-slot span { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } .g-col.off-1, .g-col.off-2 { margin-top: 0; } }
.p-img.md-size { max-width: 460px; margin-left: auto; margin-right: auto; }
