/* Albert Einstone's: "lab notebook" system.
   Layout: left-aligned 12-column page on engineering-paper ground; facts sit in drawing-style title blocks,
   specs in datasheet tables; product photography is the only rich color.
   Light = graph paper + navy ink. Dark = blueprint. Brass (humidor hardware) is the single accent. */
:root {
  --paper: #f1f3ef;
  --paper-2: #e6eae4;
  --grid: rgba(23, 35, 63, 0.055);
  --ink: #17233f;
  --ink-2: #4b5569;
  --rule: #c5ccc4;
  --surface: #ffffff;
  --brass: #7d5f27;
  --brass-hi: #b48b45;
  --ok: #2c6448;
  --err: #a2342a;
  --on-ink: #f1f3ef;
  --shadow: 0 1px 0 rgba(23, 35, 63, 0.08);

  --f-sans: "Archivo Variable", "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  --step-3: clamp(2.1rem, 1.4rem + 3vw, 3.75rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --header-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1727;
    --paper-2: #112036;
    --grid: rgba(196, 214, 238, 0.07);
    --ink: #e6ebf1;
    --ink-2: #a3b0c2;
    --rule: #2a3b55;
    --surface: #13233b;
    --brass: #d7b46e;
    --brass-hi: #e3c58b;
    --ok: #79c9a0;
    --err: #f2938a;
    --on-ink: #0d1727;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1727;
  --paper-2: #112036;
  --grid: rgba(196, 214, 238, 0.07);
  --ink: #e6ebf1;
  --ink-2: #a3b0c2;
  --rule: #2a3b55;
  --surface: #13233b;
  --brass: #d7b46e;
  --brass-hi: #e3c58b;
  --ok: #79c9a0;
  --err: #f2938a;
  --on-ink: #0d1727;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.05; text-wrap: balance; }
h1, h2 { font-stretch: 125%; font-weight: 760; letter-spacing: -0.012em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 650; font-stretch: 112%; line-height: 1.2; }
p { margin: 0; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: 38em; }
.prose { max-width: 40em; display: grid; gap: 1em; }
.muted { color: var(--ink-2); }
.small { font-size: var(--step--1); }
.code, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 8vw, 112px); }
.section + .section { border-top: 1px solid var(--rule); }
.section--tint { background: var(--paper-2); }
.section-head { display: grid; gap: 16px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 52em; }

/* Skip link */
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--on-ink); padding: 8px 12px; z-index: 60; }
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { width: 40px; height: 40px; }
.brand span { font-stretch: 125%; font-weight: 720; font-size: 1.02rem; letter-spacing: -0.005em; white-space: nowrap; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 10px; font-weight: 520; font-size: 0.95rem; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--brass-hi); }
.nav .btn { margin-left: 12px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--ink); color: var(--ink); font: inherit; font-weight: 600; padding: 6px 12px; border-radius: 2px; cursor: pointer; }
@media (max-width: 980px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 20px; gap: 0; }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .nav a[aria-current="page"] { border-bottom-color: var(--rule); color: var(--brass); }
  .nav .btn { margin: 16px 0 0; text-align: center; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 640; font-size: 0.98rem; line-height: 1.2;
  padding: 13px 18px; border-radius: 2px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--on-ink); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--brass); border-color: var(--brass); color: var(--on-ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: transparent; color: var(--brass); border-color: var(--brass); }
