/* Shared on every page (loaded after the page stylesheet): design tokens, layout container,
   type roles, navigation, footer and small shared components.
   Palette (--void … --paper) lives in the page stylesheets and is not changed here. */

/* ═══ TOKENS ═══ */
:root {
  /* Layout — one container, one left edge for nav, hero, section heads, grids, footer. */
  --container-max: 1440px;
  --gutter: clamp(20px, 4vw, 64px);
  /* Horizontal padding that puts content on the container edge. Use it as padding-inline
     on full-width blocks (the % resolves against the block's own width). */
  --edge: max(var(--gutter), (100% - var(--container-max)) / 2);
  --grid-gap: clamp(16px, 2vw, 32px);
  --section-space: clamp(72px, 8vw, 112px);

  /* Type */
  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --fs-body: clamp(16px, 15px + 0.2vw, 18px);   /* 16 px @360 → 18 px @1440 */
  --lh-body: 1.58;
  --measure: 62ch;
  --c-body: var(--pale);                         /* #b8a888 — 8.4:1 on --void, 7.7:1 on --dirt */

  /* Mono labels: two sizes, one tracking, two greys (both ≥ 4.5:1 on --void and --dirt). */
  --fs-label: 12px;
  --fs-action: 13px;                             /* nav items, action links, buttons */
  --ls-label: 0.12em;
  --c-label: var(--pale);                        /* 8.4:1 / 7.7:1 */
  --c-label-muted: var(--dim);                   /* 6.0:1 / 5.5:1 */

  /* Hero */
  --hero-focus: 58% 50%;                         /* object-position of the hero photo (Trinity lattice: edge right of centre) */
  --hero-stroke: 2px;                            /* outline weight of "DOESN'T LIE." */

  /* Nav */
  --nav-h: 76px;
  --nav-offset: calc(var(--nav-h) + 16px);       /* anchor offset under the sticky nav */
}
@media (max-width: 1180px) {
  :root { --nav-h: 64px; }
}
@media (max-width: 768px) {
  :root { --hero-stroke: 1.5px; }
}

