/* ==========================================================================
   johannwadephul.com — core styles
   Identity: "The Dossier" — an international-affairs journal.
   Palette: aubergine / wine, muted plum, ivory, parchment, graphite,
            dusty sage, champagne (hairlines only).
   ========================================================================== */

:root {
  --ink: #221a20;
  --graphite: #38343a;
  --muted: #625a60;
  --aubergine: #3a1a2b;
  --aubergine-2: #2c1320;
  --wine: #5b2340;
  --plum: #7a5869;
  --plum-mist: #e6dbe0;
  --ivory: #f8f4ee;
  --paper: #fcfaf6;
  --parchment: #efe7da;
  --parchment-2: #e5dac7;
  --sage: #8a9a85;
  --sage-deep: #4e5e4a;
  --sage-mist: #e1e6dc;
  --champagne: #c4ab76;
  --champagne-soft: #ddcda6;

  --line: rgba(58, 26, 43, .16);
  --line-strong: rgba(58, 26, 43, .32);
  --line-light: rgba(248, 244, 238, .2);

  --f-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --f-text: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --w-max: 1320px;
  --w-text: 44rem;
  --gutter: clamp(16px, 4vw, 56px);
  --head-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 24px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 1.0625rem;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--wine); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--aubergine); }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
button { font: inherit; color: inherit; }
::selection { background: var(--plum-mist); color: var(--aubergine); }
p { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
abbr[title] { text-decoration: none; border-bottom: 1px dotted var(--line-strong); cursor: help; }
strong { font-weight: 600; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { margin: 0; color: var(--aubergine); font-weight: 400; }
h1, h2 { font-family: var(--f-display); letter-spacing: -.01em; line-height: 1.06; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
h3 { font-family: var(--f-text); font-weight: 600; font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.35; letter-spacing: -.005em; }
h4 { font-family: var(--f-mono); font-weight: 500; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--plum); }
h1 em, h2 em { font-style: italic; color: var(--wine); }

.kicker, .eyebrow {
  display: inline-flex; align-items: center; gap: .75em;
  font-family: var(--f-mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--plum);
}
.kicker::before { content: ""; width: 28px; height: 1px; background: var(--champagne); }
.dek { font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.55; color: var(--graphite); max-width: 40rem; }
.small, small { font-size: .875rem; }
.mono { font-family: var(--f-mono); font-size: .8rem; letter-spacing: .04em; }
.muted { color: var(--muted); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--w-max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: calc(var(--w-text) + 2 * var(--gutter)); }
.section { padding-block: clamp(64px, 9vw, 128px); }
.section--tight { padding-block: clamp(40px, 6vw, 80px); }
.section--parchment { background: var(--parchment); }
.section--paper { background: var(--paper); }
.section--sage { background: var(--sage-mist); }
.section--aubergine { background: var(--aubergine); color: var(--ivory); }
.section--aubergine h2, .section--aubergine h3 { color: var(--ivory); }
.section--aubergine .kicker { color: var(--champagne-soft); }
.section--aubergine a { color: var(--champagne-soft); }
.section--aubergine p { color: rgba(248, 244, 238, .86); }
.section-head { display: grid; gap: 1rem; margin-bottom: clamp(32px, 5vw, 64px); max-width: 52rem; }
.section-head p { margin: 0; color: var(--graphite); }
.section--aubergine .section-head p { color: rgba(248, 244, 238, .8); }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200; padding: 12px 18px;
  background: var(--aubergine); color: var(--ivory); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--ivory); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .7em;
  min-height: 48px; padding: 0 1.5em; border: 1px solid var(--aubergine); border-radius: 0;
  background: var(--aubergine); color: var(--ivory); text-decoration: none; cursor: pointer;
  font-family: var(--f-mono); font-size: .76rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { background: var(--wine); border-color: var(--wine); color: var(--ivory); }
.btn--ghost { background: transparent; color: var(--aubergine); }
.btn--ghost:hover { background: var(--aubergine); color: var(--ivory); }
.btn--light { background: var(--ivory); color: var(--aubergine); border-color: var(--ivory); }
.btn--light:hover { background: var(--champagne-soft); border-color: var(--champagne-soft); color: var(--aubergine); }
.arrow-link {
  display: inline-flex; align-items: center; gap: .6em; text-decoration: none;
  font-family: var(--f-mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wine);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 3px; transition: background-size .35s var(--ease);
}
.arrow-link::after { content: "→"; font-family: var(--f-text); transition: transform .3s var(--ease); }
.arrow-link:hover { background-size: 100% 1px; }
.arrow-link:hover::after { transform: translateX(4px); }

/* ==========================================================================
   Masthead (sticky)
   ========================================================================== */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248, 244, 238, .94);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease);
}
.masthead::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--aubergine) 0 72%, var(--champagne) 72% 76%, var(--sage) 76%); }
.masthead.is-scrolled { box-shadow: 0 10px 30px -18px rgba(44, 19, 32, .35); }
.masthead-bar {
  display: flex; align-items: center; gap: clamp(16px, 2.5vw, 40px);
  height: var(--head-h); max-width: var(--w-max); margin-inline: auto; padding-inline: var(--gutter);
}
.wordmark { display: flex; flex-direction: column; text-decoration: none; color: var(--aubergine); line-height: 1; flex-shrink: 0; }
.wordmark-name { font-family: var(--f-display); font-size: 1.5rem; letter-spacing: -.01em; }
.wordmark-name i { font-style: italic; color: var(--wine); }
.wordmark-tag { margin-top: 6px; font-family: var(--f-mono); font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: var(--plum); }
.wordmark:hover { color: var(--aubergine); }

