/* ============================================================
 * research.trophy.inc - v3 "academic abstract" page
 *
 * One spread: five-element abstract left, "pages thrown on a
 * table" report collage right (cover in front, map + submarket
 * table pages peeking behind).
 * Canon: design-system.md (report artifact palette + Geist).
 * Shared tokens.css supplies the slot contract; overrides below.
 * 10px-rem root (set by shared reset.css). All sizing rem;
 * hairlines stay 1px by convention.
 * ============================================================ */

:root {
  /* ---- Site palette (from the report artifact's locked design system) ---- */
  --cream-bg: #fdfcf9;
  --ink: #0d0d0c;
  --ink-soft: #3d3a35;
  --muted: #8a8580;
  --chip: #fbeec5;
  --wash: rgba(250, 179, 0, 0.1);
  --edge: rgba(13, 13, 12, 0.14);
  --edge-soft: rgba(13, 13, 12, 0.08);

  /* On-dark (footer band) companions - kept light enough for AA on --ink */
  --cream-soft: rgba(253, 252, 249, 0.78);
  --cream-faint: rgba(253, 252, 249, 0.56);
  --edge-on-dark: rgba(253, 252, 249, 0.16);

  /* Cover "product shot" depth - soft, layered, low-opacity */
  --shadow-cover: 0 0.2rem 0.6rem rgba(13, 13, 12, 0.05), 0 1.8rem 4.4rem rgba(13, 13, 12, 0.09);

  /* ---- Shared slot overrides ---- */
  --bg-base: var(--cream-bg);
  --page-bg: var(--cream-bg);
  --bg-dark: var(--ink);
  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ls-caps: 0.26em;

  /* ---- Layout ---- */
  --nav-h: 7.6rem;
  --gutter: clamp(2.4rem, 6.5vw, 10rem);
}

body {
  background: var(--cream-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.7rem;
  line-height: 1.5;
}

.container {
  max-width: 144rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Focus + skip link ---- */

:focus-visible {
  outline: 2px solid var(--trophy-yellow);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 20;
  padding: 1rem 1.6rem;
  background: var(--ink);
  color: var(--cream-bg);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}

.skip-link:focus-visible {
  top: 0;
}

/* ============================================================
 * 1 · Nav
 * ============================================================ */

.nav {
  border-bottom: 1px solid var(--edge-soft);
  background: var(--cream-bg);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.4rem;
  height: var(--nav-h);
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  padding-block: 1.2rem;
}

.nav__logo img {
  height: 2.2rem;
  width: auto;
  display: block;
}

.nav__items {
  display: flex;
  align-items: center;
  gap: clamp(1.6rem, 2.6vw, 3.6rem);
}

.nav__link {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 1.5rem 0.2rem; /* comfortable touch target */
}

.nav__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.5em;
  text-decoration-thickness: 1px;
}

/* ============================================================
 * Buttons (canon: solid ink ground, cream text, radius 0;
 * hover flips to Trophy yellow + ink)
 * ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  white-space: nowrap; /* a wrapped button label reads broken */
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.btn--primary {
  background: var(--ink);
  color: var(--cream-bg);
  padding: 1.7rem 3rem 1.7rem 3.2rem; /* tracked caps read off-center; nudge left pad */
}

.btn--primary:hover {
  background: var(--trophy-yellow);
  color: var(--ink);
}

.btn--nav {
  padding: 1.3rem 2rem 1.3rem 2.2rem;
  font-size: 1.1rem;
}

/* ============================================================
 * 2 · Abstract spread
 * ============================================================ */

.spread {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  padding-block: clamp(4.8rem, 7vh, 9.6rem);
}

.spread__grid {
  display: grid;
  grid-template-columns: minmax(0, 53fr) minmax(0, 47fr);
  gap: clamp(4.8rem, 6vw, 9.6rem);
  align-items: center;
  width: 100%;
}

/* ---- Left column: the abstract ---- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--ink);
}

.eyebrow__square {
  width: 1.4rem;
  height: 1.4rem;
  background: var(--trophy-yellow);
  flex: none;
}

.spread__title {
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 2.4rem + 3.4vw, 6.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
  max-width: 14em;
  margin-top: 2.2rem;
}

.spread__abstract {
  margin-top: 3.2rem;
  max-width: 52rem;
  font-size: clamp(1.8rem, 1.5rem + 0.5vw, 2.1rem);
  line-height: 1.65;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* The one allowed flourish: display-scale 88% with a yellow stroke.
 * Kept moderate (1.35em, lh 1) so it doesn't blow out the line box,
 * underline kept thin per the hairline canon. */
.spread__stat {
  font-size: 1.35em;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-decoration: underline;
  text-decoration-color: var(--trophy-yellow);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.12em;
}

.spread__btn {
  margin-top: 4rem;
}

/* The one quiet meta line under the button */
.spread__meta {
  margin-top: 2rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---- Right column: pages thrown on a table ----
 * Cover in front (in normal flow - it defines the collage height),
 * map + submarket-table pages absolutely positioned behind, each
 * with its own small counter-rotation and side/top peek. Rotations
 * stay in the 1.5-4deg band so it reads composed, not scattered. */

.spread__cover {
  justify-self: end;
  width: 100%;
  max-width: 50rem;
}

.collage {
  position: relative;
}

.collage__page {
  display: block;
}

.collage__page img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--cream-bg);
  border: 1px solid var(--edge); /* the site's one edge treatment */
}

