/* Key Biscayne Guide — Miami-modern, mobile-first, sans-serif only */

:root {
  /* Miami sunset / ocean palette */
  --c-coral: #ff6b9d;
  --c-coral-deep: #ff3d7f;
  --c-orange: #ffa45c;
  --c-peach: #ffd6a5;
  --c-teal: #19c2c2;
  --c-teal-deep: #0fa3a3;
  --c-aqua: #7eeede;
  --c-navy: #0a2540;
  --c-ink: #16233b;
  --c-ink-soft: #4a5a72;
  --c-mute: #8390a4;
  --c-line: #e6ebf2;
  --c-bg: #f4f7fb;
  --c-card: #ffffff;
  --c-green: #1fbf75;
  --c-yellow: #f5b400;
  --c-red: #ef4444;

  --grad-sunset: linear-gradient(135deg, #ff9a5c 0%, #ff6b9d 45%, #b56cff 100%);
  --grad-ocean: linear-gradient(135deg, #19c2c2 0%, #4f9cff 100%);
  --grad-card-kite: linear-gradient(160deg, #fff5f9 0%, #fff 60%);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(16,36,72,0.05), 0 2px 8px rgba(16,36,72,0.04);
  --shadow-md: 0 6px 24px rgba(16,36,72,0.08), 0 1px 2px rgba(16,36,72,0.04);
  --shadow-hero: 0 20px 60px rgba(255,107,157,0.25);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  font-style: normal;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  line-height: 1.5;
}

/* never use italics anywhere */
em, i, cite, address, dfn, var { font-style: normal; }

a {
  color: var(--c-coral-deep);
  text-decoration: none;
  font-weight: 600;
}
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ---------- HERO ---------- */

.hero {
  position: relative;
  padding: 28px 20px 60px;
  color: #fff;
  background: var(--grad-sunset);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto auto;
  width: 70vw; height: 70vw;
  background: radial-gradient(circle at center, rgba(255,255,255,0.35), rgba(255,255,255,0) 60%);
  z-index: -1;
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto -20% -40% -20%;
  height: 70%;
  background: radial-gradient(ellipse at top, rgba(25,194,194,0.55), rgba(25,194,194,0) 70%);
  z-index: -1;
}

.hero-inner {
  max-width: 920px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-weight: 700;
}
.brand-mark { font-size: 28px; line-height: 1; }
.brand-name { font-size: 18px; letter-spacing: -0.01em; }

.hero-title {
  font-size: clamp(36px, 8vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.08);
}
.hero-sub {
  font-size: clamp(15px, 3.5vw, 18px);
  font-weight: 500;
  margin: 0 0 22px;
  max-width: 540px;
  color: rgba(255,255,255,0.95);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: rgba(255,255,255,0.96);
  background: rgba(255,255,255,0.14);
  padding: 10px 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: fit-content;
  border: 1px solid rgba(255,255,255,0.18);
}
.hero-meta .dot { opacity: 0.5; }

.hero-fresh {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.92);
  text-transform: uppercase;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b9ffd6;
  box-shadow: 0 0 0 0 rgba(185,255,214,0.7);
  animation: pulse 2s infinite;
  display: inline-block;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(185,255,214,0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(185,255,214,0); }
  100% { box-shadow: 0 0 0 0 rgba(185,255,214,0); }
}

/* ---------- MAIN LAYOUT ---------- */

.wrap {
  max-width: 920px;
  margin: -36px auto 0;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- CARDS ---------- */

.card {
  background: var(--c-card);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(16,36,72,0.04);
}

.card h2 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.emoji { font-size: 22px; line-height: 1; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.muted { color: var(--c-mute); font-size: 13px; font-weight: 500; }

.card-body-text {
  margin: 0 0 12px;
  color: var(--c-ink-soft);
  font-size: 15px;
}
.card-foot { margin: 0; font-size: 13px; }
.card-foot a { color: var(--c-teal-deep); }

/* ---------- BADGE ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--c-line);
  color: var(--c-ink-soft);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge.green  { background: #e6f9f0; color: #0a8c50; }
.badge.yellow { background: #fff5d6; color: #a17a00; }
.badge.red    { background: #fde6e6; color: #b91c1c; }
.badge.gray   { background: var(--c-line); color: var(--c-ink-soft); }

/* ---------- KITE CARD ---------- */

.kite-card {
  background: var(--grad-card-kite);
  position: relative;
  overflow: hidden;
}
.kite-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle at center, rgba(255,107,157,0.18), rgba(255,107,157,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.kite-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}
@media (min-width: 600px) {
  .kite-body { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; }
}

.kite-now { position: relative; }
.big-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 12vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--c-ink);
}
.big-stat .unit {
  font-size: 0.32em;
  font-weight: 600;
  color: var(--c-mute);
  letter-spacing: 0;
}
.sub-stat {
  margin-top: 6px;
  color: var(--c-ink-soft);
  font-weight: 600;
  font-size: 14px;
}
.kite-note {
  margin: 14px 0 0;
  color: var(--c-ink-soft);
  font-size: 14px;
  line-height: 1.5;
  max-width: 36ch;
}

.outlook-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-ink-soft);
  margin-bottom: 10px;
}
.legend { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 12px; color: var(--c-mute); }
.leg { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 3px; vertical-align: middle; }
.leg-green  { background: var(--c-green); }
.leg-yellow { background: var(--c-yellow); }
.leg-red    { background: var(--c-red); }