.primary-nav { margin-left: auto; }
.primary-nav > ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-group { position: relative; }
.nav-trigger, .nav-direct {
  display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px;
  border: 0; background: none; cursor: pointer; text-decoration: none;
  font-family: var(--f-text); font-size: .93rem; font-weight: 500; color: var(--graphite);
  position: relative;
}
.nav-trigger::after, .nav-direct::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 1px;
  background: var(--wine); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-trigger:hover::after, .nav-trigger[aria-expanded="true"]::after, .nav-direct:hover::after,
.nav-group.is-current > .nav-trigger::after, .nav-direct[aria-current="page"]::after { transform: scaleX(1); }
.nav-group.is-current > .nav-trigger, .nav-direct[aria-current="page"] { color: var(--wine); }
.nav-trigger .caret { width: 9px; height: 9px; transition: transform .25s var(--ease); }
.nav-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* Folio dropdown — a compact index card, not a full-width panel */
.folio {
  position: absolute; top: calc(100% + 14px); left: -8px; width: 380px;
  background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--aubergine);
  box-shadow: 0 30px 60px -30px rgba(44, 19, 32, .45);
  padding: 22px 22px 14px; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility 0s linear .22s;
}
.nav-group:last-child .folio, .nav-group.align-right .folio { left: auto; right: -8px; }
.folio::before { content: ""; position: absolute; left: 0; right: 0; top: -17px; height: 14px; }
.nav-group.is-open .folio { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.folio-intro { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-family: var(--f-display); font-style: italic; font-size: 1.02rem; line-height: 1.4; color: var(--plum); }
.folio ul { list-style: none; margin: 0; padding: 0; }
.folio a { display: grid; gap: 2px; padding: 10px 10px 10px 14px; margin-inline: -10px; text-decoration: none; border-left: 2px solid transparent; transition: background-color .2s, border-color .2s; }
.folio a:hover, .folio a:focus-visible { background: var(--parchment); border-left-color: var(--champagne); }
.folio a[aria-current="page"] { border-left-color: var(--wine); background: var(--plum-mist); }
.folio .f-title { font-weight: 600; font-size: .95rem; color: var(--aubergine); line-height: 1.3; }
.folio .f-desc { font-size: .8rem; color: var(--muted); line-height: 1.4; }

.masthead-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.contents-toggle {
  display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--aubergine);
  transition: background-color .2s, color .2s;
}
.contents-toggle:hover { background: var(--aubergine); color: var(--ivory); }
.contents-toggle .lines { display: grid; gap: 4px; width: 18px; }
.contents-toggle .lines span { height: 1px; background: currentColor; }
.contents-toggle .lines span:nth-child(2) { width: 70%; }

.read-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--wine); transform: scaleX(0); transform-origin: left; }

/* ==========================================================================
   Contents overlay (full index + mobile menu)
   ========================================================================== */
