/* Infravane - shared design system
   Deep graphite · signal red · warm white · hairlines · dense grid */

:root {
  --bg: #0C0E12;
  --bg-elevated: #12151B;
  --bg-inset: #0A0C10;
  --accent: #FF493D;
  --accent-soft: rgba(255, 73, 61, 0.12);
  --text: #F2F1EE;
  --text-secondary: #A8ADB6;
  --text-muted: #6E7480;
  --border: rgba(242, 241, 238, 0.12);
  --border-soft: rgba(242, 241, 238, 0.08);
  --on-accent: #0C0E12;
  --surface-cta: #0A0C10;

  --font-sans: "Geist Sans", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1120px;
  --gutter: clamp(1.15rem, 3.5vw, 2rem);
  --header-h: 64px;
  --col: calc((100% - 11 * var(--gap)) / 12);
  --gap: 1.25rem;
  --radius: 2px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  margin: 0;
}
button { cursor: pointer; padding: 0; }
::selection { background: var(--accent); color: #fff; }

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

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

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

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

.section {
  padding: clamp(2.75rem, 6vw, 4.25rem) 0;
  border-top: 1px solid var(--border-soft);
}

.section-tight {
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.section-label {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-head {
  display: grid;
  gap: 0.75rem 2rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 768px) {
  .section-head {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: end;
    margin-bottom: 2rem;
  }
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.section-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.975rem;
  max-width: 38rem;
}

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lede {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 38rem;
}

.period { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark img {
  height: 18px;
  width: auto;
}
@media (min-width: 880px) {
  .wordmark img { height: 20px; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.35rem;
}
.nav-desktop a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.15s var(--ease);
}
.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  color: var(--text);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-right: -0.4rem;
  color: var(--text);
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 40;
  background: var(--bg);
  padding: 1rem var(--gutter) 2rem;
  flex-direction: column;
  border-top: 1px solid var(--border-soft);
  overflow-y: auto;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.mobile-nav .btn {
  margin-top: 1.25rem;
  width: 100%;
}
body.nav-open { overflow: hidden; }

@media (min-width: 880px) {
  .nav-desktop { display: flex; }
  .menu-toggle { display: none !important; }
  .mobile-nav { display: none !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1;
  border-radius: var(--radius);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn .arrow { transition: transform 0.15s var(--ease); }
.btn:hover .arrow { transform: translateX(2px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.1rem;
}
.btn-primary:hover { background: #ff5c51; }

.btn-ghost {
  color: var(--text);
  padding: 0.8rem 0.15rem;
  border-bottom: 1px solid transparent;
}
.btn-ghost:hover { border-bottom-color: rgba(242, 241, 238, 0.35); }

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  font-size: 0.8125rem;
}
.btn-outline:hover { border-color: rgba(242, 241, 238, 0.28); }

.btn-dark {
  background: var(--surface-cta);
  color: var(--text);
  padding: 0.85rem 1.2rem;
}
.btn-dark:hover { background: #161920; }

.header-cta { display: none !important; }
@media (min-width: 880px) {
  .header-cta { display: inline-flex !important; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: clamp(2.25rem, 5vw, 3.25rem) 0 clamp(1.75rem, 4vw, 2.5rem);
}
.page-hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  max-width: 18ch;
}
.page-hero .lede { margin: 0; }

/* ---------- Home hero ---------- */
.home-hero {
  padding: clamp(1.75rem, 4vh, 2.5rem) 0 clamp(1.75rem, 4vh, 2.5rem);
}
.home-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
}
@media (min-width: 960px) {
  .home-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 1.5rem 2.25rem;
    min-height: 0;
  }
}

.home-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 14ch;
}
.home-hero .line2 { white-space: nowrap; }

.home-hero .lede {
  margin: 0 0 1.5rem;
  max-width: 34rem;
  font-size: 0.9875rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
}

.hero-visual {
  width: 100%;
  aspect-ratio: 5 / 4;
  max-height: 300px;
  position: relative;
}
@media (min-width: 960px) {
  .hero-visual {
    max-height: none;
    height: 100%;
    min-height: 380px;
    aspect-ratio: auto;
  }
}
.hero-visual canvas,
.hero-visual svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Strip ---------- */
.strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.95rem var(--gutter);
  text-align: center;
}
.strip p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text);
}
.strip .dot {
  color: var(--accent);
  margin: 0 0.4em;
  font-weight: 600;
}

/* ---------- Capability / system modules ---------- */
.module-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.module {
  display: grid;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.module:last-child { border-bottom: none; }

@media (min-width: 800px) {
  .module {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    gap: 1.5rem 2.5rem;
    padding: 1.75rem 0;
    align-items: start;
  }
}

.module-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.module-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.925rem;
}

.module-meta {
  display: grid;
  gap: 0.65rem;
}
.module-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  font-size: 0.85rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-soft);
}
.module-row:first-child { border-top: none; padding-top: 0; }
.module-row dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 0.15rem;
}
.module-row dd {
  margin: 0;
  color: var(--text-secondary);
}

