/* Bardach Technologies v2 — design tokens.
   Palette: Black & Oxide Red (Brand/_BRAND.md, chosen under D-083). Type: Archivo (OFL, self-hosted)
   in two widths — 125 (expanded caps, display) and 100 (text) — plus the system mono for labels. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* palette — light */
  --paper: #f4f4f2;
  --paper-2: #e9e9e5;
  --ink: #0e0e0e;
  --ink-2: #33332f;
  --muted: #5b5b56;
  --line: rgba(14, 14, 14, 0.16);
  --line-strong: rgba(14, 14, 14, 0.82);
  --accent: #b4291f;          /* oxide red, 5.8:1 on paper */
  --on-accent: #ffffff;
  /* inverse band (dark in light mode, light in dark mode) */
  --inv-bg: #0e0e0e;
  --inv-fg: #f4f4f2;
  --inv-muted: #a3a39d;
  --inv-line: rgba(244, 244, 242, 0.18);
  --inv-accent: #e8604a;

  /* type */
  --font-sans: "Archivo", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  --text-2xl: clamp(1.75rem, 1.2rem + 2.4vw, 3.25rem);
  --text-3xl: clamp(2.1rem, 1.1rem + 4.2vw, 5rem);
  --text-hero: clamp(2.3rem, 0.7rem + 6.6vw, 7.75rem);

  /* space — an 8 pt base with a deliberately uneven section rhythm */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-section: clamp(4.5rem, 3rem + 6vw, 10rem);
  --space-section-tight: clamp(3rem, 2rem + 4vw, 6rem);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1440px;

  /* shape + motion */
  --radius-tool: 3px;          /* the logo's tool radius, used only on controls */
  --duration-fast: 150ms;
  --duration-normal: 320ms;
  --duration-slow: 900ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f0f0e;
    --paper-2: #1a1a18;
    --ink: #ededea;
    --ink-2: #cfcfc9;
    --muted: #9d9d97;
    --line: rgba(237, 237, 233, 0.16);
    --line-strong: rgba(237, 237, 233, 0.8);
    --accent: #e8604a;
    --on-accent: #0f0f0e;
    --inv-bg: #ededea;
    --inv-fg: #0f0f0e;
    --inv-muted: #55554f;
    --inv-line: rgba(15, 15, 14, 0.18);
    --inv-accent: #b4291f;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f0f0e;
  --paper-2: #1a1a18;
  --ink: #ededea;
  --ink-2: #cfcfc9;
  --muted: #9d9d97;
  --line: rgba(237, 237, 233, 0.16);
  --line-strong: rgba(237, 237, 233, 0.8);
  --accent: #e8604a;
  --on-accent: #0f0f0e;
  --inv-bg: #ededea;
  --inv-fg: #0f0f0e;
  --inv-muted: #55554f;
  --inv-line: rgba(15, 15, 14, 0.18);
  --inv-accent: #b4291f;
}

/* base: reset, type, links, focus, utilities */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-stretch: 100%;
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color var(--duration-normal) ease, color var(--duration-normal) ease;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* display type: Archivo expanded caps, the approved brand voice */
.wide {
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 0.94;
}
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
}
.muted { color: var(--muted); }
.lede { font-size: var(--text-lg); line-height: 1.45; color: var(--ink-2); max-width: 38ch; text-wrap: pretty; }
.prose p + p { margin-top: var(--space-4); }
.prose p { max-width: 62ch; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

.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;
}
.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono); font-size: var(--text-sm); text-decoration: none;
}
.skip:focus { top: var(--space-3); }

::selection { background: var(--accent); color: var(--on-accent); }

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

/* layout: container, grid, header, footer, section bands */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 1.6vw, 24px);
}
.grid > * { grid-column: 1 / -1; }

/* visible column lines — the "engineering drawing" ground, desktop only */
.ground {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; display: none;
}
.ground .wrap { height: 100%; }
.ground .grid { height: 100%; }
.ground span { border-left: 1px solid var(--line); opacity: 0.45; height: 100%; grid-column: auto; }
.ground span:last-child { border-right: 1px solid var(--line); }
@media (min-width: 1024px) { .ground { display: block; } }

/* header */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  min-height: 68px;
}
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand svg { height: 26px; width: auto; }
.nav { display: flex; align-items: center; gap: clamp(var(--space-4), 2.2vw, var(--space-6)); }
.nav a {
  position: relative; text-decoration: none; color: var(--ink); padding-block: var(--space-2);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"] { color: var(--accent); }
.head-tools { display: flex; align-items: center; gap: var(--space-2); }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-tool); color: var(--ink);
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--paper-2); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .brand svg { height: 22px; }
  .menu-btn { display: inline-grid; }
  .js .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: var(--space-2) var(--gutter) var(--space-5);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity var(--duration-normal) var(--ease-out-expo), transform var(--duration-normal) var(--ease-out-expo), visibility 0s linear var(--duration-normal);
  }
  .js .nav.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .js .nav a { padding-block: var(--space-4); border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
  .js .nav a::after { display: none; }
  .no-js .site-head__row { flex-wrap: wrap; padding-block: var(--space-3); }
  .no-js .nav { order: 3; width: 100%; flex-wrap: wrap; }
}

