/* ============================================================
   Bubbalooza design system — the neutral national foam party guide.
   Mobile-first. Light + dark via html[data-theme="dark"].
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
ul[class], ol[class] { list-style: none; }

/* ---------- Brand tokens ---------- */
:root {
  --foam:  #00B4D8;
  --deep:  #023E5A;
  --sky:   #CAF0F8;
  --sun:   #FFB703;
  --coral: #EF6461;
  --ink:   #12252E;
  --paper: #FDFEFF;

  --bg: var(--paper);
  --surface: #FFFFFF;
  --surface-2: var(--sky);
  --text: var(--ink);
  --text-muted: #4A6570;
  --border: #D9EEF5;
  --border-strong: #AEDDEA;
  --shadow: 0 2px 14px rgba(2,62,90,0.08);
  --shadow-lg: 0 10px 34px rgba(2,62,90,0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --focus-ring: 0 0 0 3px rgba(0,180,216,0.4);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0A1B23;
  --surface: #0F2731;
  --surface-2: #123240;
  --text: #EAF6FA;
  --text-muted: #9AC2CE;
  --border: #1D3E4A;
  --border-strong: #2A5566;
  --shadow: 0 2px 14px rgba(0,0,0,0.35);
  --shadow-lg: 0 10px 34px rgba(0,0,0,0.45);
  --focus-ring: 0 0 0 3px rgba(0,180,216,0.55);
}

/* ---------- Base ---------- */
html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color .2s ease, color .2s ease;
}
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); }
h3 { font-size: 1.15rem; }
p { color: var(--text); }
a { text-decoration: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
section { padding: 3.25rem 0; }
.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--foam);
  margin-bottom: 0.5rem;
}
.section-lead {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0.6rem 0 2rem;
  font-size: 1rem;
  line-height: 1.7;
}

/* ---------- Brand mark (inline SVG, theme-aware via currentColor) ---------- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  color: var(--deep);
}
html[data-theme="dark"] .brand-mark { color: var(--paper); }
.brand-mark svg { height: 30px; width: auto; }
.brand-mark text { font-family: var(--font); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253,254,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .nav { background: rgba(10,27,35,0.92); }
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}
.nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav-toggle-label span {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: var(--deep);
}
html[data-theme="dark"] .nav-toggle-label span { background: var(--paper); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-links a:not(.btn-nav) {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
}
.nav-links a:not(.btn-nav):hover { color: var(--foam); }
.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--deep);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html[data-theme="dark"] .theme-toggle { color: var(--paper); }
.theme-toggle:hover { border-color: var(--foam); }

@media (max-width: 760px) {
  .nav-toggle-label { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  .nav-links a { width: 100%; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); }
  .nav-links a:not(.btn-nav):hover { background: var(--surface-2); }
  .nav-links .theme-toggle { margin: 0.9rem 1.25rem; }
  .nav-toggle-input:checked ~ .nav-links { max-height: 420px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--foam);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0,180,216,0.35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(0,180,216,0.45); }
.btn-secondary {
  background: var(--surface);
  color: var(--deep);
  border-color: var(--border-strong);
}
html[data-theme="dark"] .btn-secondary { color: var(--paper); }
.btn-secondary:hover { border-color: var(--foam); }
.btn-nav {
  background: var(--sun);
  color: #3D2900;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
}
.btn-nav:hover { filter: brightness(1.06); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 3rem;
  background: linear-gradient(180deg, var(--sky) 0%, var(--bg) 100%);
}
html[data-theme="dark"] .hero { background: linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 100%); }
.hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, transparent 56%, rgba(0,0,0,.5) 72%, #000 92%);
          mask-image: linear-gradient(to right, transparent 0, transparent 56%, rgba(0,0,0,.5) 72%, #000 92%);
}
html[data-theme="dark"] .hero-art { opacity: 0.75; }
html[data-theme="dark"] .hero-art svg { filter: saturate(0.85); }
@media (max-width: 760px) {
  .hero-art {
    opacity: 0.35;
    -webkit-mask-image: none;
            mask-image: none;
  }
  html[data-theme="dark"] .hero-art { opacity: 0.22; }
}
.hero-art svg { width: 100%; height: 100%; object-fit: cover; }
.hero-inner { position: relative; z-index: 1; max-width: 720px; }
.hero .hero-badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--deep);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
html[data-theme="dark"] .hero .hero-badge { color: var(--paper); }
.hero p.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 1rem 0 1.75rem;
  line-height: 1.75;
}
.hero p.hero-sub strong { color: var(--deep); }
html[data-theme="dark"] .hero p.hero-sub { color: #C9E6F0; }
html[data-theme="dark"] .hero p.hero-sub strong { color: var(--paper); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* ---------- Cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.card { display: block; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card img, .card svg { width: 44px; height: 44px; margin-bottom: 0.9rem; }
.card h3 { margin-bottom: 0.45rem; font-size: 1.05rem; }
.card p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.65; }
.card .card-link { display: inline-block; margin-top: 0.85rem; font-weight: 800; color: var(--foam); font-size: 0.9rem; }

/* ---------- Calculator shell ---------- */
.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: var(--shadow);
}
.calc label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 1rem 0 0.4rem;
}
.calc label:first-of-type { margin-top: 0; }
.calc input[type="number"],
.calc input[type="text"],
.calc input[type="email"],
.calc textarea,
.calc select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}
.calc textarea { resize: vertical; min-height: 96px; }
.calc input:focus, .calc select:focus, .calc textarea:focus { border-color: var(--foam); }
.calc .calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.calc .btn { margin-top: 1.5rem; width: 100%; }
.calc-result {
  margin-top: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.calc-result .calc-result-figure {
  font-size: 2rem;
  font-weight: 800;
  color: var(--deep);
}
html[data-theme="dark"] .calc-result .calc-result-figure { color: var(--paper); }
.calc-result p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.3rem; }

