/* KiteCC — Corpus Christi kiteboarding slideshow.
   Visual language inspired by omp.sh: deep violet-black canvas, Fraunces serif
   display with a magenta -> iris -> cyan gradient accent, JetBrains Mono eyebrows
   in uppercase wide tracking, hairline dividers, generous negative space. */

:root {
  /* Canvas + ink */
  --bg: oklch(0.135 0.018 295);
  --bg-raise: oklch(0.172 0.022 295);
  --ink: oklch(0.97 0.008 90);
  --ink-dim: oklch(0.82 0.014 285);
  --ink-mute: oklch(0.62 0.02 290);
  --line: oklch(1 0 0 / 0.09);
  --line-strong: oklch(1 0 0 / 0.16);

  /* Accent gradient stops */
  --magenta: oklch(0.7 0.24 340);
  --iris: oklch(0.62 0.22 285);
  --cyan: oklch(0.81 0.14 200);
  --gradient: linear-gradient(100deg, var(--iris), var(--cyan));
  /* Button gradient — starts yellow (left), through iris into cyan (no pink) */
  --gradient-btn: linear-gradient(100deg, var(--select), var(--iris) 50%, var(--cyan));

  /* Selection / active / pin accent — bright Pac-Man yellow */
  --select: oklch(0.86 0.19 100);
  --select-soft: oklch(0.86 0.19 100 / 0.55);

  /* Status hues */
  --warn: oklch(0.78 0.18 82);
  --ok: oklch(0.78 0.16 150);

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fade: opacity 0.5s ease-in-out;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Shared eyebrow: mono, uppercase, wide tracking, muted. */
.eyebrow,
.filters__group-label,
.details__group-title,
.carousel__position,
.footer__credit {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--ink-mute);
  font-weight: 400;
}
/* Filter group headers are denser-packed than other eyebrows; lift their contrast. */
.filters__group-label { color: var(--ink-dim); font-weight: 500; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================ REGION 1: HEADER ============================================ */
.header {
  position: relative;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(0deg, var(--bg) 2%, transparent 60%), url("../images/hero-bg.jpg");
  background-size: cover, cover;
  background-position: center 35%, center 35%;
}
/* Compact header: a slim title bar so the page starts at the filters. */
.header--compact {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-raise);
  display: flex; align-items: baseline; gap: var(--space-md); flex-wrap: wrap;
}
.header--compact .header__content { display: flex; align-items: baseline; gap: var(--space-md); flex-wrap: wrap; }
.header--compact .header__title { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 0; }
.header--compact .header__tagline { font-size: 0.95rem; margin-bottom: 0; }
.header__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, oklch(0.135 0.018 295 / 0.86), oklch(0.135 0.018 295 / 0.5) 60%, oklch(0.135 0.018 295 / 0.7)),
    radial-gradient(120% 90% at 85% 0%, oklch(0.62 0.22 285 / 0.24), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, oklch(0.81 0.14 200 / 0.16), transparent 50%);
  z-index: 0;
}
.header__content { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }
.header__title {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.1;
  letter-spacing: 0.18em;
  margin-bottom: var(--space-md);
}
.header__title::after {
  content: ".";
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.header__tagline {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-weight: 400;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-bottom: var(--space-sm);
}
.header__subtitle { color: var(--ink-mute); max-width: 46ch; margin-bottom: var(--space-lg); }
.header__cta {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  padding: 0.85rem 1.6rem;
  color: var(--bg);
  background: var(--gradient-btn);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.header__cta:hover { transform: translateY(-2px); box-shadow: 0 10px 30px oklch(0.62 0.22 285 / 0.3); }

/* ============================================ REGION 2: FILTERS ============================================ */
.filters { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--line); }
.filters__container { max-width: 1200px; margin: 0 auto; }
.filters__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

/* Wind rose */
.windrose {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-sm);
}
.windrose__svg { width: 100%; max-width: 180px; height: auto; display: block; overflow: visible; }

.windrose__sector {
  fill: oklch(1 0 0 / 0.04);
  stroke: var(--line-strong);
  stroke-width: 0.75;
  cursor: pointer;
  transition: fill 0.2s var(--ease);
}
.windrose__sector:hover { fill: oklch(1 0 0 / 0.1); }
.windrose__sector:focus { outline: none; fill: oklch(1 0 0 / 0.12); }
.windrose__sector.is-active {
  fill: var(--select);
  stroke: var(--select-soft);
}

