/* =============================
   CanMath.app — Global Styles
   ============================= */

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

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --red-600: #dc2626;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--slate-50);
  color: var(--slate-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* ---- Typography ---- */
h1,h2,h3,h4,h5,h6 { line-height: 1.2; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ---- Layout ---- */
/* ---- Layout ---- */
.page-wrapper {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .page-wrapper {
    /* Locks the side columns to 160px so they never overlap the content */
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    gap: 1.5rem; 
    align-items: start;
  }
  
  .page-aside { 
    display: block !important; 
    position: sticky;
    top: 6rem; /* Ensures it stays below your sticky header */
    height: fit-content; /* Critical: allows the sidebar to move with the scroll */
  }
}

.page-aside { display: none; }

.page-main {
  width: 100%;
  max-width: 100%; 
  min-width: 0;
}

/* Sidebar Ad Container */
.aside-ad {
  width: 160px;
  height: 600px;
  background: var(--slate-200); /* Visual placeholder */
  border: 1px solid var(--slate-300);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aside-ad span {
  font-size: 10px;
  font-weight: 800;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .15em;
  text-align: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* ---- Header ---- */
header {
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
}
@media (min-width: 1024px) {
  .header-inner {
    flex-direction: row;
    justify-content: space-between;
    min-height: 5rem;
    padding: 0 1rem;
  }
}

.logo-link { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.logo-link:hover .logo-can { transform: scale(1.05); }
.logo-can { display: flex; flex-direction: column; align-items: center; width: 3rem; height: 4rem; transition: transform .3s; }
.can-neck-top { width: 2rem; height: 0.5rem; background: linear-gradient(to bottom,#94a3b8,#e2e8f0); border-radius: 2px 2px 0 0; }
.can-neck-mid { width: 2.5rem; height: 0.375rem; background: var(--slate-200); }
.can-body {
  position: relative; width: 3rem; height: 3rem;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 2px; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1);
  border-left: 1px solid var(--slate-300); border-right: 1px solid var(--slate-300);
  background: #fff; z-index: 10;
}
.can-stripe-top { width: 100%; height: 0.625rem; background: var(--red-600); }
.can-icon-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #fff; position: relative; overflow: hidden;
}
.can-icon-area svg { width: 1.5rem; height: 1.5rem; position: relative; z-index: 2; }
.can-icon-area::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(148,163,184,.3) 0%, transparent 40%, transparent 60%, rgba(148,163,184,.3) 100%);
}
.can-stripe-bottom { width: 100%; height: 0.625rem; background: var(--blue-600); }
.can-base-mid { width: 2.5rem; height: 0.375rem; background: var(--slate-200); margin-top: -1px; }
.can-base-bottom { width: 2rem; height: 0.5rem; background: var(--slate-300); border-radius: 0 0 2px 2px; }

.logo-text { display: flex; flex-direction: column; align-items: flex-start; }
.logo-name { font-size: 1.875rem; font-weight: 800; letter-spacing: -.05em; color: var(--slate-900); }
.logo-name span { color: var(--blue-600); }
.logo-tagline {
  display: flex; justify-content: space-between;
  width: 100%; font-size: 8px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--slate-500); padding-top: 4px;
}

.header-ad {
  flex: 1; max-width: 42rem;
  background: var(--slate-100); height: 3.5rem; border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--slate-200); box-shadow: inset 0 2px 4px rgba(0,0,0,.06);
}
.header-ad span {
  font-size: 9px; font-weight: 800;
  color: var(--slate-400); text-transform: uppercase; letter-spacing: .2em; text-align: center; padding: 0 1rem;
}
.header-spacer { display: none; }
@media(min-width:1024px){ .header-spacer { display: block; width: 25%; } }

/* ---- Footer ---- */
footer { background: var(--slate-900); color: var(--slate-400); padding: 3rem 1rem; border-top: 1px solid #1e293b; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width:768px){ .footer-inner { grid-template-columns: repeat(4,1fr); } }

.footer-logo { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.footer-logo-can { display: flex; flex-direction: column; align-items: center; width: 2.25rem; height: 3rem; }
.footer-logo-can .can-neck-top { width: 1.5rem; height: 6px; background: #334155; border-radius: 2px 2px 0 0; }
.footer-logo-can .can-neck-mid { width: 2rem; height: 4px; background: #1e293b; }
.footer-logo-can .can-body { width: 2.25rem; height: 2.25rem; background: #1e293b; border-color: #334155; }
.footer-logo-can .can-stripe-top { background: var(--red-600); height: 6px; }
.footer-logo-can .can-icon-area { background: #fff; }
.footer-logo-can .can-icon-area svg { width: 1.25rem; height: 1.25rem; }
.footer-logo-can .can-stripe-bottom { background: var(--blue-600); height: 6px; }
.footer-logo-can .can-base-mid { background: #1e293b; height: 4px; }
.footer-logo-can .can-base-bottom { background: #334155; height: 6px; }
.footer-logo-text { display: flex; flex-direction: column; }
.footer-logo-name { font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: -.03em; }
.footer-logo-tagline { font-size: 6px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); display: flex; justify-content: space-between; width: 100%; margin-top: 6px; }
.footer-desc { font-size: .875rem; line-height: 1.6; }

.footer-col h4 { color: #fff; font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.footer-col ul { list-style: none; space-y: .5rem; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col a { font-size: .875rem; transition: color .15s; }
.footer-col a:hover { color: var(--blue-400); }
.footer-col .sub-label { font-size: 10px; font-weight: 900; color: var(--slate-500); text-transform: uppercase; letter-spacing: .08em; margin-top: 1rem; margin-bottom: .25rem; display: block; }

.footer-social { display: flex; gap: 1rem; }
.footer-social a { display: flex; transition: color .15s; }
.footer-social a:hover { color: var(--blue-500); }
.footer-social svg { width: 1.25rem; height: 1.25rem; }

.footer-bottom {
  max-width: 1280px; margin: 3rem auto 0;
  padding-top: 2rem; border-top: 1px solid #1e293b;
  text-align: center; font-size: .75rem;
}

/* ---- Ad placeholders ---- */
.ad-leaderboard {
  background: var(--slate-200); border-radius: .75rem;
  border: 1px solid var(--slate-300); height: 6rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; max-width: 56rem;
}


.ad-leaderboard span, .ad-banner span, .ad-mid span, .ad-inline span {
  font-size: 9px; font-weight: 800; color: var(--slate-300);
  text-transform: uppercase; letter-spacing: .2em; text-align: center;
}
.ad-banner {
  background: var(--slate-200); border-radius: .75rem;
  border: 1px solid var(--slate-300); height: 6rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; max-width: 56rem;
}
.ad-mid {
  background: var(--slate-200); border-radius: .75rem;
  border: 1px solid var(--slate-300); height: 6rem;
  display: flex; align-items: center; justify-content: center;
}
.ad-inline {
  background: rgba(255,255,255,.05); border-radius: .75rem;
  border: 1px dashed rgba(255,255,255,.1); height: 3.5rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---- Card / Section ---- */
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: 1rem; padding: 1.5rem; }
.card-lg { background: #fff; border: 1px solid var(--slate-200); border-radius: 1.5rem; padding: 2rem 2.5rem; }
@media(max-width:640px){ .card-lg { padding: 1.5rem 1rem; } }

.section-label {
  font-size: .625rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: .15em; color: var(--slate-400);
  display: flex; align-items: center; gap: .5rem;
}
.section-label::before { content:''; display:block; width:4px; height:1rem; background:var(--blue-600); border-radius:99px; }

/* ---- Tabs ---- */
.tabs {
  display: flex; gap: .5rem; padding: .5rem;
  background: rgba(241,245,249,.5); border-radius: .75rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .625rem 1.5rem; font-size: .875rem; font-weight: 800;
  border: none; border-radius: .5rem; white-space: nowrap;
  background: transparent; color: var(--slate-500); transition: all .15s;
}
.tab-btn svg { width: 1.125rem; height: 1.125rem; }
.tab-btn:hover { color: var(--slate-700); background: rgba(148,163,184,.2); }
.tab-btn.active { background: #fff; color: var(--blue-600); box-shadow: 0 1px 3px rgba(0,0,0,.1); outline: 2px solid var(--blue-600); }

/* ---- Buttons ---- */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  background: var(--blue-600); color: #fff;
  padding: 1rem 1.5rem; border-radius: .75rem; border: none;
  font-weight: 900; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em;
  box-shadow: 0 4px 14px -2px rgba(37,99,235,.35);
  transition: all .15s; flex: 1;
}
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:active { transform: scale(.98); }
.btn-reset {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 1rem 1.5rem; border-radius: .75rem; border: 1px solid var(--slate-200);
  background: transparent; color: var(--slate-400); font-weight: 700; font-size: .875rem;
  transition: color .15s;
}
.btn-reset:hover { color: #ef4444; }

/* ---- Toggle ---- */
.toggle-group {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .75rem; padding: .25rem; background: rgba(148,163,184,.2); border-radius: .75rem;
}
.toggle-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1rem; border-radius: .625rem; border: none;
  font-size: .75rem; font-weight: 800; background: transparent;
  color: var(--slate-500); transition: all .15s;
}
.toggle-btn svg { width: 1rem; height: 1rem; }
.toggle-btn.active { background: #fff; color: var(--blue-600); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---- Inputs ---- */
.input-main {
  width: 100%; border: 1px solid var(--slate-200); border-radius: .75rem;
  padding: 1rem 5rem 1rem 1rem; font-size: 1.25rem; font-weight: 800;
  color: var(--slate-900); outline: none; transition: all .15s;
  background: #fff;
}
.input-main::placeholder { color: var(--slate-300); }
.input-main:focus { box-shadow: 0 0 0 4px rgba(59,130,246,.15); border-color: var(--blue-500); }
.input-wrap { position: relative; }
.input-unit {
  position: absolute; right: 2.5rem; top: 50%; transform: translateY(-50%);
  font-size: .75rem; font-weight: 900; color: var(--slate-300);
  text-transform: uppercase; text-decoration: underline;
  text-decoration-color: rgba(59,130,246,.3); text-underline-offset: 4px;
  pointer-events: none;
}
.input-sm {
  width: 100%; background: var(--slate-100); border: 1px solid var(--slate-200);
  border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; font-weight: 700;
  color: var(--slate-800); outline: none;
}
.input-sm:focus { background: #fff; }
.input-label { font-size: .625rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .1em; display: block; margin-bottom: .5rem; }

/* ---- Results Panel ---- */
.results-panel {
  background: var(--slate-900); border-radius: 1.5rem;
  padding: 2rem; flex: 1; box-shadow: 0 20px 40px -8px rgba(15,23,42,.25);
  position: relative; overflow: hidden;
}
.results-panel::before {
  content: ''; position: absolute; top: -4rem; right: -4rem;
  width: 8rem; height: 8rem; background: rgba(59,130,246,.1);
  border-radius: 50%; filter: blur(2rem);
}
.results-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 1rem;
  padding: 5rem 0; opacity: .4;
}
.results-empty svg { width: 3rem; height: 3rem; color: #475569; }
.results-empty h4 { color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.results-empty p { color: var(--slate-500); font-size: .875rem; margin-top: .5rem; }

.results-content { position: relative; z-index: 1; }
.result-total { font-size: 2.5rem; font-weight: 900; color: #fff; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.result-total-label { font-size: .625rem; font-weight: 900; color: var(--blue-400); text-transform: uppercase; letter-spacing: .15em; margin-top: .25rem; }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.result-box {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.05);
  border-radius: 1rem; padding: 1.25rem; transition: background .15s;
}
.result-box:hover { background: rgba(255,255,255,.08); }
.result-box .value { font-size: 1.875rem; font-weight: 900; color: #fff; }
.result-box .label { font-size: 10px; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .1em; margin-top: .25rem; }

.result-alert {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.25rem; border-radius: .75rem; margin-top: 1rem;
}
.result-alert.blue { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.2); }
.result-alert.green { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.2); }
.result-alert .icon { border-radius: 50%; padding: 4px; display: flex; flex-shrink: 0; }
.result-alert.blue .icon { background: var(--blue-500); }
.result-alert.green .icon { background: var(--emerald-500); }
.result-alert .icon svg { width: .75rem; height: .75rem; color: #fff; }
.result-alert p { font-size: .875rem; font-weight: 700; color: rgba(239,246,255,.9); }
.result-alert.green p { color: rgba(209,250,229,.9); }

.btn-copy {
  width: 100%; padding: .75rem; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.05); border-radius: .75rem;
  color: #fff; font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; display: flex; align-items: center; justify-content: center; gap: .5rem;
  transition: background .15s; margin-top: 1rem;
}
.btn-copy:hover { background: rgba(255,255,255,.18); }

/* ---- Comparison Table ---- */
.comp-table { width: 100%; font-size: 10px; color: var(--slate-400); border-collapse: collapse; }
.comp-table thead tr { border-bottom: 1px solid rgba(255,255,255,.1); }
.comp-table th { padding-bottom: .5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #fff; }
.comp-table th:first-child { text-align: left; }
.comp-table th:not(:first-child):not(:last-child) { text-align: center; }
.comp-table th:last-child { text-align: right; }
.comp-table tbody tr { border-bottom: 1px solid rgba(255,255,255,.03); }
.comp-table td { padding: .5rem .25rem; }
.comp-table td:first-child { font-weight: 600; text-align: left; }
.comp-table td:nth-child(2) { text-align: center; font-weight: 700; }
.comp-table td:nth-child(3) { text-align: center; }
.comp-table td:last-child { text-align: right; }
.comp-table tr.selected { background: rgba(59,130,246,.1); color: #fff; }

/* ---- Size buttons ---- */
.size-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.size-btn {
  padding: .625rem 1rem; border-radius: .5rem; font-size: .875rem; font-weight: 800;
  border: 1px solid var(--slate-200); background: var(--slate-50);
  color: var(--slate-500); transition: all .15s;
}
.size-btn.active { background: var(--blue-600); color: #fff; border-color: var(--blue-600); box-shadow: 0 4px 8px -2px rgba(37,99,235,.3); }
.size-btn:hover:not(.active) { background: var(--slate-100); }

.type-btns { display: flex; gap: .5rem; }
.type-btn {
  flex: 1; padding: .75rem 1rem; border-radius: .5rem; font-size: .75rem; font-weight: 800;
  border: 1px solid var(--slate-200); background: var(--slate-50);
  color: var(--slate-500); transition: all .15s;
}
.type-btn.active { background: var(--blue-600); color: #fff; border-color: var(--blue-600); box-shadow: 0 4px 8px -2px rgba(37,99,235,.3); }
.type-btn:hover:not(.active) { background: var(--slate-100); }

/* ---- Spec cards in main page ---- */
.spec-inline-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1rem; }
@media(min-width:768px){ .spec-inline-grid { grid-template-columns: repeat(2,1fr); } }
@media(min-width:1024px){ .spec-inline-grid { grid-template-columns: repeat(4,1fr); } }
.spec-inline-item {
  border-left: 2px solid var(--blue-600); padding-left: 1rem; padding-top: .25rem; padding-bottom: .25rem;
  transition: background .15s; border-radius: 0 .5rem .5rem 0;
}
.spec-inline-item:hover { background: var(--slate-50); }
.spec-inline-item h4 { font-size: .875rem; font-weight: 900; color: var(--slate-800); }
.spec-inline-item .cpp { font-size: 1.125rem; font-weight: 700; color: var(--blue-600); }
.spec-inline-item p { font-size: 10px; color: var(--slate-500); margin-top: .25rem; }

/* ---- Spec pages ---- */
.spec-page-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.spec-icon { background: var(--blue-600); padding: .75rem; border-radius: .75rem; display: flex; box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.spec-icon svg { width: 1.5rem; height: 1.5rem; color: #fff; }
.spec-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width:768px){ .spec-grid { grid-template-columns: repeat(2,1fr); } }
@media(min-width:1024px){ .spec-grid { grid-template-columns: repeat(3,1fr); } }
.spec-section h2 { font-size: 1.125rem; font-weight: 800; color: var(--slate-800); display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.spec-section h2::before { content:''; display:block; width:6px; height:1.5rem; background:var(--blue-500); border-radius:99px; flex-shrink:0; }
.spec-table { background: var(--slate-50); border-radius: .75rem; overflow: hidden; }
.spec-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem .75rem; border-bottom: 1px solid var(--slate-100); transition: background .15s;
}
.spec-row:last-child { border-bottom: none; }
.spec-row:hover { background: var(--slate-100); }
.spec-row .sk { font-weight: 500; color: var(--slate-500); font-size: .875rem; }
.spec-row .sv { font-weight: 700; color: var(--slate-900); font-size: .875rem; }
.insight-box { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 1rem; padding: 1.5rem; margin-top: 2rem; }
.insight-box h3 { color: #1e3a8a; font-weight: 700; margin-bottom: .5rem; }
.insight-box p { color: #1d4ed8; font-size: .875rem; line-height: 1.6; }

/* ---- About page ---- */
.about-hero { text-align: center; padding: 3rem; background: #fff; border-radius: 1.5rem; border: 1px solid var(--slate-200); }
.about-hero .icon-wrap { display: inline-flex; background: var(--blue-100); padding: .75rem; border-radius: 1rem; margin-bottom: 1rem; }
.about-hero .icon-wrap svg { width: 2rem; height: 2rem; color: var(--blue-600); }
.about-hero h1 { font-size: clamp(2rem, 5vw, 3.75rem); font-weight: 900; color: var(--slate-900); letter-spacing: -.04em; margin-bottom: 1rem; }
.about-hero h1 span { color: var(--blue-600); }
.about-hero p { font-size: 1.125rem; color: var(--slate-600); max-width: 42rem; margin: 0 auto; line-height: 1.7; }
.about-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; }
@media(min-width:768px){ .about-grid { grid-template-columns: repeat(3,1fr); } }
.about-card { background: #fff; padding: 2rem; border-radius: 1rem; border: 1px solid var(--slate-200); }
.about-card .icon-wrap { display: inline-flex; padding: .75rem; border-radius: .75rem; margin-bottom: 1rem; }
.about-card h3 { font-size: 1.25rem; font-weight: 700; color: var(--slate-900); margin-bottom: .75rem; }
.about-card p { font-size: .875rem; color: var(--slate-600); line-height: 1.7; }
.story-section { background: var(--slate-900); color: #fff; padding: 2.5rem 4rem; border-radius: 1.5rem; position: relative; overflow: hidden; }
@media(max-width:640px){ .story-section { padding: 2rem 1.5rem; } }
.story-section::before { content:''; position:absolute; top:-8rem; right:-8rem; width:16rem; height:16rem; background:rgba(59,130,246,.1); border-radius:50%; filter:blur(3rem); }
.story-inner { max-width: 48rem; position: relative; z-index: 1; }
.story-kicker { display: flex; align-items: center; gap: .75rem; color: var(--blue-400); font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.story-kicker svg { width: 1.25rem; height: 1.25rem; }
.story-section h2 { font-size: 1.875rem; font-weight: 700; margin-bottom: 1.5rem; }
.story-section p { color: var(--slate-300); line-height: 1.7; margin-bottom: 1rem; }
.story-section strong { color: #fff; }

/* ---- Legal pages ---- */
.legal-page h1 { font-size: 1.875rem; font-weight: 900; color: var(--slate-900); margin-bottom: .5rem; text-decoration: underline; text-decoration-color: var(--blue-500); text-underline-offset: 8px; }
.legal-page .updated { color: var(--slate-600); margin-bottom: 2rem; }
.legal-page h2 { font-size: 1.25rem; font-weight: 700; color: var(--slate-800); margin-top: 2rem; margin-bottom: .75rem; }
.legal-page p { color: var(--slate-700); line-height: 1.7; margin-bottom: 1rem; }

/* ---- SEO sections ---- */
.seo-section { background: #fff; border: 1px solid var(--slate-200); border-radius: 1.5rem; padding: 2rem 3rem; }
@media(max-width:640px){ .seo-section { padding: 1.5rem 1rem; } }
.seo-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media(min-width:768px){ .seo-grid { grid-template-columns: 1fr 1fr; } }
.diameter-list { list-style: none; }
.diameter-list li { display: flex; gap: 1rem; margin-bottom: 1rem; }
.diameter-list .num { font-size: 1.125rem; font-weight: 900; color: var(--slate-200); flex-shrink: 0; width: 2.5rem; }
.diameter-list p { font-size: .875rem; color: var(--slate-600); font-weight: 500; line-height: 1.5; }
.why-box { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 1rem; padding: 1.5rem; }
.why-box h4 { color: var(--blue-600); font-size: .625rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.why-box p { font-size: .875rem; color: var(--slate-600); line-height: 1.6; margin-bottom: 1rem; }

/* ---- Calculator grid layout ---- */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width:768px){ .calc-grid { grid-template-columns: 1fr 1fr; } }
.calc-inputs { display: flex; flex-direction: column; gap: 2rem; }
.calc-results { display: flex; flex-direction: column; }

.input-section { background: var(--slate-50); border: 1px solid var(--slate-100); border-radius: 1rem; padding: 1.5rem; }
.input-section-title { font-size: .625rem; font-weight: 900; text-transform: uppercase; letter-spacing: .15em; color: var(--slate-400); margin-bottom: 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.action-row { display: flex; gap: .75rem; padding-top: .5rem; }

/* ---- Footer ad ---- */
.footer-ad-wrap { max-width: 56rem; margin: 0 auto 2rem; padding: 0 1rem; }

/* ---- Animations ---- */
@keyframes fadeInUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
.fade-in-up { animation: fadeInUp .5s ease forwards; }

/* ---- Nav ---- */
nav.main-nav {
  display: none;
}
@media(min-width:1024px){
  nav.main-nav {
    display: flex; align-items: center; gap: 1.5rem;
    font-size: .875rem; font-weight: 600; color: var(--slate-600);
  }
  nav.main-nav a:hover { color: var(--blue-600); }
}

/* ---- Mobile hamburger placeholder ---- */
.mobile-menu-toggle { display: flex; align-items: center; gap: .5rem; background: none; border: 1px solid var(--slate-200); border-radius: .5rem; padding: .5rem .75rem; color: var(--slate-600); font-size: .75rem; font-weight: 700; }
@media(min-width:1024px){ .mobile-menu-toggle { display: none; } }

/* ---- Utility ---- */
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.hidden { display: none !important; }

@media screen and (max-width: 600px) {
  #beverage-production-math table thead { display: none; }
  #beverage-production-math table, #beverage-production-math table tbody, 
  #beverage-production-math table tr, #beverage-production-math table td {
    display: block; width: 100%;
  }
  #beverage-production-math table tr {
    margin-bottom: 1rem; border: 1px solid var(--slate-200);
    border-radius: 8px; background: white;
  }
  #beverage-production-math table td {
    text-align: right; padding: 10px; position: relative;
    border: none; border-bottom: 1px solid var(--slate-50);
  }
  #beverage-production-math table td::before {
    content: attr(data-label); position: absolute;
    left: 10px; font-weight: 700; color: var(--slate-800);
  }
}