/* AMS Fund
   Voice: heritage, steady, on-chain.
   Marcellus (flared, engraved) for display and big figures.
   Public Sans for reading, labels and exact figures. */

@font-face {
  font-family: "Marcellus";
  src: url("/fonts/Marcellus.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("/fonts/PublicSans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* White page, deep navy ink, one fresh green. Neutrals lean toward the navy hue. */
  --paper: oklch(0.995 0.002 250);
  --paper-2: oklch(0.967 0.008 245);
  --ink: oklch(0.28 0.07 252);
  --ink-2: oklch(0.43 0.04 252);
  --ink-3: oklch(0.52 0.03 252);
  --rule: oklch(0.91 0.01 250);
  --accent: oklch(0.72 0.14 148);
  --accent-ink: oklch(0.5 0.12 150);

  --night: oklch(0.3 0.08 252);
  --night-2: oklch(0.35 0.08 252);
  --on-night: oklch(0.985 0.004 250);
  --on-night-2: oklch(0.83 0.03 250);
  --night-rule: oklch(0.42 0.07 252);

  /* Chart series, validated as a pair on the white surface (dataviz validator: all checks pass). */
  --series-fund1: oklch(0.48 0.13 255);
  --series-fund2: oklch(0.64 0.14 150);

  --font-display: "Marcellus", "Optima", "Candara", serif;
  --font-body: "Public Sans", "Helvetica Neue", "Segoe UI", sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.25rem, 1.12rem + 0.55vw, 1.5rem);
  --step-2: clamp(1.75rem, 1.35rem + 1.7vw, 2.75rem);
  --step-3: clamp(2.5rem, 1.5rem + 4.3vw, 5.5rem);

  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  --gutter: clamp(16px, 4vw, 40px);
  --section-pad: clamp(var(--space-3xl), 9vw, 144px);
  --label-col: minmax(0, 12rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--space-md);
  top: -100px;
  padding: var(--space-xs) var(--space-md);
  background: var(--ink);
  color: var(--paper);
  z-index: 20;
}

.skip:focus {
  top: var(--space-md);
}

/* The amber bar: a running mark across the top of every page. */
.topbar {
  height: 6px;
  background: var(--accent);
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding-block: var(--space-lg);
}

.title {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.title .slash {
  color: var(--ink-3);
  margin-inline: 0.12em;
}

.nav-desktop ol {
  display: flex;
  gap: var(--space-xl);
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.nav-desktop a {
  text-decoration: none;
  color: var(--ink-2);
  transition: color 160ms var(--ease-out);
}

.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  color: var(--ink);
}

.nav-desktop a[aria-current="page"] .label {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.idx {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-right: 0.35em;
}

.menu-btn {
  display: none;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  padding: 8px 16px;
  min-height: 44px;
  cursor: pointer;
}

/* ---------- Mobile menu (popover, no JS needed to open or close) ---------- */

.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
}

.menu-head {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-lg) var(--gutter) 0;
}

.menu-close {
  position: relative;
  width: 48px;
  height: 48px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink);
}

.menu-close::before,
.menu-close::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 23px;
  width: 26px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
}

.menu-close::after {
  transform: rotate(-45deg);
}

.menu-list {
  list-style: none;
  padding: var(--space-3xl) var(--gutter) var(--space-3xl);
}

.menu-list a {
  display: block;
  padding-block: var(--space-md);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 9vw + 0.5rem, 3.75rem);
  line-height: 1.15;
  color: var(--ink-3);
  text-decoration: none;
}

.menu-list a[aria-current="page"] {
  color: var(--ink);
}

.menu-foot {
  padding: 0 var(--gutter) var(--space-2xl);
  color: var(--ink-3);
  font-size: 0.9375rem;
}

@media (prefers-reduced-motion: no-preference) {
  .menu {
    transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out), overlay 260ms allow-discrete, display 260ms allow-discrete;
    opacity: 0;
    transform: translateY(-8px);
  }

  .menu:popover-open {
    opacity: 1;
    transform: none;
  }

  @starting-style {
    .menu:popover-open {
      opacity: 0;
      transform: translateY(-8px);
    }
  }
}

/* ---------- Shared section frame ---------- */

.section {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: var(--space-2xl);
  padding-block: var(--section-pad);
  border-top: 1px solid var(--rule);
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 0.6em;
}

/* ---------- Home: intro ---------- */

.intro {
  padding-top: clamp(var(--space-3xl), 9vw, 152px);
  padding-bottom: var(--section-pad);
}

