/* Miramichi HydroFest 2027 — splash page
   Palette pulled from the event crest: hull red, gold/sand, bridge black. */

:root {
  --red:        #cf1722;
  --red-bright: #ff2f2f;
  --red-deep:   #7d0c13;
  --gold:       #c9a24a;
  --gold-lt:    #e6c887;
  --sand:       #f2e6cf;
  --ink:        #0b0c0f;
  --ink-2:      #14161b;
  --ink-3:      #1d2027;
  --white:      #f7f5f1;
  --muted:      #9aa1ac;
  --border:     rgba(201, 162, 74, 0.22);
  --border-lt:  rgba(201, 162, 74, 0.40);
  --wrap:       1060px;

  /* Repeated texture layers for the dark sections — a faint diagonal "speed
     line" weave plus a red bloom from the top edge of the section. */
  --speedlines: repeating-linear-gradient(
                  115deg,
                  rgba(247, 245, 241, 0.028) 0 1px,
                  transparent 1px 9px);
  --bloom:      radial-gradient(90% 60% at 50% 0%,
                  rgba(207, 23, 34, 0.13) 0%, transparent 62%);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Condensed display type — headings, numbers, labels. */
.tagline, .racecard p, .pill, .cd-label, .countdown-band .tba, .unit .num,
.eyebrow, .section-head h2, .fi-label, .card-num, .card h2, .stay h2, .btn,
.foot-title, .foot-tag {
  font-family: "Barlow Condensed", "Barlow", sans-serif;
}

/* ------------------------------------------------------------- reveals ---- */
/* Only hidden when JS is present — see the classList hook in <head>. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.js [data-reveal].in { opacity: 1; transform: none; }

/* --------------------------------------------------------------- frame ---- */

.topline {
  height: 4px;
  background: linear-gradient(90deg,
    var(--red) 0%, var(--red) 34%,
    var(--gold) 50%,
    var(--red) 66%, var(--red) 100%);
}

/* ---------------------------------------------------------------- hero ---- */
/* The crest is a JPEG on a white background, so the hero stays light and the
   image is multiplied into it — the white square disappears into the cream. */

.hero {
  position: relative;
  /* Contain the crest's mix-blend-mode to this section — without it the blend can
     composite against the dark body background and flash black while scrolling. */
  isolation: isolate;
  background:
    radial-gradient(120% 80% at 50% 0%, #ffffff 0%, #fffdf8 45%, #f4e8d3 100%);
  padding: 26px 0 0;
  text-align: center;
}

.hero-inner {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px 36px;
}

.crest {
  display: block;
  /* Square artwork — clamp against the viewport's short side too, so the hero
     still fits on a laptop screen without scrolling. */
  width: max(200px, min(84vw, 56vh, 540px));
  height: auto;
  margin: 0 auto;
  mix-blend-mode: multiply;
}

.tagline {
  margin: 2px auto 0;
  max-width: 22ch;
  text-wrap: balance;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  line-height: 1.06;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--red-deep);
}

/* the date / venue block under the tagline */

.racecard {
  margin: 16px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.racecard p { margin: 0; }

.racecard-days {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(11, 12, 15, 0.62);
}

.racecard-date {
  display: inline-block;
  padding: 7px 22px 5px;
  background: var(--red);
  border-radius: 3px;
  font-weight: 800;
  font-size: clamp(1.25rem, 4.6vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 2px 0 0 var(--red-deep);
}

/* venue line, flanked by hairlines */
.racecard .racecard-venue {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 3px;
  font-weight: 700;
  font-size: clamp(0.85rem, 3vw, 1rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-deep);
}

.racecard-venue::before,
.racecard-venue::after {
  content: "";
  width: clamp(18px, 8vw, 56px);
  height: 2px;
  background: rgba(125, 12, 19, 0.35);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.pill {
  padding: 5px 15px 4px;
  border: 1px solid rgba(125, 12, 19, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-deep);
}

/* checkered-flag strip, from the HRL shield on the crest */
.checker {
  height: 12px;
  background-image:
    linear-gradient(45deg, var(--ink) 25%, transparent 25%, transparent 75%, var(--ink) 75%),
    linear-gradient(45deg, var(--ink) 25%, transparent 25%, transparent 75%, var(--ink) 75%);
  background-color: var(--sand);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  border-top: 3px solid var(--red);
  animation: checker-drift 14s linear infinite;
}

/* 60px is five whole tiles, so the loop is seamless. */
@keyframes checker-drift {
  to { background-position: 60px 0, 66px 6px; }
}

.checker-foot { border-top: 0; border-bottom: 3px solid var(--red); }

/* ----------------------------------------------------------- countdown ---- */

.countdown-band {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
  border-bottom: 1px solid var(--border);
  padding: 30px 0 32px;
  text-align: center;
}

.countdown-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bloom), var(--speedlines);
  pointer-events: none;
}

.countdown-band .wrap { position: relative; }

.cd-label {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.cd-label[hidden] { display: none; }

.countdown-band .tba {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.05rem, 3.6vw, 1.35rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-lt);
}

#countdown[data-state="counting"] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 540px;
  margin: 0 auto;
}

.unit {
  position: relative;
  min-width: 0;
  padding: 12px 4px 9px;
  background:
    linear-gradient(180deg, rgba(207, 23, 34, 0.14) 0%, rgba(207, 23, 34, 0.04) 100%),
    rgba(11, 12, 15, 0.55);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(247, 245, 241, 0.06);
}

/* a red tick at the top of each unit, like a gauge marker */
.unit::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  background: var(--red);
  border-radius: 0 0 2px 2px;
}

