/* ============================================================================
   BEPCO Studio — Site styles
   ----------------------------------------------------------------------------
   Ported from design/mockups/bepco-homepage-mockup.html, section by section.
   THIS PASS: global reset + shell chrome (noise overlay, amber spine,
   classification banner, nav) + the HERO. Remaining sections (ticker, archive,
   field notes, split, footer) are added in later increments.

   Conventions:
   - Colors & font families reference tokens.css (--color-*, --font-*).
   - rgba() translucent tints and letter-spacing / line-height are kept as the
     mockup's EXACT literals (imported verbatim, not invented) — they are not
     tokenized yet (deferred opacity layer + out-of-scope typography metrics).
   - --ease is defined locally below until we do a dedicated motion-token pass.
   ============================================================================ */

:root {
  /* Motion easing — from the mockup; move into tokens.css at the motion pass. */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--color-parchment);
  color: var(--color-carbon);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: multiply;
}

/* ── PAGE-LOAD CHOREOGRAPHY ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spine-grow {
  from { transform: scaleY(0); transform-origin: top; }
  to { transform: scaleY(1); transform-origin: top; }
}
@keyframes rule-draw {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}
@keyframes row-slide {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.reveal { opacity: 0; }

/* ── CLASSIFICATION BANNER ── */
/* Skip link — first focusable element; hidden until keyboard-focused. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  transform: translateY(-200%);
  background: var(--color-carbon);
  color: var(--color-parchment);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 16px;
  border: 1px solid var(--color-amber);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

/* Masthead: banner + nav stick together as one unit (no sub-pixel seam gap). */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Opaque page-surface backing so scrolling content doesn't show through the
     semi-transparent banner (6% tint) and nav (92% parchment). At the top of
     the page the banner/nav already sit on parchment, so their look is unchanged. */
  background: var(--color-parchment);
}

.class-banner {
  background: rgba(26,22,18,0.06);
  border-bottom: 1px solid rgba(26,22,18,0.10);
  padding: 6px 48px;
  display: flex;
  align-items: center;
  gap: 20px;
  backdrop-filter: blur(8px);
  animation: fade-in 0.6s var(--ease) both;
}

.cb-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cb-item {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.38);
  white-space: nowrap;
}

.cb-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(26,22,18,0.18);
  flex-shrink: 0;
}

.cb-right {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(200,134,10,0.5);
}

/* ── AMBER SPINE ── */
.amber-spine {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--color-amber);
  z-index: 200;
  opacity: 0.85;
  animation: spine-grow 1.1s var(--ease) 0.1s both;
}

/* ── NAVIGATION ── */
nav {
  position: relative;
  background: rgba(245,240,232,0.92);
  border-bottom: 1px solid rgba(26,22,18,0.10);
  padding: 0 48px;
  display: flex;
  align-items: center;
  height: 56px;
  backdrop-filter: blur(10px);
  animation: fade-in 0.6s var(--ease) 0.2s both;
}

/* Menu wrapper: transparent to layout on desktop; becomes a dropdown on mobile. */
.nav-collapse { display: contents; }

/* Hamburger toggle — hidden on desktop, shown on mobile. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-carbon);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  margin-right: 48px;
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
}
/* Definite height (the nav is a fixed 56px), so the width is derived from the
   aspect ratio rather than the SVG's intrinsic 319px. A percentage height on a
   stretched flex item is treated as indefinite by Safari/Firefox, which was
   collapsing height:100% to auto and blowing the image out to full width. The
   SVG's own internal margins supply the vertical breathing room. */
.nav-logo-img { height: 56px; width: auto; aspect-ratio: 254 / 207; display: block; }

.nav-logo::after {
  content: '';
  position: absolute;
  right: -14px;
  top: 50%;
  width: 5px; height: 5px;
  background: var(--color-amber);
  transform: translateY(-50%) rotate(45deg) scale(0);
  transition: transform 0.3s var(--ease);
}
.nav-logo:hover::after { transform: translateY(-50%) rotate(45deg) scale(1); }

.nav-links {
  display: flex;
  gap: 0;
  flex: 1;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.55);
  text-decoration: none;
  padding: 0 13px;
  height: 56px;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(26,22,18,0.07);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
  cursor: pointer;
  position: relative;
}

.nav-link:first-child { border-left: 1px solid rgba(26,22,18,0.07); }