/* ═══ BASE ═══ */
h1, h2 { text-wrap: balance; }
section[id], article[id], header[id] { scroll-margin-top: var(--nav-offset); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Decorative section numbers: drawn by CSS from data-num (aria-hidden, not content). */
.section-num::before { content: attr(data-num); }

/* ═══ BUTTONS ═══ */
.btn {
  font-family: var(--font-mono); font-size: var(--fs-action);
  letter-spacing: var(--ls-label); min-height: 44px; justify-content: center;
}
/* --paper on --rust = 5.7:1 (--bone was 3.9:1, below AA). */
.btn.rust { color: var(--paper, #e8dfc9); }
.btn.rust:hover { color: var(--void); }

/* ═══ NAV ═══ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, rgba(13,11,9,0.96), rgba(13,11,9,0.82));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mud);
}
.nav-inner {
  max-width: none; margin: 0; min-height: var(--nav-h);
  padding: 0 var(--edge);
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 32px;
}
.wordmark {
  font-family: var(--font-display); font-size: 22px; letter-spacing: 0.06em;
  color: var(--bone); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.nav-links {
  display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0;
  font-family: var(--font-mono); font-size: var(--fs-action);
  letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--c-label);
}
.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: var(--bone); }
.nav-links a:focus-visible { outline: 2px solid var(--rust); outline-offset: 4px; }
/* Current page (Chronicles) and current section (scrollspy, scripts/site.js). */
.nav-links a.active,
.nav-links a.is-current,
.nav-dd-toggle.is-current { color: var(--rust-2); }
.nav-links a.is-current,
.nav-dd-toggle.is-current { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nav-lang-item { display: none; }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; padding: 10px;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--bone); transition: transform 0.25s, opacity 0.25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Lines dropdown */
.nav-dd { position: relative; }
.nav-dd-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  display: inline-flex; align-items: center; gap: 8px; transition: color 0.2s;
}
.nav-dd-toggle::after {
  content: ""; width: 5px; height: 5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 0.2s;
}
.nav-dd-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.nav-dd-toggle:hover,
.nav-dd-toggle[aria-expanded="true"] { color: var(--bone); }
.nav-dd-toggle:focus-visible { outline: 2px solid var(--rust); outline-offset: 4px; }
.nav-dd-menu {
  position: absolute; top: calc(100% + 18px); left: -18px; z-index: 110;
  min-width: 240px; list-style: none; padding: 8px 0; margin: 0;
  background: rgba(13,11,9,0.98); border: 1px solid var(--mud);
}
.nav-dd-menu[hidden] { display: none; }
.nav-dd-menu a { display: flex; flex-direction: column; gap: 3px; padding: 10px 18px; }
.nav-dd-menu .cat { color: var(--bone); }
.nav-dd-menu .ln {
  font-family: var(--font-serif); font-style: italic; text-transform: none;
  font-size: 14px; letter-spacing: 0; color: var(--c-label-muted);
}
.nav-dd-menu a:hover,
.nav-dd-menu a:focus-visible { background: var(--dirt); outline-offset: -2px; }
.nav-dd-menu a:hover .cat { color: var(--rust-2); }

/* ═══ LANGUAGE SWITCH ═══ active: full colour + fill; inactive: muted (6.0:1). */
.lang {
  display: flex; align-items: center; gap: 2px; padding: 2px;
  border: 1px solid var(--mud);
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
}
.lang a {
  display: flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 32px;
  color: var(--c-label-muted); transition: color 0.2s, background 0.2s;
}
.lang a span { padding: 0; background: none; }
.lang a:hover { color: var(--bone); }
.lang a[aria-current="true"] { color: var(--bone); background: var(--mud); cursor: default; }
.lang a:focus-visible { outline: 2px solid var(--rust); outline-offset: 1px; }

/* Narrow desktops: tighten the row so all links + CTA stay on one line down to 1181px (EN is longest). */
@media (max-width: 1279px) {
  .nav-inner { gap: 20px; }
  .nav-links { gap: 18px; }
  .nav-cta { gap: 8px; }
}

/* ═══ NAV · below 1180px (the full link row no longer fits): full-screen menu under the button; CTA stays in the bar ═══ */
@media (max-width: 1180px) {
  .nav-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .nav-cta { order: 2; gap: 8px; }
  .nav-toggle { display: flex; order: 3; }
  .nav-cta .btn { min-height: 44px; padding: 0 16px; }
  .nav-cta .nav-copy, .nav-cta .lang--bar { display: none; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100dvh - var(--nav-h)); overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--edge) 32px;
    background: var(--void); border-top: 1px solid var(--mud);
    font-size: 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links > li { border-bottom: 1px solid var(--mud); }
  .nav-links > li > a,
  .nav-dd-toggle { display: flex; align-items: center; min-height: 56px; width: 100%; }
  .nav-dd-toggle { justify-content: space-between; }
  .nav-dd-menu {
    position: static; min-width: 0; border: 0; background: none;
    padding: 0 0 12px 16px; margin: 0;
  }
  .nav-dd-menu a { flex-direction: row; align-items: center; gap: 10px; padding: 0; min-height: 48px; }
  .nav-lang-item { display: block; border-bottom: 0 !important; padding-top: 20px; }
  .lang--menu { display: inline-flex; }
  .lang--menu a { min-width: 56px; min-height: 44px; }
  html.nav-open { overflow: hidden; }
}
@media (max-width: 420px) {
  .wordmark { font-size: 17px; }
  .nav-cta .btn { padding: 0 12px; font-size: var(--fs-label); }
}

/* ═══ COPY E-MAIL BUTTON ═══ */
.copy-wrap { display: inline-flex; align-items: center; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px dashed var(--soot); color: var(--c-label);
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: var(--ls-label); text-transform: uppercase;
  padding: 0 12px; cursor: pointer; min-height: 44px;
  transition: color 0.2s, border-color 0.2s;
}
.copy-btn::before {
  content: ""; width: 9px; height: 11px; flex: none;
  border: 1.5px solid currentColor; border-radius: 1px;
  box-shadow: 2px -2px 0 -0.5px var(--void), 2px -2px 0 1px currentColor;
}
.copy-btn:hover { color: var(--bone); border-color: var(--pale); }
.copy-btn:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
.copy-btn.is-copied { color: var(--rust-2); border-color: var(--rust-2); border-style: solid; }
.copy-btn.is-copied::before {
  width: 10px; height: 5px; border-width: 0 0 1.5px 1.5px; border-radius: 0;
  box-shadow: none; transform: rotate(-45deg) translateY(-2px);
}

/* ═══ FOOTER ═══ */
.foot-site {
  border-top: 1px solid var(--mud);
  padding: 64px var(--edge) 40px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--c-label);
}
.foot-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px var(--grid-gap); }
.foot-brand { grid-column: span 4; }
.foot-grid > .foot-col:not(.foot-brand) { grid-column: span 3; }
.foot-grid > .foot-col:last-child { grid-column: span 2; }
.foot-mark {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--bone);
}
.foot-tag { font-family: var(--font-serif); font-style: italic; color: var(--rust-2); font-size: 16px; margin: 4px 0 24px; }
/* Company data: smaller and muted, still ≥ 4.5:1 (--dim ≈ 6.0:1). */
.foot-company { font-style: normal; font-size: var(--fs-label); line-height: 1.8; color: var(--c-label-muted); }
.foot-h {
  font-family: var(--font-mono); font-weight: 400;
  font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--c-label-muted); margin: 0 0 12px;
}
.foot-h ~ .foot-h, ul + .foot-h { margin-top: 28px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot-col a { color: var(--c-label); transition: color 0.2s; }
.foot-col a:hover { color: var(--rust-2); }
.foot-col a:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }
.foot-col ul a { display: inline-flex; align-items: baseline; min-height: 32px; padding-top: 4px; }
.foot-col .ln { color: var(--c-label-muted); font-family: var(--font-serif); font-style: italic; margin-left: 8px; }
.foot-col p { margin: 0 0 12px; }
.foot-mail { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.foot-mail a { color: var(--bone); }
.foot-ig { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.foot-lang { display: inline-flex; margin-bottom: 20px; }
.foot-privacy a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--soot); }
.foot-bottom {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--mud);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--c-label-muted);
}
@media (max-width: 1024px) {
  .foot-brand, .foot-grid > .foot-col:not(.foot-brand), .foot-grid > .foot-col:last-child { grid-column: span 6; }
}
@media (max-width: 600px) {
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
  .foot-brand, .foot-grid > .foot-col:not(.foot-brand), .foot-grid > .foot-col:last-child { grid-column: auto; }
  .lang.foot-lang a { min-width: 56px; min-height: 44px; }
}

/* ═══ LEGAL PAGE (privacy) ═══ */
.legal { padding: var(--section-space) var(--edge); color: var(--c-body); }
.legal > * { max-width: 760px; }
.legal-head .kicker {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  color: var(--rust-2); text-transform: uppercase; margin-bottom: 12px;
}
.legal h1 {
  font-family: var(--font-display); font-weight: normal; text-transform: uppercase;
  font-size: clamp(44px, 7vw, 80px); line-height: 0.95; color: var(--bone); margin: 0;
}
.legal-updated {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  color: var(--c-label-muted); margin: 16px 0 48px; text-transform: uppercase;
}
.legal-section { border-top: 1px solid var(--mud); padding: 28px 0; }
.legal-section h2 {
  font-family: 'Archivo Black', sans-serif; font-weight: normal;
  font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bone); margin: 0 0 14px;
}
.legal-section p, .legal-section li {
  font-family: var(--font-serif); font-size: var(--fs-body); line-height: var(--lh-body);
  max-width: var(--measure);
}
.legal-section p + p { margin-top: 12px; }
.legal-section ul { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.legal-section li::before { content: "\2014  "; color: var(--rust-2); }
.legal a { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.legal b { color: var(--bone); font-weight: 600; }
