/* ==========================================================================
   PYRAMID VOLUME FORMULA & 3D CALCULATOR - DESIGN SYSTEM & STYLESHEET
   Aesthetics: Rich Obsidian, Radiant Gold/Amber, Electric Indigo & Glassmorphism
   Full Responsive Layout with Dark/Light Themes
   ========================================================================== */

:root {
  /* Color Palette - Egyptian Gold & Obsidian Dark Theme */
  --bg-base: #090d16;
  --bg-surface: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(245, 158, 11, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Primary Brand: Egyptian Gold / Amber */
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-light: #fbbf24;
  --primary-glow: rgba(245, 158, 11, 0.35);

  /* Secondary Accents: Electric Indigo & Cyan */
  --secondary: #6366f1;
  --secondary-hover: #4f46e5;
  --secondary-light: #818cf8;
  --secondary-glow: rgba(99, 102, 241, 0.3);

  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --input-bg: rgba(30, 41, 59, 0.8);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus: #f59e0b;

  --nav-bg: rgba(9, 13, 22, 0.88);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows & Elevation */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 35px rgba(245, 158, 11, 0.25);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --card-border: rgba(148, 163, 184, 0.22);
  --card-border-hover: rgba(217, 119, 6, 0.5);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-light: #f59e0b;
  --primary-glow: rgba(217, 119, 6, 0.25);

  --secondary: #4f46e5;
  --secondary-hover: #4338ca;
  --secondary-light: #6366f1;

  --input-bg: rgba(241, 245, 249, 0.9);
  --input-border: rgba(203, 213, 225, 0.9);
  --input-focus: #d97706;

  --nav-bg: rgba(255, 255, 255, 0.9);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 35px rgba(217, 119, 6, 0.15);
}

/* CSS Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-base);
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-base);
}

/* KaTeX adjustments */
.katex {
  font-size: 1.05em;
  color: inherit;
}
.katex-display {
  margin: 0.5em 0 !important;
}

/* Utility Containers */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Ambient Glow Orbs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  transition: opacity 0.5s ease;
}
.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.05) 70%, transparent 100%);
  top: -100px;
  right: -80px;
}
.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(6, 182, 212, 0.05) 70%, transparent 100%);
  top: 40%;
  left: -150px;
}
.glow-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  bottom: 5%;
  right: 10%;
}
[data-theme="light"] .ambient-glow {
  opacity: 0.25;
}

/* Glassmorphism Card Style */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}
.glass-card:hover {
  border-color: var(--card-border-hover);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.25;
  font-weight: 700;
}
.gradient-text {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #d97706 0%, #b45309 60%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-header {
  margin-bottom: 2.75rem;
}
.section-header.text-center {
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.section-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}
.section-title {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}
.section-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
}

/* Badges */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.badge-tag.gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-tag.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.badge-tag.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-tag.purple {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.badge-tag.rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #0b0f19;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--primary-glow);
}
.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--card-border);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
}
.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.9rem 1.8rem;
  font-size: 1.0625rem;
  border-radius: var(--radius-md);
}
.btn-arrow {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform 0.2s ease;
}
.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--card-border-hover);
}

/* ==========================================================================
   HEADER NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  transition: var(--transition);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.logo-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.logo-svg {
  width: 100%;
  height: 100%;
}
.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  display: block;
  line-height: 1.1;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
}
.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  padding: 0.25rem 0;
}
.nav-link:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.calculate-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 36px;
  padding: 0 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--radius-sm, 6px);
  line-height: 1;
}

.calculate-quick-btn span {
  white-space: nowrap;
  display: inline-block;
}

.btn-arrow,
.calculate-quick-btn .btn-arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.calculate-quick-btn:hover .btn-arrow {
  transform: translateX(3px);
}

@media (max-width: 1200px) and (min-width: 769px) {
  .calculate-quick-btn {
    height: 34px;
    padding: 0 0.8rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.hamburger-bar {
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  position: relative;
  z-index: 1;
}
.hero-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--primary-light);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: pulseAnim 2s infinite;
}
@keyframes pulseAnim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}
.hero-title {
  font-size: 3rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}
.hero-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}
.hero-formula-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
}
.formula-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.formula-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.formula-math {
  font-weight: 600;
  color: var(--text-main);
}
.formula-divider {
  width: 1px;
  height: 40px;
  background-color: var(--card-border);
}
.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.25rem;
}
.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.stat-pill {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.stat-number {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Hero Canvas Card */
.hero-canvas-card {
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
}
.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.canvas-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}
.canvas-tags {
  display: flex;
  gap: 0.4rem;
}
.canvas-viewport {
  position: relative;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.4) 0%, rgba(9, 13, 22, 0.9) 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  overflow: hidden;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}
