/* ──────────────────────────────────────────────────────────────────
   People & Places Research — Design System v1.0
   ──────────────────────────────────────────────────────────────────
   See design-system.md for the prose specification.
   Layout: tokens → reset → typography → header/footer → primitives
        → components → motion → responsive → reduced-motion.
   ────────────────────────────────────────────────────────────────── */

/* ── 1. Tokens ─────────────────────────────────────────────────── */
:root {
  /* Colour */
  --ink:      #0E1116;
  --paper:    #FAF7F2;
  --burgundy: #7B2D3A;
  --slate:    #5C5C5C;
  --stone:    #E6E0D6;

  /* Layout */
  --max-page:    1100px;
  --max-long:    1040px;
  --max-prose:   70ch;
  --max-content: 60ch;

  /* Motion */
  --ease-settle: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-hover:  200ms;
  --t-pop:    260ms;
  --t-reveal: 720ms;

  /* Type stack */
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ── 2. Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 40px 28px 80px;
}

/* ── 3. Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  font-size: 52px;
  line-height: 1.06;
  letter-spacing: -0.014em;
  margin: 0 0 28px;
  max-width: 18ch;
}

h2 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 56px 0 20px;
  max-width: var(--max-prose);
}

h3 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 28px 0 12px;
  max-width: var(--max-prose);
}

p {
  margin: 0 0 18px;
  max-width: var(--max-prose);
}

.lede {
  font-size: 21px;
  line-height: 1.5;
  color: var(--slate);
  font-style: italic;
  margin: 0 0 48px;
  max-width: 50ch;
}

a {
  color: var(--burgundy);
  text-decoration: none;
  border-bottom: 1px solid var(--burgundy);
  padding-bottom: 1px;
  transition: border-bottom-width 0.1s;
}
a:hover { border-bottom-width: 2px; }

em, i { font-style: italic; }
strong, b { font-weight: 700; }

ul {
  max-width: var(--max-prose);
  line-height: 1.65;
  padding-left: 24px;
  margin: 0 0 20px;
}
ul li { margin-bottom: 6px; }

/* Monospace eyebrow — utility label. Burgundy by default. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy);
}

/* ── 4. Header & lockup ────────────────────────────────────────── */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 28px 28px;
  max-width: var(--max-page);
  margin: 0 auto;
  border-bottom: 0.5px solid var(--stone);
  margin-bottom: 0;
}

header.site .brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border-bottom: none;
  padding-bottom: 0;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: var(--ink);
  display: block;
  transition: color var(--t-hover) ease-out;
}
.brand-emblem .ch,
.brand-emblem .hd { fill: currentColor; }
header.site .brand:hover .brand-emblem { color: var(--burgundy); }

.brand-text {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  flex-direction: column;
}

header.site nav { display: flex; gap: 28px; }
header.site nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  font-size: 16px;
  transition: color var(--t-hover) ease-out;
}
header.site nav a:hover,
header.site nav a[aria-current="page"] {
  color: var(--burgundy);
  border-bottom-color: var(--burgundy);
}

/* ── 5. Footer ─────────────────────────────────────────────────── */
footer.site {
  max-width: var(--max-page);
  margin: 96px auto 0;
  padding: 32px 28px 32px;
  border-top: 0.5px solid var(--stone);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--slate);
}
footer.site .copy { font-size: 14px; }
footer.site nav { display: flex; gap: 24px; }
footer.site nav a {
  color: var(--slate);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  font-size: 14px;
}
footer.site nav a:hover {
  color: var(--burgundy);
  border-bottom-color: var(--burgundy);
}

/* ── 6. Illustration primitives ────────────────────────────────── */

/* Full emblem — used at three scales (header / hero watermark / page mark). */
.emblem-svg .ch,
.emblem-svg .hd { fill: var(--burgundy); }

/* Watermark: positioned absolutely in its parent, large + low-opacity. */
.emblem-watermark {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.13;
}
.emblem-watermark svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Wedge — one chevron arm, used as a directional/wayfinding marker.
   Not as a section divider. */
.wedge {
  width: 14px;
  height: 10px;
  display: block;
  color: var(--burgundy);
}
.wedge path {
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: square;
  stroke-linejoin: miter;
  fill: none;
  transition: stroke-width var(--t-hover) ease-out;
}

/* Ring bullet — hollow Burgundy ring, list-marker only. Centre aligns
   with first-line text x-height middle (translateY(2px) for 17px body). */
