/* Washington Diplomacy Academy — Editorial Institutional Design System */

:root {
  /* Parchment & ink — diplomatic palette */
  --paper: #EFEDE6;        /* parchment */
  --paper-warm: #E8E5DC;   /* stone */
  --paper-deep: #DEDAD0;   /* deeper stone */
  --panel: #F5F3EC;        /* lifted panel — subtly lighter than page */
  --ink: oklch(0.22 0.02 250);       /* deep navy-charcoal */
  --ink-soft: oklch(0.32 0.02 245);  /* slate ink */
  --ink-mute: oklch(0.50 0.02 245);  /* steel */
  --ink-quiet: oklch(0.65 0.015 245);
  --rule: oklch(0.82 0.01 245);
  --rule-soft: oklch(0.88 0.008 245);

  /* Accents — restrained */
  --bordeaux: oklch(0.40 0.07 25);   /* muted burgundy */
  --bordeaux-deep: oklch(0.30 0.06 25);
  --slate: oklch(0.40 0.03 245);
  --slate-deep: oklch(0.20 0.02 250);  /* footer ground */

  /* Type */
  --serif: "Newsreader", "Source Serif 4", Georgia, serif;
  --sans: "Instrument Sans", "Söhne", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --maxw: 1380px;
  --gutter: 32px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

/* Layout */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.hairline { border-top: 1px solid var(--rule); }
.hairline-soft { border-top: 1px solid var(--rule-soft); }

/* Type scale — editorial */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.eyebrow-accent { color: var(--bordeaux); }

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.022em;
  line-height: 0.98;
  color: var(--ink);
}
.title {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.012em;
  line-height: 1.05;
}
.title-sans {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.015em;
}
.lede {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 18;
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
.body { color: var(--ink-soft); }
.meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: all 220ms cubic-bezier(.2,.6,.2,1);
  text-decoration: none;
  background: transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--bordeaux);
  border-color: var(--bordeaux);
}
.btn-ghost {
  color: var(--ink);
  border-color: var(--rule);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--paper-warm);
}
.btn-link {
  padding: 0;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding-bottom: 2px;
}
.btn-link:hover { color: var(--bordeaux); border-color: var(--bordeaux); }

.btn .arrow { transition: transform 220ms cubic-bezier(.2,.6,.2,1); }
.btn:hover .arrow { transform: translateX(3px); }

/* Topic chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  padding: 5px 9px 4px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: all 200ms;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[data-active="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Image placeholder — striped, per guidance */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(20,24,28,0.05) 0 1px,
      transparent 1px 8px),
    var(--paper-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.placeholder.dark {
  background:
    repeating-linear-gradient(135deg,
      rgba(245,241,234,0.06) 0 1px,
      transparent 1px 8px),
    var(--ink);
  color: rgba(245,241,234,0.55);
}
.placeholder span {
  padding: 6px 10px;
  background: rgba(245,241,234,0.55);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.placeholder.dark span {
  background: rgba(20,24,28,0.6);
  border-color: rgba(245,241,234,0.15);
}

/* Section */
section { padding: 96px 0; }
section.tight { padding: 64px 0; }
section.loose { padding: 128px 0; }

/* Sticky header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245,241,234,0.88);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms, background 240ms;
}
.header[data-scrolled="true"] {
  border-bottom-color: var(--rule);
}

/* Marquee dot */
.dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--bordeaux);
  display: inline-block;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--bordeaux);
  display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Hover lift for cards */
.card-hover { transition: all 280ms cubic-bezier(.2,.6,.2,1); }
.card-hover:hover { transform: translateY(-2px); }

/* Drop cap (editorial) */
.dropcap::first-letter {
  font-family: var(--serif);
  font-size: 4.4em;
  float: left;
  line-height: 0.9;
  margin: 0.05em 0.08em -0.05em 0;
  font-weight: 400;
  color: var(--bordeaux);
}

/* Underline link */
.ulink {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color 200ms, background-size 320ms cubic-bezier(.2,.6,.2,1);
  padding-bottom: 1px;
}
.ulink:hover { color: var(--bordeaux); }

/* Divider with label */
.section-label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}
.section-label .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: uppercase;
}
.section-label .title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 32px;
}
.section-label h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  letter-spacing: -0.018em;
  margin: 0;
  line-height: 1;
}

/* Selection */
::selection { background: var(--bordeaux); color: var(--paper); }

/* Editorial: light lifted panel variant (was dark masthead) */
.masthead-dark {
  background: var(--panel);
  color: var(--ink);
  position: relative;
}
.masthead-dark::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg,
      transparent 0 39px,
      oklch(0.82 0.01 245 / 0.18) 39px 40px);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  opacity: 0.35;
}
.masthead-dark > .container { position: relative; z-index: 1; }
.masthead-dark .body,
.masthead-dark .lede { color: var(--ink-soft); }
.masthead-dark .eyebrow { color: var(--ink-mute); }
.masthead-dark .meta { color: var(--ink-mute); }
.masthead-dark .ulink { color: var(--ink); }
.masthead-dark .ulink:hover { color: var(--bordeaux); }
.masthead-dark .chip {
  border-color: var(--rule);
  color: var(--ink-soft);
  background: rgba(255,255,255,0.4);
}
.masthead-dark .chip:hover { border-color: var(--ink); color: var(--ink); }
.masthead-dark .chip[data-active="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.masthead-dark .placeholder {
  background:
    repeating-linear-gradient(135deg,
      rgba(20,24,28,0.05) 0 1px,
      transparent 1px 8px),
    var(--paper-deep);
  color: var(--ink-mute);
}
.masthead-dark .placeholder span {
  background: rgba(255,255,255,0.6);
  border-color: var(--rule);
  color: var(--ink-mute);
}
.masthead-dark .section-label { border-top-color: var(--ink); }
.masthead-dark .section-label .num,
.masthead-dark .section-label h2 { color: var(--ink); }

/* Footer keeps a deep slate ground (formal, not theatrical) */
.footer-deep {
  background: var(--slate-deep);
  color: var(--paper);
}
.footer-deep .meta { color: oklch(0.75 0.02 245); }
.footer-deep .placeholder { color: rgba(245,241,234,0.5); }

/* Numbered list */
.numbered {
  display: grid;
  gap: 0;
}
.numbered > li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  list-style: none;
  align-items: start;
}
.numbered > li:last-child { border-bottom: 1px solid var(--rule); }

/* Marquee */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  gap: 64px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex;
  gap: 64px;
  align-items: center;
  animation: scroll 40s linear infinite;
  flex-shrink: 0;
}
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
  animation-play-state: paused;
}
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .live-dot { animation: none; }
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 100;
  border-radius: 2px;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--bordeaux);
  outline-offset: 3px;
}

/* Mobile */
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  section { padding: 64px 0; }
  .section-label { grid-template-columns: 1fr; gap: 12px; margin-bottom: 32px; }
  .section-label h2 { font-size: 30px; }
  .section-label .title-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lede { font-size: 18px; }
}
