/* ==========================================================================
   david-sanker.com — design system
   --------------------------------------------------------------------------
   Shared tokens, typography and interior-page components. The home page is the
   four-square composition and brings its own stylesheet (quad.css); everything
   here serves the interior pages.

   Palette is deliberately NOT warm cream. It is a cool archival board grey, so
   photography carries the only warmth and the eye goes there first. One signal
   colour (deep ultramarine) marks machine-readable things — manifest keys,
   links, focus. Nothing else is coloured.

   Fonts are self-hosted (see README.md): loading them from Google's CDN would
   transfer visitor IPs to Google without consent — the exact fact pattern in
   LG München I, 20.01.2022, 3 O 17493/20.
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable) ---------- */

@font-face {
  font-family: 'Archivo';
  src: url('/static/fonts/archivo-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url('/static/fonts/archivo-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Newsreader';
  src: url('/static/fonts/newsreader-latin.woff2') format('woff2');
  font-weight: 300 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/static/fonts/newsreader-latin-ext.woff2') format('woff2');
  font-weight: 300 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/static/fonts/geistmono-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/static/fonts/geistmono-latin-ext.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  /* Colour */
  --ink:        #17191c;
  --ink-soft:   #43484e;
  --muted:      #666c73;
  --paper:      #e7e8e3;
  --paper-lift: #f1f2ee;
  --signal:     #1b34c4;
  --rule:       #cdd0c9;

  /* Type families */
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono:    'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Type scale */
  --fs-h2:      clamp(1.9rem, 4.2vw, 3.1rem);
  --fs-lead:    clamp(1.15rem, 1.9vw, 1.45rem);
  --fs-body:    1.0625rem;
  --fs-mono:    0.75rem;
  --fs-mono-sm: 0.6875rem;

  /* Rhythm */
  --gutter:     clamp(1.25rem, 5vw, 4.5rem);
  --section-y:  clamp(4.5rem, 11vh, 9rem);
  --measure:    62ch;
  --maxw:       76rem;
}

/* ---------- Reset ---------- */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-optical-sizing: auto;
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--signal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: opacity 140ms ease;
}
a:hover { opacity: 0.62; }

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

/* ---------- Utilities ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Mono label: used for every machine-ish string on the page. */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.4rem;
}

.topbar-mark {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.topbar-mark:hover { opacity: 0.62; }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 2rem);
}

.topbar-nav a {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.topbar-nav a:hover { color: var(--signal); opacity: 1; }

.lang-switch {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
}
.lang-switch:hover { border-color: var(--signal); color: var(--signal); opacity: 1; }

/* ---------- Section shell ---------- */

.band { padding-block: var(--section-y); }
.band + .band { border-top: 1px solid var(--rule); }

.band-head { margin-bottom: clamp(2rem, 5vw, 3.25rem); }

.band-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  display: block;
  margin-bottom: 0.9rem;
}

.band-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 600;
  font-stretch: 106%;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

/* ---------- Manifest: the signature element ---------- */

.manifest { border-top: 1px solid var(--ink); }

.manifest-row {
  display: grid;
  grid-template-columns: minmax(8.5rem, 12rem) 1fr;
  gap: 0.35rem 2rem;
  align-items: baseline;
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--rule);
}

.manifest-key {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--signal);
}

.manifest-value {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.45;
  color: var(--ink);
}

.manifest-value a { color: inherit; text-decoration-color: var(--rule); }
.manifest-value a:hover { color: var(--signal); opacity: 1; }

.constraints { margin-top: clamp(2.5rem, 6vw, 4rem); }

.constraints-list {
  margin-top: 1.1rem;
  max-width: var(--measure);
}

.constraints-list li {
  list-style: none;
  padding-left: 1.4rem;
  position: relative;
  color: var(--ink-soft);
  font-size: var(--fs-lead);
  line-height: 1.55;
}
.constraints-list li + li { margin-top: 0.7rem; }

.constraints-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* ---------- Roles ---------- */

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.role {
  background: var(--paper-lift);
  padding: clamp(1.4rem, 3vw, 2.1rem);
}

.role-org {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.7rem;
}

.role-name {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  font-stretch: 100%;
  line-height: 1.18;
  margin-bottom: 0.5rem;
}

/* Some roles link out and some don't. Linked ones must not read as a different
   kind of thing, so they inherit ink and carry only a quiet underline. */
.role-name a { color: inherit; text-decoration-color: var(--rule); }
.role-name a:hover { color: var(--signal); opacity: 1; }

.role-title { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--ink);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2rem;
}

.footer-head {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.footer-list li { list-style: none; margin-bottom: 0.4rem; }

.footer-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-list a:hover { color: var(--signal); opacity: 1; }

.footer-base {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ---------- Placeholder banner (scaffold only) ---------- */

.scaffold-notice {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0.6rem var(--gutter);
}
.scaffold-notice a { color: var(--paper); }

/* ---------- Load sequence ---------- */
/* One orchestrated moment: the manifest resolves line by line, the way a
   system declares itself. Everything else on the page is still. */

@media (prefers-reduced-motion: no-preference) {
  .manifest-row {
    opacity: 0;
    transform: translateY(0.5rem);
    animation: declare 460ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    animation-delay: calc(var(--i, 0) * 55ms + 180ms);
  }
}

@keyframes declare {
  to { opacity: 1; transform: none; }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 40rem) {
  .manifest-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding-block: 0.95rem;
  }

  .topbar { flex-wrap: wrap; gap: 0.75rem 1rem; }
}
