/* ══════════════════════════════════════════════════════════
   PERSONAL PROJECT TEMPLATE
   Layout, typography, and components for personal / editorial
   case studies. Uses CSS custom properties — each page must
   define its own palette in a local :root block:

     --brand       (accent colour — required)
     --paper       (page background)
     --paper-deep  (deeper section background)
     --paper-stage (stage / artifact background)
     --ink         (primary text)
     --ink-soft    (secondary text)
     --ink-faint   (tertiary / placeholder text)
     --rule        (divider colour)
     --closing-bg  (closing section background — optional, defaults to --ink)
   ══════════════════════════════════════════════════════════ */

/* ── BASE ──────────────────────────────────────────────── */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: normal;
  font-kerning: normal;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════ */
.hero { padding: 9rem 0 2rem; position: relative; }
.hero__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
}
.hero__tag {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  font-weight: 500;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 6.8vw, 5.6rem);
  line-height: 1.02;
  margin-bottom: 1.5rem;
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}
.hero__dek {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 60ch;
  margin-bottom: 3rem;
}
.hero__meta {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 3rem;
}
.hero__meta-item { display: flex; flex-direction: column; gap: 0.3rem; }
.hero__meta-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.7;
}
.hero__meta-value {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 400;
}

/* ══════════════════════════════════════════════════════════
   EDITORIAL COLUMN
   ══════════════════════════════════════════════════════════ */
.column {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
}
.column p {
  font-size: 1.1rem;
  line-height: 1.75;
  margin-bottom: 1.4rem;
  max-width: 65ch;
}
.column p:last-child { margin-bottom: 0; }
.column p strong { font-weight: 500; color: var(--ink); }
.column p em { font-style: italic; color: var(--ink-soft); }
.lede::first-letter {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 3.6rem;
  line-height: 0.9;
  float: left;
  padding: 0.5rem 0.8rem 0 0;
  color: var(--ink);
}

/* ── LEDE SPLIT ─────────────────────────────────────────── */
.lede-split {
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 3rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: center;
}
.lede-split__img-wrap {
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 3 / 4;
}
.lede-split__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  will-change: transform;
}
.lede-split p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.18rem;
  line-height: 1.75;
  color: var(--ink);
  max-width: 65ch;
}

