/* Phase One Ventures — design system */
:root {
  --bg: #F5F1E8;
  --bg-elev: #EDE7D6;
  --ink: #0F1B4C;
  --ink-soft: #2A3563;
  --ink-mute: #6B6F86;
  --line: rgba(15, 27, 76, 0.14);
  --line-strong: rgba(15, 27, 76, 0.32);
  --paper: #FAF7EE;
  --accent: #E25C2B;
  --accent-soft: rgba(226, 92, 43, 0.12);

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad-x: clamp(20px, 4vw, 64px);
  --max-w: 1320px;
  --density: 1;
}

[data-theme="dark"] {
  --bg: #0B1238;
  --bg-elev: #121B4A;
  --ink: #F5F1E8;
  --ink-soft: #D8D5C7;
  --ink-mute: #8E94B6;
  --line: rgba(245, 241, 232, 0.14);
  --line-strong: rgba(245, 241, 232, 0.30);
  --paper: #0F1B4C;
  --accent-soft: rgba(226, 92, 43, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

section[id] { scroll-margin-top: 100px; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.section {
  padding-top: calc(112px * var(--density));
  padding-bottom: calc(112px * var(--density));
  border-top: 1px solid var(--line);
  position: relative;
}
.section:first-of-type { border-top: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
  margin-bottom: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(48px, 7.4vw, 116px); line-height: 0.96; letter-spacing: -0.035em; }
h2 { font-size: clamp(34px, 4.6vw, 68px); line-height: 1.02; }
h3 { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.15; }

p { color: var(--ink-soft); text-wrap: pretty; }
.lead { font-size: clamp(17px, 1.4vw, 22px); line-height: 1.5; max-width: 60ch; color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  transition: transform 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn .arrow { transition: transform 0.18s ease; }
.btn:hover .arrow { transform: translateX(2px); }

/* — Nav — */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 92px;
  gap: 18px;
}
.nav__brand { display: flex; align-items: center; }
.nav__wordmark { height: 38px; width: auto; display: block; }
[data-theme="dark"] .nav__wordmark { filter: invert(1) brightness(1.6) hue-rotate(180deg) saturate(0.4); }
.nav__links { display: flex; gap: 36px; font-size: 14px; color: var(--ink-soft); }
.nav__links a { position: relative; }
.nav__links a:hover { color: var(--ink); }
.nav__right { display: flex; align-items: center; gap: 14px; }
.nav__cta { display: inline-flex; }
.nav__theme-toggle {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.nav__theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.nav__theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .nav__theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .nav__theme-toggle .icon-sun { display: block; }
@media (max-width: 760px) { .nav__links { display: none; } }

/* — Hero — */
.hero { padding-top: calc(72px * var(--density)); padding-bottom: calc(96px * var(--density)); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
}
.hero__title { margin-top: 24px; }
.hero__title em {
  font-style: italic;
  color: var(--accent);
}
.hero__title .accent { color: var(--accent); font-style: italic; }
.hero__meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 36px;
}
.hero__bottom {
  margin-top: 64px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: end;
}
@media (max-width: 880px) {
  .hero__bottom { grid-template-columns: 1fr; gap: 32px; }
}
.hero__rocket {
  position: relative;
  align-self: end;
  height: 220px;
  display: flex; align-items: flex-end; justify-content: center;
}
.hero__rocket-img {
  width: 200px; height: 200px;
  object-fit: contain;
  animation: rocketFloat 6s ease-in-out infinite;
}
[data-theme="dark"] .hero__rocket-img {
  filter: invert(1) brightness(1.6) hue-rotate(180deg) saturate(0.4);
}
@keyframes rocketFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__rocket-img { animation: none; }
}

/* — Stats — */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 64px;
}
.stats__cell {
  padding: 28px 0 28px 24px;
  border-right: 1px solid var(--line);
}
.stats__cell:first-child { padding-left: 0; }
.stats__cell:last-child { border-right: 0; }
.stats__k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }
.stats__v { font-family: var(--serif); font-size: clamp(28px, 3vw, 44px); margin-top: 6px; letter-spacing: -0.02em; }
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats__cell:nth-child(2) { border-right: 0; }
  .stats__cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats__cell:nth-child(3) { padding-left: 0; }
}

/* — Section header — */
.s-head {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  margin-bottom: 72px;
  align-items: end;
}
.s-head__title { margin-top: 18px; letter-spacing: -0.025em; }
.s-head__title em { font-style: italic; color: var(--accent); }
@media (max-width: 880px) { .s-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 48px; } }

/* — Thesis — */
.thesis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line-strong);
}
.thesis__card {
  padding: 40px 28px 36px 0;
  border-right: 1px solid var(--line);
  position: relative;
}
.thesis__card:last-child { border-right: 0; padding-right: 0; }
.thesis__card:not(:last-child) { padding-right: 36px; }
.thesis__card + .thesis__card { padding-left: 36px; }
.thesis__n { font-family: var(--mono); color: var(--accent); font-size: 12px; letter-spacing: 0.18em; }
.thesis__title { margin-top: 20px; font-size: 28px; }
.thesis__body { margin-top: 14px; font-size: 15.5px; line-height: 1.55; }
@media (max-width: 880px) {
  .thesis { grid-template-columns: 1fr; }
  .thesis__card { border-right: 0; border-bottom: 1px solid var(--line); padding: 32px 0 !important; }
  .thesis__card:last-child { border-bottom: 0; }
}

