/* =========================================================================
   BARTON — brand stylesheet
   Reference: barton_website_design.md §2 (brand) and §5 (mobile).

   Ground rule: the site's default state is the brand's default state —
   distressed red on grunge metallic grey. Cream is a secondary surface for
   documents and forms, not a "light mode".
   ========================================================================= */

/* ------------------------------------------------------------------ reset */

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

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

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

ul[class], ol[class] { list-style: none; }

img, picture, svg { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

/* ----------------------------------------------------------------- tokens */

:root {
  /* Brand — exact values from Brand_Guidelines/color/barton-colors.json */
  --red: #e12102;
  --cream: #f6f5e3;
  --black: #000000;
  --gold: #ffb914;
  --brand-gradient: linear-gradient(180deg, #000000, #ffbd15, #ff7301, #d10000);

  /* Derived. --red-deep is used only where text sits ON the colour, so that
     cream-on-red clears 4.5:1. The wordmark and accents keep true --red. */
  --red-deep: #c81c02;
  --red-bright: #ff3a18;

  /* Grunge ramp, matched to the brand background artwork: the darks are
     near-black and neutral (as in Logo_on_background.png), while the mids and
     lights carry a slight warm cast so cream and red sit naturally on them. */
  --ink:        #0a0a0a;
  --steel-950:  #111110;
  --steel-900:  #181817;
  --steel-850:  #1e1e1c;
  --steel-800:  #252523;
  --steel-700:  #33322e;
  --steel-600:  #46443e;
  --steel-500:  #625f55;
  --steel-400:  #8a8578;
  --steel-300:  #b3ad9e;
  --steel-200:  #d4cec0;

  /* Semantic */
  --bg:          var(--steel-900);
  --bg-raised:   var(--steel-850);
  --bg-sunk:     var(--steel-950);
  --text:        var(--cream);
  --text-muted:  var(--steel-300);
  --text-faint:  var(--steel-400);
  --rule:        rgba(246, 245, 227, 0.13);
  --rule-strong: rgba(246, 245, 227, 0.28);

  /* Type */
  --font-display: "Anton", "Arial Narrow", "Haettenschweiler", sans-serif;
  --font-label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Space + layout */
  --wrap: 1140px;
  --gutter: clamp(1.15rem, 5vw, 2.5rem);
  --header-h: 56px;

  --radius: 2px;
  --radius-pill: 999px;

  /* Two-part grunge, reproducing the brand background artwork in CSS so no
     raster texture (and no second wordmark) is baked into the page.
     --grain  : fine speckle, like dust on plaster.
     --swirl  : low-frequency marbling, the plaster trowel texture. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.38'/%3E%3C/svg%3E");
  --swirl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1400'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.008' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)' opacity='0.30'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------- base */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The grunge ground: near-black base, swirled plaster, faint warm bloom. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--steel-900);
  background-image:
    radial-gradient(115% 75% at 50% -18%, rgba(255, 115, 1, 0.07), transparent 60%),
    radial-gradient(85% 65% at 6% 2%, rgba(225, 33, 2, 0.05), transparent 58%),
    radial-gradient(105% 95% at 88% 105%, rgba(0, 0, 0, 0.6), transparent 62%),
    var(--swirl),
    linear-gradient(178deg, var(--steel-850), var(--steel-950));
  background-size: auto, auto, auto, 1400px 1400px, auto;
  background-blend-mode: normal, normal, normal, soft-light, normal;
  opacity: 1;
}

/* Fine speckle over everything. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 240px 240px;
  opacity: 0.42;
  mix-blend-mode: overlay;
}

::selection { background: var(--red); color: var(--cream); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--gold);
  color: var(--black);
  padding: 0.7rem 1.1rem;
  font-family: var(--font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------- typography */

.display,
h1.display,
h2.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}

.d-hero { font-size: clamp(2.9rem, 13vw, 7rem); }
.d-1    { font-size: clamp(2.1rem, 8vw, 3.9rem); }
.d-2    { font-size: clamp(1.55rem, 5.5vw, 2.5rem); }
.d-3    { font-size: clamp(1.2rem, 3.6vw, 1.6rem); line-height: 1.04; }

.label {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  line-height: 1.3;
}
.label-red { color: var(--red-bright); }
.label-gold { color: var(--gold); }