.ring-bullet {
  width: 12px;
  height: 12px;
  display: block;
  transform: translateY(2px);
  flex-shrink: 0;
}
.ring-bullet circle {
  fill: none;
  stroke: var(--burgundy);
  stroke-width: 5;
}

.ring-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  max-width: var(--max-content);
}
.ring-list > li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 18px;
  align-items: baseline;
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
}

/* ── 7. Hero block (homepage) ──────────────────────────────────── */
.home-hero {
  position: relative;
  padding: 24px 0 32px;
  margin-bottom: 24px;
  overflow: visible;
}
.home-hero .copy { position: relative; z-index: 2; }
.home-hero h1 {
  font-size: 68px;
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0 0 28px;
  max-width: 14ch;
}
.home-hero .hero-sub {
  font-size: 19px;
  line-height: 1.55;
  color: var(--slate);
  max-width: 52ch;
  margin: 0;
}
.home-hero .emblem-watermark {
  right: -48px;
  top: -24px;
  width: 540px;
  height: 540px;
}

/* ── 8. Pillar tiles ───────────────────────────────────────────── */
.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  margin: 88px 0 56px;
  padding: 48px 0 8px;
  border-top: 0.5px solid var(--stone);
  border-bottom: 0.5px solid var(--stone);
}
@media (min-width: 760px) {
  .pillars { grid-template-columns: repeat(3, 1fr); gap: 56px; }
}

.pillar .pillar-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--burgundy);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.pillar .pillar-mark .wedge {
  transition: transform var(--t-hover) var(--ease-settle);
}
.pillar:hover .pillar-mark .wedge { transform: translateX(2px); }
.pillar:hover .pillar-mark .wedge path { stroke-width: 5; }

.pillar h3 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  font-weight: 400;
  margin: 0 0 12px;
  max-width: none;
}
.pillar p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--slate);
  margin: 0;
  max-width: none;
}

/* ── 9. Take-part pointer ─────────────────────────────────────── */
.take-part-pointer {
  margin: 32px 0 0;
  font-size: 16px;
  color: var(--slate);
  max-width: none;
}
.take-part-pointer .pointer-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--burgundy);
  border-bottom: 1px solid var(--burgundy);
  padding-bottom: 1px;
  transition: border-bottom-width 0.1s;
}
.take-part-pointer .pointer-link:hover { border-bottom-width: 2px; }
.take-part-pointer .pointer-arrow {
  display: inline-block;
  transition: transform var(--t-hover) var(--ease-settle);
}
.take-part-pointer .pointer-link:hover .pointer-arrow {
  transform: translateX(3px);
}

/* ── 10. Long-form layout (rail + content) ─────────────────────── */
.long-form {
  max-width: var(--max-long);
  margin: 0 auto;
  padding: 16px 28px 80px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 56px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 32px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
}
.rail-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 14px 6px;
}
.rail-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  text-decoration: none;
  border: 0;
  padding: 7px 6px;
  margin: 0 -6px;
  transition:
    color var(--t-hover) ease-out,
    transform var(--t-hover) var(--ease-settle);
}
.rail-item .wedge {
  width: 18px; height: 13px;
  display: block;
  color: var(--stone);
  transition: color var(--t-hover) ease-out;
}
.rail-item:hover {
  color: var(--burgundy);
  transform: translateX(3px);
}
.rail-item:hover .wedge { color: var(--burgundy); }
.rail-item:hover .wedge path { stroke-width: 5; }
.rail-item.active { color: var(--burgundy); }
.rail-item.active .wedge { color: var(--burgundy); }
.rail-item.active .wedge path { stroke-width: 6; }

.long-content { max-width: var(--max-content); }
.long-content h1 {
  font-size: 56px;
  line-height: 1.04;
  letter-spacing: -0.014em;
  margin: 0 0 28px;
  max-width: 14ch;
}
.long-content .lede {
  font-size: 21px;
  line-height: 1.5;
  color: var(--slate);
  margin: 0 0 56px;
  max-width: 50ch;
  font-style: italic;
}
.long-content article p,
.long-content section p {
  font-size: 17px;
  line-height: 1.72;
  margin: 0 0 22px;
  color: var(--ink);
  max-width: var(--max-content);
}
.long-content h2 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-weight: 400;
  margin: 96px 0 28px;
  max-width: none;
}
.long-content article > h2:first-child,
.long-content section > h2:first-child {
  margin-top: 12px;
}
.long-content a {
  color: var(--burgundy);
  border-bottom: 1px solid var(--burgundy);
  padding-bottom: 1px;
}