.windrose__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  fill: var(--ink-mute);
  cursor: pointer;
  user-select: none;
  pointer-events: none; /* let the sector beneath own the click; label still updates via class */
}
.windrose__label.is-active { fill: var(--bg); font-weight: 700; }
.windrose__hub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  fill: var(--ink-mute);
  pointer-events: none;
}

/* Filter groups */
.filters__controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}
.filters__group { background: var(--bg); padding: var(--space-md); }
.filters__group-label { display: block; margin-bottom: var(--space-md); }
.filters__buttons { display: flex; flex-direction: column; gap: 0.7rem; }
.filters__checkbox { display: flex; align-items: center; cursor: pointer; user-select: none; }
.filters__checkbox input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; margin-right: 0.7rem; flex-shrink: 0;
  border: 1px solid var(--line-strong); border-radius: 3px; background: transparent;
  cursor: pointer; transition: all 0.15s var(--ease); position: relative;
}
.filters__checkbox input:checked {
  background: var(--select); border-color: transparent;
}
.filters__checkbox input:checked::after {
  content: "✓"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg); font-size: 11px; font-weight: 700;
}
.filters__label { font-size: 0.95rem; color: var(--ink); transition: color 0.15s var(--ease); }
.filters__checkbox input:checked + .filters__label { color: var(--ink); font-weight: 600; }

.filters__actions {
  display: flex; gap: var(--space-sm); align-items: center;
  flex-wrap: wrap; padding-top: var(--space-md); border-top: 1px solid var(--line);
}
.filters__apply {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  padding: 0.6rem 1.2rem; color: var(--ink); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 2px; cursor: pointer; transition: all 0.2s var(--ease);
}
.filters__apply:hover { border-color: var(--select); color: var(--ink); }
.filters__reset {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  padding: 0.6rem 1.1rem; color: var(--ink); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 2px; cursor: pointer; transition: all 0.2s var(--ease);
}
.filters__reset:hover { border-color: var(--select); color: var(--ink); }
.filters__count { margin-left: auto; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-mute); }

/* ============================================ REGION 2.5: PIXEL MAP ============================================ */
.map { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--line); }
.map__container { max-width: 1200px; margin: 0 auto; }
.map__eyebrow { display: block; margin-bottom: var(--space-sm); }
.map__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.02em; margin-bottom: var(--space-md);
}
.map__stage {
  position: relative; width: 100%;
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
.map__img { display: block; width: 100%; height: auto; image-rendering: pixelated; opacity: 0.7; }

/* Overlay: crisp DOM pins + labels for the filtered spots (always readable). */
.mapo { position: absolute; inset: 0; pointer-events: none; }
/* Anchor the DOT on the spot's coordinates; the label hangs off to the side. */
.mapo__pin {
  position: absolute; transform: translate(-6px, -50%); display: flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 0; cursor: pointer; pointer-events: auto; white-space: nowrap;
}
.mapo__pin--left { flex-direction: row-reverse; transform: translate(calc(-100% + 6px), -50%); }
.mapo__dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  background: var(--select); border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--select), 0 0 6px var(--select-soft);
  transition: transform 0.15s var(--ease);
}
.mapo__label {
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--ink); background: oklch(0.135 0.018 295 / 0.9);
  padding: 2px 6px; border-radius: 2px; border: 1px solid var(--line-strong);
}
.mapo__pin:hover .mapo__dot { transform: scale(1.3); }
.mapo__pin:hover .mapo__label { border-color: var(--select); }
.mapo__pin.is-active .mapo__dot { transform: scale(1.45); box-shadow: 0 0 0 2px var(--select), 0 0 12px var(--select); }
.mapo__pin.is-active .mapo__label { color: var(--select); border-color: var(--select); font-weight: 600; }