/* sections */
.section { padding-block: var(--space-section); }
.section--tight { padding-block: var(--space-section-tight); }
.section + .section:not(.band) { border-top: 1px solid var(--line); }
.band {
  background: var(--inv-bg); color: var(--inv-fg);
  --paper: var(--inv-bg); --ink: var(--inv-fg); --ink-2: var(--inv-fg); --muted: var(--inv-muted);
  --line: var(--inv-line); --accent: var(--inv-accent);
}
.sec-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 1.6vw, 24px); row-gap: var(--space-5);
  margin-bottom: clamp(var(--space-7), 5vw, var(--space-8));
}
.sec-head__label { grid-column: 1 / -1; display: flex; gap: var(--space-4); color: var(--muted); }
.sec-head__label b { color: var(--accent); font-weight: 500; }
.sec-head__title { grid-column: 1 / -1; font-size: var(--text-3xl); }
.sec-head__aside { grid-column: 1 / -1; color: var(--ink-2); max-width: 46ch; }
@media (min-width: 900px) {
  .sec-head__label { grid-column: 1 / 4; padding-top: 0.6em; flex-direction: column; gap: var(--space-1); }
  .sec-head__title { grid-column: 4 / 13; }
  .sec-head__aside { grid-column: 4 / 10; }
}

/* page header (inner pages) */
.page-head { padding-block: clamp(var(--space-7), 8vw, 8.5rem) clamp(var(--space-7), 6vw, var(--space-8)); border-bottom: 1px solid var(--line); }
.page-head__crumb { color: var(--muted); display: flex; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-head__crumb b { color: var(--accent); font-weight: 500; }
.page-head h1 { font-size: var(--text-hero); max-width: 14ch; }
.page-head .lede { margin-top: var(--space-6); }
@media (min-width: 900px) {
  .page-head .grid > .page-head__text { grid-column: 1 / 10; }
  .page-head .lede { margin-left: calc(100% / 9 * 3); max-width: 40ch; }
}

/* footer */
.site-foot { border-top: 1px solid var(--line-strong); padding-top: var(--space-7); overflow: hidden; }
.foot-cols { row-gap: var(--space-6); }
.foot-col { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); }
.foot-col .mono { color: var(--muted); margin-bottom: var(--space-2); }
.foot-col a { text-decoration: none; width: fit-content; }
.foot-col a:hover { text-decoration: underline; }
.foot-col address { font-style: normal; color: var(--ink-2); }
@media (min-width: 640px) { .foot-col { grid-column: span 6; } }
@media (min-width: 1024px) {
  .foot-col { grid-column: span 3; }
}
.foot-word { margin-top: clamp(var(--space-7), 8vw, 8rem); color: var(--ink); }
.foot-word svg { width: 100%; height: auto; }
.foot-legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-6);
  padding-block: var(--space-5) var(--space-6); margin-top: var(--space-5);
  border-top: 1px solid var(--line); color: var(--muted);
}
.foot-legal p { max-width: 70ch; }

/* components */

/* buttons + links with arrows */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-3);
  min-height: 48px; padding: 0 var(--space-5);
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: var(--radius-tool);
  font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; position: relative; overflow: hidden; isolation: isolate;
  transition: color var(--duration-normal) var(--ease-out-expo), border-color var(--duration-normal) ease;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  transform: translateY(101%); transition: transform var(--duration-normal) var(--ease-out-expo);
}
.btn:hover { color: var(--on-accent); border-color: var(--accent); }
.btn:hover::before { transform: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn .arr, .link-arr .arr { width: 12px; height: 12px; transition: transform var(--duration-normal) var(--ease-out-expo); }
.btn:hover .arr, .link-arr:hover .arr { transform: translateX(4px); }
.link-arr {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px;
  font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.4em;
}
.link-arr:hover { text-decoration-color: var(--accent); }
.link-arr .arr-ne { width: 11px; height: 11px; }

/* status chip — red only means "live state" */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 2px var(--space-3); border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap;
}
.chip--live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  animation: pulse 2.4s var(--ease-out-expo) infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* hero */
.hero { padding-block: clamp(var(--space-7), 7vw, 7.5rem) var(--space-section-tight); }
.hero__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); color: var(--muted); margin-bottom: clamp(var(--space-6), 4vw, var(--space-7)); }
.hero__meta b { color: var(--ink); font-weight: 500; }
.hero__title { font-size: var(--text-hero); }
.hero__title .ln { display: block; }
.hero__title .ln--indent { padding-left: clamp(0px, 9vw, 9.5rem); }
.hero__body { margin-top: clamp(var(--space-6), 4vw, var(--space-8)); row-gap: var(--space-7); align-items: start; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); margin-top: var(--space-6); }
@media (min-width: 900px) {
  .hero__copy { grid-column: 1 / 7; }
  .hero__facts { grid-column: 8 / 13; }
}

