/* ImpactOS NC
   A quiet frame around real work. See README.md for the design rules. */

:root {
  /* Colors */
  --color-pine-ink: #0f2419;
  --color-pine-ink-hover: #1c3a2a;
  --color-chalk: #f1f3f0;
  --color-paper: #fcfdfb;
  --color-slate: #55605a;
  --color-fog: #7f8a84;
  --color-longleaf: #157245;
  --color-error: #a32b1f;
  --color-hairline: rgb(15 36 25 / 0.10);

  /* Typography */
  --font-sans: 'Hanken Grotesk', 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --weight-light: 350;
  --weight-regular: 400;

  --text-display: clamp(2.5rem, 1.5rem + 4vw, 4rem);
  --leading-display: 1.0625;
  --tracking-display: -0.03em;
  --text-heading: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);
  --leading-heading: 1.1;
  --tracking-heading: -0.025em;
  --text-subheading: 1.5rem;
  --leading-subheading: 1.25;
  --tracking-subheading: -0.015em;
  --text-lede: 1.25rem;
  --leading-lede: 1.5;
  --tracking-lede: -0.01em;
  --text-body: 1.0625rem;
  --leading-body: 1.55;
  --tracking-body: -0.005em;
  --text-small: 0.875rem;
  --leading-small: 1.45;
  --text-caption: 0.75rem;
  --leading-caption: 1.35;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  /* Layout */
  --page-max-width: 1200px;
  --page-gutter: 24px;
  --prose-max-width: 66ch;
  --section-gap: clamp(64px, 8vw, 128px);
  --card-padding: clamp(24px, 3vw, 40px);

  /* Border radius */
  --radius-nav: 20px;
  --radius-pill: 9999px;
  --radius-card: 32px;
  --radius-media-inner: 20px;
  --radius-portrait: 24px;
  --radius-input: 16px;

  /* Surfaces */
  --surface-canvas: var(--color-chalk);
  --surface-elevated: var(--color-paper);
  --surface-dark: var(--color-pine-ink);
}

@media (min-width: 900px) {
  :root { --page-gutter: 48px; }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--surface-canvas);
  color: var(--color-pine-ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.menu-open { overflow: hidden; }

main { flex: 1 0 auto; }

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

h1, h2, h3, h4 {
  font-weight: var(--weight-light);
  text-wrap: balance;
}

strong, b { font-weight: var(--weight-regular); }

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

button, input, textarea, select {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

::selection { background: rgb(21 114 69 / 0.18); }

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--color-longleaf);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--color-paper);
  color: var(--color-pine-ink);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  font-size: var(--text-small);
}

.skip-link:focus { top: 16px; }

/* Layout */

.container {
  width: 100%;
  max-width: calc(var(--page-max-width) + 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.section { padding-block: var(--section-gap) 0; }
.section:last-child { padding-bottom: var(--section-gap); }

.page-intro { padding-top: var(--space-24); }

@media (min-width: 900px) {
  .page-intro { padding-top: var(--space-32); }
}

.stack > * + * { margin-top: var(--space-4); }

/* Type */

.display {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  font-weight: var(--weight-light);
}

.display .line { display: block; }

.heading {
  font-size: var(--text-heading);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  font-weight: var(--weight-light);
  max-width: 20ch;
}

.subheading {
  font-size: var(--text-subheading);
  line-height: var(--leading-subheading);
  letter-spacing: var(--tracking-subheading);
  font-weight: var(--weight-light);
}

.lede {
  font-size: var(--text-lede);
  line-height: var(--leading-lede);
  letter-spacing: var(--tracking-lede);
  font-weight: var(--weight-light);
  color: var(--color-slate);
  max-width: 56ch;
}

.heading + .lede { margin-top: var(--space-4); }

.prose { max-width: var(--prose-max-width); }
.prose > * + * { margin-top: var(--space-4); }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: var(--space-2); }

.small {
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
}

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

/* Text link */

a {
  color: var(--color-longleaf);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { text-decoration-thickness: 2px; }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  line-height: 1.25;
  font-weight: var(--weight-regular);
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease-out;
}

.button:hover { text-decoration: none; }

.button-primary {
  background: var(--color-pine-ink);
  color: var(--color-paper);
  border: 0;
}

.button-primary:hover { background: var(--color-pine-ink-hover); }

.button-outline {
  background: transparent;
  color: var(--color-longleaf);
  border: 1px solid var(--color-longleaf);
  padding: 13px 25px; /* keeps the same outer size as the primary button */
}

.button-outline:hover { background: rgb(21 114 69 / 0.06); }

.button-small {
  padding: 10px 18px;
  font-size: var(--text-small);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Floating pill nav */

.site-header {
  position: sticky;
  top: 16px;
  z-index: 50;
  padding-inline: var(--page-gutter);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: var(--page-max-width);
  padding: 8px 8px 8px 20px;
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-nav);
}

.wordmark {
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  letter-spacing: -0.005em;
  color: var(--color-pine-ink);
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}

.wordmark:hover { text-decoration: none; }

.nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-1);
}