/* Cover - front of the stack */
.collage__page--cover {
  position: relative;
  z-index: 3;
  width: 68%;
  margin: 6rem auto 0;
  transform: rotate(-2deg);
}

.collage__page--cover img {
  box-shadow: var(--shadow-cover);
}

/* Map page - behind, peeking upper-left, counter-rotated */
.collage__page--map {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 1%;
  width: 58%;
  transform: rotate(-3.5deg);
}

/* Submarket-table page - behind, peeking upper-right */
.collage__page--table {
  position: absolute;
  z-index: 2;
  top: 2.6rem;
  right: 1%;
  width: 58%;
  transform: rotate(3deg);
}

.collage__page--map img,
.collage__page--table img {
  box-shadow: 0 0.2rem 0.5rem rgba(13, 13, 12, 0.04), 0 1.2rem 3rem rgba(13, 13, 12, 0.07);
}

/* ============================================================
 * 3 · Footer - slim dark band
 * ============================================================ */

.footer {
  background: var(--ink);
  color: var(--cream-soft);
  padding-block: 3.6rem 4rem;
}

/* The relocated owner CTA - the one conversion line, first in the band */
.footer__owner {
  font-size: 1.5rem;
  line-height: 1.6;
  color: var(--cream-soft);
  margin-bottom: 2rem;
}

.footer__owner-link {
  color: var(--trophy-yellow); /* canon: yellow links on dark grounds */
  font-weight: 600;
  text-decoration: none;
}

.footer__owner-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}

.footer__note {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--cream-faint);
  max-width: 88rem;
  text-wrap: pretty;
}

.footer__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1.2rem 3.2rem;
  margin-top: 2.4rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--edge-on-dark);
}

.footer__id,
.footer__contact {
  color: var(--cream-soft); /* explicit - shared typography.css paints p in dark ink */
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.footer__contact a {
  color: var(--trophy-yellow); /* canon: yellow links on dark grounds */
  text-decoration: none;
}

.footer__contact a:hover {
  text-decoration: underline;
  text-underline-offset: 0.4em;
  text-decoration-thickness: 1px;
}

/* ============================================================
 * Motion - single restrained load reveal on the spread.
 * CSS-only (runs without JS); two groups, staggered once.
 * ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  @keyframes spread-rise {
    from {
      opacity: 0;
      transform: translateY(1.6rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .spread__text {
    animation: spread-rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  /* Collage pages appear one by one, back to front - map, then table, then
     the cover lands on top last (Or, 2026-07-07). Animates the individual
     `translate` property + opacity so the pages' `transform: rotate()` is
     never clobbered mid-animation. */
  @keyframes page-rise {
    from {
      opacity: 0;
      translate: 0 1.8rem;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }

  .collage__page--map {
    animation: page-rise 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.18s both;
  }

  .collage__page--table {
    animation: page-rise 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.42s both;
  }

  .collage__page--cover {
    animation: page-rise 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.66s both;
  }
}

/* ============================================================
 * Responsive
 * ============================================================ */

@media (max-width: 899px) {
  .spread {
    align-items: flex-start;
    min-height: 0;
    padding-block: 5.6rem 7.2rem;
  }

  .spread__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 6.4rem;
  }

  .spread__cover {
    justify-self: start;
    max-width: 38rem;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 6.4rem;
  }

  /* Three-item nav collapses by dropping the text links (About = the
   * logo's destination; Contact repeats in the closer + footer).
   * The one action that matters - Download - stays. */
  .nav__link {
    display: none;
  }

  .nav__logo img {
    height: 1.9rem;
  }

  /* A solid ink slab overpowers the logo at this width - the nav download
   * goes hairline-outline (canon secondary style), same 44px tap height. */
  .btn--nav {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
  }

  .btn--nav:hover {
    background: var(--trophy-yellow);
    color: var(--ink);
    border-color: var(--ink);
  }

  .spread {
    padding-block: 4.4rem 6.4rem;
  }

  /* Tighten the collage's vertical offsets at phone scale */
  .collage__page--cover {
    margin-top: 4.4rem;
  }

  .collage__page--table {
    top: 2rem;
  }

  .footer__row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .nav__inner {
    gap: 1.2rem;
  }

  .nav__logo img {
    height: 1.8rem;
  }

  .btn--nav {
    padding: 1.2rem 1.2rem 1.2rem 1.4rem;
    font-size: 1rem;
    letter-spacing: 0.18em; /* keeps the single-line label inside 320px */
  }
}