/* ============================================ REGION 3: CAROUSEL ============================================ */
.carousel { flex: 1; padding: var(--space-xl) var(--space-lg); }
.carousel__container { max-width: 1200px; margin: 0 auto; position: relative; display: flex; flex-direction: column; gap: var(--space-md); }
.carousel__main {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
.carousel__slide-wrapper { position: relative; width: 100%; height: 100%; }
.carousel__slide { position: absolute; inset: 0; opacity: 0; transition: var(--t-fade); }
.carousel__slide.active { opacity: 1; z-index: 2; }
.carousel__slide-image {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: var(--bg-raise);
}
.carousel__slide-map { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
/* Brand tint over the pixel map keeps the caption legible and on-palette. */
.carousel__slide-image::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, oklch(0.62 0.22 285 / 0.18), oklch(0.81 0.14 200 / 0.14));
}
.carousel__slide-content {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  padding: var(--space-lg);
  background: linear-gradient(to top, oklch(0.135 0.018 295 / 0.92), transparent);
}
.carousel__slide-name {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em; margin-bottom: 0.2rem;
}
.carousel__slide-location { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; color: var(--ink-dim); text-transform: uppercase; }

.carousel__no-match {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: var(--space-md); text-align: center; color: var(--ink-dim);
}
.carousel__no-match p { font-family: var(--font-display); font-size: 1.6rem; font-style: italic; }
.carousel__reset-btn {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  padding: 0.6rem 1.1rem; color: var(--bg); background: var(--gradient-btn);
  border: none; border-radius: 2px; cursor: pointer;
}

.carousel__nav {
  position: absolute; top: calc(50% - var(--space-md)); transform: translateY(-50%); z-index: 20;
  width: 44px; height: 44px; border-radius: 50%;
  background: oklch(0.135 0.018 295 / 0.6); color: var(--ink);
  border: 1px solid var(--line-strong); cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s var(--ease);
  backdrop-filter: blur(6px);
}
.carousel__nav:hover { border-color: var(--select); background: oklch(0.172 0.022 295 / 0.8); }
.carousel__nav--prev { left: var(--space-md); }
.carousel__nav--next { right: var(--space-md); }
.carousel__nav:disabled { opacity: 0.25; cursor: not-allowed; }
.carousel__nav:disabled:hover { border-color: var(--line-strong); }

.carousel__thumbnails { display: flex; gap: 0.6rem; overflow-x: auto; padding: 0.3rem 0; }
.carousel__thumbnail {
  flex-shrink: 0; width: 110px; height: 64px; border-radius: 3px; cursor: pointer; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-raise);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.04em; color: var(--ink);
  text-transform: uppercase; padding: 0.3rem; transition: all 0.2s var(--ease); position: relative;
}
.carousel__thumbnail::before { content: ""; position: absolute; inset: 0; background: oklch(0.135 0.018 295 / 0.45); transition: background 0.2s var(--ease); }
.carousel__thumbnail-label { position: relative; z-index: 2; }
.carousel__thumbnail-map { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; z-index: 0; }
.carousel__thumbnail.active { border-color: transparent; box-shadow: 0 0 0 2px var(--select); }
.carousel__thumbnail.active::before { background: oklch(0.135 0.018 295 / 0.15); }
.carousel__thumbnail:hover::before { background: oklch(0.135 0.018 295 / 0.25); }
.carousel__thumbnail--photo { color: var(--ink); }
/* Keep the spot label above the darkening scrim. */
.carousel__thumbnail { isolation: isolate; }
.carousel__thumbnail::before { z-index: 1; }

.carousel__controls { display: flex; gap: var(--space-md); align-items: center; justify-content: center; }
.carousel__play-pause {
  width: 38px; height: 38px; border-radius: 50%; font-size: 0.9rem;
  background: transparent; color: var(--ink); border: 1px solid var(--line-strong); cursor: pointer;
  transition: all 0.2s var(--ease);
}
.carousel__play-pause:hover { border-color: var(--cyan); }
.carousel__position { min-width: 56px; text-align: center; }

/* ============================================ REGION 4: DETAILS ============================================ */
.details { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--line); }
.details__container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 280px 1fr; gap: var(--space-lg); align-items: start; }
.details__content { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--space-lg); }