.nav-links a {
  display: block;
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--color-pine-ink);
  font-size: 1rem;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.nav-links a[aria-current="page"] {
  border-color: var(--color-longleaf);
  color: var(--color-longleaf);
}

.nav-links a[aria-current="page"]:hover { text-decoration: none; }

.nav-cta { display: none; }

.menu-button {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  color: var(--color-pine-ink);
  font-size: var(--text-small);
  line-height: 1.25;
  cursor: pointer;
}

@media (min-width: 900px) {
  .nav-pill { width: auto; }
  .wordmark { margin-right: var(--space-4); }
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; margin-left: var(--space-4); }
  .menu-button { display: none; }
}

/* Mobile menu sheet */

.menu-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--color-paper);
  padding: 16px var(--page-gutter) 32px;
  overflow-y: auto;
}

.menu-sheet[hidden] { display: none; }

.menu-sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 9px 9px 9px 21px; /* lines up with the nav pill it covers */
}

.menu-sheet-links {
  list-style: none;
  margin: var(--space-8) 0 0;
  padding: 0;
}

.menu-sheet-links li + li { margin-top: var(--space-1); }

.menu-sheet-links a {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-subheading);
  line-height: var(--leading-subheading);
  letter-spacing: var(--tracking-subheading);
  font-weight: var(--weight-light);
  color: var(--color-pine-ink);
  text-decoration: none;
}

.menu-sheet-links a[aria-current="page"] {
  border-color: var(--color-longleaf);
  color: var(--color-longleaf);
}

.menu-sheet-cta {
  margin-top: auto;
  padding-top: var(--space-12);
}

.menu-sheet-cta .button { width: 100%; }

@media (min-width: 900px) {
  .menu-sheet { display: none !important; }
}

/* Home hero */

.hero { padding-top: var(--space-24); }

@media (min-width: 900px) {
  .hero { padding-top: var(--space-32); }
}

.hero .display { max-width: 19em; }

.hero .button-row { margin-top: var(--space-8); }

.hero-media { margin-top: var(--space-16); }

@media (prefers-reduced-motion: no-preference) {
  .hero-media {
    animation: hero-rise 500ms ease-out both;
  }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Media mat */

.media-mat {
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-card);
  padding: 12px;
}

.media-mat img {
  width: 100%;
  border-radius: var(--radius-media-inner);
}

.media-caption {
  margin-top: var(--space-3);
  max-width: var(--prose-max-width);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  color: var(--color-slate);
}

.media-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .media-grid { grid-template-columns: 1fr 1fr; }
  .media-grid .span-2 { grid-column: 1 / -1; }
}

/* Unfilled image slot */

.image-slot {
  display: flex;
  align-items: flex-end;
  width: 100%;
  background: var(--color-chalk);
  border: 1px solid var(--color-hairline);
  padding: var(--space-4);
  color: var(--color-slate);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
}

/* Team */

.team-grid {
  display: grid;
  gap: var(--space-12) var(--space-6);
  grid-template-columns: 1fr;
  margin-top: var(--space-12);
}

@media (min-width: 700px) {
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}

.member-portrait {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-portrait);
  border: 1px solid var(--color-hairline);
}

.member-body { margin-top: var(--space-4); }

.member-name {
  font-size: var(--text-subheading);
  line-height: var(--leading-subheading);
  letter-spacing: var(--tracking-subheading);
  font-weight: var(--weight-light);
}

.member-role {
  margin-top: var(--space-1);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  color: var(--color-slate);
}

.member-bio {
  margin-top: var(--space-3);
  max-width: 34ch;
}

.member-link {
  display: inline-block;
  margin-top: var(--space-3);
}

/* Tags */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag {
  display: inline-block;
  padding: 2px 12px;
  border: 1px solid var(--color-longleaf);
  border-radius: var(--radius-pill);
  color: var(--color-longleaf);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  white-space: nowrap;
}

/* Project entry */

.project-list { margin-top: var(--space-16); }

