/* ============================================================
   SQUARE FOOT STUDIO — PREMIUM DARK THEME
   ============================================================ */

/* --- Design Tokens --- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1424;
    --bg-tertiary: #141a2e;
    --surface: rgba(20, 26, 46, 0.65);
    --surface-hover: rgba(28, 36, 64, 0.8);
    --surface-elevated: rgba(22, 30, 54, 0.85);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.14);

    --ink: #e8ecf4;
    --ink-secondary: #9ba4b8;
    --ink-muted: #6b7490;
    --ink-faint: #4a5168;

    --accent-start: #00d4ff;
    --accent-end: #7c3aed;
    --accent-gradient: linear-gradient(135deg, var(--accent-start), #6366f1, var(--accent-end));
    --accent-glow: rgba(99, 102, 241, 0.3);
    --accent-soft: rgba(99, 102, 241, 0.08);

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 8px 32px rgba(99, 102, 241, 0.25);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 999px;

    --font-sans: "Inter", "Manrope", system-ui, -apple-system, sans-serif;
    --font-display: "Space Grotesk", "Inter", sans-serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 0.15s var(--ease-out);
    --transition-base: 0.25s var(--ease-out);
    --transition-slow: 0.4s var(--ease-out);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--bg-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Ambient Background Effects --- */
.page-glow, .texture-grid {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

.page-glow {
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    animation: orbFloat 20s ease-in-out infinite;
}

.page-glow-one {
    width: 500px;
    height: 500px;
    top: -120px;
    right: -100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), rgba(124, 58, 237, 0.15), transparent 70%);
    animation-delay: 0s;
}

.page-glow-two {
    width: 600px;
    height: 600px;
    left: -200px;
    top: 40%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2), rgba(99, 102, 241, 0.1), transparent 70%);
    animation-delay: -7s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-15px, 25px) scale(0.95); }
    75% { transform: translate(20px, 15px) scale(1.02); }
}

.texture-grid {
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 60%);
}

/* --- Layout Containers --- */
.hero,
.content-strip,
.page-shell,
.site-footer {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
}

.hero {
    width: min(1240px, calc(100% - 40px));
}

.calculator-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 auto;
    padding: 40px 28px 34px;
    border-radius: var(--radius-2xl);
    background: linear-gradient(180deg, rgba(20, 26, 46, 0.9), rgba(15, 20, 36, 0.95));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 4px 0 0 rgba(99, 102, 241, 0.55);
    backdrop-filter: blur(20px);
    min-height: calc(100vh - 102px);
}

/* --- Navbar --- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 48px;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}

.brand:hover { opacity: 0.85; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
}

.brand-mark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent 60%);
    border-radius: inherit;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    color: var(--ink-secondary);
    font-weight: 600;
    font-size: 0.82rem;
    transition: all var(--transition-fast);
}

.nav-links a:hover {
    color: var(--ink);
    background: var(--glass);
}

/* --- Nav Dropdown (Regional Calculators) --- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    color: var(--ink-secondary);
    font-weight: 600;
    font-size: 0.82rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-dropdown-toggle:hover {
    color: var(--ink);
    background: var(--glass);
}

.nav-dropdown-toggle .dropdown-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform var(--transition-fast);
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-toggle .dropdown-label {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(6px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-xs);
    color: var(--ink-secondary) !important;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.nav-dropdown-menu a:hover {
    background: var(--glass) !important;
    color: var(--ink) !important;
    border-color: var(--glass-border);
}

/* --- Grid Systems --- */
.hero-content,
.calculator-layout,
.lead-grid,
.preview-metrics,
.shape-grid,
.inputs-grid,
.addons-grid,
.results-grid,
.formula-grid,
.use-case-grid,
.footer-grid,
.page-grid {
    display: grid;
    gap: 16px;
}

/* --- Hero Section --- */
.hero-content {
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: 48px;
    align-items: center;
    padding: 48px 0 56px;
}

.eyebrow,
.mini-label,
.tile-kicker {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h1,
.page-hero h1 {
    font-family: var(--font-display);
    margin: 14px 0 18px;
    font-size: clamp(2.4rem, 4.5vw, 4.6rem);
    line-height: 1.0;
    letter-spacing: -0.045em;
    font-weight: 700;
}

.hero h1 {
    max-width: none;
}

/* gradient text for hero h1 */
.hero h1 {
    background: linear-gradient(135deg, #fff 20%, var(--accent-start) 50%, var(--accent-end) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text,
.page-intro,
.footer-copy,
.lead-card p,
.use-card p,
.info-tile p,
.summary-card,
.steps-list,
.faq-item p,
.prose-card p,
.prose-card li,
.contact-list li {
    color: var(--ink-secondary);
    line-height: 1.8;
}

.hero-text {
    max-width: 560px;
    font-size: 1.05rem;
    line-height: 1.85;
}

.hero-pills, .cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-pills { margin-top: 28px; }
.cta-row { margin-top: 28px; }

.hero-pills span {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink-secondary);
    transition: all var(--transition-fast);
}

.hero-pills span:hover {
    border-color: var(--glass-border-hover);
    background: var(--surface);
}

.primary-link, .secondary-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 700;
    transition: all var(--transition-base);
}

.primary-link {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
}

.primary-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.primary-link:hover::before { opacity: 1; }
.primary-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.35);
}

