/* WATERLOSSCLOCK.COM - PRODUCTION STYLESHEET */
:root {
  --bg-page: #FAF8F5;
  --bg-card: #FFFFFF;
  --bg-subtle: #F3EFEA;
  --text-main: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;
  --border-light: #E7E5E4;
  --accent-teal: #0F4C5C;
  --accent-teal-dark: #0A3642;
  --accent-terracotta: #C85A32;
  --accent-sage: #2E6F5E;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 12px 30px -6px rgba(15, 76, 92, 0.14), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

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

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.55;
}

body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 245, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-teal);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: block;
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.main-nav a, .nav-btn {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-body);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover, .nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.main-nav .nav-cta {
  background: var(--accent-teal);
  color: #fff;
}

.main-nav .nav-cta:hover {
  background: var(--accent-teal-dark);
  color: #fff;
}

/* Hero Live Clock Section */
.hero-section {
  padding: 2rem 0 1.5rem;
}

.hero-clock-card {
  background: radial-gradient(circle at 50% 0%, #156275 0%, #0F4C5C 52%, #082B35 100%);
  color: #FFFFFF;
  border-radius: 24px;
  padding: 2.25rem 1.5rem 2.75rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content-layer {
  position: relative;
  z-index: 2;
}

/* Subtle Animated Water Wave at Bottom of Hero Card */
.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 44px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
}

.hero-wave svg {
  width: 200%;
  height: 100%;
  display: block;
  animation: waveSlide 18s linear infinite;
}

@keyframes waveSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-wave svg, .live-dot { animation: none; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.95rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF6B4A;
  box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.28);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

.hero-title {
  margin: 0 auto 0.5rem;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 860px;
}

.hero-subtitle {
  margin: 0 auto 1.35rem;
  color: #CBE4EA;
  font-size: 0.95rem;
  max-width: 700px;
}

/* Control Bars: Timeframe + Metric/Imperial Toggle */
.hero-controls-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.clock-mode-bar {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem;
  border-radius: 12px;
}

.clock-btn, .unit-btn {
  border: none;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: #CBE4EA;
  transition: all 0.15s ease;
}

.clock-btn:hover, .unit-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.clock-btn.active, .unit-btn.active {
  background: #FFFFFF;
  color: var(--accent-teal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.primary-counter-box {
  margin: 0.35rem auto 1.35rem;
}

.primary-counter-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
}

.primary-counter-value {
  font-size: clamp(1.85rem, 5.6vw, 4.55rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.22);
}

.primary-counter-unit {
  font-size: clamp(1.05rem, 2.2vw, 1.65rem);
  font-weight: 700;
  color: #7DD3FC;
}

.primary-counter-caption {
  font-size: 0.85rem;
  color: #BAE6FD;
  margin-top: 0.5rem;
}

.copy-stat-wrap {
  margin-top: 0.75rem;
}

.copy-stat-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #E0F2FE;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.copy-stat-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* Year Progress Bar */
.year-progress-wrap {
  max-width: 640px;
  margin: 0 auto 1.65rem;
  text-align: left;
}

.year-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #CBE4EA;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.year-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.year-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38BDF8, #FF7A59);
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
}

/* Secondary Live Metrics */
.hero-subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  max-width: 980px;
  margin: 0 auto;
}

.hero-subcard {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 1.05rem 1.2rem;
  text-align: left;
  backdrop-filter: blur(4px);
}

.hero-subcard-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #BAE6FD;
  font-weight: 700;
}

.hero-subcard-val {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.25rem 0;
  color: #FFFFFF;
}

.hero-subcard-val.warn {
  color: #FF9E80;
}

.hero-subcard-val.sage {
  color: #86EFAC;
}

.hero-subcard-note {
  font-size: 0.76rem;
  color: #CBE4EA;
}