.canvas-viewport:active {
  cursor: grabbing;
}
.canvas-viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-controls-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 5;
}
.btn-chip {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-chip.active, .btn-chip:hover {
  background: var(--primary);
  color: #0b0f19;
  border-color: var(--primary);
}
.canvas-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.canvas-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.apex-dot { background-color: #fef08a; }
.height-dot { background-color: #38bdf8; }
.base-dot { background-color: #f59e0b; }
.slant-dot { background-color: #34d399; }
.text-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}
.text-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   CALCULATOR SECTION
   ========================================================================== */
.calculator-section {
  padding: 4rem 0;
  position: relative;
  z-index: 1;
}

/* Mode Tabs */
.calc-tabs-wrapper {
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}
.calc-tabs {
  display: flex;
  gap: 0.5rem;
  min-width: max-content;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}
.calc-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.calc-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.calc-tab.active {
  background: var(--primary);
  color: #0b0f19;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.tab-icon {
  font-size: 1rem;
}

/* Calculator Grid */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Input Form Card */
.calc-inputs-card {
  padding: 2rem;
}
.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--card-border);
}
.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}
.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.preset-wrapper {
  min-width: 180px;
}
.custom-select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}
.custom-select:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

select option {
  background-color: #0b0f19;
  color: #f8fafc;
}

.preset-select {
  width: 100%;
  font-weight: 500;
  border-color: rgba(245, 158, 11, 0.45);
  background-color: #000000 !important;
  color: #ffffff !important;
  color-scheme: dark !important;
}

.preset-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
}

.preset-select option {
  background-color: #000000 !important;
  color: #ffffff !important;
  padding: 10px 14px;
}

.preset-select option:disabled {
  background-color: #080b12 !important;
  color: #fbbf24 !important;
  font-weight: 600;
}

.preset-select option:hover,
.preset-select option:checked {
  background-color: #291804 !important;
  color: #fef08a !important;
}

/* Dynamic Forms */
.calc-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group.flex-1 {
  flex: 1;
}
.label-with-tooltip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}
.math-symbol-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary-light);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
.input-with-slider {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.input-unit-group {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 0.5rem;
}
.calc-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}
.calc-input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.calc-options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
}
.small-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-actions-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.form-actions-row .btn svg {
  width: 16px;
  height: 16px;
}

/* Results & Visualizer Column */
.calc-results-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.visualizer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.vis-tabs {
  display: flex;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}
.vis-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.vis-tab.active {
  background: var(--primary);
  color: #0b0f19;
}
.vis-tools {
  display: flex;
  gap: 0.35rem;
}
.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
}
.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.calc-canvas-viewport {
  position: relative;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.5) 0%, rgba(9, 13, 22, 0.95) 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  overflow: hidden;
  height: 280px;
  margin-bottom: 1.25rem;
  cursor: grab;
}
.calc-canvas-viewport:active {
  cursor: grabbing;
}
.calc-canvas-viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Dynamic Live Dimension Badges */
.live-dimension-badge {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--card-border);
}
.badge-h {
  top: 12px;
  left: 12px;
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}
.badge-a {
  bottom: 12px;
  left: 12px;
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}
.badge-s {
  top: 12px;
  right: 12px;
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

/* Primary Result Banner */
.result-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.result-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.result-title-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.result-main-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}
.result-big-number {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.result-big-unit {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-light);
}
.result-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Companion Statistics Grid */
.companion-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}
.stat-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.stat-card .stat-formula {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Step Solution Panel */
.step-solution-panel {
  padding: 2rem;
  margin-top: 2rem;
}
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}
.step-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.step-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-icon svg {
  width: 22px;
  height: 22px;
}
.step-title {
  font-size: 1.25rem;
}
.step-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.step-content-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sol-step-item {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}
.sol-step-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 0.4rem;
}
.sol-step-math {
  font-size: 1rem;
  margin: 0.4rem 0;
}
.sol-step-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Multi-Unit Conversions */
.unit-conversion-wrapper {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-border);
}
.conversions-title {
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}
.conversions-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.conv-chip {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}
.conv-unit-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.conv-unit-val {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.2rem;
}

/* ==========================================================================
   DERIVATION / WATER POURING SIMULATION
   ========================================================================== */