.secondary-link {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink-secondary);
}

.secondary-link:hover {
    border-color: var(--glass-border-hover);
    color: var(--ink);
    transform: translateY(-2px);
}

/* --- Hero Preview Card --- */
.preview-card {
    padding: 24px;
    border-radius: var(--radius-xl);
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-gradient);
    opacity: 0.5;
}

.hero-preview {
    align-self: stretch;
}

.hero-preview-copy {
    margin: 16px 0 0;
    color: var(--ink-muted);
    line-height: 1.7;
    font-size: 0.9rem;
}

.preview-topline, .diagram-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--ink-muted);
    font-size: 0.82rem;
    gap: 16px;
}

.preview-metrics {
    grid-template-columns: repeat(2, 1fr);
    margin: 20px 0 22px;
}

.preview-metrics div {
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.preview-metrics strong, .metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-family: var(--font-display);
}

.preview-metrics span,
.metric-label,
.metric-unit {
    font-size: 0.82rem;
    color: var(--ink-muted);
    font-weight: 600;
}

.preview-graph, .shape-stage {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.preview-graph {
    height: 200px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.06), rgba(0, 212, 255, 0.03));
}

.graph-room {
    position: absolute;
    inset: 44px 60px 48px 50px;
    border: 2px solid rgba(99, 102, 241, 0.5);
    border-radius: var(--radius-xs);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.08);
}

.graph-label, .shape-axis {
    position: absolute;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-muted);
}

.graph-label-x {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
}

.graph-label-y, .shape-axis-right {
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
}

/* --- Section & Card Shared Styles --- */
.panel,
.info-tile,
.use-card,
.lead-card,
.table-card,
.faq-item,
.prose-card {
    backdrop-filter: blur(16px);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.panel,
.lead-card,
.table-card,
.prose-card {
    border-radius: var(--radius-xl);
}

.info-tile,
.use-card,
.faq-item {
    border-radius: var(--radius-md);
}

.info-tile:hover,
.use-card:hover,
.lead-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* --- Section Headings --- */
.section-heading {
    margin-bottom: 32px;
}

.section-heading h2,
.prose-card h2 {
    font-family: var(--font-display);
    margin: 10px 0 0;
    font-size: clamp(1.6rem, 2.5vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 700;
}

.content-strip, .intro-strip, .page-shell {
    padding-bottom: 80px;
}

/* --- Calculator Intro --- */
.calculator-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.calc-intro-title {
    font-size: clamp(32px, 4.2vw, 64px);
    font-weight: 800;
    font-family: var(--font-display);
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 6px 0 4px;
    white-space: nowrap;
    background: linear-gradient(135deg, #fff 20%, var(--accent-start) 50%, var(--accent-end) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calculator-intro-copy {
    margin: 0 auto;
    color: var(--ink-secondary);
    line-height: 1.45;
    font-size: 1rem;
    font-weight: 700;
    max-width: 720px;
    text-align: center;
}

/* --- Calculator Layout --- */
.calculator-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.panel {
    padding: 28px;
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.panel-heading,
.results-header,
.steps-card-header,
.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-badge,
.results-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--accent-soft);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--accent-start);
    letter-spacing: 0.04em;
}

.panel h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --- Shape Grid --- */
.control-group + .control-group,
.toggle-row,
.inputs-grid,
.addons-grid,
.action-row,
.summary-card,
.steps-card {
    margin-top: 22px;
}

.group-label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.shape-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.shape-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 96px;
    padding: 14px 10px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass);
    color: var(--ink-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    transition: all var(--transition-base);
}

.shape-chip:hover {
    border-color: var(--glass-border-hover);
    background: var(--surface);
    transform: translateY(-2px);
    color: var(--ink);
}

.shape-chip.active {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.08));
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--ink);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Shape Icons --- */
.shape-icon {
    position: relative;
    width: 26px;
    height: 26px;
}

.rectangle-icon::before,
.circle-icon::before,
.triangle-icon::before,
.trapezoid-icon::before,
.lshape-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid currentColor;
}

.rectangle-icon::before { border-radius: 4px; }
.circle-icon::before { border-radius: 50%; }

.triangle-icon {
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-bottom: 24px solid currentColor;
}

.triangle-icon::before { display: none; }

.trapezoid-icon {
    width: 28px;
    height: 20px;
}

.trapezoid-icon::before {
    inset: 2px;
    clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}

.lshape-icon::before {
    clip-path: polygon(0 0, 70% 0, 70% 30%, 100% 30%, 100% 100%, 0 100%);
    border-radius: 4px;
}

/* --- Toggle Row --- */
.toggle-row {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 16px;
}

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.segment {
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--ink-muted);
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    transition: all var(--transition-base);
}

.segment:hover {
    border-color: var(--glass-border-hover);
    color: var(--ink-secondary);
    transform: translateY(-1px);
}

.segment.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-accent);
}

.segmented-wrap .segment {
    min-width: 52px;
    text-align: center;
}

