/* Surf Rio — design tokens & styles (editorial-cinematic deep-ocean) */

:root {
  --bg-deep: #001525;
  --bg-mid: #002b4a;
  --bg-warm: #04293f;
  --surface-1: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.1);
  --border-1: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);

  --text-1: #f5f1ea;
  --text-2: rgba(245, 241, 234, 0.78);
  --text-3: rgba(245, 241, 234, 0.55);

  --accent-coral: #FF7A5C;
  --accent-aqua: #6ED9C8;

  /* 5-stop quality ramp: Clássico -> Boas Ondas -> Surfável -> Fraco -> Flat */
  --q-classico: #6ED9C8;  /* aqua/cyan - clássico (best) */
  --q-boas:     #5FD970;  /* green - boas ondas */
  --q-surfavel: #F2C44A;  /* yellow - surfável */
  --q-fraca:    #EA7A40;  /* orange - fraco */
  --q-liso:     #D9425E;  /* red - flat (worst) */

  /* Compatibility aliases for API condition ratings */
  --q-excellent: var(--q-classico);
  --q-good:      var(--q-boas);
  --q-fair:      var(--q-surfavel);
  --q-poor:      var(--q-fraca);

  --font-display: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
  --font-serif: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --max-w: 1400px;
  --pad-x: 56px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { overflow-x: hidden; }
body { min-height: 100vh; }

button {
  font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer;
}

.serif { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; font-style: normal; }
.serif.italic { font-family: var(--font-display); font-style: normal; font-weight: 500; color: var(--accent-aqua); }
.mono { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.04em; }
.huge-u { font-family: var(--font-mono); font-size: 0.5em; font-weight: 400; letter-spacing: 0.06em; opacity: 0.7; margin-left: 4px; vertical-align: 0.3em; }
.tiny-l { font-size: 10px; letter-spacing: 0.12em; color: var(--text-3); }
.huge { font-family: var(--font-display); font-size: 56px; line-height: 1; font-weight: 500; letter-spacing: -0.03em; }

/* -- Wave background ----------------------------------------------- */
.wave-bg {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, #02101a 0%, #021c2e 40%, #03293f 100%);
  overflow: hidden;
}
.wave-bg-gradient {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(255, 122, 92, 0.08), transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 10%, rgba(110, 217, 200, 0.06), transparent 60%),
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(10, 74, 110, 0.4), transparent 70%);
  pointer-events: none;
}
.wave-bg-glow {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%);
  width: 1200px; height: 1200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 217, 200, 0.05), transparent 60%);
  pointer-events: none;
  filter: blur(40px);
}
.wave-layer {
  position: absolute; left: -10%; right: -10%; width: 120%;
  bottom: 0; height: 60vh;
  opacity: 0.7;
}
.wave-layer-1 { bottom: 0; opacity: 0.55; }
.wave-layer-2 { bottom: -2%; height: 50vh; opacity: 0.5; }
.wave-layer-3 { bottom: -4%; height: 45vh; opacity: 0.45; }
:root[data-animate="on"] .wave-layer-1 { animation: drift1 22s ease-in-out infinite alternate; }
:root[data-animate="on"] .wave-layer-2 { animation: drift2 30s ease-in-out infinite alternate; }
:root[data-animate="on"] .wave-layer-3 { animation: drift3 40s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translateX(-2%); } to { transform: translateX(2%); } }
@keyframes drift2 { from { transform: translateX(2%); } to { transform: translateX(-3%); } }
@keyframes drift3 { from { transform: translateX(-1%); } to { transform: translateX(2%); } }
@media (prefers-reduced-motion: reduce) {
  :root[data-animate="on"] .wave-layer-1,
  :root[data-animate="on"] .wave-layer-2,
  :root[data-animate="on"] .wave-layer-3 { animation: none; }
}

/* -- Offline banner ------------------------------------------------ */
.offline-banner {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  background: linear-gradient(180deg, rgba(234, 122, 64, 0.95), rgba(217, 66, 94, 0.95));
  color: #1a0a05;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.offline-banner.hidden { display: none; }
.offline-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #1a0a05;
}