@media (max-width: 900px) {
  .lede-split {
    grid-template-columns: 1fr;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ══════════════════════════════════════════════════════════
   SECTION BAND
   ══════════════════════════════════════════════════════════ */
.section-band {
  background: var(--paper-stage);
  padding: 0 0 4rem;
}

/* ── MAP SPLIT — 3:1 image + aside ─────────────────────── */
.map-split {
  max-width: 1100px;
  margin: 2rem auto 3rem;
  padding: 0 3rem;
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 2rem;
  align-items: start;
}
.map-split .artifact__aside { align-self: end; }

/* ── TEXT-PHOTO SPLIT — 1:1 ─────────────────────────────── */
.text-photo-split {
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.text-photo-split .col-text { display: flex; flex-direction: column; gap: 1.4rem; }
.text-photo-split .col-text p {
  font-size: 1.1rem;
  line-height: 1.75;
  max-width: 65ch;
  margin: 0;
}
@media (max-width: 900px) {
  .text-photo-split { grid-template-columns: 1fr; padding: 0 1.5rem; }
  .map-split        { grid-template-columns: 1fr; padding: 0 1.5rem; }
}

.section-band .chapter {
  margin-top: 0;
  padding-top: 6rem;
}

/* ══════════════════════════════════════════════════════════
   CHAPTER MARKERS
   ══════════════════════════════════════════════════════════ */
.chapter {
  max-width: 1100px;
  margin: 6rem auto 2.5rem;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}
.chapter__num {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--brand);
  line-height: 1;
}
.chapter__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.chapter__title em { font-style: italic; font-weight: 300; }

/* ══════════════════════════════════════════════════════════
   PHOTO PRIMITIVES
   ══════════════════════════════════════════════════════════ */
figure { margin: 0; }
figure.photo {
  position: relative;
  background:
    repeating-linear-gradient(
      45deg,
      transparent, transparent 10px,
      rgba(0,0,0,0.04) 10px, rgba(0,0,0,0.04) 11px
    ),
    var(--paper-deep);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
figure.photo::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.32);
  font-size: 0.72rem;
  font-family: var(--sans);
  font-weight: 500;
  padding: 1rem;
  text-align: center;
  z-index: 0;
}
figure.photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}
figure.photo.photo--error img { display: none; }
figure.photo.photo--error::before {
  content: "Something's wrong with this image :(";
  text-transform: none;
  font-style: italic;
  letter-spacing: 0;
  color: rgba(0,0,0,0.4);
}
figcaption {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.7rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
figcaption em { font-style: italic; }

/* ── PHOTO CONTAINERS ──────────────────────────────────── */
.photo--col {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 3rem;
}
.photo--wide {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 3rem;
}
.photo--wide figure.photo {
  min-height: 0;
  background: none;
  overflow: visible;
  flex-direction: column;
  align-items: stretch;
}
.photo--duo {
  max-width: 1100px;
  margin: 2.5rem auto;
  padding: 0 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.photo--duo figure.photo { min-height: 220px; }
.photo--duo-wide {
  max-width: 1100px;
  margin: 2rem auto 3rem;
  padding: 0 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* ══════════════════════════════════════════════════════════
   ARTIFACT — full-bleed stage, with exhibit label
   ══════════════════════════════════════════════════════════ */
.artifact {
  background: var(--paper-stage);
  padding: 6rem 0;
  margin: 5rem 0;
  position: relative;
}
.artifact__stage {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 4rem;
}
.artifact__media figure.photo {
  min-height: 520px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent, transparent 12px,
      rgba(0,0,0,0.045) 12px, rgba(0,0,0,0.045) 13px
    ),
    var(--paper-deep);
}
.artifact__caption {
  margin-top: 1rem;
  min-height: 1.4rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.artifact__caption:empty::before { content: ''; display: block; }

/* Artifact with side note (marginalia) */
.artifact--note .artifact__stage {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 3rem;
  align-items: end;
}
.artifact--note .artifact__aside { padding-bottom: 1rem; }
.artifact__aside-mark {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.8rem;
}
.artifact__aside p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.artifact__aside p strong { color: var(--ink); font-style: normal; font-weight: 500; }
.artifact__aside a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.artifact__aside a:hover { color: var(--brand); }

/* Full-bleed parallax */
.artifact--full-bleed {
  padding: 0;
  margin: 2.4rem 0;
  height: 75vh;
  overflow: hidden;
  position: relative;
}
.artifact--full-bleed .artifact__stage,
.artifact--full-bleed .artifact__media {
  max-width: none;
  padding: 0;
  height: 100%;
}
.artifact--full-bleed .artifact__media figure.photo {
  border-radius: 0;
  height: 100%;
  min-height: unset;
  overflow: hidden;
  background: none;
}
.artifact--full-bleed .artifact__media figure.photo::before { display: none; }
.artifact--full-bleed .artifact__media figure.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Scroll-driven parallax — Chrome 115+; degrades to static crop elsewhere */
@supports (animation-timeline: scroll()) {
  .artifact--full-bleed {
    view-timeline-name: --parallax;
    view-timeline-axis: block;
  }
  .artifact--full-bleed .artifact__media figure.photo img {
    height: 130%;
    will-change: transform;
    animation: parallax-scroll linear both;
    animation-timeline: --parallax;
    animation-range: cover 0% cover 100%;
  }
  @media (prefers-reduced-motion: reduce) {
    .artifact--full-bleed .artifact__media figure.photo img {
      height: 100%;
      animation: none;
    }
  }
}

@keyframes parallax-scroll {
  from { transform: translateY(10%); }
  to   { transform: translateY(-10%); }
}
@media (max-width: 768px) {
  .artifact--full-bleed { margin: 0; padding: 0; height: auto; overflow: visible; }
  .artifact--full-bleed .artifact__stage,
  .artifact--full-bleed .artifact__media { height: auto; }
  .artifact--full-bleed .artifact__media figure.photo { height: auto; min-height: unset; overflow: visible; }
  .artifact--full-bleed .artifact__media figure.photo img { width: 100%; height: auto; animation: none; transform: none; }
}

/* Artifact duo — two objects side by side */
.artifact-duo .artifact__stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.artifact-duo .artifact__media figure.photo { min-height: 380px; }

/* Section title above artifact */
.artifact__intro {
  max-width: 1300px;
  margin: 0 auto 3rem;
  padding: 0 4rem;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 2rem;
  align-items: baseline;
}
.artifact__intro .chapter__num { font-size: 2.2rem; }

/* ══════════════════════════════════════════════════════════
   PULL QUOTE
   ══════════════════════════════════════════════════════════ */
.pullquote {
  max-width: 1100px;
  margin: 5rem auto;
  padding: 0 3rem;
  text-align: center;
}
.pullquote__mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(8rem, 18vw, 20rem);
  line-height: 0.6;
  color: var(--brand);
  display: block;
  margin-bottom: -6rem;
}
.pullquote__text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: normal;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 70ch;
  margin-bottom: 1.2rem;
  margin-left: auto;
  margin-right: auto;
}
.pullquote__attr {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.pullquote__rule {
  width: 36px;
  height: 1px;
  background: rgba(0,0,0,0.25);
  margin: 0 auto 0.9rem;
}

/* ── ASIDE BLOCKQUOTE ───────────────────────────────────── */
blockquote.aside {
  background: var(--paper-deep);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--ink-soft);
  padding: 0.5rem 0 0.5rem 1.5rem;
  border-left: 2px solid var(--brand);
  margin: 2rem 0 3rem;
}

/* ══════════════════════════════════════════════════════════
   THOUGHTS — reflective closing section
   ══════════════════════════════════════════════════════════ */
.thoughts {
  background: var(--paper-deep);
  color: var(--ink);
  padding: 6rem 0;
}
.thoughts__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
}
.thoughts__label {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 500;
  margin-bottom: 1.2rem;
}
.thoughts__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 2.5rem;
}
.thoughts__title em { font-style: italic; color: var(--brand); }
.thoughts p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.18rem;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 1.4rem;
  max-width: 65ch;
}
.thoughts p em { font-style: italic; color: var(--ink); }
.thoughts p strong { color: var(--ink); font-weight: 500; }
.reflect-list {
  list-style: none;
  counter-reset: r;
  margin: 1.5rem 0 2rem;
}
.reflect-list li {
  counter-increment: r;
  position: relative;
  padding: 1.2rem 0 1.2rem 3.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
  max-width: 65ch;
}
.reflect-list li:last-child { border-bottom: 1px solid var(--rule); }
.reflect-list li::before {
  content: '0' counter(r);
  position: absolute;
  left: 0;
  top: 1.2rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--brand);
  font-weight: 400;
}
.reflect-list li em { font-style: italic; color: var(--ink); }