.nav-link::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 1px;
  background: var(--color-amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-link:hover {
  color: var(--color-carbon);
  background: rgba(26,22,18,0.04);
}
.nav-link:hover::after { transform: scaleX(1); }

/* Active section — persists across a section's detail pages. */
.nav-link.active { color: var(--color-carbon); }
.nav-link.active::after { transform: scaleX(1); }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-code {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: 0.12em;
  color: rgba(26,22,18,0.22);
}

/* Search: a pill that expands into a text field on click. */
.nav-search {
  display: flex;
  align-items: center;
  border: 1px solid rgba(26,22,18,0.15);
  padding: 5px 10px;
  background: transparent;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav-search:hover { border-color: var(--color-amber); }
.nav-search.open {
  border-color: var(--color-amber);
  background: rgba(26,22,18,0.03);
}

.ns-toggle {
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.45);
  transition: color 0.2s var(--ease);
}
.nav-search:hover .ns-toggle,
.nav-search.open .ns-toggle { color: var(--color-carbon); }

.ns-icon { width: 12px; height: 12px; flex-shrink: 0; display: block; }

.ns-label {
  margin-left: 6px;
  max-width: 140px;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.35s var(--ease), opacity 0.2s var(--ease), margin 0.35s var(--ease);
}
.nav-search.open .ns-label { max-width: 0; opacity: 0; margin-left: 0; }

.ns-input {
  width: 0;
  opacity: 0;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--color-carbon);
  transition: width 0.35s var(--ease), opacity 0.25s var(--ease), padding 0.35s var(--ease);
}
.nav-search.open .ns-input {
  width: 180px;
  opacity: 1;
  padding-left: 8px;
}
.ns-input::placeholder {
  color: rgba(26,22,18,0.35);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ── HERO ── */
.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: visible;
}

.hero-left {
  padding: 80px 64px 80px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 3;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(200,134,10,0.7);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fade-up 0.7s var(--ease) 0.5s both;
}

/* Eyebrow prefix mark deliberately removed (2026-07-21): the generic amber
   line was an AI-design cliché; stud/pylon pixel marks didn't survive
   prototyping. Eyebrows stand on letterspacing + amber alone. */

/* ── GRID-BREAK: hero title bleeds 12% past its column into the dark panel ── */
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(42px, 5.5vw, 80px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--color-carbon);
  margin-bottom: 20px;
  width: 112%;
  position: relative;
  z-index: 4;
  animation: fade-up 0.9s var(--ease) 0.6s both;
}
.hero-title::after {
  content: '';
  position: absolute;
  inset: -8px -16px -8px 60%;
  background: radial-gradient(ellipse at center, var(--color-parchment) 0%, rgba(245,240,232,0.0) 75%);
  z-index: -1;
  pointer-events: none;
}

.hero-title-company {
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 400;
  color: var(--color-amber);
  letter-spacing: 0.04em;
  margin-bottom: 36px;
  font-style: italic;
  animation: fade-up 0.7s var(--ease) 0.75s both;
}

.hero-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  animation: fade-in 0.5s var(--ease) 0.9s both;
}

.hero-rule-line { flex: 1; height: 1px; background: rgba(26,22,18,0.12); transform-origin: left; animation: rule-draw 0.7s var(--ease) 0.9s both; }
.hero-rule-diamond {
  width: 6px; height: 6px;
  background: var(--color-amber);
  transform: rotate(45deg);
  opacity: 0.5;
  flex-shrink: 0;
}

.hero-body {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
  color: rgba(26,22,18,0.65);
  max-width: 440px;
  margin-bottom: 48px;
  animation: fade-up 0.8s var(--ease) 1.0s both;
}

.hero-body em {
  color: var(--color-carbon);
  font-style: italic;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  animation: fade-up 0.6s var(--ease) 1.2s both;
}

.btn-primary {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-parchment);
  background: var(--color-amber);
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), letter-spacing 0.3s var(--ease);
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--color-amber-dk);
  letter-spacing: 0.24em;
}

.btn-secondary {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.55);
  background: transparent;
  border: 1px solid rgba(26,22,18,0.18);
  padding: 14px 28px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  color: var(--color-carbon);
  border-color: var(--color-amber);
  background: rgba(26,22,18,0.03);
  letter-spacing: 0.24em;
}