.unit .num {
  display: block;
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 2.9rem);
  line-height: 1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(207, 23, 34, 0.35);
}

.unit .lbl {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-lt);
}

@media (min-width: 480px) {
  .unit .lbl { font-size: 0.72rem; letter-spacing: 0.2em; }
}

/* --------------------------------------------------------------- intro ---- */

.intro { padding: 58px 0 12px; }

.intro .wrap { max-width: 760px; }

.lede {
  margin: 0 0 16px;
  font-size: clamp(1.15rem, 3.6vw, 1.4rem);
  line-height: 1.5;
  color: var(--white);
  text-wrap: pretty;
}

.lede strong {
  color: var(--gold-lt);
  font-weight: 600;
}

.intro p:not(.lede) {
  margin: 0;
  color: var(--muted);
}

/* ------------------------------------------------------- section heads ---- */

.section-head { margin: 0 0 26px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  background: var(--red);
  flex: none;
}

.section-head h2 {
  margin: 0;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(1.6rem, 5.4vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
}

/* ------------------------------------------------------ feature strip ----- */

.features {
  position: relative;
  overflow: hidden;
  margin-top: 50px;
  padding: 44px 0 46px;
  background: var(--ink-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bloom), var(--speedlines);
  pointer-events: none;
}

.features .wrap { position: relative; }

.feature-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 26px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  flex: 1 1 136px;
  max-width: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.fi-wrap {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid var(--border-lt);
  border-radius: 50%;
  background:
    radial-gradient(70% 70% at 50% 30%, rgba(207, 23, 34, 0.20), transparent 70%),
    rgba(11, 12, 15, 0.5);
  color: var(--gold-lt);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.feature:hover .fi-wrap {
  border-color: var(--gold-lt);
  color: var(--white);
  transform: translateY(-2px);
}

.fi {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fi-label {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.22;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
}

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

.cards { padding: 50px 0 8px; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 24px 22px 26px;
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 4px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.card:hover {
  background: var(--ink-3);
  border-color: var(--border-lt);
  border-top-color: var(--red-bright);
  transform: translateY(-3px);
}

/* Oversized ghost number in the corner. Scoped under .card so it outranks the
   generic `.card p` rules below. */
.card .card-num {
  position: absolute;
  top: 0;
  right: 12px;
  margin: 0;
  font-weight: 800;
  font-style: italic;
  font-size: 4.4rem;
  line-height: 1;
  color: rgba(201, 162, 74, 0.11);
  pointer-events: none;
}

.card h2 {
  position: relative;
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-lt);
}

.card p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ----------------------------------------------------------------- CTA ---- */

.stay {
  position: relative;
  overflow: hidden;
  margin-top: 54px;
  padding: 52px 0 56px;
  background: linear-gradient(180deg, var(--ink-2) 0%, var(--ink) 100%);
  border-top: 1px solid var(--border);
  text-align: center;
}

.stay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bloom), var(--speedlines);
  pointer-events: none;
}

.stay .wrap { position: relative; }

.stay h2 {
  margin: 0 0 6px;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--white);
}

.stay p { margin: 0; color: var(--muted); }

.stay .contact { margin-top: 24px; }

.btn {
  display: inline-block;
  padding: 13px 30px 12px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  border-radius: 3px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 0 var(--red-deep);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--red-bright);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 0 var(--red-deep);
}

.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 0 var(--red-deep); }

.social {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  color: var(--gold-lt);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(230, 200, 135, 0.35);
}

.social a:hover { color: var(--white); }

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

footer {
  background: var(--ink);
  text-align: center;
}

footer .wrap { padding-top: 30px; padding-bottom: 38px; }

.foot-title {
  margin: 0 0 2px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
}

.foot-tag {
  margin: 0 0 12px;
  font-weight: 700;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-lt);
}

.foot-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

:where(a):focus-visible,
:where(.btn):focus-visible {
  outline: 2px solid var(--gold-lt);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- wide ---- */

@media (min-width: 720px) {
  .hero { padding-top: 40px; }
  .card-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .feature-grid { gap: 22px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