/* ---------- Work panels ---------- */
.work-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
@media (min-width: 900px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
}

.work-panel {
  background: var(--bg);
  padding: 1.35rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100%;
  transition: background 0.15s var(--ease);
}
.work-panel:hover { background: var(--bg-elevated); }

.work-panel .status {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(255, 73, 61, 0.35);
  padding: 0.25rem 0.45rem;
}

.work-panel h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.work-panel p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  flex: 1;
}
.work-panel .link {
  font-size: 0.8125rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.work-panel .link:hover { color: var(--accent); }

/* ---------- Standard list ---------- */
.standard-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}
.standard-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.85rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: start;
}
.standard-item .idx {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--accent);
  padding-top: 0.2rem;
}
.standard-item h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.standard-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  max-width: 48rem;
}
@media (min-width: 800px) {
  .standard-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
  }
  .standard-item:nth-child(odd) {
    border-right: 1px solid var(--border-soft);
    padding-right: 1.25rem;
  }
}

/* ---------- Lab areas ---------- */
.lab-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
@media (min-width: 800px) {
  .lab-grid { grid-template-columns: repeat(3, 1fr); }
}
.lab-card {
  background: var(--bg);
  padding: 1.35rem 1.2rem 1.5rem;
}
.lab-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.lab-card p {
  margin: 0 0 0.85rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.lab-card .q-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.lab-card ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}
.lab-card li { margin-bottom: 0.3rem; }

/* ---------- Facts table (content-width only — no full-bleed hairlines) ---------- */
.facts-block {
  max-width: 28rem;
}
.facts {
  width: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.facts th,
.facts td {
  text-align: left;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: baseline;
}
.facts th {
  white-space: nowrap;
  padding-right: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.facts td {
  color: var(--text-secondary);
  white-space: normal;
  overflow-wrap: anywhere;
}
.facts td strong { color: var(--text); font-weight: 500; }
.facts tr:last-child th,
.facts tr:last-child td { border-bottom: none; }

/* ---------- Prose pages ---------- */
.prose {
  max-width: 42rem;
}
.prose h2 {
  margin: 2rem 0 0.65rem;
  font-size: 1.15rem;
}
.prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
}
.prose p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
}
.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--text-secondary);
}
.prose li { margin-bottom: 0.35rem; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }

/* ---------- Detail page ---------- */
.detail-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 900px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr);
    gap: 3rem;
    align-items: start;
  }
}
.detail-side {
  border: 1px solid var(--border);
  padding: 1.15rem 1.2rem;
  background: var(--bg-elevated);
}
.detail-side h2 {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.detail-side dl { margin: 0; }
.detail-side dt {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.75rem;
}
.detail-side dt:first-child { margin-top: 0; }
.detail-side dd {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ---------- Contact form ---------- */
.form {
  max-width: 32rem;
  display: grid;
  gap: 1rem;
}
.field { display: grid; gap: 0.35rem; }
.field label {
  font-size: 0.8125rem;
  color: var(--text);
}
.field .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  color: var(--text);
  transition: border-color 0.15s var(--ease);
}
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field .error {
  font-size: 0.75rem;
  color: #ff8a82;
  display: none;
}
.field.is-invalid .error { display: block; }
.field.is-invalid input,
.field.is-invalid textarea {
  border-color: #ff8a82;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
}
.form-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 28rem;
}
.form-status {
  display: none;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.form-status.is-visible { display: block; }
.form-status a { color: var(--accent); }

/* ---------- Final CTA ---------- */
.final-cta {
  background: var(--accent);
  color: #fff;
  padding: clamp(2.5rem, 6vw, 3.5rem) 0;
  border-top: none;
}
.final-cta-inner {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  align-items: flex-start;
}
.final-cta h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  color: #fff;
  max-width: 14ch;
  letter-spacing: -0.03em;
}
@media (min-width: 720px) {
  .final-cta-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 1.75rem 0 1.5rem;
}
.footer-top {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
}
.footer-nav a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.footer-nav a:hover { color: var(--text); }
.footer-mail {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.footer-mail:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
}
.footer-bottom p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
}
@media (min-width: 800px) {
  .footer-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
  }
  .footer-legal { text-align: right; max-width: 36rem; }
}

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack { display: grid; gap: 1rem; }
.stack-sm { display: grid; gap: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