.hero-ref {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(26,22,18,0.22);
  animation: fade-in 0.5s var(--ease) 1.4s both;
}

/* ── HERO RIGHT — data panel ── */
.hero-right {
  background: var(--color-soot);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0; /* no panel padding: image fills top/left/right; data panel pads itself */
}

.hero-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200,134,10,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,134,10,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  animation: fade-in 1.2s var(--ease) 0.4s both;
}

.hero-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 60%, rgba(200,134,10,0.08) 0%, transparent 65%);
  z-index: 0;
}

.hero-data-panel {
  position: relative;
  z-index: 2;
  padding: 32px 48px 48px; /* top gap from image; sides + bottom match old panel padding */
}

/* Rotating hero image slot — fills the space above the data panel. */
.hero-media {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 140px;
  overflow: hidden;
  border-bottom: 1px solid rgba(200,134,10,0.2);
}
.hero-media-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.hero-media-img.is-active {
  opacity: 1;
}

.hdp-header {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200,134,10,0.5);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200,134,10,0.15);
  display: flex;
  justify-content: space-between;
  animation: fade-in 0.6s var(--ease) 0.9s both;
}

.hdp-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
  position: relative;
}

.hdp-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  align-items: baseline;
  animation: row-slide 0.5s var(--ease) both;
}

.hdp-label {
  font-family: var(--font-serif);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  font-style: italic;
}

.hdp-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
}

.hdp-value.amber { color: var(--color-amber-lt); }

.hdp-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid rgba(200,134,10,0.2);
  background: rgba(200,134,10,0.06);
  animation: fade-up 0.6s var(--ease) 1.6s both;
}

.hdp-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-amber);
  animation: pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

.hdp-status-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(200,134,10,0.7);
}

/* ── LIVE SYSTEM-FREQUENCY WIDGET (hero.panel.status) ──
   One line: left = dot + status text (state-colored); right = label + live
   value (always amber). */
.hdp-status .hdp-status-dot {
  transition: background 0.25s var(--ease);
}

.freq-left,
.freq-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Left: status text — colored by state; nominal (porcelain) is the default. */
.freq-status {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-porcelain);
  transition: color 0.25s var(--ease);
}

/* Right: label + live value — always amber. */
.freq-label {
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-amber);
}
.freq-value {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--color-amber);
}
#freq-value {
  font-weight: 500;
}

/* State-driven colors for the status text + dot only. */
.hdp-status[data-state="nominal"] .hdp-status-dot { background: var(--color-porcelain); }
.hdp-status[data-state="away"]    .freq-status    { color: var(--color-amber); }
.hdp-status[data-state="away"]    .hdp-status-dot { background: var(--color-amber); }
.hdp-status[data-state="far"]     .freq-status    { color: var(--color-status-rust); }
.hdp-status[data-state="far"]     .hdp-status-dot { background: var(--color-status-rust); }

/* "EB" watermark — sits behind the data rows, nudged down-right. */
.hero-eb-mark {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(44px, -25%);
  font-family: var(--font-serif);
  font-size: 200px;
  font-weight: 700;
  color: rgba(200,134,10,0.07);
  letter-spacing: -0.02em;
  line-height: 1;
  z-index: -1;
  user-select: none;
  pointer-events: none;
  animation: fade-in 1.4s var(--ease) 0.7s both;
}

/* ── FOOTER ── */
footer {
  background: var(--color-carbon);
  color: var(--color-parchment);
  padding: 36px 52px 32px;
  border-top: 2px solid var(--color-amber);
  position: relative;
}

.footer-brand {
  text-align: center;
  margin-bottom: 28px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(200,134,10,0.15);
}

.footer-logo-img {
  height: 72px;
  width: auto;
  aspect-ratio: 254 / 207;
  display: block;
  margin: 0 auto -8px;
  transition: opacity 0.2s var(--ease);
}

.footer-full {
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
  color: rgba(245,240,232,0.55);
}
/* Brand block links home; inherits the logo/name styling, no underline. */
.footer-brand-link { display: inline-block; text-decoration: none; color: inherit; }
.footer-brand-link:hover .footer-logo-img { opacity: 0.82; }
.footer-brand-link:hover .footer-full { color: rgba(245,240,232,0.8); }

.footer-tagline {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(245,240,232,0.55);
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-amber);
  margin-bottom: 18px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(245,240,232,0.55);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer-link:hover { color: var(--color-amber-lt); }