.derivation-section {
  padding: 4.5rem 0;
  position: relative;
  z-index: 1;
}
.proof-interactive-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
}
.proof-simulator-card {
  padding: 2rem;
}
.sim-header {
  margin-bottom: 1.5rem;
}
.sim-title {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}
.sim-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.sim-canvas-stage {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sim-stage-visual {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.station-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 0.75rem;
}
.station-meter {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}
.pyr-liquid-container, .prism-liquid-container {
  width: 140px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sim-svg-pyr, .sim-svg-prism {
  width: 100%;
  height: 100%;
}
.sim-stream-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.water-stream {
  width: 4px;
  height: 60px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.water-stream.flowing {
  opacity: 1;
  animation: flowStream 0.6s infinite linear;
}
@keyframes flowStream {
  0% { transform: scaleY(0.8); }
  50% { transform: scaleY(1.1); }
  100% { transform: scaleY(0.8); }
}
.arrow-indicator {
  font-size: 1.5rem;
  color: var(--primary);
  margin-top: 0.5rem;
}

.sim-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.sim-counter-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.pour-step-pill {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.pour-step-pill.completed {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 700;
}

/* Proof Explanation Card */
.proof-explanation-card {
  padding: 2rem;
}
.expl-title {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}
.expl-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
}
.expl-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}
.expl-tab.active {
  background: var(--primary);
  color: #0b0f19;
}
.expl-lead {
  font-size: 1rem;
  margin-bottom: 1rem;
}
.expl-points {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.math-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1rem 0;
}
.expl-footer-note {
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 1rem;
}

/* ==========================================================================
   FORMULA MATRIX & CHEAT SHEET
   ========================================================================== */
.formulas-section {
  padding: 4.5rem 0;
  position: relative;
  z-index: 1;
}
.formulas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.formula-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.formula-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.pill-gold { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-cyan { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.pill-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.pill-purple { background: rgba(139, 92, 246, 0.15); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }
.pill-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.pill-amber { background: rgba(217, 119, 6, 0.15); color: #f59e0b; border: 1px solid rgba(217, 119, 6, 0.3); }

.card-abbr {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}
.formula-expression {
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
  color: var(--primary-light);
}
.formula-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.formula-variables {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.8125rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ==========================================================================
   ANATOMY & NET SECTION
   ========================================================================== */
.anatomy-section {
  padding: 4.5rem 0;
  position: relative;
  z-index: 1;
}
.anatomy-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
}
.anatomy-card {
  padding: 2rem;
}
.anatomy-title {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}
.anatomy-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.anatomy-table-wrapper {
  overflow-x: auto;
}
.anatomy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.anatomy-table th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-muted);
  font-weight: 600;
}
.anatomy-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}
.net-svg-wrapper {
  width: 100%;
  max-width: 280px;
  margin: 0 auto 1.25rem;
}
.net-svg {
  width: 100%;
  height: auto;
  display: block;
}
.net-summary-pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--primary-light);
  font-weight: 600;
}

/* ==========================================================================
   WORKED EXAMPLES SECTION
   ========================================================================== */
.examples-section {
  padding: 4.5rem 0;
  position: relative;
  z-index: 1;
}
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.75rem;
}
.example-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}
.example-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ex-number {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ex-title {
  font-size: 1.125rem;
  margin-bottom: 0.2rem;
}
.ex-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ex-problem {
  font-size: 0.9375rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.ex-solution-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
}
.step-num {
  font-weight: 700;
  color: var(--primary-light);
}
.ex-step.highlight {
  background: rgba(245, 158, 11, 0.1);
  padding: 0.6rem;
  border-radius: 4px;
  border-left: 3px solid var(--primary);
  color: var(--text-main);
}
.load-example-btn {
  margin-top: auto;
  width: 100%;
}

/* ==========================================================================
   QUIZ SECTION
   ========================================================================== */
.quiz-section {
  padding: 4.5rem 0;
  position: relative;
  z-index: 1;
}
.quiz-card {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem;
}
.quiz-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--card-border);
}
.quiz-score-pill, .quiz-streak-pill {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
}
.quiz-question-box {
  margin-bottom: 2rem;
}
.quiz-q-num {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.5rem;
}
.quiz-q-text {
  font-size: 1.35rem;
  line-height: 1.4;
}
.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.quiz-opt-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.quiz-opt-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.1);
  transform: translateY(-2px);
}
.quiz-opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
}
.quiz-opt-btn.correct {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}
.quiz-opt-btn.incorrect {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #fb7185;
}

