/* ==========================================================================
   BRAIGR Partners — styles.css
   Vanilla CSS, mobile-first. All colours, spacing and type sizes live in the
   custom properties below: change them there, not inline.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (self-hosted, see assets/fonts/)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Marcellus";
  src: url("assets/fonts/marcellus-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette — brand.md. No other colours are allowed. */
  --ink: #10262d;
  --stone: #5e6a6b;
  --slate: #999997;
  --bone: #ededea;
  --white: #ffffff;

  /* Low-opacity variants for hairlines and the stone-course motif. */
  --line-on-light: rgba(153, 153, 151, 0.45);
  --line-on-dark: rgba(153, 153, 151, 0.28);
  --course-on-dark: rgba(153, 153, 151, 0.14);

  /* Typography */
  --font-display: "Marcellus", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-xs: 0.6875rem;                          /* 11px — mono eyebrows   */
  --text-sm: 0.875rem;                           /* 14px — meta            */
  --text-base: 1.0625rem;                        /* 17px — body            */
  --text-md: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);   /* lead paragraphs */
  --text-lg: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);    /* email link      */
  --text-h3: 1.1875rem;
  --text-h2: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  --text-h1: clamp(2.5rem, 1.5rem + 4.6vw, 4.75rem);

  --leading-tight: 1.08;
  --leading-snug: 1.3;
  --leading-body: 1.65;

  --tracking-mono: 0.14em;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 6rem;
  --space-section: clamp(5rem, 4rem + 6vw, 8.5rem);

  /* Layout */
  --container: 1120px;
  --gutter: 1.5rem;
  --header-h: 3.25rem;
  --radius: 2px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 220ms;
  --dur-reveal: 640ms;
}

/* --------------------------------------------------------------------------
   3. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Single, consistent focus ring for every interactive element. */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. Typography helpers
   -------------------------------------------------------------------------- */
.display,
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.005em;
}

