/* RWEdnesdays design system
   Palette: paper / ink / vermilion. One accent, locked sitewide.
   Type: IBM Plex Serif (display), IBM Plex Sans (UI/body), IBM Plex Mono (data/code). */

:root {
  --paper: #fafaf9;        /* stone-50 */
  --paper-raised: #ffffff;
  --ink: #1c1917;          /* stone-900 */
  --ink-soft: #44403c;     /* stone-700 */
  --muted: #78716c;        /* stone-500 */
  --line: #e7e5e4;         /* stone-200 */
  --line-strong: #d6d3d1;  /* stone-300 */
  --accent: #c2410c;       /* vermilion (orange-700) */
  --accent-deep: #9a3412;  /* orange-800 */
  --accent-wash: #fff7ed;  /* orange-50 */
  --accent-line: #fed7aa;  /* orange-200 */
}

html { overflow-x: hidden; scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
.font-display { font-family: 'IBM Plex Serif', Georgia, serif; }
.font-mono, pre, code, kbd { font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace; }

::selection { background: var(--accent-wash); color: var(--accent-deep); }

a { text-underline-offset: 3px; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav .inner {
  max-width: 80rem; margin: 0 auto; padding: 0 1.25rem;
  height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: relative;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; font-size: 0.9rem; }
.nav-links a { color: var(--ink-soft); font-weight: 500; transition: color 0.15s; white-space: nowrap; }
.nav-links a:hover { color: var(--accent-deep); }
.nav-links a.active { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 560px) {
  .site-nav .inner { overflow: hidden; }
  .nav-links {
    flex: 1;
    min-width: 0;
    gap: 0.9rem;
    overflow-x: auto;
    padding: 0.25rem 2.4rem 0.25rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    scroll-snap-type: x proximity;
    font-size: 0.82rem;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links a { scroll-snap-align: start; }
  .nav-links::-webkit-scrollbar { display: block; height: 3px; }
  .nav-links::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
  .site-nav .inner::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2.5rem;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(250,250,249,0), var(--paper) 70%);
  }
  /* The mark carries the brand on small screens; four links beat a hamburger */
  .nav-wordmark-text { display: none; }
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border-radius: 0.5rem;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 0.95rem;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border-radius: 0.5rem;
  border: 1px solid var(--line-strong); color: var(--ink); font-weight: 500; font-size: 0.95rem;
  background: transparent; transition: border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn-secondary:active { transform: translateY(1px); }
.btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border-radius: 0.5rem;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 0.95rem;
  transition: background 0.15s, transform 0.1s; white-space: nowrap;
}
.btn-accent:hover { background: var(--accent-deep); }
.btn-accent:active { transform: translateY(1px); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d6d3d1; }
.site-footer a { color: #e7e5e4; }
.site-footer a:hover { color: #fdba74; }
.site-footer .fine { color: #a8a29e; font-size: 0.78rem; }

/* ---------- Prose (long-form rendering) ---------- */
.prose { max-width: none; }
.prose p { margin: 0 0 0.9em; line-height: 1.7; }
.prose p:last-child { margin-bottom: 0; }
.prose h4 { font-weight: 600; color: var(--ink); margin: 1.4em 0 0.4em; font-size: 0.95rem; }
.prose h4:first-child { margin-top: 0; }
.prose em { font-style: italic; }
.prose strong { color: var(--ink); }
.prose code { background: #f5f5f4; border-radius: 3px; padding: 0 0.3em; font-size: 0.85em; }

/* ---------- Forms ---------- */
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink); margin-bottom: 0.35rem; }
.field .help { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
.field .error { font-size: 0.75rem; color: #b91c1c; margin-top: 0.3rem; display: none; }
.field.invalid .error { display: block; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: #b91c1c; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 0.5rem;
  padding: 0.55rem 0.75rem; font-size: 0.9rem; background: var(--paper-raised); color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.field input::placeholder, .field textarea::placeholder { color: #a8a29e; }

/* ---------- Misc shared ---------- */
.tabular { font-variant-numeric: tabular-nums; }
.kbd {
  display: inline-block; padding: 0.05rem 0.4rem; border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 0.3rem; font-size: 0.72rem; color: var(--ink-soft);
  background: var(--paper-raised);
}
body.modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