/* Footer bottom bar: disclaimer centered on top, then the copyright/est row. */
.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 32px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(245,240,232,0.32);
}

/* Trademark / non-affiliation notice */
.footer-disclaimer {
  max-width: 640px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  color: rgba(245,240,232,0.28);
}

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.footer-est { color: rgba(200,134,10,0.7); }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── MOBILE / ADAPTIVE ── */
@media (max-width: 900px) {
  /* Lighten heavy side paddings */
  .class-banner { padding: 6px 20px; }
  nav { padding: 0 20px; }
  .hero-left { padding: 40px 20px 48px; }
  footer { padding: 32px 20px 24px; }

  /* Banner: drop the long record codes, keep the short service line */
  .cb-left { display: none; }
  .cb-right { margin-left: 0; }

  /* Nav → hamburger menu */
  .nav-toggle { display: flex; }
  .nav-logo { margin-right: 0; }
  nav.open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  nav.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  nav.open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .nav-collapse {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(245,240,232,0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(26,22,18,0.10);
    box-shadow: 0 10px 24px rgba(26,22,18,0.14);
    padding: 8px 20px 18px;
  }
  nav.open .nav-collapse { display: flex; }

  /* Nav links stack vertically in the dropdown */
  .nav-links { flex-direction: column; flex: none; }
  .nav-link {
    height: auto;
    padding: 14px 0;
    border: none;
    border-bottom: 1px solid rgba(26,22,18,0.07);
  }
  .nav-link:first-child { border-left: none; }
  .nav-link::after { display: none; }

  /* Record count + search beneath the links */
  .nav-right {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-left: 0;
    margin-top: 16px;
  }

  /* Hero: single column; give the panel image a defined height */
  .hero { grid-template-columns: 1fr; }
  .hero-title { width: 100%; }
  .hero-title::after { display: none; }
  .hero-media { min-height: 240px; }

  /* Frequency widget: stack its two groups */
  .hdp-status { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Footer: two columns; centered bottom bar */
  .footer-columns { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
  .footer-bottom-row { flex-direction: column; gap: 10px; text-align: center; }
}

/* ── Seamless navigation (progressive enhancement) ───────────────────────────
   Cross-document view transitions: same-origin navigations cross-fade the page
   content instead of hard-cutting, while the masthead and amber spine are named
   so they stay anchored — the nav reads as persistent, no reload flash. Browsers
   without support (Firefox today) just navigate normally. Paired with the
   speculation-rules prefetch in base.njk so the next page lands instantly. */
@view-transition { navigation: auto; }
.masthead { view-transition-name: masthead; }
.amber-spine { view-transition-name: amber-spine; }
/* Persistent chrome doesn't animate; only the page body cross-fades. */
::view-transition-group(masthead),
::view-transition-old(masthead),
::view-transition-new(masthead),
::view-transition-group(amber-spine),
::view-transition-old(amber-spine),
::view-transition-new(amber-spine) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ── Shared form modal ─────────────────────────────────────────────────────── */
.fm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26,22,18,0.55);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
/* `display:flex` above outranks the UA `[hidden]{display:none}`, so restate it —
   otherwise the closed overlay stays stretched over the page and eats all clicks. */
.fm-overlay[hidden] { display: none; }
.fm-overlay.is-open { opacity: 1; }
.fm-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-parchment);
  border: 1px solid rgba(26,22,18,0.15);
  box-shadow: 0 24px 60px -20px rgba(26,22,18,0.5);
  padding: 40px 40px 36px;
  transform: translateY(8px);
  transition: transform 0.25s var(--ease);
}
.fm-overlay.is-open .fm-dialog { transform: none; }
.fm-close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1;
  color: rgba(26,22,18,0.5);
  background: none; border: 0; cursor: pointer;
  transition: color 0.2s var(--ease);
}
.fm-close:hover { color: var(--color-amber-dk); }
.fm-eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-10);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(200,134,10,0.7); margin-bottom: 10px;
}
.fm-title {
  font-family: var(--font-serif); font-size: var(--fs-24);
  font-weight: var(--weight-regular); color: var(--color-carbon);
  line-height: 1.1; margin: 0 0 8px;
}
.fm-context {
  font-family: var(--font-serif); font-style: italic; font-size: var(--fs-14);
  color: rgba(26,22,18,0.6); margin: 0 0 4px; line-height: 1.5;
}
/* Interest context on three lines: lead / kit name / archive code. */
.fm-context span { display: block; }
.fm-context-item { margin-top: 3px; }
.fm-context-code {
  font-family: var(--font-mono); font-style: normal;
  font-size: var(--fs-11); letter-spacing: 0.08em;
  color: var(--color-amber-dk); margin-top: 5px;
}
/* Header row: text on the left, a close-up thumbnail on the right. */
.fm-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.fm-head-text { flex: 1 1 auto; min-width: 0; }
.fm-thumb { flex: 0 0 auto; }
.fm-thumb[hidden] { display: none; }
.fm-thumb img {
  display: block; width: 104px; height: 104px;
  object-fit: cover; border: 1px solid rgba(26,22,18,0.15);
}
.fm-form { display: grid; gap: 14px; margin-top: 8px; }
.fm-field { display: flex; flex-direction: column; gap: 5px; }
/* `display:flex` above outranks the UA [hidden]; restate so hidden fields (and
   the disabled inputs inside them) are truly gone and don't submit. */
