/* ==========================================================================
   The 24 Fund — site styles
   Tokens live in :root so brand tweaks stay one-line edits.
   ========================================================================== */

:root {
  --ink:        #0a0a0a;
  --ink-soft:   #3d3d3d;
  --cardinal:   #8c1515;   /* Stanford cardinal — headline accent + active nav */
  --rule:       #c9c9c9;
  --rule-soft:  #e7e4df;   /* hairline between mosaic tiles */
  --hairline:   rgba(140, 21, 21, 0.34);  /* cardinal, under the header */
  --tile-overlay: rgba(72, 72, 72, 0.74);  /* the grey wash behind a hovered tile */
  --bg:         #ffffff;
  --footer-bg:  #000000;
  --footer-fg:  #ffffff;

  --font-display: "Lato", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Jost", "Helvetica Neue", Arial, sans-serif;

  --container: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

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

/* --------------------------------------------------------------- header -- */

/* Sticky. The shadow and the tighter padding only arrive once the page has
   actually moved, so the top of the page stays as flat and open as the
   original — the bar earns its weight on the way down. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding-block: 19px;
  border-bottom: 1px solid var(--hairline);
  transition: box-shadow 0.28s ease, padding 0.28s ease;
}

.site-header.is-stuck {
  padding-block: 12px;
  box-shadow: 0 12px 28px -14px rgba(10, 10, 10, 0.28);
}

.site-header.is-stuck .brand img { width: 92px; }

.brand img { transition: width 0.28s ease; }

/* The sentinel the observer watches. Zero-height, purely a scroll tripwire. */
.scroll-sentinel {
  position: absolute;
  top: 0;
  height: 1px;
  width: 100%;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .brand img { transition: none; }
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-block; line-height: 0; }
.brand img { width: 118px; height: auto; }

.nav {
  display: flex;
  gap: 40px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  transition: color 0.15s ease;
  position: relative;
  /* Padding lifts the touch target to ~44px; the negative margin keeps the
     visual layout exactly where it was. */
  padding-block: 10px;
  margin-block: -10px;
}

.nav a:hover { color: var(--cardinal); }

/* Active page. Colour alone would leave anyone with red-green colour blindness
   unable to tell which page they're on, so the rule carries the state too. */
.nav a[aria-current="page"] {
  color: var(--cardinal);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  height: 2px;
  background: var(--cardinal);
}

/* ------------------------------------------------- section label + rule -- */

.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.005em;
  margin: 0 0 10px;
}

.eyebrow::after {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  background: var(--rule);
  margin-top: 12px;
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  padding-block: clamp(40px, 5.5vw, 76px) clamp(56px, 9vw, 120px);
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 4.5vw, 70px);
  align-items: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 2.45vw, 2.2rem);
  line-height: 1.34;
  letter-spacing: -0.005em;
  margin: 0;
  max-width: 545px;
}

.hero h1 .accent { color: var(--cardinal); }

/* ------------------------------------------------------ portfolio tiles -- */

/* Homepage: tight 2x2 block, tiles abutting — matches the original layout. */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, var(--tile, 200px));
  gap: 0;
}

/* Companies page: four across, as on the original site. Fixed column counts
   rather than auto-fit, so the row length stays exactly four however many
   companies the list grows to. */
.tile-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.2vw, 30px);
}

.tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
}

.tile img,
.tile svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ------------------------------------------------------------ tile hover -- */

/* The logo pushes in behind a grey wash and the company name comes forward.
   Gated on (hover: hover) so touch devices never get stuck showing the card. */
.tile-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12%;
  text-align: center;
  color: #fff;
  background: var(--tile-overlay);
  opacity: 0;
  pointer-events: none;
}

.tile-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  line-height: 1.25;
}

.tile-founders {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: clamp(0.78rem, 0.95vw, 0.88rem);
  line-height: 1.35;
}

@media (hover: hover) {
  .tile.has-info img,
  .tile.has-info svg,
  .tile.has-info > span:not(.tile-info) {
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
  }

  .tile-info {
    transition: opacity 0.3s ease;
  }

  .tile.has-info:hover img,
  .tile.has-info:hover svg,
  .tile.has-info:hover > span:not(.tile-info) {
    transform: scale(1.22);
  }

  .tile.has-info:hover .tile-info { opacity: 1; }
}

/* No hover available: the names would otherwise be invisible to the reader,
   so keep them in the flow for assistive tech but off the painted page. */
@media (hover: none) {
  .tile-info {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile.has-info img,
  .tile.has-info svg,
  .tile.has-info > span:not(.tile-info) { transition: none; }
  .tile.has-info:hover img,
  .tile.has-info:hover svg,
  .tile.has-info:hover > span:not(.tile-info) { transform: none; }
}

/* Awaiting artwork: the company name set in type. Deliberately quiet so a
   half-filled grid still reads as a finished page. */
.tile--name {
  background: #f4f2ef;
  padding: 12% 10%;
  text-align: center;
}

.tile--name > span:not(.tile-info) {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.15vw, 1.05rem);
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

a.tile {
  transition: opacity 0.18s ease;
}
a.tile:hover { opacity: 0.72; }

/* ------------------------------------------------------------ tradition -- */

.tradition {
  padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 104px);
}

/* One track per fund, sized to whatever fits — the list grows by one a year,
   so it wraps into an even second row rather than stranding the newest mark. */
