/* ===========================================================================
 * borgnames.com — Shared site chrome & page-shell styles (Story 2.1)
 * ---------------------------------------------------------------------------
 * THE single non-brand stylesheet. It styles the header, nav, footer, page
 * layout, and the structural placeholder shells used by all five pages
 * (home / pillar / supplies / about / privacy).
 *
 * It CONSUMES the brand tokens from brand/tokens.css and never redefines a
 * brand color / type / spacing / radius value — every paint references a
 * var(--bn-*) token. No forked palette literals live here. (The only literal
 * colors are transparent-overlay rgba() values keyed off brand hues, noted
 * inline.) No duplicate jug lives here either — the one jug is brand/jug.svg.
 *
 * ZERO BUILD. Plain CSS. Load order on every page (exactly these requests,
 * no per-page extra stylesheet):
 *
 *     <link rel="stylesheet" href="brand/tokens.css">
 *     <link rel="stylesheet" href="brand/brand.css">
 *     <link rel="stylesheet" href="site.css">
 *
 * Relative hrefs are used everywhere (not root-relative "/...") so the plain
 * checkout works from file:// as well as any static host — every page file
 * sits at the repo root next to brand/.
 *
 * Mobile-first: base rules target a 390px phone; a single min-width media
 * query widens line lengths and the nav for desktop.
 * ===========================================================================*/

/* --- RESET / BASE -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bn-bg);
  color: var(--bn-text);
  font-family: var(--bn-font-body);
  font-size: var(--bn-text-base);
  line-height: var(--bn-leading-body);
  /* prevent any accidental horizontal overflow at 390px */
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--bn-accent); }
a:hover { color: var(--bn-primary); }

:focus-visible {
  outline: 3px solid var(--bn-accent);
  outline-offset: 2px;
  border-radius: var(--bn-radius-sm);
}

h1, h2, h3, p, ul, ol { margin: 0; }

/* Skip link — keyboard users jump straight to <main>. Visually hidden until
   focused; required for clean landmark navigation. */
.bn-skip {
  position: absolute;
  left: var(--bn-space-2);
  top: var(--bn-space-2);
  transform: translateY(-150%);
  background: var(--bn-primary);
  color: var(--bn-on-primary);
  font-weight: var(--bn-fw-bold);
  padding: var(--bn-space-2) var(--bn-space-3);
  border-radius: var(--bn-radius-sm);
  text-decoration: none;
  z-index: 10;
  transition: transform 120ms ease;
}
.bn-skip:focus { transform: translateY(0); }

/* --- SHARED WIDTH WRAPPER ------------------------------------------------- */
/* Caps line length on desktop for readability; full-bleed-friendly on phone. */
.bn-wrap {
  width: 100%;
  max-width: 64rem;          /* ~1024px shell max */
  margin-inline: auto;
  padding-inline: var(--bn-space-4);
}
/* A narrower measure for long-form prose so lines stay readable at desktop. */
.bn-prose { max-width: 42rem; }

/* =========================================================================
 * HEADER + NAV  (identical markup on every page; only aria-current differs)
 * ========================================================================= */
.bn-header {
  background: var(--bn-bg-deep);
  border-bottom: 1px solid var(--bn-line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.bn-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bn-space-3) var(--bn-space-5);
  padding-block: var(--bn-space-3);
}
/* Wordmark already styled by brand.css (.bn-wordmark); just spacing/flex here */
.bn-header .bn-wordmark { flex: 0 0 auto; }