/* Filtered spot list — pick a spot to view its details. */
.spotlist { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; max-height: 520px; overflow-y: auto; }
.spotlist__item {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  padding: 0.7rem 0.9rem; background: transparent; color: var(--ink);
  border: none; border-bottom: 1px solid var(--line); transition: background 0.15s var(--ease);
}
.spotlist__item:last-child { border-bottom: none; }
.spotlist__item:hover { background: var(--bg-raise); }
.spotlist__item.is-active { background: var(--bg-raise); box-shadow: inset 3px 0 0 var(--select); }
.spotlist__name { font-family: var(--font-display); font-size: 1rem; font-weight: 500; }
.spotlist__item.is-active .spotlist__name { color: var(--select); }
.spotlist__loc { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); }
.details__no-match {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-md); text-align: center; color: var(--ink-dim); padding: var(--space-xl);
}
.details__no-match p { font-family: var(--font-display); font-size: 1.6rem; font-style: italic; }
.details__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.02em; margin-bottom: 0.3rem; }
.details__location { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; color: var(--ink-mute); margin-bottom: var(--space-lg); }
.details__description { color: var(--ink-dim); margin-bottom: var(--space-md); max-width: 62ch; }
.details__group { margin-bottom: var(--space-md); }
.details__group-title { display: block; margin-bottom: var(--space-sm); }
.details__condition {
  display: flex; justify-content: space-between; gap: var(--space-sm);
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
}
.details__condition-label { color: var(--ink-mute); font-size: 0.9rem; }
.details__condition-value { color: var(--ink); text-align: right; }
.details__list { list-style: none; }
.details__list-item { padding: 0.45rem 0 0.45rem 1.4rem; position: relative; color: var(--ink-dim); font-size: 0.95rem; }
.details__nearby-link {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
  color: var(--cyan); text-align: left; transition: color 0.15s var(--ease);
}
.details__nearby-link:hover { color: var(--select); text-decoration: underline; }
.details__list-item::before { content: "→"; position: absolute; left: 0; color: var(--cyan); }
.details__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.details__tag {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem;
  padding: 0.35rem 0.7rem; border-radius: 2px; color: var(--ink-dim);
  border: 1px solid var(--line-strong); background: var(--bg-raise);
}

/* ============================================ REGION 5: FOOTER ============================================ */
.footer { padding: var(--space-lg); border-top: 1px solid var(--line); background: var(--bg); }
.footer__container { max-width: 1200px; margin: 0 auto; }
.footer__content { text-align: center; }
.footer__about { color: var(--ink-mute); font-size: 0.92rem; max-width: 80ch; margin: 0 auto var(--space-md); }
.footer__links { display: flex; gap: var(--space-sm); align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: var(--space-md); }
.footer__links a { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; color: var(--ink-dim); text-decoration: none; transition: color 0.2s var(--ease); }
.footer__links a:hover { color: var(--cyan); }
.footer__divider { color: var(--ink-mute); opacity: 0.5; }
.footer__credit { opacity: 0.7; }

/* ============================================ SETTINGS (floating) ============================================ */
.settings { position: fixed; bottom: var(--space-md); right: var(--space-md); z-index: 100; }
.settings__toggle {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--bg-raise); color: var(--ink); font-size: 1.1rem; cursor: pointer;
  transition: all 0.2s var(--ease); backdrop-filter: blur(6px);
}
.settings__toggle:hover { border-color: var(--select); transform: scale(1.08); }
.settings__panel {
  position: absolute; bottom: 58px; right: 0; width: 280px;
  background: var(--bg-raise); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 4px; padding: var(--space-md); box-shadow: 0 16px 50px oklch(0 0 0 / 0.5);
}
.settings__title { font-family: var(--font-display); font-weight: 500; font-size: 1.2rem; margin-bottom: var(--space-md); }
.settings__group { margin-bottom: var(--space-md); }
.settings__group label { display: block; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.68rem; color: var(--ink-mute); margin-bottom: var(--space-xs); }
.settings__group input[type="range"] { width: 78%; accent-color: var(--select); vertical-align: middle; }
.settings__checkbox { display: flex; align-items: center; gap: 0.6rem; margin-bottom: var(--space-md); cursor: pointer; font-size: 0.9rem; color: var(--ink-dim); }
.settings__checkbox input { accent-color: var(--select); }
.settings__close {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.7rem;
  padding: 0.5rem 1rem; color: var(--ink); background: transparent; border: 1px solid var(--line-strong);
  border-radius: 2px; cursor: pointer; transition: all 0.2s var(--ease);
}
.settings__close:hover { border-color: var(--select); }