.intro h1 {
  font-size: var(--step-3);
  line-height: 1.04;
  letter-spacing: -0.012em;
  max-width: 17ch;
}

.intro h1 em {
  font-style: normal;
  color: var(--accent-ink);
}

.intro-copy {
  margin-top: var(--space-2xl);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 46ch;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: var(--space-xl) var(--space-lg);
  margin-top: clamp(var(--space-3xl), 7vw, 112px);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--ink);
}

.facts dt {
  font-size: var(--step--1);
  color: var(--ink-3);
  margin-bottom: var(--space-xs);
}

/* Figures use Public Sans: Marcellus draws "1" like a capital I. */
.facts dd {
  font-size: var(--step-2);
  font-weight: 300;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
  line-height: 1;
}

/* ---------- Home: what we do ---------- */

.pillars {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--ink);
}

.pillars li {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-md) var(--space-xl);
  padding-block: var(--space-xl) var(--space-2xl);
  border-bottom: 1px solid var(--rule);
}

.pillars .idx {
  padding-top: 0.5em;
  font-size: 0.9375rem;
}

.pillars h3 {
  font-size: var(--step-2);
  line-height: 1.1;
}

.pillars p {
  color: var(--ink-2);
  max-width: 46ch;
  padding-top: 0.35em;
}

/* ---------- Home: funds (night band, ticket stubs) ---------- */

.funds {
  background: var(--night);
  color: var(--on-night);
  padding-block: var(--section-pad);
}

.funds-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md) var(--space-xl);
  margin-bottom: var(--space-3xl);
}

.funds-head h2 {
  font-size: var(--step-3);
  line-height: 1;
}

.asof {
  color: var(--on-night-2);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.tickets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 272px), 1fr));
  gap: var(--space-lg);
  list-style: none;
  padding: 0;
}

.ticket {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
}

.ticket--total {
  background: var(--accent);
}

.ticket-top {
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
}

.ticket h3 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-xl);
}

.ticket-big {
  display: block;
  font-size: clamp(2.75rem, 2.2rem + 1.4vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
}

.ticket-exact {
  display: block;
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

/* Perforation: a dotted tear line with a notch cut from each edge. */
.perf {
  position: relative;
  margin-inline: 20px;
  border-top: 2px dotted oklch(0.2 0.012 240 / 0.35);
}

.perf::before,
.perf::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--night);
}

.perf::before {
  left: -32px;
}

.perf::after {
  right: -32px;
}

.stub {
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-lg);
  font-size: 0.9375rem;
}

.stub div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
}

.stub dt {
  color: var(--ink-2);
}

.stub dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.funds-note {
  margin-top: var(--space-2xl);
  max-width: 76ch;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--on-night-2);
}

/* ---------- Track record ---------- */

.track {
  padding-block: var(--section-pad);
}

.track-head {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.track-lead {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 40ch;
}

.track-big {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: var(--step-3);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.chart {
  margin: 0 0 var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--ink);
}

.chart-cap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-xl);
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
}

.chart-title {
  font-weight: 600;
}

.legend {
  display: flex;
  gap: var(--space-lg);
  padding: 0;
  list-style: none;
  color: var(--ink-2);
}

.legend li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.key {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.key--fund1 { background: var(--series-fund1); }
.key--fund2 { background: var(--series-fund2); }

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-body);
}

.chart-svg--narrow {
  display: none;
}

.chart-svg .grid {
  stroke: var(--rule);
  stroke-width: 1;
}

.chart-svg .grid--zero {
  stroke: var(--ink-3);
}

