/* ---------- Tokens ---------- */
:root {
  --bg: #081310;
  --panel: #132118;
  --panel-2: #17281c;
  --border: rgba(111,224,137,0.12);
  --text: #eef5f0;
  --text-dim: #a0bcae;
  --text-faint: #6b8f78;
  --mint: #5fe07a;
  --mint-dim: #4bac60;
  --blue: #4a86c9;
  --green: #5fae5a;
  --yellow: #c9b23e;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* Guards against any single element (an icon, a long number, a fixed
     width somewhere) accidentally pushing the page wider than the
     screen — without this, that shows up as the whole site being able
     to scroll sideways slightly on some phones, which reads as "things
     don't fit." */
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 900px 500px at 20% 0%, rgba(95,224,122,0.09), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 30%, rgba(74,134,201,0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 800px; margin: 0 auto; padding: 0 24px; }

.sub { font-size: 0.7em; vertical-align: sub; }

/* ---------- Eyebrow / headings ---------- */
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mint-dim);
  margin: 0 0 10px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

h2 { font-size: 1.7rem; margin-bottom: 18px; }
h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
h3.no-icon { display: block; }

.content-icon { width: 19px; height: 19px; color: var(--mint); flex-shrink: 0; }

p { color: var(--text-dim); max-width: 66ch; }

.rule { height: 1px; background: var(--border); margin: 20px 0; }

/* ---------- Hero / 3D tank ---------- */
.hero {
  position: relative;
  min-height: 640px;
  height: 92vh;
  /* dvh tracks the browser's ACTUAL visible area and updates smoothly as
     the address bar shows/hides, instead of vh's fixed-then-jumping
     behavior — this is what stops the hero (and the canvas inside it)
     from being resized mid-scroll on mobile. Falls back to 92vh above
     on older browsers that don't support dvh yet. */
  height: 92dvh;
  max-height: 820px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3,8,6,0.75) 0%, rgba(3,8,6,0.15) 22%, transparent 45%),
    linear-gradient(0deg, rgba(3,8,6,0.5) 0%, transparent 20%),
    radial-gradient(ellipse 70% 60% at 50% 100%, transparent 40%, rgba(3,8,6,0.35) 100%);
}

.tank-canvas-wrap {
  position: absolute;
  inset: 0;
}

#tank-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}

#tank-canvas:active { cursor: grabbing; }

.tank-hint {
  position: absolute;
  bottom: 22px;
  right: 26px;
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
  padding: 64px 40px 0;
  pointer-events: none;
}

.hero-copy > * { pointer-events: auto; }

.hero-copy h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1;
  margin: 0 0 20px;
}

.hero-sub {
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0 0 26px;
  color: #c7d8d0;
}