/* -- Top bar ------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(2, 16, 26, 0.85), rgba(2, 16, 26, 0.5));
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border-1);
}
.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px var(--pad-x);
  display: flex; align-items: center; gap: 36px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text-1);
}
.brand-name { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; font-weight: 600; }
.topnav { display: flex; gap: 8px; flex: 1; margin-left: 24px; }
.navlink {
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; color: var(--text-2);
  text-decoration: none;
  transition: all 0.15s;
}
.navlink:hover { color: var(--text-1); background: var(--surface-1); }
.navlink.active { color: var(--text-1); background: var(--surface-2); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.fav-count {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  color: var(--accent-coral);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.fav-count.hidden { display: none; }
.fav-count:hover { background: var(--surface-2); border-color: var(--border-2); }
.live-time {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  font-size: 12px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--q-excellent);
  box-shadow: 0 0 8px var(--q-excellent);
  animation: pulse 2s ease-in-out infinite;
}
.live-dot.offline {
  background: var(--q-fraca);
  box-shadow: 0 0 8px var(--q-fraca);
}
.refresh-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  color: var(--text-2);
  transition: all 0.15s;
}
.refresh-btn:hover { color: var(--text-1); border-color: var(--border-2); }
.refresh-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* -- Main layout --------------------------------------------------- */
.app { min-height: 100vh; position: relative; }
.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px var(--pad-x) 96px;
}

/* -- Hero ---------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  margin-bottom: 96px;
  align-items: end;
}
.hero-greeting { padding-top: 16px; }
.hero-eyebrow {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(60px, 7.5vw, 104px);
  line-height: 0.95;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
}
.hero-title .serif.italic {
  color: var(--accent-aqua);
}
.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 480px;
  margin: 0 0 28px;
  text-wrap: pretty;
  font-weight: 400;
}
.hero-sub strong { color: var(--text-1); font-weight: 500; }
.hero-sub em { color: var(--accent-aqua); font-style: normal; font-weight: 500; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 18px 24px;
}
.hero-meta-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.hero-meta-item .mono { font-size: 12px; }

.hero-feature {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border-1);
  border-radius: 20px;
  padding: 28px 32px 28px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.hero-feature::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 60% at 50% 0%, rgba(110, 217, 200, 0.12), transparent 70%);
  pointer-events: none;
}
.hero-feature:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
}
.hero-feature-tag {
  font-size: 10px;
  color: var(--q-excellent);
  letter-spacing: 0.22em;
  margin-bottom: 14px;
  position: relative;
}
.hero-feature-tag::before {
  content: "\25CF"; margin-right: 8px; font-size: 8px; vertical-align: 1px;
}
.hero-feature-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 26px;
  gap: 24px;
  position: relative;
}
.hero-feature-region {
  font-size: 11px; color: var(--text-3); letter-spacing: 0.18em;
  margin-top: 8px;
}
.hero-feature-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 22px 0;
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
  position: relative;
}
.hero-feature-stats .huge { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; }
.hero-feature-foot {
  display: flex; justify-content: space-between; align-items: end;
  margin-top: 22px;
  position: relative;
}
.hero-sparkline { color: var(--accent-aqua); }
.hero-feature-cta {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  background: var(--accent-coral);
  color: #1a0a05;
  border-radius: 999px;
  font-weight: 500;
  font-size: 13px;
  transition: transform 0.15s;
}
.hero-feature:hover .hero-feature-cta { transform: translateX(2px); }

/* -- Section heads ------------------------------------------------- */
.section-head {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-1);
}
.section-title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text-1);
}
.section-title .serif.italic {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 500;
  color: var(--accent-aqua);
}
.section-sub {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.18em;
}

/* -- Coast strip (W->E linear coastline) --------------------------- */
.coast-map { margin-bottom: 96px; }
.coast-strip {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012));
  border: 1px solid var(--border-1);
  border-radius: 18px;
  padding: 18px 14px 14px;
  overflow-x: auto;
}
.coast-strip svg {
  min-width: 1100px;
}
.coast-strip svg g[data-pin]:hover circle:first-of-type { opacity: 1; }