.outlook-bars {
  display: grid;
  grid-template-columns: repeat(48, 1fr);
  gap: 2px;
  height: 64px;
  align-items: end;
  padding: 8px;
  background: rgba(16,36,72,0.03);
  border-radius: var(--r-md);
}
.outlook-bars .bar {
  width: 100%;
  border-radius: 2px;
  background: var(--c-line);
  min-height: 4px;
  transition: opacity .15s ease;
}
.outlook-bars .bar.green  { background: var(--c-green); }
.outlook-bars .bar.yellow { background: var(--c-yellow); }
.outlook-bars .bar.red    { background: #e6ebf2; }
.outlook-bars .bar[data-now="1"] { outline: 2px solid var(--c-ink); outline-offset: 1px; }

/* ---------- WEATHER CARD ---------- */

.weather-card {
  background: linear-gradient(160deg, #fffaf0 0%, #fff 55%);
  position: relative;
  overflow: hidden;
}
.weather-card::before {
  content: '';
  position: absolute;
  top: -80px; right: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle at center, rgba(255,164,92,0.20), rgba(255,164,92,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.weather-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 18px;
}
@media (min-width: 600px) {
  .weather-body { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; }
}

.weather-now { position: relative; }
.weather-now .big-stat .unit { font-size: 0.34em; }
.weather-now #wx-summary {
  font-weight: 700;
  color: var(--c-ink);
  font-size: 16px;
  margin-top: 2px;
}

.weather-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 480px) {
  .weather-stats { grid-template-columns: repeat(4, 1fr); }
}
.weather-stats .stat { background: rgba(255,164,92,0.08); }
.weather-stats .stat-label { color: #b85c00; }

.forecast-strip-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-ink-soft);
  margin: 6px 0 8px;
  letter-spacing: 0.02em;
}

/* ---------- STAT CARDS ---------- */

.stat-card .stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.stat-row-3 { grid-template-columns: repeat(3, 1fr); }
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: rgba(25,194,194,0.06);
  border-radius: var(--r-md);
}
.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-teal-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}

/* ---------- BEACH WATER QUALITY ---------- */

