/* ============================================================
   AST COACH — Hammhaus theme layer
   ------------------------------------------------------------
   Hammhaus (hammhaus.css) is loaded first from the CDN. This file
   ONLY (a) overrides --hh-* tokens to hit the vintage letterpress
   look from the brand kit, and (b) adds app-specific pieces the
   system doesn't ship: sticky nav, hero, marquee, star rules,
   photo placeholders, and the gallery lightbox.
   Palette is locked to three inks: cream · charcoal · barn red.
   ============================================================ */

/* ---------- 1. Token overrides (the whole re-skin) ---------- */
:root {
  /* Barn-brick red, closer to the letterpress mockups than the
     default vermillion. Feeds accent, badges, red sections. */
  --hh-red: #b0342a;

  /* Warm the paper a touch and keep ink near-black. */
  --hh-paper:   light-dark(#f3ecdc, #17130d);
  --hh-paper-2: light-dark(#e7dcc6, #221b13);
  --hh-paper-3: light-dark(#fbf6ec, #100d08);

  /* Heavy slab display face for the vintage poster/ticket feel.
     Body stays Archivo, labels stay mono (reads like ticket stubs). */
  --hh-font-display: "Roboto Slab", "Rockwell", "Zilla Slab", Georgia, serif;

  /* Slabs need far less negative tracking than Archivo Black. */
  --hh-tracking-hero: -0.005em;
  --hh-tracking-display: 0em;
  --hh-tracking-title: 0.004em;
  --hh-tracking-section: 0.006em;
  --hh-tracking-subhead: 0.01em;

  /* Crisp letterpress rectangles instead of pills everywhere. */
  --hh-radius: 3px;
  --hh-radius-sm: 2px;
  --hh-radius-pill: 3px;

  --hh-container: 1180px;
  --hh-container-wide: 1420px;

  /* Neutralize the blue/yellow accents so nothing leaves the palette. */
  --hh-accent-2: var(--hh-ink);
  --hh-accent-3: var(--hh-red);
}

/* Keep bold bands inside the three-ink palette (Hammhaus defaults
   these accents/focus to yellow, which we don't use). */
.hh-section--red,
.hh-section--ink,
.hh-card--inverse {
  --hh-accent: var(--hh-cream);
  --hh-focus: var(--hh-cream);
}
.hh-section--paper,
.hh-section--white { --hh-accent: var(--hh-red); }

/* Uppercase slab headings — the poster look. Body/lede stay cased. */
.hh-display,
.hh-title,
.hh-section-title,
.hh-hero__title {
  text-transform: uppercase;
}

/* hh-list ships as display:flex, which splits a "<strong>lead-in</strong> then
   trailing text" item into separate columns. Reflow to a normal block with an
   absolutely-placed square marker so the bold lead-in and text read as one line. */
.hh-list li {
  display: block;
  position: relative;
  padding-inline-start: 1.35em;
}
.hh-list li::before {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.62em;
  margin: 0;
}

/* Default badge → red stamp, not yellow. */
.hh-badge {
  background: var(--hh-red);
  color: var(--hh-cream);
  border-color: var(--hh-ink);
}

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

/* iOS renders date inputs at an intrinsic min-width that ignores width:100%,
   so they overflow the form on narrow screens. Let form fields shrink, strip
   the native appearance on mobile, and left-align the value so it fits. */
.hh-field { min-width: 0; }
.hh-input[type="date"] { min-width: 0; }
.hh-input[type="date"]::-webkit-date-and-time-value { margin: 0; text-align: left; }
@media (max-width: 640px) {
  .hh-input[type="date"] { -webkit-appearance: none; appearance: none; }
}

/* ---------- 2. Paper grain + letterpress atmosphere ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
}
/* Soft paper vignette. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 60%, color-mix(in srgb, var(--hh-ink) 12%, transparent) 100%);
}
/* Keep real content above the texture layers. */
.ast-nav, main, .ast-footer { position: relative; z-index: 2; }

@media (prefers-color-scheme: dark) {
  body::before { mix-blend-mode: screen; opacity: 0.35; }
}

/* ---------- 3. Star rule (mockup dividers) ---------- */
.ast-rule {
  display: flex;
  align-items: center;
  gap: var(--hh-space-3);
  color: color-mix(in srgb, var(--hh-red) 80%, var(--hh-fg));
}
.ast-rule::before,
.ast-rule::after {
  content: "";
  flex: 1;
  height: 2px;
  background: currentColor;
  opacity: 0.55;
}
.ast-rule__star { font-size: 0.9rem; line-height: 1; }
.ast-rule--center { justify-content: center; }

/* ---------- 4. Sticky navigation ---------- */
.ast-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  min-height: 4.75rem;
  transition: background-color 0.35s var(--hh-ease), box-shadow 0.35s var(--hh-ease), min-height 0.35s var(--hh-ease);
  border-bottom: 2px solid transparent;
}
.ast-nav.is-stuck {
  min-height: 4rem;
  background: color-mix(in srgb, var(--hh-paper) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--hh-ink);
}
.ast-nav__inner {
  width: min(100% - (var(--hh-gutter) * 2), var(--hh-container-wide));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hh-space-5);
}
.ast-brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.ast-brand img { height: 2.5rem; width: auto; }
.ast-brand__text {
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}
.ast-brand__text .ast-red { color: var(--hh-red); }
.ast-brand__star { color: var(--hh-red); font-size: 0.7em; vertical-align: 0.15em; }

.ast-nav__links { display: flex; align-items: center; gap: var(--hh-space-6); }
.ast-nav__links a:not(.hh-button) {
  font-family: var(--hh-font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.25s var(--hh-ease), color 0.25s var(--hh-ease);
}
.ast-nav__links a:not(.hh-button):hover,
.ast-nav__links a.is-active { border-bottom-color: var(--hh-red); }

.ast-nav__toggle {
  display: none;
  width: 2.75rem; height: 2.75rem;
  background: none; border: 0; cursor: pointer;
  color: var(--hh-fg);
}
.ast-nav__toggle span { display: block; width: 1.6rem; height: 2px; margin: 0.32rem auto; background: currentColor; transition: transform 0.3s var(--hh-ease), opacity 0.25s; }
.ast-nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(0.44rem) rotate(45deg); }
.ast-nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ast-nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-0.44rem) rotate(-45deg); }

