/* technicaldomain.xyz — Technical Domain design system.
   Light (Birch) by default; html.dark switches the palette. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-variable.woff2') format('woff2');
}

:root {
  /* Core palette */
  --c-maple: #c22a2a;
  --c-ink: #14212b;
  --c-birch: #f7f4ee;
  --c-snow: #ffffff;
  --c-granite: #55606a;
  --c-lake: #1f5a85;
  --c-spruce: #2f6b4f;
  --c-toque: #f2b705;

  /* Site tokens — light */
  --bg: var(--c-birch);
  --bg2: #efe9df;
  --surface: var(--c-snow);
  --text: var(--c-ink);
  --muted: var(--c-granite);
  --line: #14212b24;
  --line-strong: #14212b47;
  --maple: var(--c-maple);
  --maple-hover: #a51f22;
  --maple-text: var(--c-maple);
  --on-maple: #ffffff;
  --link: var(--c-lake);
  --spruce: var(--c-spruce);
  --toque: var(--c-toque);
  --shadow: 0 1px 2px #14212b14, 0 12px 32px -12px #14212b2e;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --max: 1160px;
  --gutter: 28px;
  --header-h: 68px;
  color-scheme: light;
}
html.dark {
  --bg: #0e161d;
  --bg2: #121d26;
  --surface: #16232e;
  --text: #f1ede6;
  --muted: #a7b0b8;
  --line: #f1ede621;
  --line-strong: #f1ede642;
  --maple-hover: #d63a2f;
  --maple-text: #ff7a6b;
  --link: #7cc4f0;
  --spruce: #6fcf9f;
  --shadow: 0 1px 2px #0006, 0 16px 40px -16px #000a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
html:has(.sub-nav) { scroll-padding-top: calc(var(--header-h) + 72px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(40px, 6.4vw, 72px); font-weight: 800; letter-spacing: -0.035em; }
h1 span, .spec-display span { color: var(--maple-text); }
h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 750; }
h2 em { font-style: normal; color: var(--muted); font-weight: 600; }
h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
h4 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin: 28px 0 10px; }
p { margin: 0 0 14px; }
code, pre { font-family: var(--mono); font-size: 13px; }
b { font-weight: 650; }
:focus-visible { outline: 2px solid var(--maple); outline-offset: 3px; border-radius: var(--radius-sm); }

.ico {
  display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -0.2em;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.mark { display: block; flex: none; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 14px; background: var(--maple); color: var(--on-maple); border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

.eyebrow { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--maple-text); margin: 0 0 16px; }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 60ch; }
.hint { font-size: 13.5px; color: var(--muted); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.button:hover { border-color: var(--text); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--maple); border-color: var(--maple); color: var(--on-maple); }
.button.primary:hover { background: var(--maple-hover); border-color: var(--maple-hover); }
.button.small { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.text-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  height: var(--header-h); padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 36px; height: 36px; }
.brand > span { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 16px; font-weight: 750; letter-spacing: -0.015em; white-space: nowrap; }
.brand small { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.desktop-nav { display: flex; gap: 4px; margin: 0 auto; }
.desktop-nav a, .mobile-menu a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); font-size: 14.5px; font-weight: 550; text-decoration: none; }
.desktop-nav a:hover, .mobile-menu a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.desktop-nav a[aria-current="true"], .mobile-menu a[aria-current="true"] { color: var(--text); }
.desktop-nav a[aria-current="true"] { box-shadow: inset 0 -2px 0 var(--maple); border-radius: 0; }
.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.desktop-nav + .header-actions { margin-left: 0; }
.language { display: inline-flex; gap: 2px; padding: 10px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.06em; color: var(--muted); border-radius: var(--radius-sm); text-decoration: none; }
.language span[aria-current="true"] { color: var(--text); }
.language:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.icon-button, .menu-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); border-radius: var(--radius-sm); cursor: pointer; font-size: 20px; }
.icon-button:hover, .menu-button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.menu-button { display: none; }
.mobile-menu { position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 49; display: flex; flex-direction: column; padding: 8px 20px 20px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.mobile-menu a { padding: 14px 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 16px; }

/* Layout */
main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 96px; }
.content-section { padding-top: 64px; margin-top: 64px; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 56px; align-items: end; margin-bottom: 36px; }
.section-heading h2 { margin: 0; }
.section-heading > p { margin: 0; color: var(--muted); max-width: 52ch; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 56px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 40px; }
.page-heading { padding: 80px 0 24px; }
.page-heading .lead { margin-bottom: 0; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 56px; align-items: center; padding: 72px 0 8px; }
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 28px; }
.cover {
  position: relative; padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, color-mix(in srgb, var(--text) 5%, transparent) 27px 28px),
    var(--surface);
  box-shadow: var(--shadow);
}
.cover-mark { display: grid; place-items: center; padding: 18px 0 26px; color: var(--text); }
.cover-mark .mark { width: min(168px, 60%); height: auto; }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 11px 0; border-top: 1px dashed var(--line-strong); }
.facts dt { font: 600 11px/1.6 var(--font); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); padding-top: 2px; }
.facts dd { margin: 0; font-size: 14.5px; font-weight: 550; }
.cover-stamp {
  position: absolute; top: 18px; right: 18px; margin: 0; padding: 4px 9px;
  border: 2px solid var(--maple-text); border-radius: var(--radius-sm); color: var(--maple-text);
  font: 700 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; transform: rotate(6deg);
}