.quality-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 10px;
}
.ql-label {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.2em;
  margin-right: 6px;
}
.ql-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.ql-dot {
  width: 12px; height: 12px;
  border-radius: 3px;
}

/* -- Beach section ------------------------------------------------- */
.beaches-section { margin-bottom: 96px; }
.filterbar {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 12px;
}
.filter-group {
  display: flex; align-items: center; gap: 6px;
}
.filter-label {
  font-size: 10px; color: var(--text-3); letter-spacing: 0.18em;
  margin-right: 6px;
}
.filter-spacer { flex: 1; }
.pill {
  padding: 7px 12px; border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.pill:hover { color: var(--text-1); background: var(--surface-1); }
.pill-on {
  color: var(--bg-deep);
  background: var(--text-1);
  font-weight: 500;
}
.select-styled {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text-1);
  font-size: 12px;
  cursor: pointer;
}
.filter-count {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  margin-left: 12px;
}

.beach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

/* -- Beach card ---------------------------------------------------- */
.bcard {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 24px 22px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  animation: cardIn 0.5s ease-out both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.bcard:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
}
.bcard-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  opacity: 0.9;
}
.bcard-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
}
.bcard-head-text { min-width: 0; flex: 1; }
.bcard-region {
  font-size: 10px; color: var(--text-3); letter-spacing: 0.18em;
  margin-bottom: 4px;
}
.bcard-name {
  font-family: var(--font-display);
  font-size: 28px; line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}
.fav-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-3);
  flex-shrink: 0;
  transition: all 0.15s;
}
.fav-btn:hover { color: var(--text-1); background: var(--surface-1); }
.fav-btn.on { color: var(--accent-coral); }

.bcard-verdict {
  display: flex; align-items: flex-end; gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-1);
}
.bcard-verdict-text { flex: 1; min-width: 0; }
.bcard-verdict-label {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.bcard-verdict-line {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
  text-wrap: pretty;
}

.bcard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 16px;
}
.bcard-stat-val {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-1);
}
.bcard-stat-lbl {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
}
.bcard-timeline {
  position: relative;
  margin-bottom: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-1);
}
.bts-ticks {
  position: relative;
  height: 14px;
  margin-bottom: 4px;
}
.bts-ticks-below {
  margin-bottom: 0;
  margin-top: 6px;
}
.bts-tick {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}
.bts-tick:first-child { transform: translateX(0); }
.bts-tick:last-child { transform: translateX(-100%); }
.bts-tick-val {
  font-size: 10px;
  color: var(--text-1);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.bts-tick-lbl {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.14em;
}
.bts-tick[data-now="true"] .bts-tick-lbl {
  color: var(--accent-coral);
  font-weight: 600;
}
.bts-strip {
  display: block;
  width: 100%;
  height: 28px;
  border-radius: 3px;
  overflow: hidden;
  filter: saturate(1.05);
  background: rgba(255,255,255,0.03);
}
.bts-wind {
  position: relative;
  height: 30px;
  margin-top: 4px;
}
.bts-w {
  position: absolute;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  top: 0;
}
.bts-w svg { display: block; }
.bts-w-spd {
  font-size: 8px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.bcard-meta {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  margin-bottom: 14px;
}
.bcard-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.bcard-nodata {
  font-size: 13px;
  color: var(--text-3);
  padding: 22px 0;
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 16px;
}

.tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-1);
  color: var(--text-2);
  letter-spacing: 0.02em;
}

/* -- 72h Timeline (Windguru-style multi-track) --------------------- */
.timeline72-wrap {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--border-1);
  border-radius: 18px;
  padding: 24px 20px 20px;
  overflow-x: auto;
}
.timeline72-wrap svg {
  min-width: 1100px;
}
.forecast-strip { margin-bottom: 96px; }

/* -- Detail view --------------------------------------------------- */
.detail { animation: detailIn 0.4s ease-out; }
@keyframes detailIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.home { animation: detailIn 0.4s ease-out; }
.detail-hero { margin-bottom: 80px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 32px;
  transition: all 0.15s;
}
.back-btn:hover { color: var(--text-1); border-color: var(--border-2); }