.tradition-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  align-items: center;
  justify-items: center;
  gap: clamp(32px, 4vw, 52px) clamp(18px, 2.5vw, 36px);
  margin-top: clamp(40px, 6vw, 76px);
}

.tradition-row img {
  height: 84px;
  width: auto;
  object-fit: contain;
}

/* The current fund sits in the row like any other — the wrapper is kept only
   as a hook if it ever needs marking again. */
.tradition-row .is-current {
  display: grid;
  place-items: center;
}

.tradition-row .is-current img { height: 84px; width: auto; }

/* ----------------------------------------------------------- portfolio -- */

.portfolio {
  padding-block: clamp(48px, 7vw, 96px) clamp(72px, 12vw, 176px);
}

.portfolio .tile-row { margin-top: clamp(22px, 3vw, 38px); }

/* --------------------------------------------------------------- footer -- */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding-block: clamp(48px, 7vw, 78px) 26px;
  font-size: 15px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
}

.footer-brand img { width: 94px; margin-bottom: 20px; }

.footer-brand p {
  margin: 0 0 20px;
  max-width: 26ch;
  line-height: 1.5;
}

.footer-col h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 12px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li + li { margin-top: 4px; }

.footer-col a {
  display: inline-block;
  text-decoration: none;
  transition: opacity 0.18s ease;
  padding-block: 11px;
  margin-block: -11px;
}
.footer-col a:hover { opacity: 0.7; }

.social {
  display: inline-flex;
  color: var(--footer-fg);
  padding: 12px;
  margin: -12px;
}
.social:hover { opacity: 0.7; }
.social svg { width: 19px; height: 19px; fill: currentColor; }

.colophon {
  margin-top: clamp(42px, 6vw, 74px);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0.66;
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1000px) {
  .tile-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .tile-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }
  .hero h1 { max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .site-header { padding-block: 24px 4px; }
  .brand img { width: 94px; }
  .nav { gap: 26px; font-size: 15px; }
  .tile-grid { --tile: min(42vw, 180px); }
  .tradition-row img { height: 62px; }
  .tradition-row .is-current img { height: 62px; }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ------------------------------------------------------- featured stories -- */

/* A square card per story: photo, a scrim, and the outlet's own headline over
   it. Scroll-snap does the paging, so it still works if the script never runs. */
.carousel { --card: clamp(280px, 34vw, 470px); width: var(--card); }

.carousel-track {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  width: var(--card);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: 18px;
}
.carousel-track::-webkit-scrollbar { display: none; }

.slide-item { flex: 0 0 var(--card); scroll-snap-align: center; }

.slide {
  position: relative;
  display: block;
  width: var(--card);
  height: var(--card);
  border-radius: 18px;
  overflow: hidden;
  background: var(--ink);
  text-decoration: none;
  color: #fff;
  isolation: isolate;
}

.slide-art {
  position: absolute;
  inset: 0;
  background: var(--bg, var(--ink));
  display: grid;
  place-items: center;
}

.slide-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.slide:hover .slide-photo { transform: scale(1.05); }

/* fallback when no photo exists yet */
.slide-mark { width: 46%; height: 46%; object-fit: contain; opacity: 0.9; }

/* The scrim is what makes white type legible over an unknown photo. Two stops
   so the headline sits on real density while the top of the image stays open. */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(8, 8, 9, 0.92) 0%,
    rgba(8, 8, 9, 0.72) 32%,
    rgba(8, 8, 9, 0.12) 62%,
    rgba(8, 8, 9, 0) 100%);
  z-index: 1;
}

.slide-text {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 20px;
}

.slide-kicker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.82;
}

.slide-head {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.98rem, 1.35vw, 1.16rem);
  line-height: 1.26;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.slide-dek {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.8;
}

.slide-source {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.68;
}
a.slide .slide-source::after { content: " \2197"; }

/* ------------------------------------------------------ carousel controls -- */



.dots {
  display: flex;
  justify-content: center;
  gap: 0;              /* each button carries its own hit area */
  margin-top: 12px;
}

.dot {
  width: 28px;         /* hit area — the visible dot is drawn by ::after */
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
  transition: background 0.2s, transform 0.2s;
}

.dot[aria-selected="true"]::after {
  background: var(--cardinal);
  transform: scale(1.3);
}

.dot:focus-visible { outline: 2px solid var(--cardinal); outline-offset: -4px; }

@media (max-width: 900px) {
  .carousel { --card: min(86vw, 400px); }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track { scroll-behavior: auto; }
  .slide-photo, .slide:hover .slide-photo { transition: none; transform: none; }
}

/* ------------------------------------------------------ entrance motion -- */

/* The hidden state is scoped to `.js`, which an inline script in <head> adds.
   No script, no hiding — the page renders complete. See assets/js/reveal.js. */
.js [data-anim],
.js [data-anim-group] > * {
  opacity: 0;
  transform: translateY(15px);
}

.js [data-anim].is-in,
.js [data-anim-group] > .is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.62s cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 0.62s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* The header shouldn't slide — it just settles in. */
.js .site-header[data-anim] { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-anim],
  .js [data-anim-group] > * { opacity: 1; transform: none; }
  .js [data-anim].is-in,
  .js [data-anim-group] > .is-in { transition: none; }
}
