/* ══════════════════════════════════════════════════════
   atlas.css
   The shared "atlas" language: engraved cobalt ink on
   laid paper, Cormorant for voice, DM Sans for wayfinding.

   Pages opt in with <body class="atlas …">. Everything a
   page may want to re-tint lives in the tokens below, so
   a page can shift the mood (see .atlas--nocturne, added
   by the Contact page) without re-authoring components.

   Ink artwork is recoloured by an inline SVG filter with
   id="atlas-ink" declared in each page's markup. Pages
   that change --ink-rgb should also change that filter's
   matrix so illustrations print in the same ink.
══════════════════════════════════════════════════════ */

.atlas,
.atlas .on-paper {
  /* colour */
  --paper:           #f3eee3;
  --paper-raised:    #f8f4eb;
  --ink:             #173a77;
  --ink-soft:        #3f5480;   /* 6.5:1 on paper — safe for small text */
  --ink-rgb:         23, 58, 119;
  --hairline:        rgba(var(--ink-rgb), .22);
  --hairline-strong: rgba(var(--ink-rgb), .55);
  --veil:            rgba(243, 238, 227, .96);  /* paper laid over artwork */
  --grain-opacity:   .085;

  /* type */
  --serif: 'Cormorant Garamond', 'Baskerville', 'Palatino Linotype', Georgia, serif;
  --sans:  'DM Sans', 'Helvetica Neue', Arial, sans-serif;

  /* One scale for every atlas page. Sans sizes never drop
     below 12px; serif body never below 17px, because
     Cormorant's hairlines vanish at smaller sizes. */
  --t-micro:   .75rem;                          /* 12px  sans labels */
  --t-small:   .8125rem;                        /* 13px  sans UI     */
  --t-ui:      .875rem;                         /* 14px  sans links  */
  --t-note:    .9375rem;                        /* 15px  sans prose  */
  --t-body:    clamp(1.125rem, 1.05rem + .3vw, 1.25rem);   /* 18–20 serif */
  --t-lede:    clamp(1.25rem, 1.1rem + .6vw, 1.5rem);      /* 20–24 serif */
  --t-title:   clamp(1.5rem, 1.2rem + 1.1vw, 2rem);        /* 24–32 serif */
  --t-display: clamp(3rem, 1.6rem + 5.4vw, 5.5rem);        /* 48–88 serif */
  --track-caps: .18em;

  --gutter: clamp(20px, 4.4vw, 72px);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ── theme variants ──────────────────────────────────
   Nocturne: the atlas printed as a night chart. Ground and
   ink trade places (pale ink on Prussian blue), so every
   component above re-tints without being restyled. An
   element marked .on-paper inside it returns to day paper
   (the tokens above apply again at that element). */
.atlas--nocturne {
  --paper:           #0e2146;
  --paper-raised:    #132a56;
  --ink:             #efe7d6;   /* 12.6:1 on the ground */
  --ink-soft:        #b9c4dc;   /*  8.9:1 */
  --ink-rgb:         239, 231, 214;
  --veil:            rgba(14, 33, 70, .94);
  --grain-opacity:   .05;
}

.atlas,
.atlas .on-paper {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* laid-paper grain, above everything but never interactive */
.atlas::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  background: url('../images/expertise/paper.svg') repeat;
  background-size: 180px;
  opacity: var(--grain-opacity);
}

.atlas ::selection { background: var(--ink); color: var(--paper); }
.atlas a { color: inherit; text-underline-offset: .28em; text-decoration-thickness: 1px; }
.atlas :is(a, summary, button, input, textarea):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* ── shared utilities ────────────────────────────── */
.atlas .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;
}
.atlas .skip-link {
  position: fixed; left: 20px; top: -100px; z-index: 1200;
  padding: 12px 16px; background: var(--paper); color: var(--ink);
  font: 500 var(--t-ui)/1 var(--sans);
}
.atlas .skip-link:focus { top: 12px; }
.atlas-filter-defs { position: absolute; width: 0; height: 0; pointer-events: none; }
.atlas .desktop-break { display: inline; }