.hero-cta {
  display: inline-block;
  background: var(--mint);
  color: #0d1613;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.hero-cta:hover { background: #a6e6b5; transform: translateY(-1px); }
.hero-cta:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

/* =====================================================================
   AD SLOTS
   -----------------------------------------------------------------
   This block only styles the ad container boxes. The actual AdSense
   publisher ID (ca-pub-XXXXXXXXXXXXXXXX) and per-slot ad unit IDs
   (data-ad-slot="...") are NOT set here — they live in index.html.
   Search index.html for "AD SLOT" to find all 4 placements (one after
   each major content section) and swap in your real IDs there.

   The <ins> is stacked above the ".ad-fallback" placeholder text via
   z-index rather than sitting beside it — this keeps the "Advertisement"
   label properly centered instead of squeezed to one side, and once a
   real ad loads it simply covers the placeholder instead of competing
   with it for space.
   ===================================================================== */
.ad-wrap { padding-top: 22px; }

.ad-slot {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 26px 0;
  min-height: 90px;
  overflow: hidden;
}

.ad-slot ins.adsbygoogle {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  min-height: 90px;
}

.ad-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- Panels ---------- */
main { padding-bottom: 20px; }

.panel {
  background: linear-gradient(180deg, rgba(111,224,137,0.045), rgba(0,0,0,0.12)), var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  /* Fluid padding: scales down smoothly as the viewport narrows instead
     of jumping at one fixed breakpoint, so it looks right on every phone
     width, not just ones that happen to sit below/above 640px. */
  padding: clamp(18px, 4vw, 32px);
  margin: 26px 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 12px 30px -18px rgba(0,0,0,0.5);
}

.console { margin-top: 26px; }

/* ---------- Calculator fields ---------- */
.field-grid {
  display: grid;
  /* auto-fit + minmax lets the grid decide per-device how many columns
     fit: two side-by-side on a wider phone/tablet, one stacked column on
     a narrow phone — with no hard-coded breakpoint to maintain. */
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.field-box {
  background: linear-gradient(180deg, rgba(111,224,137,0.04), rgba(0,0,0,0.1)), var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: clamp(14px, 3.5vw, 20px) clamp(16px, 4vw, 20px) clamp(16px, 4vw, 20px);
}

.field-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.field-icon { width: 17px; height: 17px; color: var(--mint); flex-shrink: 0; }

.field-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex: 1;
}

.toggle {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 4px 11px;
  border-radius: 16px;
  cursor: pointer;
}

.toggle-btn.active { background: var(--mint); color: #0d1613; font-weight: 600; }

.big-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-display);
  /* Scales continuously with viewport width between a 1.5rem floor and
     2.1rem ceiling, instead of being one fixed size that's either too
     big for a narrow phone or unnecessarily small on a wider one. */
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  padding: 0;
  margin-bottom: 4px;
  -moz-appearance: textfield;
}

.big-input::-webkit-outer-spin-button,
.big-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.big-input:focus { outline: none; }
.big-input:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; border-radius: 4px; }

.field-helper {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin: 0;
}

.slider {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--mint) 0%, var(--mint) var(--fill, 56%), rgba(255,255,255,0.12) var(--fill, 56%));
  margin-top: 6px;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--mint);
  cursor: pointer;
  border: 2px solid #0d1613;
}

.slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--mint);
  cursor: pointer;
  border: 2px solid #0d1613;
}

/* ---------- Result panel ---------- */
.result-panel {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 8px;
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.status-pill {
  font-size: 0.8rem;
  padding: 4px 13px;
  border-radius: 20px;
  border: 1px solid var(--green);
  color: var(--green);
}

.status-pill.low { border-color: var(--blue); color: var(--blue); }
.status-pill.high { border-color: var(--yellow); color: var(--yellow); }

.result-value { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }

.big-number { font-family: var(--font-display); font-size: clamp(2.1rem, 9vw, 3rem); line-height: 1; }
.unit-tag { color: var(--text-faint); font-size: 1rem; }

.gauge-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--blue) 0%, var(--green) 25%, var(--green) 58%, var(--yellow) 100%);
}

.gauge-marker {
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--bg);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
  left: 31.6%;
  transition: left 0.25s ease;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 8px;
}

.extreme-note {
  font-size: 0.85rem;
  color: var(--yellow);
  margin: 14px 0 0;
  max-width: none;
}

/* ---------- Drop checker ---------- */
.dc-row {
  display: flex;
  gap: 26px;
  align-items: center;
  margin: 30px 0 8px;
  flex-wrap: wrap;
}

.dc-icon-wrap { flex: 0 0 auto; }

.dc-icon {
  width: 76px;
  height: 88px;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: var(--green);
  position: relative;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.dc-icon::after {
  content: "";
  position: absolute;
  top: 30%; left: 22%;
  width: 30%; height: 12%;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  filter: blur(1px);
}

.dc-list { flex: 1 1 280px; display: flex; flex-direction: column; gap: 8px; }

.dc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}

.dc-item.active {
  border-color: var(--border);
  border-left-color: var(--dc-active-color, var(--mint));
  background: rgba(255,255,255,0.045);
  transform: translateX(2px);
}

.dc-item.active .dc-name { color: var(--text); font-weight: 700; }
.dc-item.active .dc-range { color: var(--text-dim); }

