/* Triple-A-Tropics · shared site styles.
   Edit this one file and every page's look updates. */

/* Metropolis (geometric sans) — sole site font.
   The cdnfonts.com @import also includes local('Metropolis') fallbacks
   which were catching stale local system fonts on some machines (all
   weights collapsing to Regular). These explicit @font-face rules
   bypass that by requesting the .woff files directly with no local()
   fallback, so the browser MUST use the CDN-served file and weight
   mappings are exact. */
@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://fonts.cdnfonts.com/s/16308/Metropolis-Regular.woff') format('woff');
}
@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('https://fonts.cdnfonts.com/s/16308/Metropolis-Medium.woff') format('woff');
}
@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('https://fonts.cdnfonts.com/s/16308/Metropolis-SemiBold.woff') format('woff');
}
@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://fonts.cdnfonts.com/s/16308/Metropolis-Bold.woff') format('woff');
}
@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('https://fonts.cdnfonts.com/s/16308/Metropolis-ExtraBold.woff') format('woff');
}
@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('https://fonts.cdnfonts.com/s/16308/Metropolis-Black.woff') format('woff');
}

:root {
  --bg: #131519;       /* muted dark charcoal (was deep navy) */
  --panel: #1b1e24;    /* slightly lighter card surface */
  --border: #2a2e36;   /* neutral mid-gray border */
  --fg: #e8ebef;       /* near-white text, neutral */
  --muted: #9199a4;    /* medium gray for secondary text */
  --accent: #ffb83a;   /* amber */
  --accent-2: #5dd3ff; /* cyan */
  --accent-3: #c084fc; /* violet */
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  /* Subtle dotted-grid texture. Radial-gradient paints one small dot
     per 36×36 tile; size + alpha are tuned to read as "texture" rather
     than "pattern" so the eye picks it up peripherally. */
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.055) 1.1px,
    transparent 1.5px
  );
  background-size: 36px 36px;
  background-position: 0 0;
  color: var(--fg);
  font-family: "Metropolis", "Helvetica Neue", Arial, sans-serif;
  /* Whole site runs on Metropolis Bold by default. Heavier weights
     (800 on the hero h1, 900 on the active-banner readout) still win
     on their own elements. */
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Top navigation, metallic brand bar ---- */

