/*
 * Foundry86 site styles.
 *
 * One stylesheet for every page. Colors are tokens on :root so the dark
 * theme only has to redefine them; components never name a raw color.
 */

/*
 * Fonts are self-hosted (Latin subset, SIL OFL 1.1; licenses in /fonts/) so
 * that no visitor data goes to a third-party font CDN.
 */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/fonts/archivo-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
}

:root {
  --bg: #F3F0E8;
  --ink: #17150F;
  --muted: #5C574E;
  --line: #D8D1C4;
  --surface: #F8F6F1;
  --dot: rgba(23, 21, 15, 0.09);
  --accent: #C2410C;

  --font-sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --ink: #ECE8DF;
    --muted: #A09A8E;
    --line: #2E2B26;
    --surface: #1A1917;
    --dot: rgba(236, 232, 223, 0.07);
    --accent: #F26B2E;
  }
}

/* Base */

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

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

.mono { font-family: var(--font-mono); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */

.site-header { border-bottom: 1px solid var(--line); }

.site-header .container,
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 32px;
}

.site-header .container { padding-block: 12px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.wordmark-name {
  font-weight: 700;
  font-stretch: 115%;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.wordmark-num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 21px;
  color: var(--accent);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  text-decoration: none;
}

.nav-list a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 5px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 120ms, color 120ms;
}

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--bg); }

/* Hero */

.hero {
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  border-bottom: 1px solid var(--line);
}

.hero .container {
  padding-block: clamp(72px, 10vw, 136px) clamp(64px, 8vw, 112px);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
}

.hero h1 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 600;
  font-stretch: 106%;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 48px;
  padding-top: 8px;
}

.hero-lede {
  margin: 0;
  flex: 0 1 520px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Home sections */

.section { border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }

.section .container {
  padding-block: clamp(64px, 8vw, 104px);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

/* The rule that runs from the heading to the right edge. */
.section-head::after {
  content: "";
  flex: 1 1 40px;
  height: 1px;
  background: var(--line);
  align-self: center;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  font-stretch: 106%;
  letter-spacing: -0.02em;
}

/* Products */

.product-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}

.product-grid > li { display: flex; }

.product-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  min-height: 216px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 120ms;
}

.product-card:hover { border-color: var(--ink); }

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.product-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.product-card h3 {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.product-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.product-link {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.product-link svg { transition: transform 120ms; }
.product-card:hover .product-link svg { transform: translate(2px, -2px); }

/* About */

.about-text {
  margin: 0;
  max-width: 760px;
  font-size: clamp(21px, 2.3vw, 27px);
  line-height: 1.42;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

/* Contact */

.contact-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
}

.contact-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.contact-list dt {
  flex: 1 1 200px;
  padding-top: 5px;
}

.contact-list dd {
  flex: 999 1 360px;
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
}

.accent-link {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.site-footer .container { padding-block: 24px; }

.site-footer p { margin: 0; padding: 12px 0; }

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

/* Legal pages */

.legal {
  padding-block: clamp(48px, 7vw, 88px) clamp(64px, 8vw, 112px);
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.legal-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
}

.legal-head h1 {
  margin: 0;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.05;
  font-weight: 600;
  font-stretch: 106%;
  letter-spacing: -0.025em;
}

.legal-dates {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.legal-dates time { color: var(--ink); }

.not-found-text {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
}

.legal-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px 72px;
}

.toc {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.toc li { border-bottom: 1px solid var(--line); }

.toc a {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.toc a:hover { color: var(--accent); }

.toc .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.legal-article {
  flex: 999 1 560px;
  min-width: 0;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  font-size: 17px;
  line-height: 1.68;
}

.legal-article section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-article h2 {
  margin: 0;
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.legal-article h2 .num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.legal-article p { margin: 0; }

.legal-article a {
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.legal-article address {
  font-style: normal;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