/* Novelty goods: coupon-style tiles */
.novelty { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; padding: 0; margin: 0; }
.novelty li { padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); }
.novelty h3 { margin: 0 0 8px; }
.novelty p { margin: 0; color: var(--muted); font-size: 15px; }

.fine-print { align-self: start; padding: 24px; border-left: 3px solid var(--maple); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.fine-print h3 { margin-top: 0; }
.fine-print p { color: var(--muted); font-size: 14.5px; margin: 0; }
#company h2 { margin-bottom: 20px; }

/* Lists used by the guide */
.rules { list-style: none; padding: 0; margin: 0; }
.rules li { position: relative; padding: 9px 0 9px 22px; border-top: 1px solid var(--line); font-size: 15px; }
.rules li:first-child { border-top: 0; }
.rules li::before { content: ''; position: absolute; left: 2px; top: 19px; width: 10px; height: 2px; background: var(--maple); }
.rules li.warn { color: var(--text); }
.rules li.warn::before { content: '!'; width: 14px; height: 14px; top: 13px; left: 0; border-radius: 50%; background: var(--maple); color: var(--on-maple); font: 800 10px/14px var(--font); text-align: center; }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 40px; }
.mini-list li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.mini-list b { font: 700 13px/1.75 var(--mono); color: var(--maple-text); }
.download-list { list-style: none; padding: 0; margin: 0; }
.download-list li { border-top: 1px solid var(--line); }
.download-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; min-height: 44px; font-size: 15px; font-weight: 550; text-decoration: none; }
.download-list a::after { content: '↓'; font-weight: 700; color: var(--muted); }
.download-list a:hover::after { color: var(--maple-text); }