/* Key Global KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
}

.kpi-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-card-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.2rem 0;
}

.kpi-card-sub {
  font-size: 0.78rem;
  color: var(--text-body);
}

/* Sponsor Banner Strip */
.sponsor-section {
  margin: 1.5rem 0 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
}

.sponsor-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.sponsor-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-muted);
}

.sponsor-inquire {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-teal);
  text-decoration: none;
}

.sponsor-inquire:hover {
  text-decoration: underline;
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.sponsor-card {
  background: var(--bg-card);
  border: 1px dashed #CBD5E1;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sponsor-card:hover {
  border-color: var(--accent-teal);
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.sponsor-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.sponsor-slot-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: #F1F5F9;
  color: var(--text-muted);
}

.sponsor-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.sponsor-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.55rem;
}

.sponsor-cta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-teal);
}

/* Methodological Alert Banner */
.alert-banner {
  margin-top: 1.25rem;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.86rem;
  color: #78350F;
}

/* Main Content Sections */
.content-section {
  padding: 2.75rem 0 1rem;
  border-top: 1px solid var(--border-light);
  margin-top: 2rem;
}

.section-header {
  max-width: 820px;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-header p {
  margin: 0;
  color: var(--text-body);
  font-size: 0.95rem;
}

/* Cards & Grids */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.col-7 { grid-column: span 7; }
.col-5 { grid-column: span 5; }
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }

@media (max-width: 960px) {
  .col-7, .col-5, .col-8, .col-4, .col-6 {
    grid-column: span 12;
  }
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.panel-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.panel-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pill-btn {
  border: 1px solid var(--border-light);
  background: #F8FAFC;
  color: var(--text-body);
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--bg-subtle);
}

.pill-btn.active {
  background: var(--accent-teal);
  color: #fff;
  border-color: var(--accent-teal);
}

.chart-box {
  position: relative;
  width: 100%;
  height: 340px;
}

.chart-box-tall {
  position: relative;
  width: 100%;
  height: 470px;
}

.panel-footnote {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.85rem 0 0;
}

/* Data Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-top: 1.25rem;
}

.table-card-head {
  background: var(--bg-subtle);
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
}

.table-scroll {
  overflow-x: auto;
  max-height: 520px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  color: var(--text-body);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  z-index: 5;
}

tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #F1F5F9;
}

tbody tr:hover {
  background: #FAF8F5;
}

.text-right {
  text-align: right;
}

.total-row {
  background: var(--bg-subtle);
  font-weight: 800;
  border-top: 2px solid #CBD5E1;
}

/* Continent Tabs */
.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.cont-tab {
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cont-tab:hover {
  background: var(--bg-subtle);
}

.cont-tab.active {
  background: var(--accent-teal);
  color: #fff;
  border-color: var(--accent-teal);
}

.continent-panel.hidden {
  display: none;
}

.stat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.stat-list li {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  gap: 0.5rem;
}

.callout-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.1rem;
  font-size: 0.84rem;
  color: var(--text-body);
}

/* Explorer Filter Controls */
.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

.form-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  font-size: 0.88rem;
  background: #FAF8F5;
  color: var(--text-main);
}

.form-input:focus, .form-select:focus {
  outline: 2px solid var(--accent-teal);
  border-color: transparent;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-nat { background: #DCFCE7; color: #166534; }
.badge-sub { background: #CCFBF1; color: #115E59; }
.badge-gap { background: #FEF3C7; color: #92400E; }

/* Simulator */
.sim-slider-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 1.1rem;
}

.sim-slider-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-teal);
  cursor: pointer;
}

.sim-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.sim-metric {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.95rem;
}

.sim-metric-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sim-metric-val {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0.25rem 0;
}

/* Modal for Embed Widget */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border-radius: 18px;
  max-width: 580px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.code-snippet {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  margin: 0.75rem 0;
  resize: none;
}

/* Footer */
.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
  padding: 2.25rem 0;
  font-size: 0.82rem;
  color: var(--text-body);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.6rem;
}

.footer-links a {
  color: var(--accent-teal);
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}