.detail-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: start;
}
.detail-region {
  font-size: 11px; color: var(--text-3); letter-spacing: 0.18em;
  margin-bottom: 14px;
}
.detail-name {
  font-family: var(--font-display);
  font-size: clamp(56px, 6.5vw, 88px);
  line-height: 0.95;
  font-weight: 600;
  margin: 0 0 24px;
  letter-spacing: -0.035em;
}
.detail-desc {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 540px;
  margin: 0 0 24px;
  text-wrap: pretty;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.fav-big {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.16em;
}
.fav-big.on { color: var(--accent-coral); border-color: var(--accent-coral); }
.fav-big:hover { color: var(--text-1); border-color: var(--border-2); }

.detail-quality-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border-1);
  border-radius: 20px;
  padding: 28px 30px;
}
.dq-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
}
.dq-eyebrow {
  font-size: 10px; color: var(--text-3); letter-spacing: 0.2em;
  margin-bottom: 8px;
}
.dq-rating {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.dq-headline {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 4px;
  margin-bottom: 16px;
  max-width: 380px;
  text-wrap: pretty;
}
.dq-update {
  font-size: 10px; color: var(--text-3); letter-spacing: 0.16em;
}
.detail-quality-card .rating-bar { margin-bottom: 14px; }
.detail-quality-card .rating-bar-seg { width: 14px; height: 26px; }
.dq-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border-1);
}

.stat-val {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.stat-unit {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.6;
  letter-spacing: 0.04em;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.14em;
  margin-top: 6px;
}
.stat-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
  letter-spacing: 0.08em;
}

.card-section { margin-bottom: 80px; }

.env-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.env-item {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 12px;
  color: var(--text-2);
}
.env-val {
  font-size: 18px;
  color: var(--text-1);
  letter-spacing: 0.02em;
}
.env-lbl {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  margin-top: 2px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.best-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.best-card {
  padding: 24px 22px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px;
}
.best-l {
  font-size: 10px; color: var(--text-3); letter-spacing: 0.18em;
}
.best-v {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--accent-aqua);
  font-weight: 600;
}
.best-tide-vis {
  margin-top: 4px;
  color: var(--text-3);
}

/* -- Footer -------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-1);
  padding: 36px var(--pad-x);
  background: rgba(0, 16, 26, 0.6);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px;
}
.footer-text {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.14em;
}
.footer-text a { color: var(--text-2); text-decoration: none; }
.footer-text a:hover { color: var(--text-1); }

/* -- Contact ------------------------------------------------------- */
.contact {
  animation: detailIn 0.4s ease-out;
  min-height: 60vh;
}
.contact-inner {
  max-width: 720px;
  margin: 80px 0 120px;
}
.contact-eyebrow {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.22em;
  margin: 32px 0 16px;
}
.contact-title {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
}
.contact-body {
  max-width: 620px;
}
.contact-body p {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.65;
}
.contact-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent-aqua);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  word-break: break-word;
}
.contact-link:hover { color: var(--text-1); }
.contact-note {
  margin-top: 34px;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.16em;
}

/* -- Rating bar ---------------------------------------------------- */
.rating-bar {
  display: flex;
  gap: 4px;
  align-items: stretch;
  flex-shrink: 0;
}
.rating-bar-seg {
  display: block;
  width: 9px; height: 18px;
  border-radius: 2px;
}