.dc-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dc-name { font-weight: 500; color: var(--text-dim); transition: color 0.2s ease, font-weight 0.2s ease; }
.dc-range { margin-left: auto; color: var(--text-faint); font-size: 0.85rem; }

/* ---------- Bubble rate ---------- */
.bps-panel {
  background: linear-gradient(180deg, rgba(111,224,137,0.04), rgba(0,0,0,0.1)), var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  margin-top: 26px;
}

.bps-value {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5.5vw, 1.9rem);
  margin: 6px 0 10px;
  color: var(--text);
}

.bps-note { font-size: 0.88rem; margin: 0; }

.formula-note {
  font-size: 0.82rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin: 22px 0 0;
}

/* ---------- Content panels ---------- */
.content-panel p { margin: 0 0 14px; }
.content-panel p:last-child { margin-bottom: 0; }

.trap {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.trap:last-child { margin-bottom: 0; }

.trap-badge {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--mint-dim);
  color: var(--mint);
  font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}

.trap-title { color: var(--text); font-weight: 500; margin: 2px 0 6px; }
.trap p:not(.trap-title) { margin: 0; font-size: 0.94rem; }

/* ---------- Quick reference ---------- */
.ref-table { display: flex; flex-direction: column; }

.ref-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.ref-row:last-child { border-bottom: none; }
.ref-row span:last-child { color: var(--text); font-weight: 500; }

/* ---------- Privacy policy page ---------- */
.policy-page { padding-top: 44px; padding-bottom: 40px; }

.back-link { margin: 0 0 22px; }
.back-link a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-link a:hover { color: var(--mint); }
.back-link-bottom { margin: 30px 0 0; }

.policy-title {
  font-size: clamp(2rem, 5vw, 2.7rem);
  margin: 0 0 8px;
}

.policy-updated {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin: 0 0 30px;
}

.policy-body h3 { margin-top: 28px; }
.policy-body h3:first-child { margin-top: 0; }
.policy-body ul { padding-left: 20px; margin: 0 0 14px; }
.policy-body li { margin-bottom: 8px; color: var(--text-dim); }
.policy-body a { color: var(--mint); }

/* ---------- Footer ---------- */
footer { padding: 10px 0 40px; }
footer p { font-size: 0.85rem; color: var(--text-faint); max-width: 60ch; }
.footer-links { margin-top: 10px; }
.footer-links a { color: var(--mint-dim); text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { color: var(--mint); text-decoration: underline; }

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 640px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(111,224,137,0.05), rgba(0,0,0,0.15)), var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 12px 34px -12px rgba(0,0,0,0.6);
  z-index: 50;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cookie-banner.visible { opacity: 1; transform: translateY(0); }

.cookie-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 14px;
  max-width: none;
}

.cookie-text a { color: var(--mint); text-decoration: underline; }

.cookie-actions { display: flex; gap: 10px; justify-content: flex-end; }

.cookie-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--mint);
  color: #0d1613;
}

.cookie-btn:hover { background: #8fe89e; }

.cookie-btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

.cookie-btn-ghost:hover { color: var(--text); border-color: var(--mint-dim); }

@media (max-width: 480px) {
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 16px; }
  .cookie-actions { justify-content: stretch; }
  .cookie-btn { flex: 1; }
}

/* ---------- Back to top ---------- */
.top-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.top-btn.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.top-btn svg { width: 18px; height: 18px; }
.top-btn:hover { color: var(--mint); border-color: var(--mint-dim); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }
  .hero { height: 68vh; height: 68dvh; min-height: 480px; max-height: 620px; }
  .hero-copy { padding: 34px 20px 0; }
  .hero-copy h1 { font-size: clamp(2.1rem, 11vw, 2.8rem); }
  .hero-cta { width: 100%; text-align: center; }
  .tank-hint { right: 16px; bottom: 16px; font-size: 0.65rem; }
  .panel { padding: 24px 20px; }
  .dc-row { flex-direction: column; align-items: flex-start; }
}

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


/* ---------- Hide Netlify badge ---------- */
a[href*="netlify.com/?utm_source=platform-badge"] {
  display: none !important;
}