.fm-field[hidden] { display: none; }
.fm-label {
  font-family: var(--font-mono); font-size: var(--fs-10);
  letter-spacing: 0.14em; text-transform: uppercase; color: rgba(26,22,18,0.55);
}
.fm-opt { color: rgba(26,22,18,0.35); }
.fm-field input, .fm-field select, .fm-field textarea {
  font-family: var(--font-sans); font-size: var(--fs-14); color: var(--color-carbon);
  background: #fff; border: 1px solid rgba(26,22,18,0.2); border-radius: 0;
  padding: 10px 12px; transition: border-color 0.2s var(--ease);
}
.fm-field input:focus, .fm-field select:focus, .fm-field textarea:focus { outline: none; border-color: var(--color-amber); }
.fm-field textarea { resize: vertical; }
/* Safari (and others) ignore select styling until the native appearance is off;
   then re-add our own caret. Keeps dropdowns in the BEPCO flat style. */
.fm-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233A3028' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
}
/* Match the option-list text to the form font (browsers vary in how much of the
   native option popup they'll theme — Safari honors little of this). */
.fm-field select,
.fm-field select option {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  color: var(--color-carbon);
}
/* Newsletter opt-in — matches the form-label typography. */
.fm-check {
  display: flex; align-items: flex-start; gap: 9px;
  font-family: var(--font-mono); font-size: var(--fs-10);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(26,22,18,0.55); line-height: 1.5; cursor: pointer;
}
.fm-check input { flex: 0 0 auto; margin-top: 1px; accent-color: var(--color-amber-dk); }
.fm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fm-submit {
  justify-self: start; margin-top: 4px;
  font-family: var(--font-mono); font-size: var(--fs-11);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-parchment); background: var(--color-carbon);
  border: 1px solid var(--color-carbon); padding: 12px 28px; cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.fm-submit:hover { background: var(--color-amber-dk); border-color: var(--color-amber-dk); }
.fm-submit:disabled { opacity: 0.55; cursor: default; }
.fm-status { font-family: var(--font-serif); font-size: var(--fs-13); line-height: 1.5; margin: 4px 0 0; }
.fm-status.is-ok { color: var(--color-amber-dk); }
.fm-status.is-err { color: var(--color-status-rust); }
.fm-thanks { text-align: center; padding: 40px 16px 32px; cursor: pointer; }
.fm-thanks-mark {
  width: 54px; height: 54px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--color-amber-dk);
  border: 2px solid rgba(139,74,8,0.4); border-radius: 50%;
}
.fm-thanks-title {
  font-family: var(--font-serif); font-size: var(--fs-24);
  color: var(--color-carbon); margin: 0 0 12px; line-height: 1.2;
}
.fm-thanks-text {
  font-family: var(--font-serif); font-style: italic; font-size: var(--fs-15);
  color: rgba(26,22,18,0.66); margin: 0 auto; max-width: 340px; line-height: 1.65;
}
.fm-thanks-note {
  font-family: var(--font-mono); font-size: var(--fs-10);
  letter-spacing: 0.06em; color: var(--color-amber-dk);
  margin: 18px 0 0;
}
@media (prefers-reduced-motion: reduce) { .fm-overlay, .fm-dialog { transition: none; } }