/* --- Input Fields --- */
.inputs-grid,
.addons-grid,
.results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.formula-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.use-case-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.field-card:focus-within {
    border-color: rgba(99, 102, 241, 0.3);
}

.field-card span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink-muted);
}

.field-card input,
.field-card select,
.prose-card input,
.prose-card textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(10, 14, 26, 0.6);
    color: var(--ink);
    outline: none;
    transition: all var(--transition-fast);
    font-size: 0.95rem;
}

.field-card input:focus,
.field-card select:focus,
.prose-card input:focus,
.prose-card textarea:focus {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.field-card input::placeholder,
.prose-card input::placeholder,
.prose-card textarea::placeholder {
    color: var(--ink-faint);
}

.input-shell {
    position: relative;
}

.input-shell input {
    padding-right: 60px;
}

.unit-tag {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-start);
}

.unit-tag.muted {
    color: var(--ink-muted);
}

/* --- Action Buttons --- */
.action-row {
    display: flex;
    gap: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    border-radius: var(--radius-sm);
    font-weight: 700;
    border: 1px solid transparent;
    transition: all var(--transition-base);
}

.primary-btn {
    flex: 1;
    padding: 14px 22px;
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
}

.primary-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.primary-btn:hover::before { opacity: 1; }
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.35);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn,
.ghost-btn {
    background: var(--glass);
    border-color: var(--glass-border);
    color: var(--ink-secondary);
}

.secondary-btn {
    padding: 14px 18px;
    font-size: 0.95rem;
}

.secondary-btn:hover,
.ghost-btn:hover {
    border-color: var(--glass-border-hover);
    color: var(--ink);
    transform: translateY(-1px);
}

.ghost-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.form-note {
    margin: 14px 0 0;
    color: var(--ink-muted);
    font-size: 0.85rem;
}

/* --- Results Panel --- */
.diagram-card,
.summary-card,
.steps-card {
    padding: 18px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--glass);
}

.shape-stage {
    height: 240px;
    margin-top: 14px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05), rgba(0, 212, 255, 0.02));
}

.shape-display {
    position: absolute;
    left: 42px;
    right: 72px;
    top: 36px;
    bottom: 44px;
    border: 2px solid rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.06);
}

.shape-display.rectangle { border-radius: 8px; }

.shape-display.circle {
    left: 56px;
    right: 86px;
    top: 32px;
    bottom: 32px;
    border-radius: 50%;
}

.shape-display.triangle {
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: transparent;
}

.shape-display.trapezoid {
    clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}

.shape-display.lshape {
    clip-path: polygon(0 0, 75% 0, 75% 30%, 100% 30%, 100% 100%, 0 100%);
}

.shape-axis-bottom {
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
}

/* --- Metric Cards --- */
.metric-card {
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-fast);
}

.metric-card:hover {
    border-color: var(--glass-border-hover);
}

.metric-card.accent {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(0, 212, 255, 0.06));
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-glow);
}

.metric-card.accent .metric-value {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.steps-list {
    margin: 16px 0 0;
    padding-left: 20px;
    color: var(--ink-secondary);
}

.steps-list li {
    margin-bottom: 6px;
}

/* --- Lead Cards --- */
.lead-card,
.table-card,
.prose-card {
    padding: 24px;
}

.lead-card h3,
.use-card h3,
.info-tile h3 {
    font-family: var(--font-display);
    margin: 0 0 10px;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.info-tile,
.use-card {
    padding: 20px;
}

/* gradient accent line on top of info tiles */
.info-tile {
    position: relative;
    overflow: hidden;
}

.info-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.info-tile:hover::before { opacity: 1; }

/* --- Table --- */
.table-card {
    overflow-x: auto;
    padding: 0 20px;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
    text-align: left;
}

tr:last-child td {
    border-bottom: none;
}

th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-start);
    font-weight: 700;
}

td {
    color: var(--ink-secondary);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--glass);
}

/* --- FAQ --- */
.faq-list {
    display: grid;
    gap: 12px;
}

.faq-item {
    padding: 18px 22px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color var(--transition-fast);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--ink-muted);
    transition: transform var(--transition-base);
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item[open] summary::after {
    content: '−';
    color: var(--accent-start);
}

.faq-item summary:hover {
    color: var(--accent-start);
}

.faq-item p {
    margin: 14px 0 0;
}

.faq-item[open] {
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.03);
}

/* --- Footer --- */
.site-footer {
    padding: 20px 0 52px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr 0.7fr 0.7fr;
    align-items: start;
    justify-content: stretch;
    padding: 32px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    gap: 24px;
}

.footer-grid div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
}

.footer-grid h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
}

.footer-grid a {
    display: block;
    color: var(--ink-muted);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-grid a:hover {
    color: var(--accent-start);
}

.footer-social {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px !important;
    margin-top: 8px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink-muted);
    transition: all var(--transition-base);
}