.btn--sm { padding: 9px 14px; font-size: 0.92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero { padding-block: clamp(40px, 6vw, 88px) clamp(40px, 5vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 24px; min-width: 0; }
.hero-figure { margin: 0; min-width: 0; }
.hero-figure img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 1px solid var(--ink); }
.hero-figure figcaption { margin-top: 10px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-figure { max-width: 520px; } }

/* Title block (drawing-style fact strip) */
.titleblock {
  margin-top: clamp(36px, 5vw, 64px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border: 1.5px solid var(--ink); background: var(--surface);
}
.titleblock > div { padding: 14px 16px 16px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; gap: 4px; min-width: 0; }
.titleblock dt { font-size: 0.8rem; color: var(--ink-2); }
.titleblock dd { margin: 0; font-weight: 640; font-size: 1.02rem; overflow-wrap: anywhere; }
.titleblock dd .mono { font-weight: 500; font-size: 0.98rem; }
.titleblock--stats dd { font-size: var(--step-2); font-stretch: 112%; font-weight: 720; line-height: 1.1; }

/* Datasheet tables */
.table-scroll { overflow-x: auto; border-top: 2px solid var(--ink); }
table.sheet { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 560px; }
table.sheet th, table.sheet td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); }
table.sheet thead th { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
table.sheet tbody th { font-weight: 640; }
table.sheet tbody tr:hover > * { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.sheet-note { margin-top: 14px; }

/* Photo rows */
.plates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 20px); margin-top: clamp(28px, 4vw, 48px); }
.plates figure { margin: 0; display: grid; gap: 8px; min-width: 0; }
.plates img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.plates figcaption { font-size: var(--step--1); color: var(--ink-2); }
@media (max-width: 760px) { .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Process steps (a real sequence) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 2px solid var(--ink); counter-reset: step; }
.steps li { padding: 20px 20px 4px 0; display: grid; gap: 8px; align-content: start; counter-increment: step; min-width: 0; }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--f-mono); font-size: 0.9rem; color: var(--brass); }
.steps p { color: var(--ink-2); font-size: 0.98rem; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .steps li { border-bottom: 1px solid var(--rule); padding-bottom: 18px; } }

/* Services: three numbered columns (home) */
/* Rows are shared across the columns (subgrid), so headings, text and links line up even when a heading wraps. */
.pillars { list-style: none; margin: 0; padding: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto 1fr auto; gap: 12px clamp(20px, 3vw, 40px); border-top: 2px solid var(--ink); counter-reset: pillar; }
.pillars li { counter-increment: pillar; grid-row: span 4; display: grid; grid-template-rows: subgrid; min-width: 0; }
.pillars li::before { content: counter(pillar, decimal-leading-zero); font-family: var(--f-mono); font-size: 0.9rem; color: var(--brass); }
.pillars h3 { font-size: var(--step-2); font-stretch: 125%; font-weight: 740; letter-spacing: -0.01em; }
.pillars p { color: var(--ink-2); }
@media (max-width: 860px) {
  .pillars { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 0; padding-top: 0; }
  .pillars li { grid-row: auto; grid-template-rows: none; gap: 12px; padding: 20px 0 24px; border-bottom: 1px solid var(--rule); }
  .pillars li:last-child { border-bottom: 0; padding-bottom: 0; }
}
.more { justify-self: start; font-weight: 640; text-decoration: none; border-bottom: 1.5px solid var(--brass-hi); padding-bottom: 2px; }
.eyebrow { font-family: var(--f-mono); font-size: 0.9rem; color: var(--brass); }

/* Options: a ruled grid of spec cells */
.specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1.5px solid var(--ink); }
.specs > div { background: var(--surface); padding: 18px 18px 22px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.specs h3 { font-size: var(--step-0); font-weight: 680; font-stretch: 112%; }
.specs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.specs li { color: var(--ink-2); font-size: 0.98rem; line-height: 1.45; }
.specs li strong { display: block; color: var(--ink); font-weight: 620; }
.specs .tier { display: block; margin-top: 2px; font-size: 0.85rem; color: var(--brass); }
@media (max-width: 980px) { .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .specs { grid-template-columns: 1fr; } }
.specs ul.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--rule); border-radius: 2px; padding: 3px 10px; color: var(--ink); font-size: 0.92rem; }

/* Short brass-rule bullets */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 26px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 0.8em; width: 12px; height: 2px; background: var(--brass); }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

/* Partners and co-brands */
.partners { display: grid; gap: 10px; }
.partners .label { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.partners .label ~ .label { margin-top: 18px; }

/* Two-column split */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .split, .split--even { grid-template-columns: 1fr; } }