.bn-nav { flex: 1 1 auto; }
.bn-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--bn-space-2) var(--bn-space-4);
}
.bn-nav__link {
  /* Flex so the link is a >=44px tap target (Story 5.1) even though the text
     is short; the underline still hugs the text via inline-size of content. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--bn-space-1) var(--bn-space-1);
  color: var(--bn-text);
  text-decoration: none;
  font-weight: var(--bn-fw-bold);
  border-bottom: 2px solid transparent;
}
.bn-nav__link:hover { color: var(--bn-primary); }

/* Active page — indicated visually (lime + underline) AND to AT via
   aria-current="page" on the link itself. Both required by the story. */
.bn-nav__link[aria-current="page"] {
  color: var(--bn-primary);
  border-bottom-color: var(--bn-primary);
}

/* =========================================================================
 * MAIN / PAGE BODY
 * ========================================================================= */
.bn-main {
  flex: 1 0 auto;            /* push footer to the bottom on short pages */
  padding-block: var(--bn-space-6);
}

.bn-page-head { margin-bottom: var(--bn-space-6); }
.bn-page-head h1 {
  font-family: var(--bn-font-display);
  font-weight: var(--bn-fw-black);
  font-size: var(--bn-text-2xl);
  line-height: var(--bn-leading-tight);
  letter-spacing: -0.02em;
}
.bn-page-head .bn-kicker {
  color: var(--bn-muted);
  font-size: var(--bn-text-sm);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: var(--bn-fw-bold);
  margin-bottom: var(--bn-space-2);
}

.bn-section { margin-block: var(--bn-space-6); }
.bn-section h2 {
  font-size: var(--bn-text-xl);
  font-weight: var(--bn-fw-bold);
  line-height: var(--bn-leading-tight);
  margin-bottom: var(--bn-space-3);
}
.bn-section h3 {
  font-size: var(--bn-text-lg);
  font-weight: var(--bn-fw-bold);
  margin-bottom: var(--bn-space-2);
}

/* (Story 5.1) The dashed-border placeholder block and the skeleton "line of
 * copy" stand-in bars (.bn-placeholder / .bn-skel) were removed: every page
 * now ships real content, no page references them, and the hardening pass
 * requires that NO skeleton/placeholder/loading construct exist anywhere in
 * the codebase (verifiable by search). First paint shows real content. */

/* --- PROSE COPY (Story 4.3) ----------------------------------------------
 * Readable body copy + lists for the written content pages (privacy, about)
 * and the supplies disclosure. Consumes brand tokens only; no new layout. */
.bn-prose p { color: var(--bn-text); line-height: var(--bn-leading-body); }
.bn-prose p + p { margin-top: var(--bn-space-3); }
.bn-prose a { color: var(--bn-primary); }
.bn-prose ul {
  margin: var(--bn-space-3) 0 0;
  padding-left: var(--bn-space-5);
  color: var(--bn-text);
}
.bn-prose li + li { margin-top: var(--bn-space-2); }
/* "Last updated" stamp on the plain legal pages. */
.bn-updated {
  color: var(--bn-muted);
  font-size: var(--bn-text-sm);
  margin-top: var(--bn-space-2);
}

/* --- AFFILIATE DISCLOSURE (Story 4.3 canonical block; placed Story 4.5) ----
 * The self-contained FTC disclosure that sits above the first product on the
 * supplies page. A quiet tinted card so it reads as a disclosure, not a CTA. */
.bn-disclosure {
  background: var(--bn-surface);
  border: 1px solid var(--bn-line);
  border-radius: var(--bn-radius-md);
  padding: var(--bn-space-4);
  color: var(--bn-muted);
  font-size: var(--bn-text-sm);
  line-height: var(--bn-leading-body);
}
.bn-disclosure strong { color: var(--bn-text); }

/* =========================================================================
 * HOME — reserved generator region (Story 2.6 fills the internals)
 * ========================================================================= */
.bn-hero { text-align: center; padding-block: var(--bn-space-5) var(--bn-space-4); }
.bn-hero h1 {
  font-family: var(--bn-font-display);
  font-weight: var(--bn-fw-black);
  font-size: var(--bn-text-2xl);
  line-height: var(--bn-leading-tight);
  letter-spacing: -0.02em;
}
.bn-hero p {
  color: var(--bn-muted);
  max-width: 28ch;
  margin-inline: auto;
  margin-top: var(--bn-space-3);
}

/* =========================================================================
 * GENERATOR + RESULT SCREEN (Story 2.6)
 * The home generator UI and screenshot-first result screen. Every paint
 * references a brand token; the jug + wordmark are the shared brand assets.
 * Mobile-first: at 390px the pre-gen controls (name/theme/generate) fit
 * without scrolling and generate is the dominant, >=44px control.
 * ========================================================================= */

/* Visually-hidden helper (labels/headings/live regions kept for AT). */
.bn-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.bn-gen {
  margin-block: var(--bn-space-5);
}

/* --- PRE-GENERATION FORM -------------------------------------------------- */
.bn-gen__form {
  background: var(--bn-surface);
  border: 1px solid var(--bn-line);
  border-radius: var(--bn-radius-lg);
  padding: var(--bn-space-5);
  box-shadow: var(--bn-shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--bn-space-4);
  max-width: 30rem;
  margin-inline: auto;
}
.bn-gen__field { display: flex; flex-direction: column; gap: var(--bn-space-2); }
.bn-gen__label {
  font-weight: var(--bn-fw-bold);
  font-size: var(--bn-text-sm);
  color: var(--bn-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bn-gen__optional {
  color: var(--bn-muted);
  font-weight: var(--bn-fw-regular);
  text-transform: none;
  letter-spacing: 0;
}
.bn-gen__input {
  font-family: var(--bn-font-body);
  font-size: var(--bn-text-lg);
  color: var(--bn-text);
  background: var(--bn-bg-deep);
  border: 2px solid var(--bn-line);
  border-radius: var(--bn-radius-md);
  padding: var(--bn-space-3) var(--bn-space-4);
  min-height: 48px;                /* comfortable phone target */
  width: 100%;
}
.bn-gen__input::placeholder { color: var(--bn-muted); opacity: 0.8; }
.bn-gen__input:focus { border-color: var(--bn-accent); outline: none; box-shadow: 0 0 0 3px rgba(62,240,255,0.25); }

/* The DOMINANT generate control — big lime pill, >=44px hit target. */
.bn-gen__go {
  font-family: var(--bn-font-display);
  font-weight: var(--bn-fw-black);
  font-size: var(--bn-text-lg);
  letter-spacing: 0.01em;
  color: var(--bn-on-primary);
  background: var(--bn-primary);
  border: none;
  border-radius: var(--bn-radius-pill);
  padding: var(--bn-space-4) var(--bn-space-5);
  min-height: 56px;
  cursor: pointer;
  box-shadow: var(--bn-glow-primary);
}
.bn-gen__go:hover { background: var(--bn-primary-deep); }
.bn-gen__go:active { transform: translateY(1px); }

/* --- RESULT SCREEN -------------------------------------------------------- */
.bn-gen__results { margin-top: var(--bn-space-5); text-align: center; }

/* Brand bar: jug + wordmark + caption. Sits at the top of the result screen
   so the 390px screenshot crop captures jug + "borgnames.com" with a name. */
.bn-gen__brandbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bn-space-2);
}
.bn-gen__jug { width: clamp(96px, 28vw, 160px); height: auto; }
.bn-gen__wordmark { display: inline-block; }
.bn-gen__caption {
  color: var(--bn-muted);
  font-size: var(--bn-text-sm);
  font-weight: var(--bn-fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Results list — HERO composition (Story 3.8, committed): the first item is a
   large centered display name; the rest are the smaller scannable rows below.
   The uniform-list variant and its data-composition switch were deleted. */
.bn-gen__list {
  list-style: none;
  margin: var(--bn-space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bn-space-3);
}
.bn-gen__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bn-space-3);
  background: var(--bn-surface);
  border: 1px solid var(--bn-line);
  border-radius: var(--bn-radius-md);
  padding: var(--bn-space-3) var(--bn-space-4);
  text-align: left;
}
.bn-gen__name {
  /* Inherits the brand display treatment from .bn-name (font/weight/color);
     here we only set the list-row SIZE and make long real output (multi-word
     names up to ~40 chars) wrap inside the row instead of overflowing or
     forcing horizontal scroll. */
  font-size: var(--bn-text-xl);
  line-height: var(--bn-leading-tight);
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* HERO row: the one big borg name the screenshot is built around. */
.bn-gen__item--hero {
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bn-bg-deep);
  border-color: var(--bn-primary-deep);
  box-shadow: var(--bn-glow-loud);
  gap: var(--bn-space-3);
  padding: var(--bn-space-5) var(--bn-space-4);
}
.bn-gen__item--hero .bn-name--hero {
  /* .bn-name--hero (brand.css) reaches up to --bn-display-hero (~7rem) — too
     tall for the longest real output beside the jug + wordmark at 390px. This
     context override damps it so even "Christopher the Honor Roll
     Valedictorian" stays on-screen with no overflow/scroll, while staying the
     loud magenta display name. Wrapping is allowed for the long multi-word
     keepers. (Brand tokens still drive the type; this only re-sizes.) */
  font-size: clamp(2rem, 0.9rem + 6vw, 4rem);
  flex: 0 0 auto;
  width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  text-wrap: balance;
}

/* Per-result copy button + its self-reverting confirmation. */
.bn-gen__copy {
  flex: 0 0 auto;
  font-family: var(--bn-font-body);
  font-weight: var(--bn-fw-bold);
  font-size: var(--bn-text-sm);
  color: var(--bn-accent);
  background: transparent;
  border: 2px solid var(--bn-line);
  border-radius: var(--bn-radius-pill);
  padding: var(--bn-space-2) var(--bn-space-4);
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}
.bn-gen__copy:hover { border-color: var(--bn-accent); }
.bn-gen__copy.is-copied {
  color: var(--bn-on-primary);
  background: var(--bn-primary);
  border-color: var(--bn-primary);
}

.bn-gen__nojs, .bn-gen__error {
  color: var(--bn-muted);
  font-size: var(--bn-text-sm);
  text-align: center;
  margin-top: var(--bn-space-4);
}

/* --- NO-JS FALLBACK (Story 5.1) ------------------------------------------
 * Rendered only inside <noscript> (JS off): a visible "needs JavaScript"
 * notice plus a static sample of real borg names so the generator region
 * shows real content with no blank space and no dead controls. Consumes
 * brand tokens only; .bn-name supplies the loud magenta display treatment. */
.bn-gen__nojs-fallback { margin-top: var(--bn-space-4); }
.bn-gen__nojs-fallback .bn-gen__nojs { color: var(--bn-text); }
.bn-gen__nojs-fallback .bn-gen__nojs a { color: var(--bn-primary); }
.bn-gen__sample {
  list-style: none;
  margin: var(--bn-space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bn-space-3);
}
.bn-gen__sample-item {
  background: var(--bn-surface);
  border: 1px solid var(--bn-line);
  border-radius: var(--bn-radius-md);
  padding: var(--bn-space-3) var(--bn-space-4);
  font-family: var(--bn-font-display);
  font-weight: var(--bn-fw-black);
  font-size: var(--bn-text-xl);
  letter-spacing: var(--bn-display-tracking);
  color: var(--bn-loud);
  overflow-wrap: anywhere;
}

/* =========================================================================
 * PILLAR PAGE — "300+ Borg Names" (Story 4.4)
 * The site's one rankable content asset: five themed sections, each a
 * scannable one-name-per-item list, plus two generator CTAs. Every paint
 * references a brand token — no forked palette here. Mobile-first: the name
 * grid is a single readable column at 390px and packs into multiple columns
 * on wider viewports (no horizontal scroll at any width).
 * ========================================================================= */

/* Section heading count chip — muted, smaller than the heading text. */
.bn-pillar__count {
  font-family: var(--bn-font-body);
  font-weight: var(--bn-fw-regular);
  font-size: var(--bn-text-sm);
  color: var(--bn-muted);
  white-space: nowrap;
}

/* The name list. One scannable column on phone; responsive multi-column on
   wider screens via auto-fill so long names never force horizontal scroll. */
.bn-pillar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bn-space-2);
}
.bn-pillar__item {
  background: var(--bn-surface);
  border: 1px solid var(--bn-line);
  border-radius: var(--bn-radius-md);
  padding: var(--bn-space-3) var(--bn-space-4);
  font-weight: var(--bn-fw-bold);
  color: var(--bn-text);
  /* long multi-word names wrap inside the chip instead of overflowing */
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* --- GENERATOR CTA (appears twice: near intro + after final section) ------ */
.bn-pillar__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--bn-space-2);
  margin-top: var(--bn-space-5);
}
.bn-pillar__cta-btn {
  display: inline-block;
  font-family: var(--bn-font-display);
  font-weight: var(--bn-fw-black);
  font-size: var(--bn-text-lg);
  letter-spacing: 0.01em;
  color: var(--bn-on-primary);
  background: var(--bn-primary);
  text-decoration: none;
  border-radius: var(--bn-radius-pill);
  padding: var(--bn-space-3) var(--bn-space-5);
  min-height: 48px;
  box-shadow: var(--bn-glow-primary);
}
.bn-pillar__cta-btn:hover { background: var(--bn-primary-deep); color: var(--bn-on-primary); }
.bn-pillar__cta-sub {
  color: var(--bn-muted);
  font-size: var(--bn-text-sm);
}