.footer-social a:hover {
    color: var(--accent-start);
    border-color: rgba(99, 102, 241, 0.3);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.footer-copy {
    max-width: 420px;
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    color: var(--ink-faint);
    margin: 20px 0 0;
    font-size: 0.85rem;
}

/* --- Sub-Pages --- */
.page-shell {
    padding-top: 10px;
}

.page-hero {
    padding: 24px 0 48px;
}

.page-hero h1 {
    max-width: 14ch;
    background: linear-gradient(135deg, #fff 30%, var(--accent-start) 70%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-intro {
    max-width: 680px;
    font-size: 1.05rem;
}

.page-grid {
    grid-template-columns: 1fr 300px;
    align-items: start;
}

.prose-card h2 {
    margin-bottom: 14px;
}

.prose-card ul {
    margin: 0;
    padding-left: 20px;
}

.prose-card ul li {
    margin-bottom: 6px;
}

.sidebar-card {
    padding: 22px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.sidebar-card h3 {
    margin-top: 0;
    font-family: var(--font-display);
    font-weight: 700;
}

.sidebar-card a {
    display: block;
    margin-top: 8px;
    color: var(--accent-start);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.sidebar-card a:hover {
    color: var(--ink);
}

/* --- Contact Form --- */
.contact-list {
    margin: 0;
    padding-left: 20px;
}

.contact-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.contact-form button {
    width: fit-content;
}

/* --- Toast --- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 22px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--shadow-accent);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s var(--ease-spring);
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Mobile Menu --- */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink);
    font-size: 1.4rem;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--surface);
    border-color: var(--glass-border-hover);
}

/* --- Scroll Reveal Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-strip {
    animation: fadeInUp 0.6s var(--ease-out) both;
}

.content-strip:nth-child(2) { animation-delay: 0.1s; }
.content-strip:nth-child(3) { animation-delay: 0.2s; }
.content-strip:nth-child(4) { animation-delay: 0.3s; }
.content-strip:nth-child(5) { animation-delay: 0.4s; }

/* --- Responsive: Tablet --- */
@media (max-width: 1100px) {
    .shape-grid,
    .formula-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .hero-content,
    .calculator-intro,
    .calculator-layout,
    .toggle-row,
    .formula-grid,
    .use-case-grid,
    .lead-grid,
    .page-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding: 36px 0 44px;
        gap: 32px;
    }

    .hero h1 { max-width: none; }
}

/* --- Responsive: Mobile --- */
@media (max-width: 720px) {
    body { font-size: 14px; }

    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }

    .shape-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inputs-grid,
    .addons-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .action-row {
        flex-direction: column;
    }

    .hero,
    .calculator-shell,
    .content-strip,
    .page-shell,
    .site-footer {
        width: min(100% - 24px, 1280px);
    }

    .calculator-shell {
        padding: 20px 18px 28px;
        border-radius: var(--radius-xl);
    }

    .panel,
    .preview-card,
    .lead-card,
    .table-card,
    .prose-card,
    .sidebar-card {
        padding: 18px;
    }

    .hero-content {
        padding-top: 20px;
    }

    .hero h1,
    .page-hero h1 {
        max-width: none;
        font-size: clamp(2rem, 7vw, 3.2rem);
    }

    .formula-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        padding: 24px;
    }

    .page-glow-one { width: 300px; height: 300px; }
    .page-glow-two { width: 350px; height: 350px; }
}

/* --- Mobile Menu Overlay --- */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(360px, 85vw);
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--glass-border);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease-out);
    overflow-y: auto;
}

.mobile-menu-overlay.open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink);
    transition: all var(--transition-fast);
}

.mobile-menu-close:hover {
    background: var(--surface);
    border-color: var(--glass-border-hover);
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-menu-links a {
    display: block;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink-secondary);
    transition: all var(--transition-fast);
}

.mobile-menu-links a:hover {
    background: var(--glass);
    color: var(--ink);
}

/* --- Footer Social Icons --- */
.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink-muted);
    transition: all var(--transition-base);
}

.footer-social a:hover {
    background: var(--accent-soft);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-start);
    transform: translateY(-2px);
}

/* --- Language Switcher --- */
.locale-switcher {
    margin-top: 24px;
    padding: 20px 32px;
    border-radius: var(--radius-xl);
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.locale-switcher-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-muted);
    margin-bottom: 12px;
}

.locale-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.locale-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-fast);
}

.locale-link:hover {
    color: var(--ink);
    border-color: var(--glass-border-hover);
    background: var(--surface);
}

.locale-link.active {
    background: var(--accent-soft);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-start);
}

/* --- RTL Support (Arabic) --- */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] .navbar {
    flex-direction: row-reverse;
}

html[dir="rtl"] .brand {
    flex-direction: row-reverse;
}

html[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

html[dir="rtl"] .mobile-menu-panel {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--glass-border);
    transform: translateX(-100%);
}

html[dir="rtl"] .mobile-menu-overlay.open .mobile-menu-panel {
    transform: translateX(0);
}

html[dir="rtl"] .hero-content {
    direction: rtl;
}

html[dir="rtl"] .input-shell input {
    padding-right: 14px;
    padding-left: 60px;
}

html[dir="rtl"] .unit-tag {
    right: auto;
    left: 12px;
}

html[dir="rtl"] .steps-list {
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] .prose-card ul {
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] .contact-list {
    padding-left: 0;
    padding-right: 20px;
}