/* Hero feature verdict layout */
.hero-feature-titles { min-width: 0; flex: 1; }
.hero-feature-verdict {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.hero-feature-name {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 500;
  color: var(--text-1);
  margin-top: 4px;
}
.hero-feature-headline {
  font-size: 15px;
  color: var(--text-2);
  margin-top: 14px;
  max-width: 380px;
  line-height: 1.5;
  text-wrap: pretty;
}
.hero-feature-rating {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  flex-shrink: 0;
}
.hero-feature-rating .rating-bar-seg { width: 12px; height: 24px; }
.hero-feature-rating-l {
  font-size: 9px; letter-spacing: 0.18em; color: var(--text-3);
}

/* -- Chart card ---------------------------------------------------- */
.chart-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}
.chart-card-top {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-1);
  background: rgba(255,255,255,0.015);
}
.chart-card-titlerow {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 6px;
}
.chart-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-1);
}
.chart-card-unit {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.18em;
}
.chart-card-takeaway {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 12px;
  text-wrap: pretty;
}
.chart-card-takeaway strong {
  color: var(--text-1);
  font-weight: 600;
}
.chart-card-legend-row {
  display: flex; gap: 18px;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.14em;
}
.chart-card-legend-item {
  display: flex; align-items: center; gap: 6px;
}
.chart-card-legend-swatch {
  width: 10px; height: 10px; border-radius: 2px;
  border: 1.5px solid transparent;
}
.chart-card-legend-swatch.dashed {
  background: transparent !important;
  border-style: dashed;
}
.chart-card-body {
  padding: 14px 16px 18px;
}

/* -- Skeleton / loading ------------------------------------------- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}
.skel-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 24px 22px;
  min-height: 320px;
}
.skel {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 12px; margin-bottom: 12px; }

/* -- Filter search ------------------------------------------------- */
.filter-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  color: var(--text-3);
}
.filter-search input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text-1);
  font: inherit;
  font-size: 13px;
}
.filter-search input::placeholder { color: var(--text-3); }
.clear-search {
  font-size: 18px;
  color: var(--text-3);
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.clear-search:hover { color: var(--text-1); background: var(--surface-3, rgba(255,255,255,0.06)); }

/* -- Top 3 rail ---------------------------------------------------- */
.top3 { margin-bottom: 80px; }
.top3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.top3-card {
  display: flex; align-items: stretch; gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid var(--border-1);
  border-radius: 14px;
  color: inherit;
  text-align: left;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid var(--qc, var(--accent-aqua));
}
.top3-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
}
.top3-rank {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--qc, var(--accent-aqua));
  opacity: 0.6;
  flex-shrink: 0;
  align-self: center;
}
.top3-body { flex: 1; min-width: 0; }
.top3-region {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  margin-bottom: 4px;
}
.top3-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.top3-verdict {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}
.top3-stats {
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.top3-arrow {
  align-self: center;
  color: var(--text-3);
  transition: transform 0.2s;
}
.top3-card:hover .top3-arrow { transform: translateX(3px); color: var(--text-1); }

/* -- Favorites rail ------------------------------------------------ */
.favs-rail { margin-bottom: 80px; }
.favs-grid {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.fav-pin {
  position: relative;
  display: flex; flex-direction: column;
  padding: 14px 16px;
  min-width: 200px;
  background: linear-gradient(180deg, rgba(255, 122, 92, 0.06), rgba(255, 122, 92, 0.015));
  border: 1px solid var(--border-1);
  border-left: 3px solid var(--qc, var(--accent-coral));
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.fav-pin:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
}
.fav-pin-x {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: none; border: none; cursor: pointer;
  color: var(--accent-coral);
  transition: all 0.15s;
}
.fav-pin-x:hover { background: var(--surface-2); }
.fav-pin-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  padding-right: 24px;
}
.fav-pin-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-2);
}
.fav-pin-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* -- Empty state (v2) ---------------------------------------------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: 80px 24px;
  border: 1px dashed var(--border-1);
  border-radius: 16px;
  background: var(--surface-1);
  text-align: center;
  color: var(--text-2);
}
.empty-state-icon { color: var(--text-3); }
.empty-state-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-1);
}
.empty-state-sub {
  font-size: 14px;
  color: var(--text-2);
}
.empty-state-cta {
  margin-top: 8px;
  padding: 10px 18px;
  background: var(--accent-coral);
  color: #1a0a05;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
}
/* fallback for legacy markup */
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-1);
}
.empty-state button {
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent-coral);
  color: #1a0a05;
  border: none;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
  cursor: pointer;
}