.contents {
  position: fixed; inset: 0; z-index: 150; background: var(--aubergine); color: var(--ivory);
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s linear .3s;
}
.contents.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.contents-inner { max-width: var(--w-max); margin-inline: auto; padding: 0 var(--gutter) 64px; }
.contents-top { display: flex; align-items: center; justify-content: space-between; height: calc(var(--head-h) + 3px); border-bottom: 1px solid var(--line-light); position: sticky; top: 0; background: var(--aubergine); z-index: 2; }
.contents-top .wordmark, .contents-top .wordmark:hover { color: var(--ivory); }
.contents-top .wordmark-name i { color: var(--champagne-soft); }
.contents-top .wordmark-tag { color: var(--champagne-soft); }
.contents-close {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; cursor: pointer;
  border: 1px solid var(--line-light); background: transparent; color: var(--ivory);
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
}
.contents-close:hover { background: var(--ivory); color: var(--aubergine); }
.contents-title { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: clamp(32px, 6vw, 72px) 0 clamp(24px, 4vw, 48px); }
.contents-title h2 { color: var(--ivory); font-size: clamp(2.6rem, 7vw, 6rem); }
.contents-title h2 em { color: var(--champagne-soft); }
.contents-title p { margin: 0; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(248, 244, 238, .65); }
.contents-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px clamp(24px, 4vw, 64px); }
.contents-group h3 { font-family: var(--f-mono); font-weight: 500; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--champagne-soft); padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line-light); }
.contents-group ol { list-style: none; margin: 0; padding: 0; }
.contents-group a { display: flex; align-items: baseline; gap: 14px; padding: 9px 0; text-decoration: none; color: var(--ivory); border-bottom: 1px solid rgba(248, 244, 238, .08); }
.contents-group a .c-no { font-family: var(--f-mono); font-size: .68rem; color: rgba(248, 244, 238, .5); min-width: 1.8em; }
.contents-group a .c-title { font-family: var(--f-display); font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.2; transition: color .2s, transform .3s var(--ease); }
.contents-group a:hover .c-title, .contents-group a:focus-visible .c-title { color: var(--champagne-soft); transform: translateX(4px); }
.contents-group a[aria-current="page"] .c-title { font-style: italic; color: var(--champagne-soft); }
body.contents-open { overflow: hidden; }

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.crumbs { border-bottom: 1px solid var(--line); background: var(--ivory); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; list-style: none; margin: 0 auto; padding: 14px var(--gutter); max-width: var(--w-max); font-family: var(--f-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 10px; }
.crumbs li + li::before { content: "/"; color: var(--champagne); }
.crumbs a { color: var(--plum); text-decoration: none; }
.crumbs a:hover { color: var(--wine); text-decoration: underline; }
.crumbs [aria-current] { color: var(--aubergine); }

/* ==========================================================================
   Footer
   ========================================================================== */
.colophon { background: var(--parchment); color: var(--graphite); border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.colophon-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: clamp(32px, 5vw, 72px); padding-block: clamp(56px, 8vw, 96px) clamp(40px, 5vw, 64px); }
.colophon h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.colophon-intro p { margin: 16px 0 0; max-width: 30rem; color: var(--graphite); font-size: .98rem; }
.colophon h3 { font-family: var(--f-mono); font-weight: 500; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--plum); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.colophon-contact address { font-style: normal; display: grid; gap: 8px; }
.colophon-contact .c-name { font-family: var(--f-display); font-size: 1.35rem; color: var(--aubergine); }
.colophon-contact a { color: var(--graphite); text-decoration: none; border-bottom: 1px solid var(--line-strong); justify-self: start; padding-bottom: 1px; }
.colophon-contact a:hover { color: var(--wine); border-color: var(--wine); }
.colophon-links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.colophon-links a { color: var(--graphite); text-decoration: none; }
.colophon-links a:hover { color: var(--wine); text-decoration: underline; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 22px 0 0; padding: 0; }
.socials a, .socials span.social-off {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong);
  color: var(--aubergine); transition: background-color .2s, color .2s, border-color .2s;
}
.socials a:hover { background: var(--aubergine); color: var(--ivory); border-color: var(--aubergine); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.socials-note { margin: 12px 0 0; font-size: .78rem; color: var(--muted); max-width: 26rem; line-height: 1.5; }
.colophon-name {
  font-family: var(--f-display); font-style: italic; line-height: .8; letter-spacing: -.03em;
  font-size: clamp(4.2rem, 17vw, 15.5rem); color: transparent; -webkit-text-stroke: 1px rgba(91, 35, 64, .28);
  white-space: nowrap; text-align: center; user-select: none; margin: 0; padding-bottom: .06em;
}
.colophon-base { border-top: 1px solid var(--line); }
.colophon-base .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 22px; font-size: .84rem; color: var(--muted); }
.colophon-base a { color: var(--aubergine); }
.colophon-base .end-session { background: none; border: 0; padding: 0; cursor: pointer; color: var(--plum); text-decoration: underline; text-underline-offset: .2em; font-size: .84rem; }
.colophon-base .end-session:hover { color: var(--wine); }

/* footer wordmark: keep descenders inside its own band */
.colophon-name { padding-bottom: .22em; margin-bottom: 0; overflow: hidden; line-height: .9; }