/* Definition list (contact details) */
.record { margin: 0; border-top: 2px solid var(--ink); display: grid; grid-template-columns: minmax(150px, 15em) minmax(0, 1fr); }
.record dt, .record dd { padding: 12px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.record dt { color: var(--ink-2); font-size: 0.92rem; padding-right: 16px; }
.record dd { font-weight: 560; overflow-wrap: anywhere; }
@media (max-width: 560px) { .record { grid-template-columns: 1fr; } .record dt { border-bottom: 0; padding-bottom: 0; } }
.field-input { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--ink-2); border-radius: 2px; padding: 12px 14px; min-width: 0; width: 100%; }

/* Callout bands */
.band { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; } }
.phone { font-family: var(--f-mono); font-weight: 500; font-size: var(--step-2); letter-spacing: -0.01em; white-space: nowrap; }
.names { display: flex; flex-wrap: wrap; gap: 10px 28px; font-stretch: 112%; font-weight: 600; font-size: var(--step-1); max-width: 58em; }
.names--lg { font-size: clamp(1.25rem, 1rem + 0.8vw, 1.6rem); font-stretch: 118%; font-weight: 680; gap: 8px 32px; }
.names--sm { font-size: var(--step-0); font-weight: 560; gap: 4px 22px; }
.names small { font-size: 0.62em; font-weight: 500; font-stretch: 100%; color: var(--ink-2); }
.logos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.logos a { display: grid; place-items: center; background: #ffffff; border: 1px solid var(--rule); padding: 18px; aspect-ratio: 16 / 9; }
.logos img { max-height: 100%; width: auto; object-fit: contain; }
@media (max-width: 640px) { .logos { grid-template-columns: 1fr; } }

/* Forms */
.form input, .form select, .form textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--ink-2); border-radius: 2px; padding: 12px 14px; min-width: 0; width: 100%; }
.form { display: grid; gap: 18px; max-width: 46em; }
.form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 640px) { .form .row { grid-template-columns: 1fr; } }
.form .field { display: grid; gap: 6px; min-width: 0; }
.form label { font-weight: 600; font-size: 0.95rem; }
.form .hint { color: var(--ink-2); font-weight: 400; }
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .field-input:focus { outline: 2px solid var(--brass-hi); outline-offset: 1px; border-color: var(--ink); }
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; font-weight: 600; }
.form-status[data-state="ok"] { color: var(--ok); }
.form-status[data-state="error"] { color: var(--err); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; max-width: 34em; }
.inline-form input { flex: 1 1 240px; }

/* Media */
.figure { margin: 0; display: grid; gap: 8px; }
.figure img { width: 100%; border: 1px solid var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 20px); }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Footer */
.site-footer { border-top: 2px solid var(--ink); background: var(--paper-2); padding-block: 48px 40px; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 980px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h2 { font-size: 0.85rem; font-stretch: 100%; font-weight: 650; letter-spacing: 0; color: var(--ink-2); margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-legal { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--ink-2); font-size: var(--step--1); }

/* Emblem: black line art; inverted on dark grounds */
.emblem { filter: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .emblem { filter: invert(1); } }
:root[data-theme="dark"] .emblem { filter: invert(1); }

/* Age gate */
.agegate[hidden] { display: none !important; }
.agegate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.agegate-card { width: min(100%, 460px); background: var(--surface); border: 1.5px solid var(--ink); padding: clamp(24px, 5vw, 40px); display: grid; gap: 18px; justify-items: start; }
.agegate-card img { width: 88px; height: 88px; }
.agegate-card h2 { font-size: var(--step-2); }
body.gated { overflow: hidden; }

.preview-note { background: var(--ink); color: var(--on-ink); font-size: var(--step--1); padding: 8px var(--gutter); text-align: center; }
.preview-note a { color: inherit; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Long words in headings: hyphenate only when a word cannot fit */
h1, h2 { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }

/* Stacked datasheet rows on phones */
@media (max-width: 560px) {
  .table-scroll:has(.sheet--stack) { overflow-x: visible; }
  table.sheet--stack { min-width: 0; }
  table.sheet--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.sheet--stack tr { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  table.sheet--stack th, table.sheet--stack td { border: 0; padding: 0; }
  table.sheet--stack td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-2); font-size: 0.88rem; }
}

/* Title block: let a lone last fact span the row on phones */
@media (max-width: 520px) {
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