/* -- Page hero (Previsão / Mapa) ----------------------------------- */
.page-hero { margin: 0 0 56px; max-width: 720px; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 7vw, 96px);
  line-height: 0.95;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
}
.page-title .serif.italic { color: var(--accent-aqua); }
.page-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0;
  text-wrap: pretty;
}
.page-sub strong { color: var(--text-1); font-weight: 500; }

/* -- Forecast heatmap ---------------------------------------------- */
.heatmap-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012));
  border: 1px solid var(--border-1);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 80px;
  overflow-x: auto;
}
.heatmap {
  display: flex; flex-direction: column;
  gap: 6px;
  min-width: 880px;
}
.hm-head {
  display: grid;
  grid-template-columns: 200px repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.hm-corner {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  padding: 8px 4px;
  display: flex; align-items: center;
}
.hm-daycol {
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
}
.hm-daycol.today {
  background: rgba(255, 122, 92, 0.08);
  border: 1px solid rgba(255, 122, 92, 0.3);
}
.hm-dayname {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  margin-bottom: 4px;
}
.hm-daycol.today .hm-dayname { color: var(--accent-coral); font-weight: 600; }
.hm-daynum {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hm-row {
  display: grid;
  grid-template-columns: 200px repeat(7, 1fr);
  gap: 6px;
}
.hm-rowlabel {
  text-align: left;
  padding: 12px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  color: inherit;
}
.hm-rowlabel:hover { background: var(--surface-2); border-color: var(--border-2); }
.hm-beachname {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-1);
}
.hm-beachregion {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  margin-top: 2px;
}
.hm-cell {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  color: #001525;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.hm-cell:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px -8px rgba(0,0,0,0.5);
  z-index: 2;
}
.hm-cell-wave {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hm-cell-verdict {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.hm-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-1);
}

/* -- Beach table (Map page) ---------------------------------------- */
.beach-table { margin-top: 64px; }
.bt-table {
  display: flex; flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  overflow: hidden;
}
.bt-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr 0.8fr 1.2fr 1.2fr 24px;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border: none;
  border-bottom: 1px solid var(--border-1);
  background: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.bt-row:last-child { border-bottom: none; }
.bt-row:hover { background: var(--surface-2); }
.bt-head {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  background: rgba(0,0,0,0.15);
  cursor: default;
  padding: 12px 22px;
}
.bt-head:hover { background: rgba(0,0,0,0.15); }
.bt-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.bt-meta { font-size: 12px; color: var(--text-2); letter-spacing: 0.04em; }
.bt-verdict {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}
.bt-arrow { color: var(--text-3); }
.bt-row:hover .bt-arrow { color: var(--text-1); }

/* -- Responsive ---------------------------------------------------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .charts-grid { grid-template-columns: 1fr; }
  .detail-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .env-grid { grid-template-columns: repeat(2, 1fr); }
  .best-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .top3-grid { grid-template-columns: 1fr; }
  .bt-row { grid-template-columns: 1fr 1fr; row-gap: 6px; }
  .bt-head { display: none; }
  .hm-head, .hm-row { grid-template-columns: 140px repeat(7, minmax(60px, 1fr)); }
}
@media (max-width: 700px) {
  :root { --pad-x: 20px; }
  .main { padding: 40px var(--pad-x) 72px; }
  .hero-title { font-size: 64px; }
  .detail-name { font-size: 56px; }
  .topnav { display: none; }
  .beach-grid, .skeleton-grid { grid-template-columns: 1fr; }
  .env-grid, .best-grid { grid-template-columns: 1fr; }
  .hero-feature-stats { grid-template-columns: repeat(2, 1fr); }
  .dq-row { grid-template-columns: repeat(2, 1fr); }
  .bcard-stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .hero-feature-name { font-size: 32px; }
  .hero-feature-verdict { font-size: 34px; }
  .hero-feature { padding: 24px 22px; }
  .hero-feature-foot { flex-direction: column; align-items: stretch; gap: 16px; }
  .hero-sparkline svg { width: 100%; height: auto; }
  .hero-feature-cta { justify-content: center; }
  .hero-feature-top { flex-direction: column; gap: 16px; }
  .hero-feature-rating { align-items: flex-start; flex-direction: row; gap: 14px; }
}