.display {
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

.section-title {
  font-size: var(--text-h2);
  line-height: 1.12;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  line-height: 1;
  color: var(--stone);
}

.lead {
  font-size: var(--text-md);
  line-height: 1.55;
}

.muted {
  color: var(--stone);
}

/* Keeps hyphenated terms such as "pre-IPO" on one line without touching the copy. */
.nowrap {
  white-space: nowrap;
}

/* Inline text links (email, footer). */
.link {
  text-decoration: underline;
  text-decoration-color: var(--slate);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.link:hover {
  text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------------
   5. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--bone);
  color: var(--ink);
  font-weight: 500;
  transform: translateY(-120%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: -2px;
}

/* --------------------------------------------------------------------------
   6. Header / nav
   -------------------------------------------------------------------------- */
/* The header starts transparent over the hero photograph and fades to solid
   Ink Navy as the hero scrolls out. script.js drives --header-alpha from the
   scroll position (0 → 1 over the last 160px of the hero); without JS the
   header is simply solid. The negative bottom margin lets the hero slide
   underneath while the header keeps its sticky behaviour. */
.site-header {
  --header-alpha: 1;
  --header-fade: 28px; /* soft edge below the header, no hard line against the hero */
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: calc(-1 * var(--header-h));
  background: rgba(16, 38, 45, var(--header-alpha));
  color: var(--bone);
}
/* With JS running the header starts transparent, so there is no solid flash
   before the scroll handler sets --header-alpha. */
.js .site-header {
  --header-alpha: 0;
}
/* The fade hangs below the header and follows the same alpha, so the bottom
   edge dissolves into the hero instead of cutting across it. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: var(--header-fade);
  /* --header-fade-alpha follows --header-alpha while the hero is behind the
     header, then script.js brings it back to 0 over the light sections, so the
     fade never reads as a shadow on Bone. */
  background: linear-gradient(to bottom, rgba(16, 38, 45, var(--header-fade-alpha, 0)), rgba(16, 38, 45, 0));
  pointer-events: none;
}
/* Solid while the mobile menu is open, whatever the scroll position. */
.site-header.is-menu-open {
  background: var(--ink);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

/* The compact lockup is the only image. Its mark occupies x 3.9–16.6 of the
   102.72-unit viewBox and the wordmark starts at 41.9, so clipping the link to
   0.76 × height shows the mark alone; widening it to the full 4.2 × height
   wipes the wordmark in. All ratios are relative to --brand-h. */
.brand {
  --brand-h: 36px;
  position: relative;
  display: block;
  overflow: hidden;
  height: var(--brand-h);
  width: calc(var(--brand-h) * 0.76);
  flex-shrink: 0;
  transition: width 420ms var(--ease);
}
.brand img {
  position: absolute;
  top: 0;
  left: calc(var(--brand-h) * -0.16); /* cancel the mark's own left inset */
  height: 100%;
  width: auto;
  max-width: none;
}
.site-header.is-scrolled .brand {
  width: calc(var(--brand-h) * 4.2); /* compact lockup ratio 102.72 / 24.48 */
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: -10px; /* optically align the icon with the container edge */
  align-items: center;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ink);
  border-bottom: 1px solid var(--line-on-dark);
  padding: var(--space-3) var(--gutter) var(--space-6);
  display: none;
}
.site-nav.is-open {
  display: block;
}
.site-nav ul {
  display: flex;
  flex-direction: column;
}
.site-nav a {
  display: block;
  padding: var(--space-3) 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--bone);
  border-bottom: 1px solid var(--line-on-dark);
}
.site-nav li:last-child a {
  border-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
/* Photographic hero. The image (client-supplied, assets/img/) is anchored to
   the bottom so the lit horizon stays low; copy sits in the dark upper part.
   A Ink Navy veil (::before) guarantees contrast under the text whatever the
   viewport crops, then fades out so the glow at the bottom stays visible. */
.hero {
  position: relative;
  isolation: isolate;
  background-color: var(--ink);
  background-image: url("assets/img/hero-space-1200.jpg");
  background-size: cover;
  /* Shifted down by 13vh from the bottom edge so the lit horizon sits below the
     copy; the strip uncovered at the top is background-color under the veil. */
  background-position: center calc(100% + 13vh);
  background-repeat: no-repeat;
  color: var(--bone);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-start;
  /* Top padding includes the header height, since the hero runs underneath it. */
  padding-block: calc(var(--header-h) + clamp(3rem, 9vh, 6rem)) clamp(12rem, 34vh, 22rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(16, 38, 45, 1) 0%,
    rgba(16, 38, 45, 0.9) 50%,
    rgba(16, 38, 45, 0.55) 70%,
    rgba(16, 38, 45, 0) 90%
  );
  pointer-events: none;
}

/* Landscape slideshow: slides sit above the hero's own background (space)
   and below the veil (::before, z-index -1). Only the active slide is visible;
   with no active slide the space background shows through. */
.hero-slides {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  opacity: 0;
  transition: opacity 1800ms ease-in-out;
}
.hero-slide.is-active {
  opacity: 1;
}

/* Centred composition: logo, headline and sub-line stacked on the axis. */
.hero-inner {
  display: grid;
  justify-items: center;
  gap: var(--space-6);
  max-width: 52rem;
  margin-inline: auto;
  text-align: center;
}

.hero-logo {
  width: clamp(180px, 24vw, 260px); /* never below the 120px minimum */
  height: auto;
  margin-bottom: var(--space-4);
}

.hero .display {
  max-width: 17ch;
}

.hero-sub {
  /* Bone rather than Muted Slate: over the photograph Slate would drop below AA. */
  color: var(--bone);
  font-size: clamp(0.9375rem, 0.9rem + 0.3vw, 1.0625rem);
  line-height: 1.6;
  max-width: 48ch;
  text-wrap: balance; /* even line lengths; on desktop the copy sits on two lines */
}

/* --------------------------------------------------------------------------
   8. Sections (shared)
   -------------------------------------------------------------------------- */
.section {
  padding-block: var(--space-section);
  border-top: 1px solid var(--line-on-light);
}
.section:first-of-type {
  border-top: 0;
}

/* Section header: title on the left, intro on the right from tablet up. */
.section-head {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--space-9);
}
.section-head--tight {
  margin-bottom: 0;
}
.section-body {
  display: grid;
  gap: var(--space-5);
}
.section-body > * + * {
  margin-top: 0;
}

/* Grids */
.grid {
  display: grid;
  gap: var(--space-4);
}

/* Raised white card on Bone. */
.card {
  background: var(--white);
  padding: var(--space-6);
  border: 1px solid var(--line-on-light);
  border-radius: var(--radius);
}

.card-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-h3);
  line-height: var(--leading-snug);
  margin-top: var(--space-4);
}
.card p {
  margin-top: var(--space-3);
  color: var(--stone);
}

/* --------------------------------------------------------------------------
   9. About
   -------------------------------------------------------------------------- */
/* Photograph under the title, 4:5, revealed with an upward wipe while the
   image settles from a slight zoom. Decorative: alt="", no copy on it. */
