/* Sub-pages (pages/*.html): an editorial layer on top of main.css.
   Big type, hairline rules, index lists and images that open up on scroll.
   Everything reads fine without JS; js/pages.js adds `.motion` to <html>
   and only then are the hidden starting states applied. */

:root {
  --p-gutter: max(1rem, calc((100% - var(--max-width)) / 2));
  --p-rule: 1px solid var(--border);
  --p-radius: 18px;
  --header-h: 110px;
}

.p-wrap {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.p-section {
  padding-block: clamp(4rem, 9vw, 8rem);
}

.p-section + .p-section {
  padding-top: 0;
}

/* First section right under the header: no empty screen before the content */
.p-section.p-section--top {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.p-section--band {
  padding-block: clamp(2rem, 4vw, 3rem);
}

/* Visually hidden, still read by screen readers */
.p-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Type ---------- */

.p-label {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-display {
  margin: 0;
  font-size: clamp(3.4rem, 11vw, 9.5rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--text);
  text-transform: none;
}

.p-title {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3.8vw, 3.2rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  text-transform: none;
}

.p-lead {
  margin: 0;
  max-width: 36ch;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.45;
  color: var(--muted);
}

.p-body p {
  max-width: 62ch;
  margin: 0 0 1.1rem;
}

.p-body p:last-child {
  margin-bottom: 0;
}

.p-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.p-after {
  margin-top: 2rem;
}

.p-label--gap {
  margin-top: clamp(4rem, 9vw, 7rem);
}

.p-link {
  display: inline-flex;
  gap: 0.5em;
  align-items: center;
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.1em;
}

/* ---------- Hero ---------- */

.p-hero {
  padding-top: clamp(3.5rem, 9vw, 8rem);
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
  border-bottom: var(--p-rule);
}

.p-hero-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem 3rem;
  margin-top: clamp(2rem, 5vw, 4rem);
}

.p-hero-meta {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-hero-logo {
  height: clamp(36px, 5vw, 56px);
  width: auto;
}

/* Words of a [data-rise] title slide up from behind their own line */
.rise {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.rise > span {
  display: inline-block;
}

/* ---------- Statement: large text that fills in word by word ---------- */

.p-statement {
  margin: 0;
  max-width: 28ch;
  font-size: clamp(1.7rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.motion [data-fill] .w {
  opacity: 0.15;
}

/* ---------- Media ---------- */

.p-media {
  margin: 0;
  overflow: hidden;
  border-radius: var(--p-radius);
  background: var(--border-soft);
}

.p-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-media--wide {
  aspect-ratio: 16 / 9;
}

.p-media--tall {
  aspect-ratio: 4 / 5;
}

.p-media--banner {
  aspect-ratio: 21 / 9;
}

.p-caption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Featured story ---------- */

.p-feature {
  display: block;
  color: var(--text);
}

.p-feature-body {
  margin-top: 1.5rem;
}

.p-feature-body .p-hero-meta {
  margin-bottom: 0.75rem;
}

.p-feature:hover .p-title {
  color: var(--accent);
}

/* ---------- Split: sticky label column + content ---------- */

.p-split {
  display: grid;
  gap: 1.5rem 3rem;
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-top: var(--p-rule);
}

@media (min-width: 861px) {
  .p-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }

  .p-split > :first-child {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
  }
}

.p-split--spaced {
  margin-top: clamp(3rem, 7vw, 6rem);
}

.p-split .p-media {
  margin-top: 2rem;
}

/* ---------- Stats ---------- */

.p-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-stat {
  border-top: var(--p-rule);
  padding-top: 1rem;
}

.p-stat-value {
  display: block;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.p-stat-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Index list ---------- */

.p-index {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: var(--p-rule);
}

.p-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 0.25rem 1.5rem;
  align-items: baseline;
  padding: clamp(1.25rem, 2.4vw, 2rem) 0;
  border-top: var(--p-rule);
  color: var(--text);
}

a.p-row:hover {
  color: var(--accent);
}

.p-row-num {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.p-row-title {
  font-size: clamp(1.4rem, 3.2vw, 2.6rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

a.p-row:hover .p-row-title {
  transform: translateX(0.6rem);
}

.p-row-meta {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.p-row-sub {
  grid-column: 2 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.p-row-thumb {
  display: none;
}

/* Quiet lists for long titles (publications, talks) */
.p-index--compact .p-row {
  padding: clamp(1rem, 1.8vw, 1.4rem) 0;
}

.p-index--compact .p-row-title {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.4;
  letter-spacing: 0;
}

.p-index--compact .p-row-sub {
  font-size: 0.875rem;
  line-height: 1.55;
}

.p-index--compact a.p-row:hover .p-row-title {
  transform: none;
}

/* Phones (and touch screens) get the picture in the row instead of the hover preview */
@media (max-width: 760px), (hover: none) {
  .p-row.p-row--peek {
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
  }

  .p-row--peek .p-row-num {
    display: none;
  }

  .p-row--peek .p-row-thumb {
    display: block;
    grid-row: span 3;
    width: 88px;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
  }

  .p-row--peek .p-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .p-row--peek .p-row-meta,
  .p-row--peek .p-row-sub {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .p-row {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }

  .p-row-meta,
  .p-row-sub {
    grid-column: 2;
    text-align: left;
  }
}

/* Floating image that follows the pointer over an index list */
.p-peek {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  width: clamp(240px, 24vw, 360px);
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.p-peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Logo tiles inside index rows */
.p-row--logo {
  grid-template-columns: 12rem minmax(0, 1fr) auto;
  align-items: center;
}

/* The logo files are wide white cards, so show them whole at their own proportions */
.p-row-logo {
  grid-row: span 2;
  width: 12rem;
  aspect-ratio: 701 / 390;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.p-row-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 760px) {
  .p-row.p-row--logo {
    grid-template-columns: 7.5rem minmax(0, 1fr);
  }

  .p-row-logo {
    width: 7.5rem;
    grid-row: span 3;
  }
}

.p-row-title a {
  color: inherit;
}

.p-row-title a:hover,
.p-row-meta a:hover {
  color: var(--accent);
}

.p-row-meta a {
  color: var(--muted);
}

.p-icon-link {
  display: inline-flex;
  margin-left: 0.6rem;
  vertical-align: middle;
}

.p-icon-link .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.p-row--current {
  background: linear-gradient(90deg, rgba(131, 88, 38, 0.08), transparent 70%);
}

.p-tag {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---------- Timeline ---------- */

.p-timeline {
  display: grid;
  gap: 0 3rem;
}

.p-year {
  display: none;
}

.p-chapter {
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: var(--p-rule);
}

.p-chapter-year {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.p-chapter .p-media {
  margin-top: 2rem;
}

@media (min-width: 861px) {
  .motion .p-timeline {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  }

  .motion .p-year {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
    margin: 0;
    padding-top: clamp(2rem, 5vw, 3.5rem);
    font-size: clamp(5rem, 13vw, 11rem);
    font-weight: 600;
    line-height: 0.9;
    letter-spacing: -0.05em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
  }

  .motion .p-chapters {
    grid-column: 2;
    grid-row: 1;
  }

  .motion .p-chapter {
    min-height: 60vh;
  }

  .motion .p-chapter-year {
    display: none;
  }
}

/* ---------- Horizontal strip ---------- */

.p-strip {
  overflow: hidden;
  padding-block: clamp(3rem, 6vw, 5rem);
}

.p-strip-track {
  display: flex;
  gap: clamp(1rem, 2vw, 1.75rem);
  padding-inline: var(--p-gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.p-strip-track::-webkit-scrollbar {
  display: none;
}

.p-strip-item {
  flex: 0 0 auto;
  width: clamp(240px, 34vw, 520px);
  margin: 0;
  scroll-snap-align: start;
}

.p-strip-item .p-media {
  aspect-ratio: 4 / 5;
}

.p-strip-item:nth-child(3n + 2) .p-media {
  aspect-ratio: 4 / 3;
}

@media (min-width: 861px) {
  .motion .p-strip {
    height: calc(100svh - var(--header-h));
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .motion .p-strip-track {
    overflow: visible;
    align-items: center;
  }

  .motion .p-strip-item {
    width: auto;
  }

  .motion .p-strip-item .p-media {
    height: min(58vh, 560px);
  }
}

/* ---------- Marquee of words ---------- */

.p-marquee {
  overflow: hidden;
  padding-block: clamp(2rem, 4vw, 3rem);
  border-block: var(--p-rule);
  white-space: nowrap;
}

.p-marquee-track {
  display: inline-flex;
  gap: 3rem;
  font-size: clamp(1.8rem, 4.5vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.p-marquee-track span::after {
  content: "·";
  margin-left: 3rem;
  color: var(--accent);
}

.motion .p-marquee-track {
  animation: p-marquee 60s linear infinite;
}

@keyframes p-marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Dark band ---------- */

.p-dark {
  background: var(--al-green);
  color: var(--al-beige);
}

.p-dark .p-label,
.p-dark .p-lead,
.p-dark .p-row-meta,
.p-dark .p-row-sub {
  color: rgba(227, 217, 202, 0.7);
}

.p-dark .p-display,
.p-dark .p-title {
  color: var(--al-beige);
}

.p-dark a {
  color: var(--al-beige);
}

.p-upcoming {
  display: grid;
  gap: 1.5rem 3rem;
  align-items: end;
}

@media (min-width: 861px) {
  .p-upcoming {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

.p-upcoming-date {
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.p-upcoming-date small {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.25em;
  line-height: 1.3;
  letter-spacing: 0;
  font-weight: 500;
  opacity: 0.7;
}

/* ---------- Partners ---------- */

.p-partner {
  display: grid;
  gap: 2rem 3rem;
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-top: var(--p-rule);
}

@media (min-width: 861px) {
  .p-partner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  }

  .p-partner-org {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
  }
}

.p-partner-org .p-row-num {
  display: block;
  margin-bottom: 1rem;
}

.p-partner-name {
  margin: 0 0 0.4rem;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text);
  text-transform: none;
}

.p-partner-sub {
  margin: 0 0 1rem;
  color: var(--muted);
}

.p-partner-logo {
  max-height: 56px;
  max-width: 180px;
  width: auto;
  margin-top: 1.5rem;
  mix-blend-mode: multiply;
}

.p-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-person-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  background: var(--border-soft);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.p-person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.p-person:hover .p-person-photo img {
  transform: scale(1.04);
}

.p-person-name {
  margin: 0.75rem 0 0.15rem;
  font-weight: 600;
  line-height: 1.25;
}

.p-person-contact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.p-person-contact .icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
}

/* ---------- Chips ---------- */

.p-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.p-chips li {
  padding: 0.45em 1.1em;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Next page ---------- */

.p-next {
  display: block;
  padding-block: clamp(3rem, 8vw, 6rem);
  border-top: var(--p-rule);
  color: var(--text);
}

.p-next:hover {
  color: var(--accent);
}

.p-next .p-display {
  color: inherit;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.p-next:hover .p-display {
  transform: translateX(1rem);
}

/* ---------- Illustrations and placeholders ---------- */

.p-illustration {
  margin: 2rem 0 0;
}

.p-illustration img {
  width: 100%;
}

.p-placeholder {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(-45deg, var(--border-soft) 0 12px, transparent 12px 24px), var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-placeholder span {
  padding: 0.5em 1em;
  border-radius: 999px;
  background: var(--bg);
}

.p-row--draft .p-row-title {
  color: var(--muted);
}

/* ---------- Tabs (Output) ----------
   Without JS every panel shows, one under the other, each with its own heading. */

.p-tabs {
  display: none;
}

.tabs-ready .p-tabs {
  display: flex;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: var(--p-rule);
  overflow-x: auto;
  scrollbar-width: none;
}

.p-tab {
  flex: none;
  margin: 0 0 -1px;
  padding: 0 0 0.7em;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--muted);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.p-tab:hover {
  opacity: 1;
}

.p-tab[aria-selected="true"] {
  color: var(--text);
  opacity: 1;
  border-bottom-color: var(--accent);
}

.p-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.p-panel + .p-panel {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.p-panel-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-transform: none;
}

.tabs-ready .p-panel + .p-panel {
  margin-top: 0;
}

.tabs-ready .p-panel-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.p-panel .p-split {
  padding-top: 0;
  border-top: 0;
}

.p-panel .p-upcoming-date {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5rem);
}