/* Brand guide */
.sub-nav {
  position: sticky; top: var(--header-h); z-index: 10;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin: 24px calc(var(--gutter) * -1) 0; padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sub-nav::-webkit-scrollbar { display: none; }
.sub-nav a { flex: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13.5px; font-weight: 550; text-decoration: none; }
.sub-nav a:hover { color: var(--text); border-color: var(--line-strong); }
.sub-nav + .content-section { margin-top: 32px; border-top: 0; padding-top: 32px; }
.tagline-card { padding: 24px; border-radius: var(--radius-lg); background: var(--bg2); }
.tagline-card h3 { margin-top: 0; }
.tagline-card p { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; margin: 0 0 10px; }
.tagline-card p[lang="fr"] { color: var(--muted); font-weight: 550; }

.logo-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 32px; }
.stage { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 230px; padding: 28px 18px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.stage img, .stage > .mark { width: 112px; height: 112px; }
.stage figcaption { margin-top: auto; font-size: 12.5px; color: var(--muted); }
.stage.on-light { background: #f7f4ee; }
.stage.on-light figcaption { color: #55606a; }
.stage.on-dark { background: #0e161d; }
.stage.on-dark figcaption { color: #a7b0b8; }
.stage.lockup-stage { background: var(--surface); }
.brand.as-specimen { margin: auto 0 0; }
.brand.as-specimen .mark { width: 48px; height: 48px; }
.brand.as-specimen strong { font-size: 20px; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin-bottom: 24px; }
.swatch {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px;
  min-height: 116px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--c); color: var(--fg, #fff); font: inherit; text-align: left; cursor: copy;
}
.swatch span { font-size: 14px; font-weight: 650; }
.swatch code { font-size: 12px; opacity: .85; }
.swatch.copied::after { content: '✓'; position: absolute; top: 10px; right: 12px; font-weight: 800; }
.swatches.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.swatches.small .swatch { min-height: 78px; }
.swatches.small .swatch span { font: 600 12px/1.3 var(--mono); }

.specimen { padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.specimen h3 { margin-top: 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; }
.spec-display { font-size: clamp(32px, 4vw, 46px); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; margin: 8px 0 18px; }
.spec-eyebrow { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--maple-text); margin: 0; }
.spec-body { color: var(--muted); margin: 0; }
.scale { list-style: none; padding: 0; margin: 0; }
.scale li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.scale li:nth-child(1) b { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.scale li:nth-child(2) b { font-size: 20px; font-weight: 700; }
.scale li:nth-child(4) b { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.16em; }
.scale li:nth-child(5) b { font-family: var(--mono); }

.table-wrap { overflow-x: auto; margin-bottom: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.tokens { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tokens th { text-align: left; padding: 12px 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; background: var(--bg2); }
.tokens td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.tokens td:nth-child(2) { white-space: nowrap; }
.tokens code { font-size: 13px; }
.chip { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 3px; background: var(--c); border: 1px solid var(--line-strong); }
.do, .dont { padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.do h3, .dont h3 { display: flex; align-items: center; gap: 8px; margin-top: 0; }
.do h3 .ico { color: var(--spruce); }
.dont h3 .ico { color: var(--maple-text); }
.dont .rules li::before { background: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg2); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px 56px; max-width: var(--max); margin: 0 auto; padding: 40px var(--gutter) 48px; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand .mark { width: 32px; height: 32px; color: var(--text); }
.footer-brand strong { display: block; margin-bottom: 6px; }
.footer-brand p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 62ch; }
.footer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; font-size: 13.5px; color: var(--muted); }
.footer-meta address { font-style: normal; }
.footer-meta small { font-size: 12.5px; }

.not-found { min-height: 50vh; }

/* Responsive */
@media (max-width: 860px) {
  :root { --gutter: 16px; --header-h: 60px; }
  .desktop-nav { display: none; }
  .menu-button { display: grid; }
  .desktop-nav + .header-actions { margin-left: auto; }
  .hero, .section-heading, .two-col, .three-col, .footer-inner { grid-template-columns: 1fr; }
  .hero { gap: 32px; padding-top: 48px; }
  .novelty { grid-template-columns: 1fr 1fr; }
  .page-heading { padding-top: 48px; }
  .content-section { margin-top: 48px; padding-top: 48px; }
  .footer-meta { align-items: flex-start; text-align: left; }
}
@media (max-width: 600px) {
  .site-header { gap: 8px; }
  .brand { gap: 9px; }
  .brand .mark { width: 32px; height: 32px; }
  .brand small { display: none; }
  .language { padding: 10px 6px; }
  .novelty { grid-template-columns: 1fr; }
  .logo-stage { grid-template-columns: 1fr; gap: 10px; }
  .stage { min-height: 180px; padding: 20px 10px 12px; }
  .stage img, .stage > .mark { width: 80px; height: 80px; }
  .brand.as-specimen .mark { width: 36px; height: 36px; }
  .brand.as-specimen strong { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