/* About: first paragraph as a statement in Ink Navy, second as body copy in Stone Gray. */
.about-statement {
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
}
.about-body {
  color: var(--stone);
  max-width: 58ch;
}

/* Three stone courses between the paragraphs, drawn with the scroll: each
   line is a scaled bar; the second and third start later along the same
   0 → 1 progress that script.js writes into --rule-progress. */
.about-courses {
  --rule-progress: 1;
  display: grid;
  gap: 7px;
  margin-block: var(--space-6);
}
.js .about-courses {
  --rule-progress: 0;
}
.about-courses span {
  display: block;
  height: 1px;
  background: var(--stone);
  transform-origin: left center;
  transform: scaleX(var(--rule-progress));
}
.about-courses span:nth-child(2) {
  width: 66%;
  transform: scaleX(clamp(0, (var(--rule-progress) - 0.18) / 0.82, 1));
}
.about-courses span:nth-child(3) {
  width: 38%;
  transform: scaleX(clamp(0, (var(--rule-progress) - 0.36) / 0.64, 1));
}

/* --------------------------------------------------------------------------
   9b. Wave divider (About → How we invest)
   -------------------------------------------------------------------------- */
/* Full-bleed band of five thin sine lines in Stone Gray. Each path carries
   pathLength="1": its dash offset follows --rule-progress (0 → 1 while the
   band travels up the viewport), staggered by line index (--i) so the waves
   arrive one after the other, and the whole line drifts sideways a little. */
.wave-divider {
  --rule-progress: 1;
  height: clamp(110px, 13vw, 180px);
  overflow: hidden;
}
.js .wave-divider {
  --rule-progress: 0;
}
/* Wider than the band and tilted 3° (rising to the right); the extra width
   keeps the corners covered after the rotation. */
.wave-divider-svg {
  display: block;
  width: 112%;
  height: 100%;
  margin-left: -6%;
  overflow: visible;
  transform: rotate(-3deg);
  transform-origin: center;
}
.wave-divider-svg path {
  fill: none;
  stroke: var(--stone);
  stroke-width: 1;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  --p: clamp(0, (var(--rule-progress) - var(--i) * 0.12) / 0.52, 1);
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--p));
  transform: translateX(calc((1 - var(--p)) * -60px));
}
/* Once fully drawn (script.js adds .is-drawn at progress 1) each line flows
   to the right forever: one wavelength (--wl, in viewBox units) per cycle, so
   the loop has no seam; --flow sets a different speed per line. */
.wave-divider.is-drawn path {
  animation: wave-flow var(--flow, 12s) linear infinite;
}
@keyframes wave-flow {
  from {
    transform: translateX(calc(var(--wl) * -1px));
  }
  to {
    transform: translateX(0);
  }
}
.wave-divider + .section {
  border-top: 0;
}

/* --------------------------------------------------------------------------
   10. How we invest
   -------------------------------------------------------------------------- */
.principles .card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Higher specificity than the generic .js [data-reveal] transition, so the
   hover lift is not slowed down by the reveal timing. */
.js .principles .card,
.js .principles .card.is-visible {
  transition: transform 280ms var(--ease), box-shadow 280ms var(--ease), border-color 280ms var(--ease);
}
/* Entrance: each card rises and settles (staggered via --reveal-delay), then
   a 2px Ink Navy bar draws across its top edge. The animation only fills
   backwards, so once it has played the hover transform below can take over. */
.js .principles .card {
  opacity: 0;
}
.js .principles .card.is-visible {
  opacity: 1;
  animation: card-in 720ms var(--ease) backwards;
  animation-delay: var(--reveal-delay, 0ms);
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.principles .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 640ms var(--ease);
}
.principles .card.is-visible::before {
  transform: scaleX(1);
  transition-delay: calc(var(--reveal-delay, 0ms) + 420ms);
}
/* Hover: the card lifts, the border firms up and the number turns Ink Navy. */
.principles .card .eyebrow {
  transition: color 280ms var(--ease);
}
.js .principles .card:hover {
  transform: translateY(-6px);
  border-color: var(--stone);
  box-shadow: 0 18px 40px -18px rgba(16, 38, 45, 0.35), 0 6px 14px -8px rgba(16, 38, 45, 0.18);
}
.js .principles .card:hover .eyebrow {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   11. Focus
   -------------------------------------------------------------------------- */
/* Focus sits on the desert photograph. The veil keeps every line of Bone copy
   at AA even over the lit dunes; the section hairline is dropped because the
   photograph already separates it from its neighbours. */
.section--focus {
  position: relative;
  isolation: isolate;
  border-top: 0;
  color: var(--bone);
  background-color: var(--ink);
  background-image: url("assets/img/hero-desert-1200.jpg");
  background-size: cover;
  background-position: center 70%;
  background-repeat: no-repeat;
}
.section--focus::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(16, 38, 45, 0.8) 0%,
    rgba(16, 38, 45, 0.62) 45%,
    rgba(16, 38, 45, 0.72) 100%
  );
  pointer-events: none;
}
.section--focus .section-title,
.section--focus .lead {
  color: var(--bone);
}