.swim-headline {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.beach-card.clear    { background: linear-gradient(160deg, #e8faf0 0%, #fff 60%); }
.beach-card.caution  { background: linear-gradient(160deg, #fff5d8 0%, #fff 60%); }
.beach-card.advisory { background: linear-gradient(160deg, #ffe9e9 0%, #fff 60%); }

.beach-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.beach-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--c-bg);
  border-radius: var(--r-md);
  border: 1px solid transparent;
}
.beach-row.good     { background: #e6f9f0; border-color: rgba(31,191,117,0.18); }
.beach-row.moderate { background: #fff5d6; border-color: rgba(245,180,0,0.22); }
.beach-row.poor     { background: #ffe6d6; border-color: rgba(255,138,0,0.22); }
.beach-row.advisory { background: #fde6e6; border-color: rgba(239,68,68,0.25); }
.beach-row.unknown  { background: var(--c-bg); }

.beach-name {
  font-weight: 700;
  color: var(--c-ink);
  font-size: 14px;
  letter-spacing: -0.01em;
}
.beach-meta {
  font-size: 12px;
  color: var(--c-ink-soft);
  font-weight: 500;
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.beach-meta .num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-ink);
  font-size: 13px;
  letter-spacing: -0.01em;
}
.beach-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.beach-pill.good     { background: #1fbf75; color: #fff; }
.beach-pill.moderate { background: #f5b400; color: #5a4400; }
.beach-pill.poor     { background: #ff8a00; color: #fff; }
.beach-pill.advisory { background: #ef4444; color: #fff; }
.beach-pill.unknown  { background: var(--c-line); color: var(--c-ink-soft); }

/* ---------- SARGASSUM ---------- */

.sarg-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
@media (min-width: 600px) {
  .sarg-body { grid-template-columns: 1fr 1fr; gap: 20px; }
}
.sarg-local, .sarg-basin {
  padding: 14px;
  background: var(--c-bg);
  border-radius: var(--r-md);
}
.sarg-local  { background: rgba(31,191,117,0.06); }
.sarg-basin  { background: rgba(25,194,194,0.06); }
.sarg-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
  margin-bottom: 6px;
}
.sarg-image-wrap {
  display: block;
  margin: 8px 0 10px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #0a2540;
  aspect-ratio: 5 / 4;
  position: relative;
  cursor: zoom-in;
}
.sarg-image-wrap img {
  /* GOMF native is 3027×1536. Miami / KB sits at ~(75.5%, 45%) of the image.
     Scale to 500% of container width and translate so Miami centers. */
  position: absolute;
  width: 500%;
  height: auto;
  left: 50%;
  top: 50%;
  transform: translate(-75.5%, -45%);
  display: block;
  max-width: none;
}
.sarg-miami-pin {
  position: absolute;
  left: 50%; top: 50%;
  width: 28px; height: 28px;
  margin-left: -14px; margin-top: -14px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 12px rgba(0,0,0,0.6);
  pointer-events: none;
}
.sarg-miami-pin::after {
  content: 'Miami';
  position: absolute;
  top: 32px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(10,37,64,0.9);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.sarg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lg {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lg-low  { background: #1e6bd8; }
.lg-warn { background: #f5d000; color: #5a4400; }
.lg-med  { background: #ff8a00; }
.lg-high { background: #e23030; }

/* ---------- TIDES ---------- */

.tides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.tide-cell {
  padding: 12px;
  border-radius: var(--r-md);
  background: rgba(79,156,255,0.08);
  border: 1px solid rgba(79,156,255,0.18);
}
.tide-cell.high { background: rgba(25,194,194,0.10); border-color: rgba(25,194,194,0.22); }
.tide-cell.low  { background: rgba(255,164,92,0.10); border-color: rgba(255,164,92,0.22); }
.tide-cell .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.tide-cell .time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.tide-cell .ft {
  font-size: 13px;
  color: var(--c-mute);
  font-weight: 600;
  margin-top: 2px;
}

.tide-arc {
  width: 100%;
  height: 110px;
  display: block;
}

/* ---------- FORECAST ---------- */

.forecast {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .forecast { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.fc-day {
  text-align: center;
  padding: 12px 6px;
  border-radius: var(--r-md);
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.fc-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fc-ico { font-size: 26px; line-height: 1; }
.fc-hi {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--c-ink);
  letter-spacing: -0.02em;
}
.fc-lo {
  font-size: 13px;
  color: var(--c-mute);
  font-weight: 600;
}
.fc-pop {
  font-size: 11px;
  color: var(--c-teal-deep);
  font-weight: 700;
}

/* ---------- LINK CARD ---------- */

.link-card .links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
@media (min-width: 600px) {
  .link-card .links { grid-template-columns: 1fr 1fr; }
}
.link-card li {
  padding: 12px 14px;
  background: var(--c-bg);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
}
.link-card li a { color: var(--c-ink); display: block; }
.link-card li:hover { background: #ecf2fa; }

/* ---------- FOOTER ---------- */

.foot {
  text-align: center;
  padding: 24px 20px 40px;
  color: var(--c-ink-soft);
  font-size: 13px;
  line-height: 1.5;
}
.foot p { margin: 4px 0; }
.foot .credit { margin-top: 14px; font-weight: 600; color: var(--c-ink); }
.foot .credit a {
  color: var(--c-coral-deep);
  background: linear-gradient(90deg, var(--c-coral-deep), var(--c-teal-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* ---------- UTIL ---------- */

.skel {
  background: linear-gradient(90deg, #eef2f8 0%, #f7faff 50%, #eef2f8 100%);
  background-size: 200% 100%;
  animation: skel 1.2s linear infinite;
  border-radius: 6px;
  color: transparent !important;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

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