.project {
  border-top: 1px solid var(--color-hairline);
  padding-top: var(--space-16);
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}

.project + .project { margin-top: var(--space-24); }

.project-media { order: -1; }

@media (min-width: 900px) {
  .project {
    padding-top: var(--space-24);
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-6);
    align-items: start;
  }
  .project-text { grid-column: 1 / span 5; padding-right: var(--space-6); }
  .project-media { grid-column: 6 / span 7; order: 0; }
}

.project-title {
  font-size: var(--text-heading);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  font-weight: var(--weight-light);
  max-width: 20ch;
}

.project-meta {
  margin-top: var(--space-3);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  color: var(--color-slate);
}

.project-text .tag-list { margin-top: var(--space-4); }

.project-description { margin-top: var(--space-6); max-width: var(--prose-max-width); }
.project-description > * + * { margin-top: var(--space-4); }

/* Card */

.card {
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-card);
  padding: var(--card-padding);
}

/* Split layout (Product, Mission, About sections) */

.split {
  display: grid;
  gap: var(--space-6) var(--space-6);
  grid-template-columns: 1fr;
  border-top: 1px solid var(--color-hairline);
  padding-top: var(--space-12);
}

.split + .split { margin-top: var(--space-16); }

@media (min-width: 900px) {
  .split { grid-template-columns: repeat(12, 1fr); }
  .split > :first-child { grid-column: 1 / span 5; }
  .split > :last-child { grid-column: 6 / span 7; }
}

.section-list { margin-top: var(--space-16); }

/* Contact */

.contact-layout {
  display: grid;
  gap: var(--space-12);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .contact-layout {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-6);
    align-items: start;
  }
  .contact-intro { grid-column: 1 / span 5; padding-right: var(--space-6); }
  .contact-form-card { grid-column: 7 / span 6; }
}

.contact-email {
  margin-top: var(--space-8);
  font-size: var(--text-lede);
  line-height: var(--leading-lede);
  letter-spacing: var(--tracking-lede);
  font-weight: var(--weight-light);
  word-break: break-word;
}

.contact-intro .button-row { margin-top: var(--space-8); }

.form-intro { margin-bottom: var(--space-8); }

.field + .field { margin-top: var(--space-6); }

.field label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  color: var(--color-pine-ink);
}

.field .optional { color: var(--color-slate); }

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--color-chalk);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-input);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-pine-ink);
  appearance: none;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--color-slate); }

.field input:focus,
.field textarea:focus {
  border-color: var(--color-longleaf);
  outline: 2px solid var(--color-longleaf);
  outline-offset: 2px;
}

.field [aria-invalid="true"] { border-color: var(--color-error); }

.field-error {
  margin-top: var(--space-2);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  color: var(--color-error);
}

.field-error:empty { display: none; }

.form-actions { margin-top: var(--space-8); }

.form-status {
  margin-top: var(--space-6);
  max-width: var(--prose-max-width);
}

.form-status:empty { display: none; }

.form-status.is-error { color: var(--color-error); }

/* Turnstile check: invisible unless Cloudflare needs the visitor to click */
.turnstile { margin-top: var(--space-4); }

/* Keep the form clear of the floating nav when linked to directly */
#contact-form { scroll-margin-top: 112px; }

button:disabled { cursor: progress; opacity: 0.7; }

@media (prefers-reduced-motion: no-preference) {
  .form-status.is-visible { animation: fade-in 200ms ease-out both; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Footer band */

.site-footer {
  margin-top: var(--section-gap);
  background: var(--surface-dark);
  color: var(--color-paper);
  padding-block: var(--space-16);
  font-size: 1rem;
}

.site-footer a { color: var(--color-paper); }

.footer-grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1fr auto; align-items: start; }
}

.footer-wordmark {
  font-size: var(--text-body);
  color: var(--color-paper);
  text-decoration: none;
}

.footer-wordmark:hover { text-decoration: none; }

.footer-email { margin-top: var(--space-3); }

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
}

.footer-copy {
  margin-top: var(--space-12);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  color: var(--color-paper);
  opacity: 0.8;
}

.site-footer :focus-visible { outline-color: var(--color-paper); }

/* ==================================================================
   Motion and interaction layer (driven by assets/js/effects.js)
   ================================================================== */

/* Page transitions between pages, nav stays put */

@view-transition { navigation: auto; }

.site-header { view-transition-name: site-header; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 260ms; }

/* Dot field canvases */

.hero,
.site-footer {
  position: relative;
  isolation: isolate;
}