/* ── 11. Forms ─────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 24px;
  max-width: 540px;
}
.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--slate);
}
.form-group input,
.form-group textarea {
  width: 100%;
  font-family: var(--font-serif);
  font-size: 16px;
  padding: 10px 12px;
  border: 0.5px solid var(--slate);
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
}
.form-group textarea {
  resize: vertical;
  min-height: 140px;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--burgundy);
  outline: 1px solid var(--burgundy);
  outline-offset: -1px;
}
button.submit {
  font-family: var(--font-serif);
  font-size: 16px;
  padding: 12px 28px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background var(--t-hover) ease-out;
}
button.submit:hover { background: var(--burgundy); }

.ms-forms-embed {
  margin: 24px 0;
  max-width: 700px;
}
.ms-forms-embed iframe {
  width: 100%;
  height: 800px;
  border: 0.5px solid var(--stone);
  background: var(--paper);
}

/* ── 12. Motion ────────────────────────────────────────────────── */

/* Page entrance reveal */
@keyframes ppr-settle {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.reveal {
  animation: ppr-settle var(--t-reveal) var(--ease-settle) both;
  animation-delay: var(--delay, 0ms);
}

/* Emblem entrance: heads first clockwise, then chevrons */
@keyframes ppr-pop {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.emblem-svg .hd,
.emblem-svg .ch {
  animation: ppr-pop var(--t-pop) var(--ease-settle) both;
}
.emblem-svg .hd-0 { animation-delay:  80ms; }
.emblem-svg .hd-1 { animation-delay: 130ms; }
.emblem-svg .hd-2 { animation-delay: 180ms; }
.emblem-svg .hd-3 { animation-delay: 230ms; }
.emblem-svg .hd-4 { animation-delay: 280ms; }
.emblem-svg .hd-5 { animation-delay: 330ms; }
.emblem-svg .ch-0 { animation-delay: 420ms; }
.emblem-svg .ch-1 { animation-delay: 480ms; }
.emblem-svg .ch-2 { animation-delay: 540ms; }

/* ── 13. Responsive ────────────────────────────────────────────── */
@media (max-width: 980px) {
  .home-hero h1 { font-size: 52px; }
  .home-hero .emblem-watermark {
    width: 440px; height: 440px;
    right: -64px; top: -8px;
  }
}

@media (max-width: 800px) {
  .long-form {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 12px 22px 56px;
  }
  .rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding-top: 4px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid var(--stone);
  }
  .rail-label { width: 100%; margin: 0 0 6px; }
  .long-content h1 { font-size: 36px; }
  .long-content .lede { font-size: 18px; margin-bottom: 36px; }
  .long-content article p,
  .long-content section p { font-size: 16px; }
  .long-content h2 { font-size: 26px; margin-top: 64px; }
}

@media (max-width: 720px) {
  .page { padding: 24px 22px 64px; }

  header.site {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 22px 22px;
  }
  .brand-emblem { width: 36px; height: 36px; }
  .brand-text { font-size: 13px; }
  header.site nav { flex-wrap: wrap; gap: 18px; }
  header.site nav a { font-size: 15px; }

  h1 { font-size: 36px; }
  .home-hero h1 { font-size: 40px; line-height: 1.08; }
  .home-hero .hero-sub { font-size: 17px; }
  .lede { font-size: 17px; }
  h2 { font-size: 24px; margin-top: 44px; }
  h3 { font-size: 18px; }

  .home-hero .emblem-watermark {
    width: 360px; height: 360px;
    right: -90px; top: -40px;
    opacity: 0.08;
  }
  .pillars { margin: 56px 0 32px; padding: 36px 0 0; gap: 36px; }
  .pillar h3 { font-size: 19px; }
  .pillar p { font-size: 15px; }

  footer.site {
    margin-top: 64px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .home-hero h1 { font-size: 34px; }
  .home-hero .emblem-watermark {
    width: 300px; height: 300px;
    right: -110px; top: -30px;
  }
}

/* ── 14. Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .emblem-svg .hd,
  .emblem-svg .ch { opacity: 1; }
  html { scroll-behavior: auto; }
}