.chart-svg .band {
  stroke: var(--ink-3);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-svg .tick,
.chart-svg .band-label {
  font-size: 12px;
  fill: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.chart-svg .band-label {
  font-weight: 600;
  fill: var(--ink-2);
}

.chart-svg .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-svg .line--fund1 { stroke: var(--series-fund1); }
.chart-svg .line--fund2 { stroke: var(--series-fund2); }
.chart-svg .dot--fund1 { fill: var(--series-fund1); }
.chart-svg .dot--fund2 { fill: var(--series-fund2); }

.chart-svg .end {
  stroke: var(--paper);
  stroke-width: 2;
}

.chart-svg .end-label {
  font-size: 13px;
  font-weight: 600;
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chart-svg .hit {
  fill: transparent;
}

.chart-svg .pt .dot {
  opacity: 0;
  stroke: var(--paper);
  stroke-width: 2;
  transition: opacity 120ms var(--ease-out);
}

.chart-svg .pt:hover .dot {
  opacity: 1;
}

.table-scroll {
  overflow-x: auto;
}

.table-scroll:focus-visible {
  outline: 2px solid var(--ink);
}

.periods {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.periods th,
.periods td {
  text-align: right;
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.periods th:nth-child(-n + 3),
.periods td:nth-child(-n + 3) {
  text-align: left;
}

.periods thead th {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom-color: var(--ink);
}

.periods tbody th {
  font-weight: 600;
}

.periods td {
  color: var(--ink-2);
}

.periods .total th,
.periods .total td {
  color: var(--ink);
  font-weight: 600;
  border-top: 1px solid var(--ink);
}

.track-note {
  margin-top: var(--space-xl);
  max-width: 80ch;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink-3);
}

/* ---------- Contact ---------- */

.contact-body p {
  color: var(--ink-2);
  font-size: var(--step-1);
  margin-bottom: var(--space-lg);
}

.contact-mail {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 0.6rem + 4.4vw, 4.5rem);
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: break-word;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 3px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 280ms var(--ease-out);
}

.contact-mail:hover {
  background-size: 100% 0.5em;
}

/* ---------- Subpage lead ---------- */

.lead {
  padding-top: clamp(var(--space-2xl), 7vw, 120px);
  padding-bottom: var(--space-3xl);
}

.lead h1 {
  font-size: var(--step-3);
  line-height: 1.04;
  letter-spacing: -0.012em;
  max-width: 16ch;
}

.lead p {
  margin-top: var(--space-xl);
  max-width: 52ch;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
}

/* ---------- Portfolio ---------- */

.venues {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--space-lg);
  list-style: none;
  padding: 0;
  padding-bottom: var(--section-pad);
}

.venue {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2xl);
  min-height: 240px;
  padding: var(--space-lg);
  background: var(--paper-2);
}

.venue h2 {
  font-size: var(--step-2);
  line-height: 1.05;
  margin-bottom: var(--space-xs);
}

.venue p {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* ---------- Team ---------- */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-3xl) var(--space-lg);
  list-style: none;
  padding: 0;
  padding-bottom: var(--section-pad);
}

.person img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--paper-2);
  filter: grayscale(1) contrast(1.04);
  transition: filter 500ms var(--ease-out);
}

.person:hover img {
  filter: none;
}

.person h2 {
  margin-top: var(--space-lg);
  font-size: var(--step-2);
  line-height: 1.05;
}

.role {
  margin-top: var(--space-xs);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.role::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: var(--space-md);
  background: var(--accent);
}

.experience {
  margin-top: var(--space-lg);
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.experience li + li {
  margin-top: var(--space-2xs);
}

/* ---------- Footer ---------- */

.footer {
  background: var(--night);
  color: var(--on-night-2);
  padding-block: var(--space-3xl) var(--space-4xl);
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-2xl);
}

.footer-brand {
  display: grid;
  gap: var(--space-lg);
  align-content: start;
}

.footer-brand .title {
  color: var(--on-night);
}

.footer-nav {
  display: grid;
  gap: var(--space-2xs);
  list-style: none;
  padding: 0;
}

.footer-nav a {
  color: var(--on-night);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.disclaimer {
  display: grid;
  gap: var(--space-md);
  max-width: 72ch;
}

.disclaimer h2 {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-night);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .nav-desktop {
    display: none;
  }

  .menu-btn {
    display: inline-block;
  }

  .section,
  .footer-grid,
  .track-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .track-head .section-label {
    margin-bottom: var(--space-lg);
  }

  .section-label {
    margin-bottom: var(--space-xl);
  }
}

@media (max-width: 700px) {
  .pillars li {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .pillars p {
    grid-column: 2;
  }

  .chart-svg--wide {
    display: none;
  }

  .chart-svg--narrow {
    display: block;
  }

  .chart-svg--narrow .tick,
  .chart-svg--narrow .band-label {
    font-size: 13px;
  }

  .chart-svg--narrow .end-label {
    font-size: 14px;
  }

  /* Phones: keep period, fund, profit, return and APR; dates and capital stay in the desktop table. */
  .periods {
    min-width: 0;
    font-size: 0.8125rem;
  }

  .periods th:nth-child(3),
  .periods td:nth-child(3),
  .periods th:nth-child(4),
  .periods td:nth-child(4) {
    display: none;
  }

  .periods th,
  .periods td {
    padding-right: var(--space-xs);
  }

  .periods tbody th {
    white-space: normal;
  }
}