.dot-field {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms ease-out;
}

.dot-field.is-ready { opacity: 1; }

.hero .dot-field {
  top: -120px; /* runs up behind the floating nav */
  height: calc(100% + 120px);
}

.site-footer .dot-field {
  top: 0;
  height: 100%;
}

/* Headline words rise out of a mask */

.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.word-inner { display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  /* Hide the headline until it has been split, with a safety net
     in case the script never runs. */
  .js [data-split-words]:not(.is-split) {
    visibility: hidden;
    animation: show-anyway 0s 1.2s forwards;
  }

  .fx .word-inner {
    transform: translateY(105%);
    animation: word-up 900ms cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
    animation-delay: calc(var(--i) * 45ms + 120ms);
  }

  .fx .hero-actions {
    opacity: 0;
    animation: fade-up 700ms cubic-bezier(0.2, 0.7, 0.1, 1) 700ms forwards;
  }

  .fx .hero-media { animation-delay: 850ms; animation-duration: 900ms; }
}

@keyframes show-anyway { to { visibility: visible; } }

@keyframes word-up { to { transform: translateY(0); } }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Hero screenshot: tilted back, flattens as you scroll */

.hero-media { perspective: 1800px; }

.hero-tilt {
  transform-origin: 50% 0%;
  will-change: transform;
}

/* Reveal on scroll */

.fx [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease-out var(--reveal-delay, 0ms),
    transform 900ms cubic-bezier(0.2, 0.7, 0.1, 1) var(--reveal-delay, 0ms);
}

.fx [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Magnetic buttons */

[data-magnetic] {
  transition:
    background-color 150ms ease-out,
    transform 400ms cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* Screenshot zoom button and lightbox */

.media-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: var(--radius-media-inner);
  overflow: hidden;
  cursor: zoom-in;
}

.media-zoom:disabled { cursor: default; }

.media-zoom img { transition: transform 700ms cubic-bezier(0.2, 0.7, 0.1, 1); }

.media-zoom:not(:disabled):hover img { transform: scale(1.015); }

.lightbox {
  width: min(1400px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 12px;
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-card);
  color: var(--color-pine-ink);
}

.lightbox::backdrop { background: rgb(15 36 25 / 0.72); }

.lightbox-mat img {
  width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: var(--radius-media-inner);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px 8px 4px 12px;
}

.lightbox-caption {
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  color: var(--color-slate);
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lightbox-in 320ms cubic-bezier(0.2, 0.7, 0.1, 1); }
  .lightbox[open]::backdrop { animation: fade-in 320ms ease-out; }
}

@keyframes lightbox-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Nav: sliding outline indicator */

.nav-links { position: relative; }

.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  border: 1px solid var(--color-longleaf);
  border-radius: var(--radius-pill);
  pointer-events: none;
  opacity: 0;
  transition:
    transform 380ms cubic-bezier(0.2, 0.7, 0.1, 1),
    width 380ms cubic-bezier(0.2, 0.7, 0.1, 1),
    opacity 200ms ease-out;
}

.nav-links.has-indicator a[aria-current="page"] { border-color: transparent; }
.nav-links.has-indicator a:hover { text-decoration: none; }

/* Mission "bridge" on Home: nonprofits and developers joined by the mark */

.mission-heading { max-width: 22ch; }

.bridge {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-top: var(--space-12);
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-hairline);
  border-bottom: 1px solid var(--color-hairline);
}

.bridge-side p {
  margin-top: var(--space-3);
  max-width: 34ch;
  color: var(--color-slate);
}

.bridge-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.bridge-line {
  flex: 1;
  height: 1px;
  background: var(--color-hairline);
  transform-origin: left center;
}

.bridge-line:last-child { transform-origin: right center; }

.bridge-mark {
  flex: none;
  width: 70px;
  height: 30px;
}

@media (min-width: 900px) {
  .bridge {
    grid-template-columns: 1fr minmax(160px, 1fr) 1fr;
    align-items: center;
    gap: var(--space-6);
  }
  .bridge-side:last-child { text-align: left; }
}

@media (max-width: 899px) {
  .bridge-link { max-width: 280px; }
}

.fx .bridge .bridge-line {
  transform: scaleX(0);
  transition: transform 900ms cubic-bezier(0.2, 0.7, 0.1, 1) 350ms;
}

.fx .bridge.is-in .bridge-line { transform: scaleX(1); }

.bridge-result {
  margin-top: var(--space-6);
  max-width: var(--prose-max-width);
}

/* Live data section */