.quiz-feedback-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.feedback-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.feedback-icon.wrong {
  background: #f43f5e;
}
.feedback-heading {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.feedback-explanation {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FAQ ACCORDION SECTION
   ========================================================================== */
.faq-section {
  padding: 4.5rem 0;
  position: relative;
  z-index: 1;
}
.faq-accordion-wrapper {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.faq-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1.35rem 1.75rem;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
}
.faq-chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  color: var(--primary);
}
.faq-question[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 1.75rem;
}
.faq-question[aria-expanded="true"] + .faq-answer {
  max-height: 400px;
  padding-bottom: 1.5rem;
}
.faq-answer p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: rgba(9, 13, 22, 0.95);
  border-top: 1px solid var(--card-border);
  padding: 4.5rem 0 2rem;
  position: relative;
  z-index: 1;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 1fr 1.3fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
  align-items: start;
}
.footer-col,
.footer-brand-col,
.footer-formula-col,
.footer-pages-col,
.footer-lang-col {
  display: flex;
  flex-direction: column;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.logo-icon-wrapper.small {
  width: 32px;
  height: 32px;
}
.footer-brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.footer-badges {
  display: flex;
  gap: 0.5rem;
}
.footer-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-math-pill {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm, 6px);
  padding: 0.65rem 1rem;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main, #ffffff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.footer-math-note {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
}

/* 18-Language Selector Grid */
.footer-lang-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  max-width: 270px;
  width: 100%;
}
.lang-btn {
  height: 32px;
  min-width: 36px;
  padding: 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-sans);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}
.lang-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.lang-btn.active {
  background: #f59e0b;
  color: #0b0f19;
  font-weight: 800;
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
}

/* Hide Google Translate toolbar banners to keep website pristine */
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget-simple,
#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
}
body {
  top: 0 !important;
}
.skiptranslate {
  display: none !important;
}
#google_translate_element {
  display: none !important;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8125rem;
  color: var(--text-dim);
}
.footer-meta-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-meta-links a:hover {
  color: var(--primary);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-visual {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .proof-interactive-grid {
    grid-template-columns: 1fr;
  }
  .anatomy-grid {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.25rem;
  }
  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--card-border);
    padding: 1.5rem;
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .nav-menu.open {
    display: block;
  }
  .nav-list {
    flex-direction: column;
    gap: 1rem;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .header-cta,
  .calculate-quick-btn {
    display: none;
  }
  .hero-formula-strip {
    flex-direction: column;
    gap: 0.75rem;
  }
  .formula-divider {
    display: none;
  }
  .calc-options-row {
    grid-template-columns: 1fr;
  }
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MORE CALCULATORS CLUSTER GRID (MATCHING CONE VOLUME FORMULA)
   ========================================================================== */
.more-calculators-section {
  position: relative;
  padding: 5rem 0 4.5rem 0;
  z-index: 1;
}

.more-calcs-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.75rem;
}

.more-filter-btn {
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.more-filter-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(30, 41, 59, 0.85);
}

.more-filter-btn.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #fbbf24;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}

.more-calcs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}

@media (max-width: 1100px) {
  .more-calcs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .more-calcs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .more-calcs-grid {
    grid-template-columns: 1fr;
  }
}

.home-calc-card {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.85rem 1.25rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 165px;
  gap: 1.15rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.home-calc-card:hover,
.home-calc-card:focus-visible {
  border-color: #f59e0b;
  border-width: 1px;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35), inset 0 0 15px rgba(245, 158, 11, 0.08);
  transform: translateY(-4px);
}

.home-calc-icon-wrap {
  width: 68px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.home-calc-icon-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.25s ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.home-calc-card:hover .home-calc-icon-wrap svg {
  transform: scale(1.1);
}

.home-calc-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.home-calc-card:hover .home-calc-title {
  color: #ffffff;
}

.home-calc-card.active-calc-card {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35), inset 0 0 15px rgba(245, 158, 11, 0.1);
  cursor: default;
}

.home-calc-card.active-calc-card:hover {
  transform: none;
}

.home-calc-card.active-calc-card .home-calc-title {
  color: #fbbf24;
}

.calc-current-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: #f59e0b;
  color: #0f172a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.more-calcs-cta-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(56, 189, 248, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg, 20px);
  padding: 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.5rem;
}


/* Print Styles */
@media print {
  .ambient-glow, .site-header, .site-footer, .hero-controls-overlay,
  .vis-tools, .form-actions-row, .preset-wrapper, .quiz-section {
    display: none !important;
  }
  body, html {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .glass-card {
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }
}