.nav {
  position: sticky; top: 0; z-index: 10;
  /* Horizontal-banded metallic gradient: dark at the top and bottom,
     a wider lighter band in the middle for the "glossy" sheen. */
  background:
    linear-gradient(180deg,
      #0a1a2e 0%,
      #1d3a5c 22%,
      #2b4976 50%,
      #1d3a5c 78%,
      #0a1a2e 100%);
  border-bottom: 1px solid #050a14;
  /* Subtle inset highlight on top and shadow on bottom for the
     beveled / embossed feel. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.40),
    0 2px 6px rgba(0, 0, 0, 0.45);
}
/* Thin glowing white line just below the nav bar, full width.
   Positioned via ::after so no extra HTML is needed, sits right
   where the dark bevel ends. */
.nav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.75),
    0 0 14px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 8px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

/* Logo + wordmark on the left */
.brand {
  display: flex; align-items: center; gap: 12px;
  color: #ffffff;
  font-family: "Metropolis", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700; font-size: 28px; line-height: 1;
  letter-spacing: 0.5px;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.55);
}
.brand:hover { text-decoration: none; color: #ffffff; }
.brand > span { white-space: nowrap; }
.brand .logo {
  width: 40px; height: 40px;
  display: inline-block; flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

/* Right-side nav links, all-caps and embossed to match */
.nav-links {
  display: flex; gap: 26px;
  font-family: "Metropolis", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
}
.nav-links a {
  color: #c8d4e7;
  padding: 4px 2px;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 2px 3px rgba(0, 0, 0, 0.45);
}
.nav-links a:hover { color: #ffffff; text-decoration: none; }
.nav-links a.active {
  color: #ffffff;
  border-bottom: 2px solid var(--accent);
}

@media (max-width: 760px) {
  .brand { font-size: 20px; gap: 8px; }
  .brand .logo { width: 32px; height: 32px; }
  .nav-links { font-size: 12px; gap: 14px; letter-spacing: 0.8px; }
  .nav-inner { padding: 6px 14px; min-height: 48px; }
}
/* On true phones the brand wordmark eats too much horizontal room
   alongside four uppercase nav links, drop the wordmark, keep the
   logo so it's still recognizable. */
@media (max-width: 500px) {
  .brand > span { display: none; }
}

/* ---- Homepage hero ---- */
.hero {
  max-width: 1180px; margin: 0 auto;
  padding: 56px 20px 28px;
  text-align: center;
}
/* Flex row holding the title + a spinning hurricane on each side. */
.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.5vw, 28px);
  margin: 0 auto 14px;
  /* nowrap keeps icon | title | icon on a single line at every
     viewport. Icons + title shrink via clamp() to fit. Below the
     mobile breakpoint (460 px) the icons hide so the title reads
     cleanly on phones. */
  flex-wrap: nowrap;
  max-width: 100%;
  padding: 0 8px;
}
.hero-icon {
  width: clamp(38px, 10vw, 86px);
  height: clamp(38px, 10vw, 86px);
  flex-shrink: 0;
  /* Rotating path extends past the viewBox at its corners, without
     this the SVG clips its own fins mid-spin. */
  overflow: visible;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.hero h1 {
  font-family: "Metropolis", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(28px, 6vw, 54px);
  margin: 0;
  min-width: 0;   /* allow the h1 to shrink inside the flex row */
  line-height: 1.1;
  font-weight: 800;
  /* Metallic chrome gradient that ties to the nav bar: bright highlight
     to light steel blue to mid steel to deeper navy, back up to highlight
     for the "gleam running diagonally across the letters" look. */
  background: linear-gradient(
    135deg,
    #e8f0fb 0%,
    #b6cfe8 25%,
    #6b8ed4 50%,
    #3d5a92 72%,
    #b6cfe8 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  max-width: 680px;
  margin: 0 auto;
}
.hero .handle {
  display: inline-block;
  margin-top: 18px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}
.hero .handle b { color: var(--fg); }

/* ---- Sub-page header ---- */
.page-head {
  max-width: 1180px; margin: 0 auto;
  padding: 36px 20px 16px;
}
.page-head h1 {
  font-size: clamp(22px, 3.5vw, 32px);
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--fg);
}
.page-head p {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.page-head .crumb {
  margin: 0 0 10px;
  font-size: 13px;
}
.page-head .crumb a {
  color: var(--muted);
  text-decoration: none;
}
.page-head .crumb a:hover {
  color: var(--accent-2);
}

/* ---- Section cards (homepage grid) ---- */
.cards {
  max-width: 1180px; margin: 0 auto;
  padding: 28px 20px 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
  display: block;
}
.card:hover {
  border-color: var(--accent-2);
  text-decoration: none;
  transform: translateY(-2px);
}
.card .emoji {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}
.card h2 {
  font-size: 18px;
  margin: 0 0 6px;
  font-weight: 700;
}
.card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  font-weight: 700;
}
.card.soon { opacity: 0.55; cursor: not-allowed; }
.card.soon:hover { transform: none; border-color: var(--border); }
.card .badge {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 999px;
  background: rgba(255,184,58,0.15);
  color: var(--accent);
  font-weight: 600;
}
.card.live .badge { background: rgba(93,211,255,0.15); color: var(--accent-2); }

/* ---- Tab strip (ACE / Tracks switcher on basin pages) ---- */
.tabs {
  max-width: 1180px; margin: 0 auto;
  padding: 0 20px;
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
}
.tabs a {
  padding: 10px 16px;
  font-size: 14px; font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
  transition: color 0.15s, background 0.15s;
}
.tabs a:hover { color: var(--fg); background: rgba(93,211,255,0.06); text-decoration: none; }
.tabs a.active {
  color: var(--fg);
  background: var(--panel);
  border-color: var(--border);
  border-bottom: 1px solid var(--panel);
}

/* ---- Chart embed ---- */
.chart-section {
  max-width: 1180px; margin: 0 auto;
  padding: 8px 20px 40px;
}
.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.chart-iframe {
  display: block;
  width: 100%;
  border: 0;
  background: var(--bg);
  height: 820px;
}
@media (max-width: 760px) {
  .chart-iframe { height: 1100px; }
}

/* ---- Explainer / about ---- */
.about {
  max-width: 860px; margin: 0 auto;
  padding: 32px 20px 80px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}
.about h2 {
  color: var(--fg);
  font-size: 20px; margin: 32px 0 10px;
  font-weight: 700;
}
.about h2:first-child { margin-top: 0; }
.about p { margin: 0 0 12px; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  background: #0d0f13;    /* a touch darker than --bg for contrast */
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 24px 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---- "Active Now" top banner (populated by active-banner.js) ---- */
.active-banner-wrap {
  max-width: 1180px; margin: 20px auto 0; padding: 0 20px;
}
.active-banner-wrap:empty { display: none; }
.active-banner-wrap .ab-label {
  color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
  padding: 0 2px 8px;
}
.active-banner {
  position: relative;
  border-radius: 12px;
  padding: 14px 86px 14px 20px;
  /* No outer amber ring, it read as a hard border and the rotating
     corner spinner's fins were cutting against it. Just the soft
     drop shadow remains for depth. */
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
}
.active-banner + .active-banner { margin-top: 12px; }
.active-banner .ab-spinner {
  position: absolute; top: 14px; right: 18px;
  width: 54px; height: 54px;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.35));
}
.active-banner .ab-spinner svg {
  width: 100%; height: 100%;
  /* Rotation is handled by <animateTransform> inside the SVG so the
     center label can stay upright, no CSS keyframes needed.
     overflow:visible lets the rotating fins extend past the viewBox
     corners (the hurricane path rotates on a radius of ~41 in a
     viewBox of 68, so the default overflow:hidden was clipping them). */
  overflow: visible;
}
.active-banner .ab-title {
  font-size: 13px; font-weight: 800; letter-spacing: 0.4px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.active-banner .ab-cat {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.15);
}
.active-banner .ab-intensity {
  display: flex; align-items: baseline; gap: 12px; margin-top: 8px;
}
.active-banner .ab-big {
  font-size: 56px; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.active-banner .ab-units {
  font-size: 13px; font-weight: 700; line-height: 1.3;
}
.active-banner .ab-deets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 4px 22px;
  margin-top: 10px;
  font-size: 12px; font-weight: 600;
}
.active-banner .ab-deets span { opacity: 0.72; margin-right: 6px; }
.active-banner .ab-deets b {
  font-weight: 700; font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .active-banner { padding-right: 74px; }
  .active-banner .ab-spinner { width: 44px; height: 44px; }
  .active-banner .ab-big { font-size: 46px; }
}

/* ---- SST pages ---- */
.page-head-sub { padding-top: 12px; }
.page-head .muted { color: var(--muted); font-size: 13px; margin-top: 6px; }
.sst-chart {
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column;
}
.sst-image {
  display: block;
  width: 100%;
  height: auto;
  background: #07101c;
  border-radius: 6px;
}
.sst-caption {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 4px 2px;
  text-align: center;
  font-weight: 700;
}

/* ---- SST region dropdown ---- */
.sst-controls {
  max-width: 1180px; margin: 0 auto;
  padding: 4px 20px 14px;
}
.sst-select {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px 6px 14px;
}
.sst-select-label {
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.sst-select select {
  background: transparent;
  color: var(--fg);
  border: 0;
  outline: 0;
  font-family: "Metropolis", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; font-weight: 600;
  padding: 4px 26px 4px 4px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='%238ea2bd'><path d='M6 8 0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
}
.sst-select select:focus { outline: 1px solid var(--accent-2); outline-offset: 2px; }
.sst-select select optgroup { color: var(--muted); font-style: normal; }
.sst-select select option { background: var(--panel); color: var(--fg); }

/* ---- Section divider between OISST and CRW on /sst/ ---- */
.page-head.section-divider {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.page-head.section-divider .section-h2 {
  margin: 0 0 6px;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  color: var(--fg);
}

/* ---- Global-mean SSTA readout under each chart card ---- */
.sst-globalmean {
  padding: 6px 4px 2px;
  color: var(--accent-2);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.3px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sst-globalmean:empty { display: none; }

/* ---- Option toggles under each SST tab row ---- */
.sst-toggle {
  max-width: 1180px; margin: 0 auto;
  padding: 10px 20px 0;
  display: flex; justify-content: flex-end; gap: 18px;
  flex-wrap: wrap;
}
.sst-toggle label {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.sst-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent-2);
  cursor: pointer;
}
.sst-toggle input[type="checkbox"]:disabled { cursor: not-allowed; }