.lede {
  font-size: clamp(1.06rem, 2.2vw, 1.24rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 46ch;
}

.prose { max-width: 64ch; }
.prose p { margin-bottom: 1.15rem; color: var(--text-muted); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 700; }
.prose a { color: var(--red-bright); text-underline-offset: 3px; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

/* ----------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3.25rem, 9vw, 6rem); }
.section-tight { padding-block: clamp(2.25rem, 6vw, 3.5rem); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

/* A torn/blown-highlight divider between major bands of content. */
.rule-brand {
  height: 3px;
  border: 0;
  background: var(--brand-gradient);
  opacity: 0.85;
}

/* ----------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(18, 17, 16, 0.86);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--cream);
  margin-left: -10px;
}
.nav-toggle-bars { display: block; width: 22px; height: 2px; background: currentColor; position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

.site-header.is-open .nav-toggle-bars { background: transparent; }
.site-header.is-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

.header-logo {
  justify-self: center;
  display: block;
  line-height: 0;
}
.header-logo img { height: 29px; width: auto; }

/* Mobile: exactly one contextual action, driven by the active campaign. */
.header-cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 0.95rem;
  background: var(--red-deep);
  color: var(--cream);
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease;
}
.header-cta:hover { background: var(--red); }

.primary-nav { display: none; }

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 99;
  background: rgba(12, 11, 10, 0.97);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 1.5rem var(--gutter) 3rem;
  overflow-y: auto;
  display: none;
}
.nav-drawer.is-open { display: block; }

.nav-drawer-list { display: flex; flex-direction: column; }
.nav-drawer-list a {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 9vw, 2.6rem);
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--cream);
}
.nav-drawer-list a:hover,
.nav-drawer-list a[aria-current="page"] { color: var(--red-bright); }

.nav-drawer-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;              /* thumb-sized, per §5 */
  padding: 0.7rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-primary { background: var(--red-deep); color: var(--cream); }
.btn-primary:hover { background: var(--red); }

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--rule-strong);
}
.btn-ghost:hover { border-color: var(--cream); background: rgba(246, 245, 227, 0.07); }

.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: #ffc93f; }

.btn-sm { min-height: 40px; padding: 0.4rem 1.05rem; font-size: 0.88rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ------------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding-block: clamp(2.75rem, 10vw, 5.5rem) clamp(3rem, 9vw, 5rem);
  overflow: hidden;
}

/* Hero ground: the actual brand artwork.
   texture-*.jpg is a band cropped from below the wordmark in
   Brand_Guidelines/logos/Logo_on_background.png — the genuine swirled
   plaster and speckle, with no second BARTON baked into it. This replaces
   the CSS approximation, which had been tuned so far down chasing a tile
   seam that it stopped reading as texture at all. */
.hero-texture {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #171716;
  background-image: -webkit-image-set(
    url("/img/texture-900.jpg") 1x,
    url("/img/texture-1600.jpg") 2x
  );
  background-image: image-set(
    url("/img/texture-900.jpg") 1x,
    url("/img/texture-1600.jpg") 2x
  );
  background-size: cover;
  background-position: center;
}

/* Keeps the texture legible at the top and settles it into the page colour
   at the bottom, so the hero does not end on a hard edge. */
.hero-texture::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.12) 0%,
    rgba(10, 10, 10, 0.30) 60%,
    var(--steel-900) 100%
  );
}

.hero-inner { position: relative; z-index: 1; }

/* The wordmark is the hero, not decoration on it — sized to dominate the
   first screen the way it dominates Logo_on_background.png. */
.hero-wordmark {
  width: min(100%, 940px);
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
}
.hero-wordmark img { width: 100%; height: auto; }

.hero-eyebrow { margin-bottom: 0.85rem; }
.hero-headline { margin-bottom: 1rem; }
.hero-sub { margin-bottom: 1.9rem; }

/* ------------------------------------------------------------------ cards */