/* --- Body scroll lock when menu open --- */
body.menu-open {
    overflow: hidden;
}

/* --- Responsive Mobile Menu --- */
@media (max-width: 720px) {
    .locale-switcher {
        padding: 16px 20px;
    }

    .locale-link {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

/* --- Selection Color --- */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--ink-faint);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ink-muted);
}

/* --- Focus Visible for accessibility --- */
:focus-visible {
    outline: 2px solid var(--accent-start);
    outline-offset: 2px;
}

/* ============================================================
   COMPACT CALCULATOR REDESIGN (cc- prefix)
   ============================================================ */

/* --- Compact Wrapper (two-column grid inside calculator-shell) --- */
.calc-compact-wrap {
    display: grid;
    grid-template-columns: minmax(0, 2.25fr) minmax(280px, 0.95fr);
    gap: 16px;
    align-items: start;
    max-width: 100%;
    margin: 0 auto;
}

/* --- Form Panel --- */
.calc-compact-form {
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Label --- */
.cc-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 6px;
}

.cc-label-sub {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-faint);
}

/* --- Field --- */
.cc-field {
    display: flex;
    flex-direction: column;
}

.cc-field-grow {
    flex: 1;
    min-width: 0;
}

.cc-quantity-row {
    align-items: flex-end;
}

.cc-quantity-field {
    width: min(180px, 100%);
}

/* --- Horizontal Row of Fields --- */
.cc-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* --- Shape Buttons --- */
.cc-shapes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.cc-shape {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--glass);
    color: var(--ink-secondary);
    font-size: 0.65rem;
    font-weight: 700;
    transition: all var(--transition-fast);
    cursor: pointer;
    min-height: 50px;
    line-height: 1.2;
    text-align: center;
}

.cc-shape:hover {
    border-color: var(--glass-border-hover);
    background: var(--surface);
    color: var(--ink);
}

.cc-shape.active {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.08));
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--ink);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15);
}

.cc-shape svg {
    flex-shrink: 0;
    display: block;
    width: 22px;
    height: 18px;
}

/* --- Border Toggle --- */
.cc-toggle {
    display: inline-flex;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cc-toggle-btn {
    padding: 6px 13px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-muted);
    border: none;
    background: none;
    font-family: inherit;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.cc-toggle-btn + .cc-toggle-btn {
    border-left: 1px solid var(--glass-border);
}

.cc-toggle-btn.active {
    background: var(--accent-gradient);
    color: #fff;
}

/* --- Unit Buttons --- */
.cc-units {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cc-unit {
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-muted);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    background: var(--glass);
    font-family: inherit;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.cc-unit:hover {
    border-color: var(--glass-border-hover);
    color: var(--ink-secondary);
}

.cc-unit.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}

/* --- Dimension Inputs --- */
.cc-dims {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cc-dim {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cc-dim-inputs {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.cc-dim-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition-fast);
    flex: 1;
}

.cc-dim-input-wrap:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.09);
}

.cc-dim-secondary {
    flex: 0 0 auto;
}

.cc-dim-input-wrap input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    background: none;
    border: none;
    color: var(--ink);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
}

.cc-dim-input-wrap input::placeholder {
    color: var(--ink-faint);
}

.cinput-unit {
    padding: 0 9px 0 2px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ink-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Generic Input --- */
.cc-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.cc-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.09);
}

.cc-input::placeholder {
    color: var(--ink-faint);
}

.cc-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7490' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

/* --- Input Group (prefix/suffix) --- */
.cc-input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.cc-input-group:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.09);
}

.cc-prefix, .cc-suffix {
    display: flex;
    align-items: center;
    padding: 0 9px;
    background: rgba(10, 14, 26, 0.85);
    color: var(--ink-muted);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.cc-input-mid {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
}

.cc-input-mid:focus {
    box-shadow: none;
}

.cc-input-end {
    border: none;
    border-radius: 0;
    border-left: 1px solid var(--glass-border);
    background-color: rgba(10, 14, 26, 0.85);
    flex: 0 0 auto;
    width: auto;
}

.cc-input-end:focus {
    box-shadow: none;
}

/* --- Optional / Collapsible Sections --- */
.cc-optional {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cc-opt-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--ink-secondary);
    user-select: none;
    list-style: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    gap: 10px;
}

.cc-opt-summary::-webkit-details-marker { display: none; }
.cc-opt-summary::marker { display: none; }

.cc-opt-summary:hover {
    color: var(--ink);
    background: var(--glass);
}

.cc-optional[open] > .cc-opt-summary {
    border-bottom: 1px solid var(--glass-border);
    background: var(--glass);
}

.cc-opt-tag {
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--ink-muted);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    padding: 2px 7px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    flex-shrink: 0;
}

.cc-opt-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Action Buttons --- */
.cc-buttons {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.cc-calc-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
}

.cc-calc-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.cc-calc-btn:hover::before { opacity: 1; }
.cc-calc-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(99,102,241,0.35); }
.cc-calc-btn:active { transform: translateY(0); }