/* fact sheet (definition list) */
.facts { border-top: 1px solid var(--line-strong); }
.facts__title { padding-block: var(--space-3); color: var(--muted); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.facts dl { display: grid; grid-template-columns: minmax(7.5rem, 34%) 1fr; }
.facts dt, .facts dd { padding-block: var(--space-3); border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); padding-right: var(--space-4); }
.facts dd { font-size: var(--text-sm); color: var(--ink); }
.facts dd a { text-decoration-color: var(--line-strong); }

/* ventures */
.ventures { row-gap: clamp(var(--space-5), 2vw, var(--space-6)); }
.venture {
  position: relative; border: 1px solid var(--line-strong); background: var(--paper);
  padding: clamp(var(--space-5), 3vw, var(--space-7)); display: flex; flex-direction: column; gap: var(--space-5);
  transition: transform var(--duration-normal) var(--ease-out-expo), box-shadow var(--duration-normal) var(--ease-out-expo);
}
.venture__top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); color: var(--muted); }
.venture__name { font-size: var(--text-3xl); }
.venture__desc { color: var(--ink-2); max-width: 44ch; }
.venture__foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-4); }
@media (hover: hover) { .venture--feature:hover { transform: translate(-4px, -4px); box-shadow: 8px 8px 0 var(--ink); } }
.venture--feature:focus-within { box-shadow: 8px 8px 0 var(--ink); }
@media (min-width: 900px) {
  .venture--feature { grid-column: 1 / 8; min-height: 24rem; }
}

/* contact */
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); padding-block: var(--space-6); border-block: 1px solid var(--line-strong); }
.mail__addr { font-size: clamp(1.15rem, 0.4rem + 3.6vw, 3.6rem); text-decoration: none; text-transform: none; letter-spacing: -0.02em; overflow-wrap: anywhere; line-height: 1.05; }
.mail__addr:hover { color: var(--accent); }
.copy-btn { min-height: 44px; padding: 0 var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-tool); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; }
.copy-btn:hover { background: var(--ink); color: var(--paper); }
.no-js .copy-btn { display: none; }
.topics { margin-top: var(--space-7); row-gap: var(--space-6); }
.topic { border-top: 1px solid var(--line); padding-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.topic h3 { font-size: var(--text-lg); font-weight: 600; }
.topic p { color: var(--ink-2); font-size: var(--text-sm); max-width: 36ch; }
@media (min-width: 700px) { .topic { grid-column: span 6; } }
@media (min-width: 1024px) { .topic { grid-column: span 3; } }

/* closing band */
.cta-band__h { font-size: var(--text-3xl); max-width: 16ch; }
.cta-band__row { margin-top: var(--space-7); row-gap: var(--space-5); align-items: end; }
.cta-band .btn { background: var(--ink); color: var(--paper); }
@media (min-width: 900px) {
  .cta-band__p { grid-column: 1 / 6; }
  .cta-band__act { grid-column: 8 / 13; justify-self: end; }
}

/* legal */
.legal { row-gap: var(--space-7); }
.legal__nav { display: flex; flex-direction: column; gap: var(--space-1); }
.legal__nav a { text-decoration: none; padding-block: var(--space-2); border-bottom: 1px solid var(--line); }
.legal__nav a[aria-current="page"] { color: var(--accent); }
.legal__body h2 { font-size: var(--text-lg); font-weight: 650; margin: var(--space-7) 0 var(--space-3); }
.legal__body h2:first-of-type { margin-top: 0; }
.legal__body p, .legal__body li { max-width: 66ch; color: var(--ink-2); }
.legal__body ul { list-style: square; padding-left: 1.2em; }
.legal__body address { font-style: normal; }
.draft-note { border: 1px solid var(--accent); color: var(--accent); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-7); font-size: var(--text-sm); max-width: 66ch; }
@media (min-width: 900px) {
  .legal__nav { grid-column: 1 / 4; position: sticky; top: 100px; align-self: start; }
  .legal__body { grid-column: 4 / 11; }
}

/* reveal (progressive: content is visible without JS) */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 700ms ease, transform 900ms var(--ease-out-expo); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .venture--feature, .venture--feature:hover { transition: none; transform: none; }
  .chip--live::before { animation: none; }
}

/* page-specific placements */
.venture--side { align-self: start; }
@media (min-width: 900px) {
  .venture--side { grid-column: 9 / 13; }
  .contact-facts, .about-facts { grid-column: 4 / 11; }
}

/* home § 01: one editorial statement on the content column */
.statement { row-gap: var(--space-5); }
.statement__p { grid-column: 1 / -1; font-size: var(--text-lg); line-height: 1.45; max-width: 40ch; color: var(--ink); text-wrap: pretty; }
.statement__s { grid-column: 1 / -1; color: var(--ink-2); max-width: 46ch; }
@media (min-width: 900px) {
  .statement__p { grid-column: 4 / 12; }
  .statement__s { grid-column: 4 / 10; }
}