/* — Program — */
.program {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.program__cell {
  background: var(--bg);
  padding: 36px 28px 32px;
  display: flex; flex-direction: column;
  min-height: 280px;
  transition: background 0.2s ease;
  position: relative;
}
.program__cell:hover { background: var(--bg-elev); }
.program__cell:hover .program__title { color: var(--accent); }
.program__stage { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mute); }
.program__title {
  font-family: var(--serif); font-size: 32px; line-height: 1.05;
  margin-top: 14px; letter-spacing: -0.02em;
  transition: color 0.2s ease;
}
.program__body { margin-top: auto; padding-top: 24px; font-size: 14.5px; color: var(--ink-soft); }
@media (max-width: 1000px) { .program { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .program { grid-template-columns: 1fr; } }

/* — Portfolio — */
.portfolio {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.portfolio__cell {
  background: var(--bg);
  padding: 32px 26px;
  position: relative;
  min-height: 200px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: background 0.4s ease;
  color: inherit;
  --portfolio-brand: var(--ink);
}
.portfolio__cell:hover {
  background: color-mix(in oklab, var(--portfolio-brand) 14%, var(--bg));
}
[data-theme="dark"] .portfolio__cell:hover {
  background: color-mix(in oklab, var(--portfolio-brand) 32%, var(--bg));
}
.portfolio__logo {
  height: 30px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0);
  opacity: 0.78;
  transition: filter 0.35s ease, opacity 0.35s ease;
}
.portfolio__cell:hover .portfolio__logo { filter: none; opacity: 1; }
[data-theme="dark"] .portfolio__logo { filter: brightness(0) invert(1); }
[data-theme="dark"] .portfolio__cell:hover .portfolio__logo { filter: none; opacity: 1; }
.portfolio__name {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-top: 32px;
}
@media (max-width: 1000px) { .portfolio { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .portfolio { grid-template-columns: 1fr; } }

/* — Team — */
.team {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 36px;
}
.team__card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.team__photo {
  width: 70%;
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, var(--bg-elev), var(--paper));
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}
.team__photo::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg,
      transparent 0, transparent 10px,
      color-mix(in oklab, var(--ink) 6%, transparent) 10px,
      color-mix(in oklab, var(--ink) 6%, transparent) 11px);
}
.team__photo span {
  position: absolute; left: 14px; bottom: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--ink-mute); text-transform: uppercase;
}
.team__photo-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
  filter: grayscale(1) contrast(0.95);
  mix-blend-mode: multiply;
  opacity: 0.55;
  transition: filter 0.4s ease, opacity 0.4s ease, mix-blend-mode 0.4s ease;
}
.team__card:hover .team__photo-img {
  filter: none;
  mix-blend-mode: normal;
  opacity: 1;
}
[data-theme="dark"] .team__photo-img {
  mix-blend-mode: screen;
  opacity: 0.6;
}
.team__name { font-family: var(--serif); font-size: 26px; margin-top: 18px; letter-spacing: -0.02em; }
.team__role { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-top: 8px; }
.team__bio { font-size: 14.5px; line-height: 1.55; margin-top: 14px; color: var(--ink-soft); }
@media (max-width: 880px) { .team { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .team { grid-template-columns: 1fr; } }

/* — FAQ — */
.faq { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line-strong); }
.faq__row { border-bottom: 1px solid var(--line); padding: 28px 0; cursor: pointer; }
.faq__q { display: flex; justify-content: space-between; align-items: center; gap: 24px; list-style: none; }
.faq__q::-webkit-details-marker { display: none; }
.faq__qt { font-family: var(--serif); font-size: clamp(20px, 1.9vw, 26px); letter-spacing: -0.015em; }
.faq__plus { width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; transition: all 0.2s ease; font-size: 14px; color: var(--ink-soft); }
.faq__row[open] .faq__plus { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: rotate(45deg); }
.faq__a { padding-top: 16px; max-width: 70ch; color: var(--ink-soft); display: none; font-size: 15px; line-height: 1.6; }
.faq__row[open] .faq__a { display: block; }

/* — CTA — */
.cta {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(64px, 8vw, 120px) var(--pad-x);
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.cta__inner { max-width: var(--max-w); margin: 0 auto; position: relative; z-index: 2; }
.cta__eyebrow { color: rgba(245, 241, 232, 0.7); }
.cta__title { font-family: var(--serif); font-size: clamp(40px, 6vw, 88px); line-height: 0.98; color: var(--bg); letter-spacing: -0.03em; max-width: 16ch; margin-top: 24px; }
.cta__title em { color: var(--accent); font-style: italic; }
.cta__row { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; }
.cta .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.cta .btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.cta__bg {
  position: absolute; right: -120px; bottom: -160px; opacity: 0.07; z-index: 1;
  width: 540px; height: 540px;
}
.cta__bg img { width: 100%; height: 100%; object-fit: contain; filter: invert(1); }

/* — Footer — */
.footer {
  padding: 48px var(--pad-x) 32px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer__inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; }
.footer__wordmark { height: 26px; width: auto; display: block; }
[data-theme="dark"] .footer__wordmark { filter: invert(1) brightness(1.6) hue-rotate(180deg) saturate(0.4); }
.footer__meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); }
.footer__links { display: flex; gap: 18px; font-size: 13px; color: var(--ink-soft); align-items: center; }
.footer__links a:hover { color: var(--accent); }
.footer__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); transition: all 0.18s ease; }
.footer__icon:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* — Reveal animation — */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* — Selection — */
::selection { background: var(--accent); color: var(--paper); }