@media (max-width: 900px) {
  .ast-nav__toggle { display: block; z-index: 60; }
  /* The stuck nav's backdrop-filter would make it the containing block for the
     fixed overlay below, trapping the full-screen menu inside the ~64px bar
     (notably on iOS). Drop the filter on mobile and use an opaque bar instead. */
  .ast-nav.is-stuck {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--hh-paper);
  }
  .ast-nav__links {
    position: fixed; inset: 0; z-index: 55;
    flex-direction: column; justify-content: center; gap: var(--hh-space-6);
    background: var(--hh-paper); /* opaque: guaranteed full-screen cover, no filter needed */
    opacity: 0; pointer-events: none; transition: opacity 0.3s var(--hh-ease);
  }
  .ast-nav__links.is-open { opacity: 1; pointer-events: auto; }
  .ast-nav__links a:not(.hh-button) { font-size: 1.1rem; }
}

/* ---------- 5. Hero ---------- */
.ast-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-block: 9rem 5rem;
  overflow: hidden;
}
.ast-hero__bg {
  position: absolute; inset: 0; z-index: 0;
  object-fit: cover; width: 100%; height: 100%;
  opacity: 0.16; filter: grayscale(0.4) contrast(1.05);
}
.ast-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 50% 42%, color-mix(in srgb, var(--hh-red) 8%, transparent), transparent 70%);
}
.ast-hero__inner { position: relative; z-index: 2; text-align: center; display: grid; gap: var(--hh-space-5); justify-items: center; }
.ast-hero__logo { max-width: min(420px, 74vw); height: auto; margin-inline: auto; }
.ast-hero__title {
  font-family: var(--hh-font-display);
  font-weight: 900;
  text-transform: uppercase;
  text-wrap: balance;
  font-size: var(--hh-type-hero);
  line-height: var(--hh-leading-hero);
  letter-spacing: var(--hh-tracking-hero);
}
.ast-hero__title .ast-red { color: var(--hh-red); }
.ast-hero .hh-lede { margin-inline: auto; text-align: center; }
.ast-hero__cta { display: flex; flex-wrap: wrap; gap: var(--hh-space-4); justify-content: center; }
.ast-scrollcue {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  z-index: 2; font-family: var(--hh-font-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase; color: color-mix(in srgb, currentColor 60%, var(--hh-bg));
  display: grid; justify-items: center; gap: 0.4rem;
}
.ast-scrollcue::after { content: ""; width: 2px; height: 2.4rem; background: linear-gradient(var(--hh-red), transparent); animation: astcue 1.9s var(--hh-ease) infinite; }
@keyframes astcue { 0% { transform: scaleY(0); transform-origin: top; } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* Page hero (interior pages) */
.ast-pagehero { padding-block: 8.5rem 3rem; text-align: center; }
.ast-pagehero .hh-lede { margin-inline: auto; }

/* Vintage ticket-button graphic used as the hero CTA */
.ast-ticket-btn {
  display: inline-block;
  line-height: 0;
  border-radius: 4px;
  transition: transform 0.3s var(--hh-ease), filter 0.3s var(--hh-ease);
}
.ast-ticket-btn img {
  width: min(270px, 72vw);
  max-width: 270px; /* hard cap so a stale/failed width rule can't balloon it */
  height: auto;
  filter: drop-shadow(3px 4px 0 rgba(17, 17, 17, 0.32));
}
.ast-ticket-btn:hover { transform: translateY(-3px) rotate(-1deg); }
.ast-ticket-btn:hover img { filter: drop-shadow(5px 7px 0 rgba(17, 17, 17, 0.4)); }
.ast-ticket-btn:focus-visible { outline: 3px solid var(--hh-focus); outline-offset: 4px; }

/* Decorative admission-ticket graphic (quote page) */
.ast-ticket-graphic {
  width: min(340px, 66vw);
  height: auto;
  margin: var(--hh-space-2) auto 0;
  transform: rotate(-1.5deg);
}
@media (prefers-reduced-motion: reduce) {
  .ast-ticket-graphic { transform: none; }
}

/* ---------- 6. Marquee ---------- */
.ast-marquee { overflow: hidden; border-block: 2px solid var(--hh-ink); background: var(--hh-ink); color: var(--hh-cream); padding-block: 0.8rem; }
.ast-marquee__track { display: flex; width: max-content; gap: 2.5rem; animation: astmarquee 34s linear infinite; }
.ast-marquee:hover .ast-marquee__track { animation-play-state: paused; }
.ast-marquee__track span { font-family: var(--hh-font-display); text-transform: uppercase; font-size: 1.15rem; letter-spacing: 0.06em; white-space: nowrap; }
.ast-marquee__track .ast-red { color: var(--hh-red); margin-inline: 2.5rem; }
@keyframes astmarquee { to { transform: translateX(-50%); } }

/* ---------- 7. Photo placeholders + media frames ---------- */
.ast-media {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--hh-ink);
  border-radius: var(--hh-radius);
  background: var(--hh-paper-2);
  aspect-ratio: var(--ast-ar, 4 / 3);
}
.ast-media--portrait { --ast-ar: 4 / 5; }
.ast-media--wide { --ast-ar: 2 / 1; }
.ast-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.7s var(--hh-ease); }
.ast-media--hover:hover img { transform: scale(1.05); }
/* hard offset frame shadow on the media cards */
.ast-media--framed { box-shadow: var(--hh-shadow-hard); }