/* ── header: the site header, printed on paper ────── */
.atlas .site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.atlas .site-header__inner { max-width: 1440px; padding-inline: var(--gutter); }
.atlas .site-header__brand {
  color: var(--ink);
  font: 500 23px/1 var(--serif);
  letter-spacing: -.01em;
  text-transform: none;
}
.atlas .site-header__nav { gap: clamp(18px, 2vw, 30px); }
.atlas .site-header__nav a {
  font: 500 var(--t-small)/1 var(--sans);
  color: var(--ink-soft);
  letter-spacing: .02em;
  text-transform: none;
}
.atlas .site-header__nav a:hover,
.atlas .site-header__nav a[aria-current="page"] { color: var(--ink); }
.atlas .site-header__nav a[aria-current="page"]::after { bottom: -7px; opacity: 1; }
.atlas .site-header__toggle { color: var(--ink); border-color: var(--hairline-strong); }
.atlas .site-header__mobile {
  background: var(--paper);
  border-color: var(--hairline);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.atlas .site-header__mobile a {
  color: var(--ink);
  font: 500 var(--t-ui)/1 var(--sans);
  letter-spacing: .03em;
  text-transform: none;
  padding-block: 16px;
  border-color: var(--hairline);
}
.atlas :is(.site-header__brand, .site-header__nav a, .site-header__toggle, .site-header__mobile a):focus-visible {
  outline-color: var(--ink);
}

/* ── wayfinding type ─────────────────────────────── */
.atlas-edition {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font: 500 var(--t-micro)/1.5 var(--sans);
  letter-spacing: .08em;
  color: var(--ink-soft);
}
.atlas-eyebrow {
  font: 500 var(--t-micro)/1.3 var(--sans);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-soft);
}
.atlas-display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-display);
  line-height: .96;
  letter-spacing: -.035em;
}
.atlas-display em { font-weight: 400; }
.atlas-lede {
  font-size: var(--t-lede);
  line-height: 1.4;
  font-weight: 500;
}

/* underlined sans link with a trailing mark (↓ ↗ →) */
.ink-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
  padding: 0;
  font: 500 var(--t-ui)/1.4 var(--sans);
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hairline-strong);
  transition: border-color .25s var(--ease);
}
.ink-link:hover { border-bottom-color: var(--ink); }
.ink-link > span[aria-hidden] { transition: transform .25s var(--ease); }
.ink-link:hover > span[aria-hidden] { transform: translate(2px, -2px); }

/* engraved map cartouche: paper plate, double hairline frame */
.cartouche {
  position: relative;
  background: var(--veil);
  border: 1px solid var(--hairline-strong);
  outline: 1px solid var(--hairline);
  outline-offset: 3px;
}

/* ══════════════════════════════════════════════════
   ATLAS FOOTER — the estuary at the far edge
══════════════════════════════════════════════════ */
.atlas-footer {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  /* the estuary's own proportion (1672×941), but never shorter
     than the footer's writing needs — and never wider than the page */
  height: clamp(640px, 56.28vw, 900px);
  padding-top: 35px;
}
.footer-writing {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 2.1fr 1fr 1.4fr 1fr;
  gap: 35px;
  padding: 0 6%;
}
.footer-brand { display: inline-block; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; text-decoration: none; }
.footer-imprint p { font-size: var(--t-body); margin-top: 12px; line-height: 1.4; }
.footer-return {
  display: inline-block;
  margin-top: 18px;
  font-size: 17px;
  font-style: italic;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.footer-writing nav h2 {
  margin-bottom: 12px;
  font: 500 var(--t-micro)/1.3 var(--sans);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-soft);
}
.footer-writing nav a {
  display: block;
  width: fit-content;
  padding: 4px 0;
  font-size: 18px;
  line-height: 1.35;
  text-decoration: none;
}
.footer-writing nav a:hover { text-decoration: underline; }
.footer-writing nav a[aria-current="page"] { font-style: italic; }
.footer-note { font-size: 18px; font-style: italic; padding-top: 36px; transform: rotate(-6deg); }
.footer-note span { display: block; margin: 10px 0 0 15px; font-size: 31px; font-style: normal; }
.estuary {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
  filter: url('#atlas-ink');
}
.footer-bottom {
  position: absolute;
  z-index: 2;
  bottom: 14px;
  left: 6%;
  right: 6%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font: 500 var(--t-micro)/1.4 var(--sans);
}
.footer-bottom p { background: var(--veil); padding: 5px 9px; }
.footer-bottom > span { font: italic 500 21px/1 var(--serif); background: var(--veil); padding: 4px 9px; }

@media (max-width: 860px) {
  .atlas-footer { height: auto; padding-top: 20px; }
  .footer-writing { grid-template-columns: 1.7fr 1fr 1.3fr; gap: 24px; }
  .footer-note { display: none; }
  .estuary { position: relative; inset: auto; height: 430px; margin-top: -100px; }
}
@media (max-width: 520px) {
  .atlas .desktop-break { display: none; }
  .atlas-edition { font-size: 11px; letter-spacing: .05em; }
  .footer-writing { grid-template-columns: 1fr 1fr; gap: 30px 16px; padding-inline: 24px; }
  .footer-imprint { grid-column: 1 / -1; }
  .footer-brand { font-size: 34px; }
  .footer-writing nav a { font-size: 18px; min-height: 40px; padding-top: 8px; }
  .estuary { height: 340px; object-position: 54% bottom; margin-top: -90px; }
  .footer-bottom { left: 16px; right: 16px; bottom: 12px; flex-wrap: wrap; gap: 8px; font-size: 11px; }
  .footer-bottom > span { font-size: 18px; }
}

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