/* ══════════════════════════════════════════════════════════
   CLOSING
   ══════════════════════════════════════════════════════════ */
.closing {
  --closing-text:       var(--white, #fff);
  --closing-text-muted: rgba(255,255,255,0.38);
  background: var(--closing-bg, var(--ink));
  padding: 7rem 0;
  text-align: center;
}
.closing__text {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  font-weight: 400;
  color: var(--closing-text);
  font-style: italic;
  max-width: 48ch;
  margin: 0 auto;
  line-height: 1.65;
}
.closing__second {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--closing-text);
  font-style: italic;
}
.closing__thanks {
  margin-top: 2.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--closing-text-muted);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   PROJECT NAV / FOOTER
   ══════════════════════════════════════════════════════════ */
.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--rule);
}
.project-nav__item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.8rem 3rem;
  text-decoration: none;
  color: var(--ink);
}
.project-nav__item:hover { background: var(--paper-deep); }
.project-nav__item--next {
  text-align: right;
  border-left: 1px solid var(--rule);
}
.project-nav__label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.7;
  font-weight: 500;
}
.project-nav__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--ink);
}

footer.cs-footer {
  --footer-text: rgba(255,255,255,0.45);
  background: var(--ink);
  padding: 2.5rem 0;
  text-align: center;
}
footer.cs-footer p {
  font-size: 0.8rem;
  color: var(--footer-text);
  letter-spacing: 0.06em;
}
footer.cs-footer a { color: var(--brand); text-decoration: none; }
footer.cs-footer a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .pullquote__mark { margin-bottom: -2rem; }
  .hero__inner, .column, .chapter, .pullquote, .closing,
  .photo--col, .photo--duo, .photo--duo-wide {
    padding-left: 1.5rem; padding-right: 1.5rem;
  }
  .photo--wide { padding-left: 0; padding-right: 0; max-width: 100%; }
  .photo--wide figure.photo { border-radius: 0; }
  .photo--wide figcaption { padding-left: 1.5rem; padding-right: 1.5rem; }
  .hero { padding-top: 7rem; }
  .hero__meta { grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; }
  .chapter { grid-template-columns: 1fr; gap: 0.4rem; }
  .photo--duo, .photo--duo-wide { grid-template-columns: 1fr; }

  .artifact { padding: 0; margin: 2rem 0; }
  .artifact__stage, .artifact__intro { padding: 0 1.5rem; }
  .artifact--note .artifact__stage { grid-template-columns: 1fr; gap: 1.5rem; }
  .artifact-duo .artifact__stage { grid-template-columns: 1fr; }
  .artifact__media figure.photo { min-height: 320px; }
  .artifact__intro { grid-template-columns: 1fr; gap: 0.4rem; }

  .thoughts__inner { padding: 0 1.5rem; }
  .project-nav { grid-template-columns: 1fr; }
  .project-nav__item--next {
    text-align: left;
    border-left: none;
    border-top: 1px solid var(--rule);
  }
}