/* ---------- 8. Fleet horizontal scroller ---------- */
.ast-scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(380px, 82vw);
  gap: var(--hh-space-5); overflow-x: auto; scroll-snap-type: x mandatory;
  padding-block-end: var(--hh-space-4); scrollbar-width: none;
}
.ast-scroller::-webkit-scrollbar { display: none; }
.ast-scroller > * { scroll-snap-align: center; }
/* On desktop, drop the horizontal scroll and show all four cards as a grid
   (no cut-off 4th tile), with uniform image heights so the row lines up. */
@media (min-width: 1080px) {
  .ast-scroller {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: auto;
    overflow: visible;
    scroll-snap-type: none;
  }
  .ast-scroller .hh-card__media { aspect-ratio: 4 / 3; min-height: 0; }
  .ast-scroller .hh-card__media > img { width: 100%; height: 100%; object-fit: cover; }
}

/* ---------- 9. Gallery + lightbox ---------- */
.ast-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-rows: 220px; grid-auto-flow: dense; gap: var(--hh-space-4); }
.ast-gallery__item { position: relative; overflow: hidden; border: 2px solid var(--hh-ink); border-radius: var(--hh-radius); cursor: zoom-in; background: var(--hh-paper-2); }
.ast-gallery__item.is-tall { grid-row: span 2; }
.ast-gallery__item.is-wide { grid-column: span 2; }
@media (max-width: 620px) { .ast-gallery__item.is-wide { grid-column: span 1; } }
.ast-gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--hh-ease), filter 0.4s; }
.ast-gallery__item:hover img { transform: scale(1.06); filter: brightness(1.05); }

