/* ============================================
   Swim Beast Tools — Design System
   Reuses Content Pack §8's established app palette
   ============================================ */

:root {
  /* Color — grounded in the app's own psychology-based palette, not invented */
  --color-primary: #0077B6;
  --color-primary-dark: #00507D;
  --color-accent: #FF6B47;
  --color-accent-dark: #E5502F;
  --color-success: #2D9D5F;
  --color-caution: #F2A93C;
  --color-ink: #0F2439;
  --color-ink-soft: #45607A;
  --color-panel: #0F2439;
  --color-bg: #F7FAFC;
  --color-surface: #FFFFFF;
  --color-border: #DCE6EE;

  /* Type */
  --font-heading: 'Sora', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Layout */
  --content-max: 640px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --radius: 10px;
}

[data-theme="dark"] {
  --color-ink: #EAF2F8;
  --color-ink-soft: #A9C0D4;
  --color-bg: #0A1F33;
  --color-surface: #0F2A42;
  --color-border: #1C3C57;
  --color-primary: #4FA8DA;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  color: var(--color-ink);
}

h1 { font-size: 3.2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; }

p { max-width: 68ch; }

a { color: var(--color-primary); }

/* ---- Layout shell ---- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header .logo img {
  height: 36px;
  display: block;
}

.site-nav {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--color-ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.site-nav a:hover { color: var(--color-primary); }

.btn-get-app {
  background: var(--color-accent);
  color: #fff !important;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

/* ---- Lane-line divider: made bolder and thicker — the earlier version
   was too subtle to register as a real design element at all. ---- */
.lane-divider {
  border: none;
  height: 8px;
  margin: var(--space-lg) 0;
  background-image: repeating-linear-gradient(
    to right,
    var(--color-accent) 0, var(--color-accent) 28px,
    transparent 28px, transparent 44px
  );
  background-repeat: repeat-x;
  background-size: 44px 8px;
  border-radius: 4px;
  opacity: 0.85;
}

/* ---- The calculator: a real instrument panel now, not a bordered card.
   Deep navy background, not white — this is the page's one bold color
   block, spent deliberately on the thing that matters most. ---- */
.calculator {
  background: var(--color-panel);
  border: none;
  border-radius: 16px;
  padding: var(--space-lg) var(--space-md);
  color: #fff;
}

.field-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.field {
  flex: 1;
  min-width: 120px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.field input, .field select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  font-size: 1.15rem;
  font-family: var(--font-body);
  font-weight: 600;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.field input:focus, .field select:focus, button:focus, a:focus {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.field input[aria-invalid="true"] {
  border-color: var(--color-accent);
}

.field-error {
  font-size: 0.82rem;
  color: #FFB199;
  margin-top: 0.3rem;
}

.unit-toggle {
  display: inline-flex;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.unit-toggle button {
  background: transparent;
  border: none;
  padding: 0.5rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
}

.unit-toggle button[aria-pressed="true"] {
  background: var(--color-accent);
  color: #fff;
}

/* ---- Result: the real hero now — huge, confident, scoreboard-scale.
   The earlier 3rem number was nowhere near bold enough to earn the
   "hero" claim the design plan made for it. ---- */
.result {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 2px solid rgba(255,255,255,0.15);
}

.result-value {
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  font-size: 6.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.result-label {
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.5rem;
  font-weight: 600;
}

.result-secondary {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.result-secondary .stat-value {
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.result-secondary .stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}

/* ---- Buttons ---- */
button.primary {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

button.secondary {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ---- Related tools strip ---- */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
}

.related-tools a {
  display: block;
  padding: var(--space-sm);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-ink);
  font-size: 0.9rem;
  font-weight: 700;
  transition: border-color 0.15s;
}

.related-tools a:hover { border-color: var(--color-accent); }

/* ---- Promotion card ---- */
.promo-card {
  background: var(--color-primary);
  color: #fff;
  border-radius: 16px;
  padding: var(--space-lg) var(--space-md);
}

.promo-card h2 { color: #fff; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-sm);
  margin: var(--space-sm) 0 var(--space-md);
}

.feature-item {
  font-size: 0.85rem;
}

.feature-item strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.tier-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.tier-table th, .tier-table td {
  padding: 0.7rem;
  text-align: center;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.tier-table th { font-family: var(--font-heading); font-size: 1rem; }

.site-footer {
  text-align: center;
  padding: var(--space-md);
  font-size: 0.8rem;
  color: var(--color-ink-soft);
}

.site-footer a { color: var(--color-ink-soft); }

.privacy-note {
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  margin-top: var(--space-sm);
}

/* Screen-reader only — used for the ARIA live region announcement text */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  h1 { font-size: 2.2rem; }
  .result-value { font-size: 3.8rem; }
  main { padding: var(--space-md) var(--space-sm); }
}