.card {
  background: linear-gradient(170deg, rgba(56, 51, 43, 0.5), rgba(25, 23, 21, 0.72));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.grid { display: grid; gap: 1rem; }
.grid-members { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

/* Member card */
.member-portrait {
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(160deg, var(--steel-700), var(--steel-850));
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
  overflow: hidden;
}
.member-portrait img { width: 100%; height: 100%; object-fit: cover; }
.member-portrait-empty {
  font-family: var(--font-label);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-500);
  text-align: center;
  padding: 1rem;
}
.member-name { margin-bottom: 0.15rem; }
.member-role {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.84rem;
  color: var(--red-bright);
  margin-bottom: 0.6rem;
}
.member-bio { font-size: 0.94rem; color: var(--text-muted); line-height: 1.6; }

/* Show row */
.show-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.show-date {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.show-venue { font-weight: 600; }
.show-city { color: var(--text-muted); font-size: 0.94rem; }
.show-action { margin-top: 0.4rem; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.62rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.pill-tickets { background: var(--red-deep); color: var(--cream); }
.pill-free    { background: var(--gold); color: var(--black); }
.pill-soldout { background: transparent; color: var(--text-faint); border: 1px solid var(--rule-strong); }

/* --------------------------------------------------------- empty states */

/* Shown wherever real content does not exist yet. Honest, on-brand, and not
   an accidental "coming soon" page — every one of these disappears the moment
   a record is added in the CMS. */
.empty {
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  background: rgba(12, 11, 10, 0.35);
}
.empty-title { margin-bottom: 0.55rem; }
.empty p { color: var(--text-muted); max-width: 52ch; }
.empty .btn-row { margin-top: 1.35rem; }

/* -------------------------------------------------------- cream surfaces */

/* Legal, EPK and form pages sit on cream — the brand's document surface. */
.surface-cream {
  background: var(--cream);
  color: #171412;
}
.surface-cream .label { color: #6d6455; }
.surface-cream .prose p { color: #3a352f; }
.surface-cream .prose a { color: var(--red-deep); }
.surface-cream .section-head { border-bottom-color: rgba(23, 20, 18, 0.18); }
.surface-cream .muted { color: #5d564c; }
.surface-cream .card {
  background: rgba(23, 20, 18, 0.035);
  border-color: rgba(23, 20, 18, 0.14);
}
.surface-cream .btn-ghost { color: #171412; border-color: rgba(23, 20, 18, 0.3); }
.surface-cream .btn-ghost:hover { background: rgba(23, 20, 18, 0.06); border-color: #171412; }

/* ----------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--rule);
  background: rgba(12, 11, 10, 0.6);
  padding-block: clamp(2.5rem, 7vw, 3.75rem);
  margin-top: auto;
}

.footer-grid { display: grid; gap: 2.25rem; }

.footer-logo img { height: 30px; width: auto; margin-bottom: 0.9rem; }

.footer-heading {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}

.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  width: fit-content;
}
.footer-links a:hover { color: var(--cream); }

.social-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.social-row a {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
}
.social-row a:hover { color: var(--cream); border-color: var(--cream); }

.footer-legal {
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-legal a { color: var(--text-faint); text-decoration: none; }
.footer-legal a:hover { color: var(--text-muted); }

/* A visible flag while the site runs on placeholder content. Removed by
   deleting the flag in server.js once real content is in Supabase. */
.holding-banner {
  background: var(--gold);
  color: var(--black);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.5rem var(--gutter);
}

/* ------------------------------------------------------------ page shell */

.page { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }

/* --------------------------------------------------------------- desktop */

@media (min-width: 900px) {
  :root { --header-h: 74px; }

  .header-inner { grid-template-columns: auto 1fr auto; gap: 2rem; }

  .nav-toggle { display: none; }
  .nav-drawer { display: none !important; }

  .header-logo { justify-self: start; }
  .header-logo img { height: 40px; }

  .primary-nav { display: flex; align-items: center; gap: 1.75rem; }
  .primary-nav a {
    font-family: var(--font-label);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-muted);
    padding-block: 0.35rem;
    border-bottom: 2px solid transparent;
  }
  .primary-nav a:hover { color: var(--cream); }
  .primary-nav a[aria-current="page"] { color: var(--cream); border-bottom-color: var(--red); }

  .header-actions { display: flex; align-items: center; gap: 0.6rem; }
  .header-cta { height: 40px; font-size: 0.92rem; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .grid-members { grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }

  .show-row {
    grid-template-columns: 12rem 1fr auto;
    gap: 1.5rem;
    padding: 1.3rem 0;
  }
  .show-action { margin-top: 0; }

  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
}

@media (min-width: 1100px) {
  .grid-members { grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
}

/* On short desktop viewports (most laptops) the full-size wordmark pushes the
   primary CTA below the fold. Tighten the hero rather than shrinking the
   wordmark everywhere — tall screens keep the full statement. */
@media (min-width: 900px) and (max-height: 860px) {
  .hero { padding-block: 1.75rem 2.25rem; }
  .hero-wordmark { width: min(100%, 860px); margin-bottom: 0.7rem; }
  .hero-eyebrow { margin-bottom: 0.5rem; }
  .hero-headline { margin-bottom: 0.7rem; }
  .hero-sub { margin-bottom: 1rem; }
}

/* -------------------------------------------------------------- a11y/motion */

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Body scroll lock while the mobile drawer is open. */
body.nav-open { overflow: hidden; }