.cc-reset-btn {
    padding: 10px 16px;
    background: var(--glass);
    color: var(--ink-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cc-reset-btn:hover {
    border-color: var(--glass-border-hover);
    color: var(--ink);
}

.cc-note {
    font-size: 0.76rem;
    color: var(--ink-faint);
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* --- Results Panel --- */
.calc-compact-results {
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    position: sticky;
    top: 20px;
}

/* --- Shape Diagram --- */
.cc-diagram {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cc-diagram-stage {
    position: relative;
    height: 106px;
    background: linear-gradient(160deg, rgba(99,102,241,0.06), rgba(0,212,255,0.03));
}

.cc-shape-vis {
    position: absolute;
}

.cc-shape-vis.rectangle {
    inset: 22px 38px 26px 38px;
    border: 2px solid rgba(99, 102, 241, 0.55);
    border-radius: 3px;
    background: rgba(99, 102, 241, 0.1);
}

.cc-shape-vis.lshape {
    inset: 18px 32px 22px 32px;
    border: none;
    background: rgba(99, 102, 241, 0.15);
    clip-path: polygon(0% 0%, 65% 0%, 65% 38%, 100% 38%, 100% 100%, 0% 100%);
}

.cc-shape-vis.circle {
    inset: 14px 50px;
    border: 2px solid rgba(99, 102, 241, 0.55);
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
}

.cc-shape-vis.triangle {
    inset: 18px 34px 22px 34px;
    border: none;
    background: rgba(99, 102, 241, 0.18);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.cc-shape-vis.trapezoid {
    inset: 22px 30px 26px 30px;
    border: none;
    background: rgba(99, 102, 241, 0.18);
    clip-path: polygon(18% 0%, 82% 0%, 100% 100%, 0% 100%);
}

.cc-shape-vis.square {
    inset: 16px 42px 20px 42px;
    border: 2px solid rgba(99, 102, 241, 0.55);
    border-radius: 3px;
    background: rgba(99, 102, 241, 0.1);
}

.cc-shape-vis.rect_border {
    inset: 20px 36px 24px 36px;
    border: 7px solid rgba(99, 102, 241, 0.45);
    border-radius: 3px;
    background: transparent;
}

.cc-shape-vis.tri3sides {
    inset: 16px 32px 20px 32px;
    background: rgba(99, 102, 241, 0.18);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    border: none;
}

.cc-shape-vis.tri_bh {
    inset: 16px 32px 20px 32px;
    background: rgba(99, 102, 241, 0.18);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    border: none;
}

.cc-shape-vis.sector {
    inset: 12px 40px 16px 28px;
    background: rgba(99, 102, 241, 0.18);
    clip-path: polygon(0% 100%, 0% 0%, 100% 0%, 70% 70%);
    border: none;
}

.cc-shape-vis.parallelogram {
    inset: 22px 28px 26px 28px;
    background: rgba(99, 102, 241, 0.18);
    clip-path: polygon(18% 0%, 100% 0%, 82% 100%, 0% 100%);
    border: none;
}

.cc-shape-vis.wall_window {
    inset: 16px 30px 20px 30px;
    border: 2px solid rgba(99, 102, 241, 0.55);
    border-radius: 3px;
    background: rgba(99, 102, 241, 0.08);
    outline: 2px solid rgba(99, 102, 241, 0.4);
    outline-offset: -10px;
}

.cc-shape-vis.cathedral {
    inset: 10px 28px 20px 28px;
    background: rgba(99, 102, 241, 0.18);
    clip-path: polygon(50% 0%, 100% 38%, 100% 100%, 0% 100%, 0% 38%);
    border: none;
}

.cc-shape-vis.room {
    inset: 20px 36px 24px 36px;
    border: 2px solid rgba(99, 102, 241, 0.55);
    border-radius: 3px 3px 0 3px;
    background: rgba(99, 102, 241, 0.1);
}

.cc-axis {
    position: absolute;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--ink-muted);
    pointer-events: none;
}

.cc-axis-x {
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
}

.cc-axis-y {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
}

.cc-diagram-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-top: 1px solid var(--glass-border);
    gap: 8px;
}

.cc-diagram-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-secondary);
}

.cc-diagram-formula {
    font-size: 0.75rem;
    color: var(--ink-muted);
    font-family: 'Courier New', monospace;
}

/* --- Primary Result --- */
.cc-primary-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(0,212,255,0.06));
    border: 1px solid rgba(99,102,241,0.22);
    border-radius: var(--radius-md);
}

.cc-primary-val {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cc-primary-val strong {
    font-size: 1.7rem;
    font-weight: 800;
    font-family: var(--font-display);
    letter-spacing: -0.04em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.cc-primary-val span {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink-muted);
}

.cc-copy-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--ink-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.cc-copy-icon:hover {
    border-color: var(--glass-border-hover);
    color: var(--ink);
    background: var(--surface);
}

/* --- Multi-unit Results Table --- */
.cc-results-table {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cc-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 11px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.78rem;
    gap: 8px;
}

.cc-result-row:last-child {
    border-bottom: none;
}

.cc-result-row span {
    color: var(--ink-secondary);
    font-weight: 500;
}

.cc-result-row strong {
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-size: 0.88rem;
}

.cc-results-header {
    background: rgba(255,255,255,0.03);
    padding: 6px 11px;
}

.cc-results-header span {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-muted);
}