@media (max-width: 520px) {
  .calc .calc-row { grid-template-columns: 1fr; }
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 1.5rem 0; }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 480px; }
.table-wrap th, .table-wrap td {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.table-wrap th { background: var(--surface-2); font-weight: 800; color: var(--deep); white-space: nowrap; }
html[data-theme="dark"] .table-wrap th { color: var(--paper); }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap td { color: var(--text); }

/* ---------- FAQ ---------- */
.faq { margin: 1.5rem 0; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.2rem 1.25rem;
  margin-bottom: 0.75rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 1rem 0;
  list-style: none;
  position: relative;
  padding-right: 1.75rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0.9rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--foam);
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { color: var(--text-muted); padding: 0 0 1.1rem; line-height: 1.7; font-size: 0.92rem; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.breadcrumbs a { color: var(--text-muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--foam); }
.breadcrumbs span[aria-hidden] { color: var(--border-strong); }
.breadcrumbs .current { color: var(--text); font-weight: 700; }

/* ---------- Table of contents ---------- */
.toc {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.toc p.toc-title { font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--deep); margin-bottom: 0.6rem; }
html[data-theme="dark"] .toc p.toc-title { color: var(--paper); }
.toc ol { list-style: none; padding: 0; }
.toc li { margin-bottom: 0.4rem; font-size: 0.9rem; }
.toc a { color: var(--text); font-weight: 600; }
.toc a:hover { color: var(--foam); }

/* ---------- Callouts ---------- */
.callout {
  background: var(--surface-2);
  border-left: 4px solid var(--foam);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  line-height: 1.7;
}
.callout strong { color: var(--deep); }
html[data-theme="dark"] .callout strong { color: var(--paper); }
.callout-safety {
  background: rgba(239,100,97,0.1);
  border-left: 4px solid var(--coral);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.callout-safety h3 { color: var(--coral); font-size: 1rem; margin-bottom: 0.6rem; }
.callout-safety ul { padding-left: 1.2rem; list-style: disc; }
.callout-safety li { font-size: 0.92rem; line-height: 1.7; margin-bottom: 0.35rem; color: var(--text); }

/* ---------- Disclosure ---------- */
.disclosure {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  margin-bottom: 1.5rem;
  display: inline-block;
}
.disclosure a { color: var(--foam); font-weight: 700; }

/* ---------- Directory ---------- */
.directory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0;
}
.op-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.op-card.badge-featured-card { border-color: var(--sun); }
.op-card h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.op-card p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; margin-bottom: 0.6rem; }
.op-card a.card-link { font-weight: 800; color: var(--foam); font-size: 0.88rem; }
.op-card a.card-link-secondary {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.op-card a.card-link-secondary:hover { color: var(--foam); }

/* ---------- Verified badge + Pro profile ---------- */
.op-card.verified-card { border-left: 5px solid #00B4D8; }
.badge-verified { background: #00B4D8; color: #fff; border-color: #00B4D8; }
.profile-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.profile-gallery img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.profile-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.25rem 0 0.5rem; }
.profile-verified-note { color: #0090ad; font-weight: 700; font-size: 0.9rem; margin: 0.4rem 0 0.8rem; }

/* ---------- Directory search ---------- */
.search-box {
  position: relative;
  max-width: 480px;
  margin-top: 1.5rem;
}
.search-box label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.search-box input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.search-box input[type="text"]:focus { border-color: var(--foam); }
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  margin-top: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
}
.search-results[hidden] { display: none; }
.search-result {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--surface-2); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--deep);
}
html[data-theme="dark"] .badge { color: var(--paper); }
.badge-featured {
  background: var(--sun);
  color: #3D2900;
}

/* ---------- Prose (long-form articles) ---------- */
.prose { max-width: 720px; }
.prose h2 { margin: 2.25rem 0 0.85rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.75rem 0 0.6rem; color: var(--deep); }
html[data-theme="dark"] .prose h3 { color: var(--paper); }
.prose p { margin-bottom: 1rem; line-height: 1.8; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.1rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.45rem; line-height: 1.75; }
.prose a:not(.btn) { color: var(--foam); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--deep); }
html[data-theme="dark"] .prose strong { color: var(--paper); }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.steps li, .steps .step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.steps .step-num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--foam);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.steps h3 { font-size: 0.98rem; margin-bottom: 0.3rem; }
.steps p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.65; }

/* ---------- Divider ---------- */
.divider { width: 100%; height: 40px; margin: 0 auto; opacity: 0.7; }
.divider svg { width: 100%; height: 100%; }

/* ---------- Footer ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.65; margin-top: 0.85rem; max-width: 320px; }
.footer-col h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.85rem; }
.footer-col a { display: block; font-size: 0.9rem; color: var(--text); margin-bottom: 0.6rem; font-weight: 600; }
.footer-col a:hover { color: var(--foam); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Print (for .prose guide pages) ---------- */
@media print {
  .nav, .footer, .theme-toggle, .btn, .callout, .disclosure, .hero-art { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { max-width: 100%; }
  a { text-decoration: underline; color: #000; }
}
