/* ============================================================
   ColoursFlux — foundations: tokens, reset, type, controls
   Festival night theme: deep navy surfaces with indigo, magenta
   and cyan accents, colour gradients and soft glow.
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces */
  --bg: #080b1a;
  --bg-deep: #050814;
  --bg-2: #0c1226;
  --bg-elev: #111a33;
  --card: #0e1530;
  --card-2: #131c3a;
  --card-3: #1a2447;
  --elevated: #151f3d;

  /* Ink */
  --text: #eef2ff;
  --muted: #a9b4d0;
  --muted-dim: #7a86a3;

  /* Accents */
  --purple: #4f46e5;
  --purple-bright: #818cf8;
  --magenta: #d946ef;
  --cyan: #06b6d4;
  --blue: #3b82f6;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --gold: #f4c46a;
  --gold-bright: #ffd98a;
  --gold-deep: #c88a2e;

  /* Lines */
  --border: rgba(129, 140, 248, 0.16);
  --border-strong: rgba(129, 140, 248, 0.34);
  --border-soft: rgba(129, 140, 248, 0.1);
  --hairline: rgba(129, 140, 248, 0.12);

  /* Gradients */
  --grad: linear-gradient(96deg, #a5b4fc 0%, #818cf8 18%, #c084fc 38%, #f0abfc 58%, #22d3ee 82%, #f4c46a 100%);
  --grad-cta: linear-gradient(100deg, #4338ca, #a21caf);
  --grad-soft: linear-gradient(140deg, rgba(79, 70, 229, 0.3), rgba(217, 70, 239, 0.08));
  --grad-gold: linear-gradient(100deg, #ffe3a3, #f0b95c 55%, #d89434);

  /* Shape + elevation */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(3, 6, 18, 0.55);
  --shadow: 0 22px 44px -30px rgba(3, 6, 18, 1);
  --shadow-glow: 0 26px 60px -30px rgba(79, 70, 229, 0.55);
  --ring: 0 0 0 3px rgba(129, 140, 248, 0.4);

  /* Type */
  --font: "Space Grotesk", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-hero: clamp(2.9rem, 6.2vw, 5.4rem);
  --fs-page: clamp(2.1rem, 4vw, 3.1rem);

  /* Rhythm */
  --header-h: 64px;
  --container: 1800px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Festival glow: indigo, magenta and cyan light sources. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(50rem 32rem at 12% -10%, rgba(79, 70, 229, 0.42), transparent 68%),
    radial-gradient(44rem 30rem at 88% -6%, rgba(217, 70, 239, 0.3), transparent 66%),
    radial-gradient(42rem 28rem at 50% 108%, rgba(6, 182, 212, 0.22), transparent 72%),
    linear-gradient(180deg, #0b1129 0%, var(--bg) 36rem);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(129, 140, 248, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(129, 140, 248, 0.04) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(90% 55% at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(90% 55% at 50% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.1;
  letter-spacing: -0.034em;
  font-weight: 620;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.022em;
}

h1 {
  font-size: clamp(2.6rem, 5.8vw, 4.6rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}

h3 {
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
}

p {
  color: var(--muted);
}

::selection {
  background: rgba(217, 70, 239, 0.42);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--purple-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - 48px, 820px);
  margin-inline: auto;
}

.section {
  padding-block: clamp(52px, 7vw, 84px);
}

.section-tight {
  padding-block: clamp(32px, 4.6vw, 52px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap, 16px);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap, 12px);
}

.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }

/* ---------- type helpers ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border: 1px solid rgba(129, 140, 248, 0.24);
  border-radius: var(--r-pill);
  background:
    linear-gradient(120deg, rgba(79, 70, 229, 0.2), rgba(217, 70, 239, 0.09) 60%, rgba(6, 182, 212, 0.1));
  color: #c7d2fe;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 10px rgba(217, 70, 239, 0.9);
  animation: dot-pulse 2.6s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.45); opacity: 1; }
}

.eyebrow-glow {
  color: #d6dcff;
}

.eyebrow-glow .dot {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.9);
}

.eyebrow .icon {
  color: var(--magenta);
}

.gradient-text {
  background: var(--grad);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-pan 9s ease-in-out infinite;
}

@keyframes gradient-pan {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.lead {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.7;
  max-width: 56ch;
}

.muted { color: var(--muted); }
.dim { color: var(--muted-dim); }
.small { font-size: 0.86rem; }
.micro { font-size: 0.76rem; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.section-head h2 {
  position: relative;
  margin-top: 10px;
  padding-bottom: 16px;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 58px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #818cf8, #d946ef 55%, #06b6d4);
  box-shadow: 0 0 20px rgba(217, 70, 239, 0.5);
  transform-origin: left center;
  animation: underline-grow 0.9s var(--ease) 0.15s both;
}

@keyframes underline-grow {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

.section-head p {
  margin-top: 10px;
  max-width: 58ch;
  font-size: 0.95rem;
}

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

.btn {
  --btn-bg: rgba(255, 255, 255, 0.035);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 550;
  letter-spacing: -0.006em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: background-color 0.16s, border-color 0.16s, color 0.16s, transform 0.16s, box-shadow 0.16s;
}

.btn:hover {
  border-color: var(--border-strong);
  background-color: rgba(255, 255, 255, 0.06);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  border-color: transparent;
  background: var(--grad-cta);
  color: #fff;
  box-shadow: 0 12px 28px -16px rgba(217, 70, 239, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:hover {
  background: linear-gradient(100deg, #4f46e5, #c026d3);
  color: #fff;
  box-shadow: 0 16px 36px -16px rgba(217, 70, 239, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-gold {
  border-color: transparent;
  background: var(--grad-gold);
  color: #1b1305;
  font-weight: 650;
  box-shadow: 0 14px 32px -16px rgba(244, 196, 106, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-gold:hover {
  background: linear-gradient(100deg, #ffe9b8, #ffc465 55%, #e6a13c);
  color: #120c03;
  box-shadow: 0 18px 38px -16px rgba(244, 196, 106, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.btn-gold:focus-visible {
  outline-color: var(--gold-bright);
}

.btn-primary::after,
.btn-gold::after {
  content: "";
  position: absolute;
  inset: -60% -40%;
  z-index: -1;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.34) 50%, transparent 62%);
  transform: translateX(-65%) rotate(8deg);
  transition: transform 0.55s var(--ease);
  pointer-events: none;
}

.btn-primary:hover::after,
.btn-gold:hover::after {
  transform: translateX(65%) rotate(8deg);
}

.btn-primary:focus-visible {
  outline-color: #f0abfc;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: rgba(129, 140, 248, 0.1);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: transparent;
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.16);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-lg {
  min-height: 50px;
  padding: 13px 22px;
  font-size: 0.95rem;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border-radius: 9px;
}

/* ---------- inputs ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > label,
.field-label {
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: 0.005em;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-dim);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.75);
  box-shadow: var(--ring);
  background: rgba(255, 255, 255, 0.045);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737a87' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: rgba(255, 255, 255, 0.03);
  padding-right: 38px;
}

.select option {
  background: #131c3a;
  color: var(--text);
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .span-full {
  grid-column: 1 / -1;
}

.hint {
  font-size: 0.78rem;
  color: var(--muted-dim);
}

.error-text {
  font-size: 0.8rem;
  color: #fca5a5;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--purple-bright);
  width: 17px;
  height: 17px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- badges / chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 550;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.badge .icon {
  opacity: 0.8;
}

.badge-purple { color: #c7d2fe; border-color: rgba(129, 140, 248, 0.34); background: rgba(79, 70, 229, 0.18); }
.badge-magenta { color: #f5d0fe; border-color: rgba(217, 70, 239, 0.34); background: rgba(217, 70, 239, 0.16); }
.badge-cyan { color: #a5f3fc; border-color: rgba(6, 182, 212, 0.34); background: rgba(6, 182, 212, 0.14); }
.badge-green { color: #a7f3d0; border-color: rgba(16, 185, 129, 0.34); background: rgba(16, 185, 129, 0.14); }
.badge-amber { color: #fde68a; border-color: rgba(245, 158, 11, 0.34); background: rgba(245, 158, 11, 0.14); }
.badge-red { color: #fecaca; border-color: rgba(239, 68, 68, 0.34); background: rgba(239, 68, 68, 0.14); }
.badge-gold { color: #ffe6ad; border-color: rgba(244, 196, 106, 0.38); background: rgba(244, 196, 106, 0.14); }
.badge-neutral { color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.16s, border-color 0.16s, background-color 0.16s;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.chip[aria-pressed="true"],
.chip.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--grad-cta);
  box-shadow: 0 8px 20px -14px rgba(217, 70, 239, 0.8);
}

.chip[aria-pressed="true"]:hover,
.chip.is-active:hover {
  background: linear-gradient(100deg, #4f46e5, #c026d3);
  color: #fff;
}

.icon {
  flex: none;
}

.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- misc ---------- */

.divider {
  height: 1px;
  background: var(--hairline);
  border: 0;
}

.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;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 9px;
  background: var(--grad-cta);
  color: #fff;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

.pill-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

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

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js-reveal .reveal.is-in {
  opacity: 1;
  transform: none;
}

.hero-copy > * {
  animation: hero-in 0.9s var(--ease) both;
}

.hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.hero-copy > :nth-child(3) { animation-delay: 0.14s; }
.hero-copy > :nth-child(4) { animation-delay: 0.2s; }
.hero-copy > :nth-child(5) { animation-delay: 0.26s; }
.hero-copy > :nth-child(6) { animation-delay: 0.32s; }

.hero-panel {
  animation: hero-panel-in 1s var(--ease) both;
  animation-delay: 0.18s;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-panel-in {
  from { opacity: 0; transform: translateY(26px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* staggered entrance for cards inside a revealed section */
.js-reveal .reveal.is-in :is(.grid, .featured-vendor-rail, .schedule-list, .announce-feed, .home-announcements) > * {
  animation: card-rise 0.62s var(--ease) both;
}

.js-reveal .reveal.is-in :is(.grid, .featured-vendor-rail, .schedule-list, .announce-feed, .home-announcements) > :nth-child(2) { animation-delay: 70ms; }
.js-reveal .reveal.is-in :is(.grid, .featured-vendor-rail, .schedule-list, .announce-feed, .home-announcements) > :nth-child(3) { animation-delay: 140ms; }
.js-reveal .reveal.is-in :is(.grid, .featured-vendor-rail, .schedule-list, .announce-feed, .home-announcements) > :nth-child(4) { animation-delay: 210ms; }
.js-reveal .reveal.is-in :is(.grid, .featured-vendor-rail, .schedule-list, .announce-feed, .home-announcements) > :nth-child(5) { animation-delay: 280ms; }
.js-reveal .reveal.is-in :is(.grid, .featured-vendor-rail, .schedule-list, .announce-feed, .home-announcements) > :nth-child(6) { animation-delay: 350ms; }

@keyframes card-rise {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .container,
  .container-narrow { width: min(100% - 24px, var(--container)); }
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .section-head { align-items: flex-start; }
  body { font-size: 15.5px; }
}

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