/* --- Cost Box --- */
.cc-cost-box {
    background: linear-gradient(135deg, rgba(52,211,153,0.08), rgba(52,211,153,0.04));
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}

.cc-cost-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
}

.cc-cost-val {
    display: block;
    font-size: 1.55rem;
    font-weight: 800;
    font-family: var(--font-display);
    letter-spacing: -0.03em;
    color: var(--success);
    line-height: 1;
}

.cc-cost-sub {
    font-size: 0.76rem;
    color: var(--ink-muted);
    margin-top: 5px;
    line-height: 1.4;
}

/* --- Ghost Button --- */
.cc-ghost-btn {
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cc-ghost-btn:hover {
    border-color: var(--glass-border-hover);
    color: var(--ink-secondary);
    background: var(--glass);
}

/* --- Responsive: Stack on small screens --- */
@media (max-width: 820px) {
    .calc-compact-wrap {
        grid-template-columns: 1fr;
    }

    .calc-compact-results {
        position: static;
    }

    .calc-intro-title {
        font-size: clamp(24px, 6vw, 40px);
        white-space: normal;
        line-height: 1.15;
    }

    .calculator-intro-copy {
        font-size: 0.88rem;
        max-width: 100%;
    }

    .calculator-shell {
        overflow: hidden;
    }

    .calc-compact-form {
        padding: 14px;
        overflow: hidden;
    }

    .cc-shapes {
        grid-template-columns: repeat(4, 1fr);
    }

    .cc-shape {
        min-height: 46px;
        font-size: 0.6rem;
        padding: 6px 4px;
    }

    .cc-shape svg {
        width: 18px;
        height: 15px;
    }
}

@media (max-width: 520px) {
    .calculator-shell {
        padding: 16px 10px 24px;
    }

    .calc-intro-title {
        font-size: clamp(20px, 6.5vw, 30px);
    }

    .calc-compact-form {
        padding: 10px;
    }

    .cc-shapes {
        grid-template-columns: repeat(3, 1fr);
    }

    .cc-shape {
        font-size: 0.55rem;
        min-height: 42px;
        padding: 5px 3px;
        gap: 2px;
    }

    .cc-shape svg {
        width: 16px;
        height: 13px;
    }

    .cc-row {
        flex-direction: column;
    }

    .cc-field-grow {
        width: 100%;
    }

    .cc-toggle-btn {
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    .cc-unit {
        padding: 4px 7px;
        font-size: 0.66rem;
    }
}

/* --- Screenshot Footer --- */
.compact-footer {
    width: min(100% - 60px, 1340px);
    margin: 0 auto;
    padding: 0 0 52px;
}

.compact-footer::before {
    content: "";
    display: block;
    height: 1px;
    margin: 0 0 48px;
    background: rgba(148, 163, 184, 0.14);
}

.footer-rule {
    height: 1px;
    background: rgba(148, 163, 184, 0.14);
    margin-top: 30px;
    margin-bottom: 34px;
}

.footer-screenshot-layout {
    display: grid;
    grid-template-columns: minmax(320px, 570px) 1fr;
    align-items: start;
    gap: 40px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.compact-footer .footer-bottom {
    margin: 0;
    text-align: left;
    color: #8390a5;
    font-size: 0.84rem;
    line-height: 1.5;
}

.footer-disclaimer {
    max-width: 650px;
    padding: 13px 14px 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.56);
}

.footer-disclaimer strong {
    display: block;
    margin-bottom: 7px;
    color: #cbd5e1;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.footer-disclaimer p {
    margin: 0;
    color: #eef4ff;
    font-size: 0.82rem;
    line-height: 1.45;
}

.footer-disclaimer b {
    color: #ffffff;
}

.compact-footer .locale-switcher {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.compact-footer .locale-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px 14px;
}

.compact-footer .locale-link {
    min-width: 58px;
    justify-content: center;
    padding: 5px 11px;
    border-radius: 6px;
    border-color: rgba(203, 213, 225, 0.56);
    background: rgba(15, 23, 42, 0.38);
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
}

.compact-footer .locale-link:hover {
    color: #ffffff;
    border-color: rgba(226, 232, 240, 0.82);
    background: rgba(30, 41, 59, 0.72);
}

.compact-footer .locale-link.active {
    border-color: rgba(226, 232, 240, 0.92);
    background: #f8fafc;
    color: #64748b;
}

.compact-footer .footer-language-disabled {
    cursor: default;
}

.compact-footer .footer-grid {
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    align-items: start;
    justify-content: stretch;
}

.compact-footer .footer-grid > div {
    align-items: flex-start;
    justify-content: flex-start;
}

@media (max-width: 920px) {
    .footer-screenshot-layout {
        grid-template-columns: 1fr;
    }

    .compact-footer .locale-links {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .compact-footer {
        width: min(100% - 24px, 1280px);
        padding: 0 0 28px;
    }

    .compact-footer::before {
        margin-bottom: 32px;
    }
}

/* ============================================================
   HOMEPAGE CONTENT SECTIONS
   ============================================================ */

/* --- Content prose --- */
.content-strip > p,
.content-strip > ol,
.content-strip > ul {
    color: var(--ink-secondary);
    font-size: 0.98rem;
    line-height: 1.7;
    max-width: 820px;
    margin-bottom: 16px;
}

.content-strip > ol,
.content-strip > ul {
    padding-left: 24px;
}

.content-strip > ol li,
.content-strip > ul li {
    margin-bottom: 8px;
    color: var(--ink-secondary);
}

/* --- Subsection --- */
.subsection {
    margin-top: 40px;
}

.subsection h3 {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--ink);
}

.subsection > p {
    margin-bottom: 20px;
}

.subsection > p:last-child,
.subsection > .table-card + p {
    margin-top: 20px;
}

/* --- Formula highlight box --- */
.formula-highlight {
    display: inline-block;
    padding: 18px 32px;
    margin: 20px 0 24px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 1.1rem;
    color: var(--ink);
    letter-spacing: 0.01em;
}

/* --- Boxed section (card wrapper for full sections) --- */
.boxed-section {
    padding: 40px 36px;
    border-radius: var(--radius-2xl);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
}

.boxed-section-center {
    text-align: center;
}

.boxed-section-center .reference-box,
.boxed-section-center .surplus-visual,
.boxed-section-center .formula-highlight {
    margin-left: auto;
    margin-right: auto;
}

.boxed-section-center p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.boxed-section-center .surplus-visual {
    justify-content: center;
}

@media (max-width: 720px) {
    .boxed-section {
        padding: 28px 20px;
    }
}

/* --- Section split layout (content + visual side-by-side) --- */
.section-split {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 420px);
    gap: 48px;
    align-items: stretch;
}

.section-split-reverse {
    grid-template-columns: minmax(300px, 420px) 1fr;
}

.section-split-content .section-heading {
    margin-bottom: 16px;
}

.section-split-content p,
.section-split-content ol,
.section-split-content ul {
    color: var(--ink-secondary);
    line-height: 1.75;
    font-size: 0.95rem;
}

.section-split-content ol {
    padding-left: 20px;
    margin: 8px 0 12px;
}

.section-split-content ol li {
    margin-bottom: 8px;
}

.section-split-content .lead-grid {
    margin-top: 32px;
}

.section-split-visual {
    padding: 24px;
    border-radius: var(--radius-xl);
    background: rgba(10, 14, 26, 0.5);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-split-visual svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Section hero illustration --- */
.section-hero-img {
    margin-bottom: 28px;
    padding: 16px;
    border-radius: var(--radius-xl);
    background: rgba(10, 14, 26, 0.4);
    border: 1px solid var(--glass-border);
}
.section-hero-img svg {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* --- Reference box --- */
.reference-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
}
.ref-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    font-size: 0.95rem;
}
.ref-val {
    font-weight: 700;
    color: var(--ink);
}
.ref-eq {
    color: var(--accent-start);
    font-weight: 700;
}
.ref-result {
    color: var(--ink-secondary);
}

/* --- Shapes grid (3 per row) --- */
.shapes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 32px;
}