/* Rule under the intro: draws left → right with the scroll (script.js sets
   --rule-progress from 0 to 1 as the rule travels up the viewport). */
.focus-rule {
  --rule-progress: 1;
  height: 1px;
  margin-block: var(--space-7) var(--space-6);
  background: var(--line-on-dark);
  overflow: hidden;
}
.focus-rule-bar {
  display: block;
  height: 100%;
  background: var(--bone);
  transform: scaleX(var(--rule-progress));
  transform-origin: left center;
}
.js .focus-rule {
  --rule-progress: 0;
}

/* The four sectors as one cluster: cells separated by hairlines, translucent
   Ink Navy over the photograph, icon → title → text. */
.sectors--cluster {
  display: grid;
  gap: 1px;
  background: var(--line-on-dark);
  border: 1px solid var(--line-on-dark);
}
.sector {
  background: rgba(16, 38, 45, 0.6);
  padding: var(--space-6) var(--space-5);
  transition: background-color var(--dur) var(--ease);
}
.sector:hover {
  background: rgba(16, 38, 45, 0.45);
}
.sector h3 {
  font-weight: 600;
  font-size: var(--text-h3);
  line-height: var(--leading-snug);
  max-width: 22ch;
  margin-top: var(--space-5);
}
.sector p {
  margin-top: var(--space-3);
  color: rgba(237, 237, 234, 0.8);
  max-width: 38ch;
}
.focus-close {
  margin-top: var(--space-8);
  color: rgba(237, 237, 234, 0.8);
  max-width: 60ch;
}

/* Line-drawn icons: every shape carries pathLength="1", so a dash of 1 hides
   it and the reveal (.is-visible from script.js) lets the stroke draw itself,
   one shape after the other. */
.sector-icon {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--bone);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sector-icon > * {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
/* Once the cell is in view the icon draws itself and keeps looping every 3s:
   draw (≈1.1s), hold, quick un-draw, again. Shapes are staggered so the icon
   builds up piece by piece and dissolves in the same order. */
.sector.is-visible .sector-icon > * {
  animation: icon-draw 3000ms cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.sector.is-visible .sector-icon > :nth-child(2) {
  animation-delay: 300ms;
}
.sector.is-visible .sector-icon > :nth-child(3) {
  animation-delay: 600ms;
}
.sector.is-visible .sector-icon > :nth-child(4) {
  animation-delay: 850ms;
}
@keyframes icon-draw {
  0% {
    stroke-dashoffset: 1;
  }
  37% {
    stroke-dashoffset: 0;
  }
  86% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 1;
  }
}
html:not(.js) .sector-icon > * {
  stroke-dashoffset: 0;
}

/* --------------------------------------------------------------------------
   12. Portfolio
   -------------------------------------------------------------------------- */
.portfolio-row {
  /* One monochrome colour drives both the SpaceX SVG (fill="currentColor")
     and the typographic name next to it. Bone background → Ink Navy. */
  --spacex-w: clamp(150px, 14vw + 60px, 208px);
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-7) var(--space-10);
  padding-block: var(--space-4);
}
.portfolio-item {
  display: flex;
  align-items: center;
}

/* Marquee (enabled by script.js, which adds .is-marquee and the clones).
   The track holds the original items plus aria-hidden copies; the first half
   and the second half are identical, so sliding from -50% to 0 loops without
   a visible seam. Direction: rightwards. */
.marquee {
  --marquee-gap: var(--space-10);
  --marquee-duration: 40s;
  overflow: hidden;
}
.marquee.is-marquee .portfolio-row {
  flex-wrap: nowrap;
  width: max-content;
  gap: 0;
  animation: marquee-right var(--marquee-duration) linear infinite;
  will-change: transform;
}
.marquee.is-marquee .portfolio-item {
  margin-inline-end: var(--marquee-gap);
}
.marquee.is-marquee {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}
.marquee.is-marquee:hover .portfolio-row,
.marquee.is-marquee:focus-within .portfolio-row {
  animation-play-state: paused;
}
@keyframes marquee-right {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}
.portfolio-logo {
  width: calc(var(--spacex-w) * var(--w, 1)); /* --w: per-logo optical weight, tuned by eye */
  height: auto;
}
/* Raster or fixed-colour logos: the file is used as an alpha mask over
   currentColor, so every mark renders in the same Ink Navy regardless of the
   colour it was supplied in. --logo = url(), --ar = width / height. */