.ast-lightbox { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: color-mix(in srgb, var(--hh-ink) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ast-lightbox.is-open { display: grid; }
.ast-lightbox img { max-width: 92vw; max-height: 86vh; border: 3px solid var(--hh-cream); border-radius: var(--hh-radius); }
.ast-lightbox button { position: absolute; width: 3rem; height: 3rem; display: grid; place-items: center; background: color-mix(in srgb, var(--hh-cream) 10%, transparent); border: 2px solid var(--hh-cream); color: var(--hh-cream); border-radius: var(--hh-radius); font-size: 1.3rem; cursor: pointer; transition: background-color 0.25s; }
.ast-lightbox button:hover { background: var(--hh-red); border-color: var(--hh-red); }
.ast-lb-close { top: 1.2rem; right: 1.2rem; }
.ast-lb-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.ast-lb-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }

/* ---------- 10. Footer ---------- */
.ast-footer { border-top: 3px double var(--hh-ink); background: var(--hh-paper-2); padding-block: var(--hh-space-8) var(--hh-space-6); }
.ast-footer__word { font-family: var(--hh-font-display); text-transform: uppercase; text-align: center; line-height: 0.82; font-size: clamp(3.5rem, 13vw, 10rem); letter-spacing: 0.04em; color: transparent; -webkit-text-stroke: 2px color-mix(in srgb, var(--hh-red) 45%, transparent); user-select: none; }
.ast-social { display: inline-flex; gap: var(--hh-space-3); }
.ast-social a { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 2px solid var(--hh-ink); border-radius: var(--hh-radius); transition: background-color 0.25s, color 0.25s, transform 0.25s var(--hh-ease); }
.ast-social a:hover { background: var(--hh-red); color: var(--hh-cream); border-color: var(--hh-red); transform: translateY(-2px); }
.ast-social svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }

/* ---------- 11. Logo fallback wordmark ---------- */
.ast-logo-fallback { display: none; }
.ast-logo-img.is-missing { display: none; }
.ast-logo-img.is-missing + .ast-logo-fallback { display: inline-flex; }

/* ---------- 12. Scroll reveal ---------- */
.ast-reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--hh-ease), transform 0.8s var(--hh-ease); transition-delay: var(--d, 0s); }
.ast-reveal.is-in { opacity: 1; transform: none; }

/* Hide the scroll cue where the centered hero content would collide with it
   (short or narrow viewports). It's a decorative flourish, not load-bearing. */
@media (max-width: 700px), (max-height: 840px) {
  .ast-scrollcue { display: none; }
}

/* ---------- 13. Credibility: client wall + testimonials ---------- */
/* Border model (like hh-stat-grid): cells draw their own hairlines, so a
   partial last row just ends in the section background — no exposed block. */
.ast-clients {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}
.ast-client {
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: var(--hh-bg);
  min-height: 5.5rem;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem 0.9rem;
  font-family: var(--hh-font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.02;
  font-size: 1.1rem;
}
/* Client logos render as a cohesive cream set on the dark wall, then bloom to
   full colour on hover — the premium "trusted by" treatment. Drop transparent
   PNGs (any colour) into /assets/img/clients/ and they normalize automatically. */
.ast-client img {
  max-height: 3rem;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.8;
  transition: opacity 0.25s var(--hh-ease), filter 0.25s var(--hh-ease);
}
.ast-client:hover img { opacity: 1; filter: none; }
@media (max-width: 560px) { .ast-clients { grid-template-columns: repeat(2, 1fr); } }

/* Tour-poster lineup of real client names, separated by red stars. */
.ast-lineup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0;
  max-width: 62rem;
  margin-inline: auto;
}
.ast-lineup span {
  font-family: var(--hh-font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
/* Festival-poster tiers: headliners large up top, full roster smaller below. */
.ast-lineup--head { gap: 0.35rem 0; max-width: 60rem; }
.ast-lineup--head span { font-size: clamp(1.6rem, 3.3vw, 3rem); }
.ast-lineup--rest { max-width: 54rem; gap: 0.4rem 0; margin-top: calc(var(--hh-space-3) * -1); }
.ast-lineup--rest span {
  font-size: clamp(0.88rem, 1.35vw, 1.2rem);
  color: color-mix(in srgb, currentColor 82%, var(--hh-bg));
}
.ast-lineup span::after {
  content: "\2605";
  color: var(--hh-red);
  margin: 0 0.5em;
  font-size: 0.6em;
  vertical-align: 0.2em;
}
.ast-lineup span:last-child::after { content: none; }
.ast-lineup .ast-lineup__more {
  font-family: var(--hh-font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, currentColor 55%, var(--hh-bg));
}
/* Placeholder tiles read as clearly editable, like the photo placeholders. */
.ast-client--ph {
  color: color-mix(in srgb, currentColor 42%, var(--hh-bg));
  font-family: var(--hh-font-mono);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.ast-trustbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--hh-space-3) var(--hh-space-6);
}
.ast-trustbar span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--hh-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, currentColor 74%, var(--hh-bg));
}
.ast-trustbar span::before { content: "★"; color: var(--hh-accent); }

.ast-quote-card { justify-content: space-between; }
.ast-quote-card .ast-stars { color: var(--hh-red); letter-spacing: 0.15em; font-size: 0.95rem; }
.ast-quote-card figcaption { margin-top: auto; }

@media (prefers-reduced-motion: reduce) {
  .ast-marquee__track, .ast-scrollcue::after { animation: none; }
  .ast-reveal { opacity: 1; transform: none; transition: none; }
  .ast-hero__bg { filter: none; }
}