/* --- Shape cards --- */
.shape-card {
    padding: 24px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
}

.shape-card h3 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.shape-card h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent-start);
    margin-bottom: 20px;
    letter-spacing: 0.01em;
}

.shape-card p,
.shape-card ul {
    color: var(--ink-secondary);
    font-size: 0.88rem;
    line-height: 1.65;
}

.shape-card ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 16px;
}

.shape-card ul li {
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.shape-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-start);
}

/* --- Shape diagram container --- */
.shape-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0 20px;
    padding: 18px 12px;
    border-radius: var(--radius-md);
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--glass-border);
}

.shape-diagram svg {
    width: 100%;
    height: auto;
}

/* --- Surplus visual --- */
.surplus-visual {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.surplus-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 32px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
}

.surplus-box-total {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.06);
}

.surplus-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-muted);
    font-weight: 600;
}

.surplus-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
}

.surplus-box-total .surplus-value {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.surplus-arrow {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-start);
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
}

/* --- FAQ h3 inside summary --- */
.faq-item summary h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    display: inline;
    font-family: var(--font-sans);
}

/* --- Responsive: tablet adjustments --- */
@media (max-width: 1024px) {
    .shapes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .section-split,
    .section-split-reverse {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .section-split-reverse .section-split-visual {
        order: -1;
    }

    .section-split-visual {
        position: static;
        max-width: 420px;
    }
}

/* --- Responsive adjustments for new content --- */
@media (max-width: 720px) {
    .shapes-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .shape-card {
        padding: 20px 16px;
    }

    .shape-diagram {
        padding: 14px 8px;
    }

    .reference-box {
        grid-template-columns: 1fr;
    }

    .ref-item {
        padding: 10px 14px;
        font-size: 0.88rem;
    }

    .section-hero-img {
        padding: 10px;
        margin-bottom: 20px;
    }

    .surplus-visual {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .surplus-box {
        padding: 16px 20px;
    }

    .surplus-arrow {
        text-align: center;
    }

    .formula-highlight {
        padding: 12px 18px;
        font-size: 1rem;
    }
}