.portfolio-logo--mask {
  display: block;
  aspect-ratio: var(--ar);
  background-color: currentColor;
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}
.portfolio-name {
  /* Prometheus: Inter Medium, uppercase, tracked out so a single word carries
     the same optical weight as the long SpaceX wordmark. The size is derived
     from the SpaceX width so the two stay balanced at every breakpoint. */
  font-weight: 500;
  font-size: calc(var(--spacex-w) * 0.104);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   14. Contact
   -------------------------------------------------------------------------- */
/* The email is an inline link inside the sentence; make it read as the CTA. */
#contact .lead .link {
  font-weight: 500;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: var(--bone);
  padding-block: var(--space-9) var(--space-8);
}
.footer-inner {
  display: grid;
  gap: var(--space-8);
}
.footer-logo {
  width: 160px;
  height: auto;
}
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--slate);
}
.footer-meta > span {
  display: inline-flex;
  align-items: center;
}
.footer-meta a {
  color: var(--slate);
}
.footer-meta a:hover {
  color: var(--bone);
}

/* --------------------------------------------------------------------------
   16. Reveal on scroll (only when JS is running and motion is allowed)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   17. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  /* Icons: no drawing loop, just the finished shapes. */
  .sector-icon > * {
    animation: none !important;
    stroke-dashoffset: 0;
  }
  /* Waves: drawn and still. */
  .wave-divider path {
    animation: none !important;
    transform: none;
  }
  /* Cards: no lift, no entrance motion. */
  .principles .card,
  .principles .card:hover {
    transform: none;
    animation: none !important;
    opacity: 1;
  }
  .principles .card::before {
    transform: scaleX(1);
  }
}

/* --------------------------------------------------------------------------
   18. Breakpoints — tablet ≥ 768px
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  :root {
    --gutter: 2.5rem;
    --header-h: 3.5rem;
  }
  .brand {
    --brand-h: 40px;
  }

  .nav-toggle {
    display: none;
  }

  .hero {
    background-image: url("assets/img/hero-space-2400.jpg");
  }
  .site-nav {
    position: static;
    display: block;
    background: transparent;
    border: 0;
    padding: 0;
  }
  .site-nav ul {
    flex-direction: row;
    gap: var(--space-6);
  }
  .site-nav a {
    padding: var(--space-2) 0;
    font-size: 0.9375rem;
    border-bottom: 0;
    position: relative;
  }
  /* Underline slides in on hover / current section. */
  .site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--bone);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur) var(--ease);
  }
  .site-nav a:hover::after,
  .site-nav a[aria-current="true"]::after {
    transform: scaleX(1);
  }

  .section-head {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--space-8);
    /* Title and intro sit on the same first baseline, not the same box top:
       the Marcellus h2 has a much taller line box than the Inter intro. */
    align-items: baseline;
  }
  .section-head .section-title {
    grid-column: 1;
  }
  .section-head .section-intro {
    grid-column: 2;
  }
  .section-body--offset {
    grid-column: 2;
  }

  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sectors--cluster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sector {
    padding: var(--space-7) var(--space-6);
  }
  .section--focus {
    background-image: url("assets/img/hero-desert-2400.jpg");
  }


  /* Footer meta becomes one line with "·" separators drawn by CSS. */
  .footer-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2) 0;
  }
  .footer-meta > span + span::before {
    content: "\00B7";
    padding-inline: var(--space-4);
  }
}

/* --------------------------------------------------------------------------
   19. Breakpoints — desktop ≥ 1120px
   -------------------------------------------------------------------------- */
@media (min-width: 1120px) {
  :root {
    --gutter: 3rem;
  }

  .site-nav ul {
    gap: var(--space-7);
  }

  .hero-inner {
    gap: var(--space-7);
    max-width: 60rem;
  }
  .hero-sub {
    max-width: 68ch; /* wide enough for the sub-line to sit on exactly two lines */
  }

  .section-head {
    column-gap: var(--space-10);
  }

  .grid {
    gap: var(--space-5);
  }
  .card {
    padding: var(--space-7);
  }

  .footer-inner {
    grid-template-columns: auto 1fr;
    align-items: end;
  }
  .footer-meta {
    justify-content: flex-end;
  }
}