/* =========================================================================
 * FOOTER  (identical markup on every page)
 * ========================================================================= */
.bn-footer {
  flex: 0 0 auto;
  background: var(--bn-bg-deep);
  border-top: 1px solid var(--bn-line);
  padding-block: var(--bn-space-6);
  margin-top: var(--bn-space-7);
}
.bn-footer__nav ul {
  list-style: none;
  margin: 0 0 var(--bn-space-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--bn-space-3) var(--bn-space-5);
}
.bn-footer__nav a {
  /* >=44px tap target (Story 5.1); inline-flex keeps the underline tight. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: var(--bn-space-1);
  color: var(--bn-text);
  text-decoration: none;
  font-weight: var(--bn-fw-bold);
}
.bn-footer__nav a:hover { color: var(--bn-primary); }

/* Subtle responsible-drinking line (real copy shipped Story 4.3). */
.bn-footer__note {
  color: var(--bn-muted);
  font-size: var(--bn-text-sm);
  max-width: 60ch;
}
.bn-footer__legal {
  margin-top: var(--bn-space-4);
  color: var(--bn-muted);
  font-size: var(--bn-text-xs);
}

/* =========================================================================
 * DESKTOP ADAPTATION
 * ========================================================================= */
@media (min-width: 48rem) {
  .bn-header__inner { flex-wrap: nowrap; }
  .bn-nav__list { justify-content: flex-end; }
  .bn-main { padding-block: var(--bn-space-7); }
  .bn-hero h1 { font-size: var(--bn-display); }
  .bn-hero { padding-block: var(--bn-space-7) var(--bn-space-5); }

  /* Generator: keep the result composition centered and screenshot-coherent
     on wide viewports — cap the measure rather than stretching rows. */
  .bn-gen__list { max-width: 40rem; margin-inline: auto; }

  /* Pillar name list: pack into responsive columns on wider viewports. Each
     column has a comfortable minimum so the longest names still fit without
     overflow; auto-fill collapses gracefully — no horizontal scroll. */
  .bn-pillar__list {
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  }
}