.live {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .live {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-6);
    align-items: center;
  }
  .live-text { grid-column: 1 / span 5; padding-right: var(--space-6); }
  .live-media { grid-column: 6 / span 7; }
}

.live-text .heading { margin-top: var(--space-4); }
.live-text .prose { margin-top: var(--space-6); }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px 12px 2px 10px;
  border: 1px solid var(--color-longleaf);
  border-radius: var(--radius-pill);
  color: var(--color-longleaf);
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
}

.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-longleaf);
}

@media (prefers-reduced-motion: no-preference) {
  .live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--color-longleaf);
    border-radius: 50%;
    animation: live-pulse 1.8s ease-out infinite;
  }
}

@keyframes live-pulse {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(3); opacity: 0; }
}

/* Nav: Home (the wordmark) as its own tinted chip, split off by a divider */

.nav-pill { padding-left: 8px; }

.home-link {
  padding: 8px 14px;
  background: var(--color-chalk);
  border: 1px solid var(--color-hairline);
  border-radius: 12px; /* nav radius 20 minus the 8px inset */
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}

.home-link:hover { background: rgb(15 36 25 / 0.07); }

.home-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* The logo mark: pixel hearts on a 21 x 9 grid joined by an infinity curve */
.home-mark {
  width: 28px;
  height: 12px;
}

.home-link[aria-current="page"] {
  border-color: var(--color-longleaf);
  color: var(--color-longleaf);
}

.nav-divider { display: none; }

@media (min-width: 900px) {
  .nav-pill .home-link { margin-right: 0; }

  .nav-divider {
    display: block;
    width: 1px;
    height: 24px;
    background: var(--color-hairline);
    margin: 0 var(--space-2) 0 var(--space-1);
  }
}

.menu-sheet-top { padding-left: 9px; }

/* Team */

.team-more { margin-top: var(--space-8); }

.team-grid-full .member-bio { max-width: 40ch; }

.page-intro .team-grid { margin-top: var(--space-16); }

/* Photo marquee */

.gallery-section { padding-top: var(--section-gap); }

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.marquee {
  margin-top: var(--space-8);
  overflow: hidden;
  padding-block: 4px; /* room for focus rings */
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 55s linear infinite;
}

.marquee-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  padding-right: var(--space-6);
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track,
.marquee.is-paused .marquee-track { animation-play-state: paused; }

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

.gallery-item { flex: none; }

.gallery-zoom { border-radius: var(--radius-portrait); }

.gallery-item img {
  height: clamp(220px, 26vw, 360px);
  width: auto;
  border-radius: var(--radius-portrait);
  border: 1px solid var(--color-hairline);
}

.gallery-caption {
  margin-top: var(--space-3);
  max-width: 36ch;
  font-size: var(--text-small);
  line-height: var(--leading-small);
  letter-spacing: 0;
  color: var(--color-slate);
}

@media (prefers-reduced-motion: reduce) {
  /* No automatic motion: a row you can scroll yourself instead. */
  .marquee { overflow-x: auto; padding-inline: var(--page-gutter); }
  .marquee-group[aria-hidden="true"],
  [data-marquee-toggle] { display: none; }
}

/* Statement that lights up word by word as you scroll */

.statement {
  max-width: 26ch;
  font-size: clamp(1.875rem, 1rem + 3vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: var(--weight-light);
}

.lit-word { transition: opacity 120ms linear; }

/* Footer: large wordmark cut off by the bottom edge */

.site-footer {
  overflow: hidden;
  padding-bottom: 0;
}

.footer-mark {
  max-width: calc(var(--page-max-width) + 2 * var(--page-gutter));
  margin: var(--space-16) auto -0.2em;
  padding-inline: var(--page-gutter);
  /* "ImpactOS NC" is about 5.5em wide, so this fills the content width. */
  font-size: min(calc((100vw - 2 * var(--page-gutter) - 16px) * 0.178), 13.25rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: var(--weight-light);
  color: var(--color-paper);
  white-space: nowrap;
  user-select: none;
}

.footer-mark .letter { display: inline-block; }

.fx .footer-mark[data-reveal] {
  opacity: 1;
  transform: none;
}

.fx .footer-mark .letter {
  transform: translateY(60%);
  opacity: 0;
  transition:
    transform 1000ms cubic-bezier(0.2, 0.7, 0.1, 1) calc(var(--i) * 45ms),
    opacity 600ms ease-out calc(var(--i) * 45ms);
}

.fx .footer-mark.is-in .letter {
  transform: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
