:root {
    --home-bg: #f9f9f9;
    --home-surface: #ffffff;
    --home-text: #17202a;
    --home-muted: #65727d;
    --home-line: #d9e1df;
    --home-accent: #0066AA;
    --home-accent-strong: #00447F;
    --home-accent-soft: #eaf4fb;
    --home-gold-soft: #fff3dc;
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body.home-page {
    margin: 0;
    background: var(--home-bg);
    color: var(--home-text);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

/* ===== HOMEPAGE GRADIENT CONTROLS ===== */
.home-page {
    --home-calculator-start: #075a9c;
    --home-calculator-end: #24b7c7;
    --home-calculator-angle: 135deg;
    --home-calculator-ink: #ffffff;

    --home-path-start: #d9f3ff;
    --home-path-end: #9edcec;
    --home-path-angle: 135deg;
    --home-path-ink: #082a43;

    --home-learn-start: #ffe39a;
    --home-learn-end: #ffc5ad;
    --home-learn-angle: 135deg;
    --home-learn-ink: #2c241c;

    --home-tools-start: #d8d2ff;
    --home-tools-end: #a9ccff;
    --home-tools-angle: 135deg;
    --home-tools-ink: #142544;

    --home-faq-start: #0d7280;
    --home-faq-end: #173d73;
    --home-faq-angle: 135deg;
    --home-faq-ink: #ffffff;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h2 {
    margin-bottom: 8px;
    color: #142631;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    line-height: 1.12;
}

h3 {
    margin-bottom: 8px;
    font-size: 0.93rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Header: keep the old site's blue identity, with the new information structure ===== */
.site-header {
    position: relative;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 70px;
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0.5rem 24px;
    overflow: visible;
    color: #fff;
    background: linear-gradient(135deg, #00447F 0%, #0066AA 100%);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}

.site-header > * {
    position: relative;
    z-index: 1;
}

.brand {
    color: #07385f;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.site-logo-badge {
    display: inline-flex;
    align-items: center;
    min-height: 43px;
    max-width: 100%;
    padding: 0 10px;
    color: #263d4f;
    background-color: rgba(255, 255, 255, 0.9);
    border: 0.9px solid rgba(0, 0, 0, 0.1);
    border-radius: 10.8px;
    box-shadow:
        inset 2.7px 2.7px 4.5px rgba(0, 0, 0, 0.2),
        inset -2.7px -2.7px 4.5px rgba(255, 255, 255, 0.8),
        0 1.8px 3.6px rgba(0, 0, 0, 0.1);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 18.5px;
    font-weight: 900;
    line-height: 1;
}

.brand-accent {
    margin-left: 1px;
    color: #1677B8;
    font-size: 0.88em;
    font-weight: 900;
}

.page-heading {
    min-width: 0;
    text-align: center;
}

.page-heading h1 {
    margin: 0;
    color: #fff;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: clamp(2rem, 2.35vw, 2.125rem);
    line-height: 1.1;
    font-weight: 700;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.2);
}

.home-page .top-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.home-page .top-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    color: #fff;
    font-size: 0.93rem;
    font-weight: 700;
    text-decoration: none;
}

.home-page .top-nav a:hover,
.home-page .top-nav a:focus-visible {
    color: #dff5ef;
    text-decoration: underline;
}

.home-page .top-nav .language-selector {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    transform: none;
    display: flex;
    align-items: center;
    align-self: center;
    margin: 0;
    z-index: 1001;
}

.home-page .top-nav .language-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    margin: 0;
    padding: 6px 11px;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.home-page .top-nav .language-toggle:hover,
.home-page .top-nav .language-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.3);
}

.home-page .top-nav .language-toggle::after {
    content: "\25BE";
    margin-left: 5px;
    font-size: 0.7rem;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    width: 107px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1002;
}

.language-selector:hover .language-dropdown,
.language-selector:focus-within .language-dropdown,
.language-dropdown.active {
    display: block;
}

.home-page .top-nav .language-selector .language-dropdown .language-option {
    display: block;
    padding: 8px 12px;
    color: #333;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.home-page .top-nav .language-selector .language-dropdown .language-option:hover,
.home-page .top-nav .language-selector .language-dropdown .language-option:focus-visible {
    color: #0066cc;
    background: #f5f8ff;
}

.home-page .top-nav .language-selector .language-dropdown .language-option.active,
.home-page .top-nav .language-selector .language-dropdown .language-option[aria-current="page"] {
    color: #0066cc;
    background: #e6f2ff;
    font-weight: 600;
}

.home-page .top-nav .language-selector .language-dropdown .language-option:last-child {
    border-bottom: 0;
}

.globe-icon {
    margin-right: 5px;
    font-size: 0.9em;
}

.product-lead {
    max-width: 1050px;
    margin: 14px auto 0;
    padding: 0 24px;
    color: #29485D;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
}

body.home-page main {
    max-width: none;
    margin: 0;
    padding: 0 0 56px;
}

/* ===== Main calculator ===== */
.calculator-shell {
    padding: 12px 0 22px;
}

.main-row-container {
    width: 100%;
    padding: 0 0 2rem;
}

.wide-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-row {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    justify-content: center;
}

.left-sidebar,
.main-row > .poster-card {
    flex: 0 0 250px;
    padding: 1.5rem;
    background-color: #f0f2f5;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.nav-title {
    margin-bottom: 1rem;
    padding: 0 0 0.7rem;
    color: var(--primary-color);
    border-bottom: 3px solid #d9dee3;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
}

.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 66px;
    padding: 0.72rem 0.9rem;
    color: var(--primary-color);
    background: #fdfefe;
    border: 1.5px solid #3a97e8;
    border-radius: 6px;
    font-size: 0.96rem;
    line-height: 1.45;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-button:hover:not(:disabled) {
    background: #f3f8ff;
    border-color: #2f8fe4;
    box-shadow: 0 4px 10px rgba(25, 45, 76, 0.08);
    transform: translateY(-1px);
}

.nav-button:disabled {
    opacity: 0.66;
    cursor: not-allowed;
}

.nav-button.external {
    position: relative;
    padding-right: 2.5rem;
    background-color: #ecf0f1;
    border: 2px solid var(--secondary-color);
}

.nav-button.external::after {
    content: ">";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-button.external:hover {
    color: #fff;
    background-color: var(--secondary-color);
}

.mobile-nav-toggle {
    display: none;
}

.calculator-main {
    flex: 0 1 930px;
    min-width: 0;
}

.quick-calculator,
.step-demo-card,
.tutor-demo {
    background: var(--home-surface);
    border: 1px solid var(--home-line);
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(27, 39, 51, 0.07);
}

.quick-calculator {
    padding: 16px;
}

.quick-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.quick-heading h2 {
    margin-bottom: 0;
    font-size: 1.28rem;
}

.quick-heading p,
.section-intro p {
    color: var(--home-muted);
    font-size: 0.93rem;
}

.quick-heading p {
    margin-bottom: 0;
}

/* ===== Old-site matrix input appearance, kept as one authoritative rule set ===== */
.matrix-calculator {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 5px;
    background-color: #f4f4f9;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.matrix-calculator .main-calculator-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.matrix-calculator .main-2m-with-swap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 12px;
    align-items: stretch;
    width: 100%;
    max-width: 868px;
}

.matrix-calculator .matrix-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.matrix-calculator .controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 2px;
    width: 100%;
    margin-bottom: 10px;
    padding: 0 2px;
}

.matrix-calculator .matrix-label {
    margin-right: 3px;
    color: #333;
    font-size: 1.42em;
    font-weight: bold;
    white-space: nowrap;
}

.matrix-calculator .matrix-dimension {
    margin-left: 3px;
    color: #666;
    font-size: 0.7em;
    font-weight: normal;
}

.matrix-calculator .size-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background-color: #f8f9fa;
    border-radius: 4px;
    white-space: nowrap;
}

.matrix-calculator .size-controls .control-label {
    margin-right: 2px;
    color: #666;
    font-size: 0.85em;
}

/* These three classes existed in the old HTML without dedicated CSS; keep them deliberately small and neutral. */
.matrix-calculator .control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    color: #333;
    background: #fff;
    border: 1px solid #cfd6db;
    border-radius: 4px;
    font-size: 0.82rem;
    cursor: pointer;
}

.matrix-calculator .control-btn:hover {
    background: #eef3f6;
    border-color: #aebbc4;
}

.matrix-calculator .size-display {
    min-width: 18px;
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.matrix-calculator .random-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background-color: transparent;
    border-radius: 4px;
}

.matrix-calculator .random-options {
    position: absolute;
    top: 45px;
    left: 0;
    z-index: 1000;
    min-width: 190px;
    padding: 5px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-direction: column;
}

.matrix-calculator .random-option-btn {
    width: 100%;
    padding: 8px 9px;
    color: #27333b;
    background: transparent;
    border: 0;
    border-radius: 3px;
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    cursor: pointer;
}

.matrix-calculator .random-option-btn:hover {
    background: #e9eef1;
}

.matrix-calculator .matrix-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
    min-width: 260px;
    min-height: 150px;
    padding: 7px;
    overflow-x: auto;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.matrix-calculator .matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    width: max-content;
    min-width: max-content;
}

.matrix-calculator .matrix input {
    width: 36px;
    height: 40px;
    margin: 0;
    padding: 0;
    color: var(--home-text);
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12.5px;
    text-align: center;
    transition: border-color 0.3s;
}

.matrix-calculator .matrix input[type=number]::-webkit-inner-spin-button,
.matrix-calculator .matrix input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.matrix-calculator .swap-mid-col {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5px;
}

.matrix-calculator .swap-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #24313a;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.matrix-calculator .swap-icon-btn:hover {
    transform: translateY(-1px);
}

.matrix-calculator .swap-icon-btn i {
    font-size: 16px;
}

.input-hint {
    width: min(100%, 850px);
    margin: 6px 0;
    padding: 0;
    color: #64748b;
    background: none;
    border: 0;
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
}

/* ===== Homepage-only operation controls: isolated from calculator.css ===== */
.home-operation-area {
    width: min(100%, 850px);
    margin-top: 8px;
}

.home-core-ops {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 8px;
}

.home-op-button,
.home-small-op,
.home-more-toggle,
.home-button-wall button {
    font: inherit;
    border-radius: 6px;
}

.home-op-button {
    min-height: 46px;
    padding: 9px 14px;
    color: #00447F;
    background: #f7fbff;
    border: 1px solid #8db9dc;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.home-op-primary {
    min-height: 50px;
    color: #fff;
    background: linear-gradient(135deg, #1677B8 0%, #1E80C1 100%);
    border-color: #1677B8;
    font-size: 20px;
    font-weight: 750;
    box-shadow: 0 4px 10px rgba(22, 119, 184, 0.22);
}

.home-op-button:hover {
    border-color: #0066AA;
    background: #edf7ff;
}

.home-op-primary:hover {
    background: linear-gradient(135deg, #126aa5 0%, #1976B9 100%);
    border-color: #126aa5;
}

.home-common-ops {
    display: grid;
    grid-template-columns: repeat(4, minmax(105px, 1fr)) minmax(170px, 1.25fr);
    gap: 8px;
    margin-top: 8px;
}

.home-small-op,
.home-more-toggle {
    min-height: 36px;
    padding: 7px 10px;
    color: #29485D;
    background: #F4F9FC;
    border: 1px solid #A9C9DD;
    font-size: 0.94rem;
    font-weight: 600;
}

.home-small-op:disabled {
    color: #29485D;
    background: #F4F9FC;
    opacity: 1;
    cursor: not-allowed;
}

.home-more-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #29485D;
    cursor: pointer;
}

.home-more-toggle::after {
    content: "\25BE";
    color: var(--home-accent);
    transition: transform 0.18s ease;
}

.home-common-ops.is-open .home-more-toggle::after {
    transform: rotate(180deg);
}

.home-more-panel {
    display: none;
    grid-column: 1 / -1;
    max-height: min(520px, 70vh);
    margin-top: 2px;
    padding: 14px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(22, 31, 42, 0.14);
}

.home-common-ops.is-open .home-more-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.home-operation-group {
    min-width: 0;
}

.home-operation-group h3 {
    margin: 0 0 8px;
    padding-bottom: 6px;
    color: #142631;
    border-bottom: 1px solid #dce8f1;
    font-size: 0.9rem;
}

.home-button-wall {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.home-button-wall button {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    color: #314b61;
    background: #f8fbfe;
    border: 1px solid #d8e5ef;
    text-align: left;
}

.home-button-wall button:disabled {
    opacity: 0.82;
    cursor: not-allowed;
}

.poster-card {
    max-width: 290px;
    border-radius: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    box-shadow: 10px 10px 20px rgba(163, 177, 198, 0.45), -10px -10px 20px rgba(255, 255, 255, 0.7);
}

.promo-text {
    margin: 0;
    padding: 0 2px;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.42;
}

.promo-text span {
    color: #1d4ed8;
    font-weight: 700;
}

.image-container {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    background: #e6e8eb;
    border-radius: 16px;
    box-shadow: inset 5px 5px 10px rgba(163, 177, 198, 0.55), inset -5px -5px 10px rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: transform 0.2s ease;
}

.image-container:hover {
    transform: translateY(-2px) scale(1.008);
}

.game-image {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0.92;
    transition: opacity 0.2s ease;
}

.image-container:hover .game-image {
    opacity: 1;
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.1), -3px -3px 8px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.play-triangle {
    width: 0;
    height: 0;
    margin-left: 3px;
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent #1d4ed8;
}

.calculator-card {
    width: 100%;
    padding: 13px;
    gap: 9px;
    border-radius: 12px;
    box-shadow: inset 4px 4px 8px rgba(163, 177, 198, 0.32), inset -4px -4px 8px rgba(255, 255, 255, 0.7);
}

.learn-links button {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    color: #00447F;
    background: #fff;
    border: 1px solid #b7cfe2;
    border-radius: 6px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: not-allowed;
    opacity: 0.72;
}

/* ===== Shared lower-page foundations ===== */
.section {
    padding: 42px 24px;
    border-top: 1px solid var(--home-line);
}

.section-heavy {
    border-top: 0;
}

.compact-feature {
    display: grid;
    justify-items: center;
    gap: 18px;
}

.section-intro {
    width: 100%;
    max-width: 780px;
    text-align: center;
}

.section-intro p {
    max-width: 620px;
    margin: 0 auto 6px;
}

.step-demo-card {
    width: min(100%, 960px);
    padding: 20px;
}

.step-equation {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.step-equation strong {
    font-size: 1.9rem;
}

.target-label {
    color: var(--home-muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.step-matrices {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    justify-content: center;
    gap: clamp(18px, 4vw, 42px);
}

.step-matrices article {
    display: grid;
    justify-items: center;
}

.mini-matrix {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 52px);
    grid-auto-rows: 46px;
    gap: 7px;
    width: max-content;
    padding: 0 11px;
}

.mini-matrix::before,
.mini-matrix::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    border-color: #24313a;
}

.mini-matrix::before {
    left: 0;
    border-left: 2px solid;
    border-top: 2px solid;
    border-bottom: 2px solid;
}

.mini-matrix::after {
    right: 0;
    border-right: 2px solid;
    border-top: 2px solid;
    border-bottom: 2px solid;
}

.mini-matrix span {
    display: grid;
    place-items: center;
    color: #68747b;
    background: #f5f7f6;
    border-radius: 5px;
    font-weight: 800;
}

.mini-matrix .hot,
.target-cell {
    color: #102d28;
    background: #bde6dc;
    outline: 2px solid var(--home-accent);
}

.row-highlight span:nth-child(2),
.col-highlight span:nth-child(3) {
    color: #334742;
    background: var(--home-accent-soft);
}

.step-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.small-tags,
.capability-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.small-tags span,
.capability-row span {
    padding: 6px 10px;
    color: #465660;
    background: #fff;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 750;
}

.ghost-action,
.calculator-links a,
.calculator-links button,
.learn-list button {
    color: var(--home-text);
    background: #fff;
    border: 1px solid var(--home-line);
    border-radius: 6px;
    font: inherit;
}

.ghost-action {
    min-height: 38px;
    padding: 9px 13px;
    font-weight: 850;
}

.tutor-demo {
    width: min(100%, 790px);
    min-height: 270px;
    padding: 18px;
}

.tutor-stage {
    display: grid;
    align-content: center;
    min-height: 178px;
}

.tutor-state {
    opacity: 1;
    transition: opacity 160ms ease;
}

.tutor-state h3 {
    font-size: 1.22rem;
}

.tutor-state.is-fading {
    opacity: 0;
}

.tutor-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.tutor-demo .step-matrices {
    gap: 18px;
}

.tutor-demo .mini-matrix {
    grid-template-columns: repeat(2, 42px);
    grid-auto-rows: 38px;
    gap: 5px;
}

.tutor-expression {
    margin-bottom: 14px;
    font-size: 1.15rem;
    font-weight: 750;
}

.answer-box {
    display: inline-block;
    min-width: 84px;
    height: 32px;
    vertical-align: middle;
    background: #fff;
    border: 1px solid #adbab6;
    border-radius: 5px;
}

.hint-pill {
    display: inline-flex;
    padding: 7px 11px;
    color: #684217;
    background: var(--home-gold-soft);
    border: 1px solid #e9ca96;
    border-radius: 999px;
    font-weight: 850;
}

.tutor-dots {
    display: flex;
    gap: 8px;
    margin: 4px 0 0;
}

.tutor-dots button {
    width: 12px;
    min-height: 12px;
    height: 12px;
    padding: 0;
    background: #fff;
    border: 1px solid #8aa79f;
    border-radius: 50%;
    cursor: pointer;
}

.tutor-dots button[aria-current="true"] {
    background: var(--home-accent);
}

.learn-practice-section {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
    gap: 20px;
    align-items: start;
}

.learn-panel,
.practice-panel {
    min-width: 0;
}

.learn-panel .section-intro,
.practice-panel .section-intro {
    text-align: left;
}

.learn-panel .section-intro p,
.practice-panel .section-intro p {
    margin-left: 0;
}

.learn-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 14px 0 12px;
}

.learn-list button {
    display: grid;
    gap: 4px;
    min-height: 76px;
    padding: 11px 12px;
    text-align: left;
}

.learn-list strong {
    color: #23323a;
    font-size: 0.94rem;
}

.learn-list span {
    color: var(--home-muted);
    font-size: 0.84rem;
}

.practice-panel {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--home-line);
    border-radius: 8px;
}

.practice-panel .ghost-action {
    margin-top: 14px;
}

.calculators-section,
.faq-section {
    display: grid;
    gap: 16px;
}

.calculators-section {
    padding-top: 38px;
    padding-bottom: 36px;
}

.calculators-section .section-intro,
.faq-section .section-intro {
    max-width: 100%;
    text-align: left;
}

.calculator-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.calculator-links a,
.calculator-links button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 10px;
    color: #31434b;
    background: #fff;
    border-color: #d7e0dd;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

.calculator-links a {
    color: var(--home-accent-strong);
    background: var(--home-accent-soft);
    border-color: #aec9c1;
    font-weight: 850;
}

.text-link {
    color: #34434b;
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover {
    color: var(--home-accent);
    text-decoration: underline;
}

.faq-section {
    max-width: 960px;
    margin: 0 auto;
    padding-top: 34px;
}

.faq-list {
    display: grid;
    gap: 8px;
}

.faq-list details {
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--home-line);
    border-radius: 8px;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 800;
}

.faq-list p {
    margin: 8px 0 0;
    color: var(--home-muted);
}

.site-footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    color: var(--home-muted);
    border-top: 1px solid var(--home-line);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
.tutor-demo:focus-visible {
    outline: 3px solid rgba(26, 127, 100, 0.32);
    outline-offset: 3px;
}

@media (max-width: 1320px) {
    .wide-container {
        padding-inline: 12px;
    }

    .main-row {
        gap: 1rem;
    }

    .left-sidebar,
    .main-row > .poster-card {
        flex-basis: 200px;
        padding: 1rem;
    }

    .calculator-main {
        flex-basis: 760px;
    }

    .quick-calculator {
        padding: 12px;
    }

    .matrix-calculator .matrix-area {
        width: 100%;
    }

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

    .home-more-toggle {
        grid-column: span 2;
    }
}

@media (max-width: 980px) {
    .site-header {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 6px;
        padding-block: 10px;
    }

    .page-heading {
        text-align: left;
    }

    .top-nav {
        gap: 12px;
    }

    .main-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .left-sidebar,
    .main-row > .poster-card {
        width: 100%;
        max-width: none;
        flex: none;
        margin-bottom: 0.5rem;
        padding: 0.25rem;
        background: transparent;
        box-shadow: none;
    }

    .main-row > .poster-card {
        padding: 12px;
        background: #f0f2f5;
        box-shadow: var(--box-shadow);
    }

    .mobile-nav-toggle {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0.5rem 0.8rem;
        color: #fff;
        background-color: var(--secondary-color);
        border: 0;
        border-radius: var(--border-radius);
        font-size: 0.95rem;
        font-weight: 500;
        text-align: center;
        cursor: pointer;
    }

    .mobile-nav-toggle::after {
        content: " \25BE";
    }

    .mobile-nav-toggle.active::after {
        content: " \25B4";
    }

    .nav-title {
        display: none;
    }

    .nav-buttons {
        display: none;
        width: 100%;
        margin-top: 0.5rem;
        padding: 0.5rem;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .nav-buttons.active {
        display: flex;
    }

    .nav-button {
        width: 100%;
        min-height: 48px;
        margin: 0;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        text-align: left;
    }

    .matrix-calculator {
        padding: 0;
        background-color: transparent;
    }

    .matrix-calculator .main-2m-with-swap {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .matrix-calculator .controls {
        flex-wrap: wrap;
    }

    .matrix-calculator .matrix-area {
        width: 100%;
        max-width: 500px;
    }

    .matrix-calculator .matrix-container {
        width: 100%;
        max-width: none;
        padding: 3px;
        border: 1px solid #bbb;
        box-shadow: none;
    }

    .matrix-calculator .swap-mid-col {
        order: 2;
        padding-top: 0;
    }

    #matrix-area-b {
        order: 3;
    }

    .matrix-calculator .swap-icon-btn {
        transform: rotate(90deg);
    }

    .matrix-calculator .swap-icon-btn:hover {
        transform: rotate(90deg) translateY(-1px);
    }

    .home-core-ops {
        grid-template-columns: 2fr 1fr 1fr;
    }

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

    .home-more-toggle {
        grid-column: 1 / -1;
    }

    .home-common-ops.is-open .home-more-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .learn-practice-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .site-header {
        padding-inline: 16px;
    }

    .page-heading h1 {
        font-size: 1.4rem;
    }

    .product-lead {
        padding-inline: 16px;
        font-size: 0.95rem;
    }

    .wide-container {
        width: calc(100% - 1px);
        padding: 0 8px;
    }

    .quick-calculator,
    .step-demo-card,
    .tutor-demo,
    .practice-panel {
        padding: 14px;
    }

    .quick-heading {
        display: block;
    }

    .quick-heading p {
        margin-top: 4px;
    }

    .matrix-calculator .controls {
        justify-content: center;
    }

    .matrix-calculator .matrix input {
        width: 36px;
        height: 40px;
    }

    .home-core-ops,
    .home-common-ops,
    .home-common-ops.is-open .home-more-panel {
        grid-template-columns: 1fr;
    }

    .home-more-toggle {
        grid-column: auto;
    }

    .step-matrices {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
    }

    .step-equation {
        display: block;
        margin-bottom: 14px;
    }

    .step-equation strong {
        display: block;
        margin-top: 6px;
        font-size: 1.55rem;
    }

    .mini-matrix {
        grid-template-columns: repeat(2, 46px);
        grid-auto-rows: 40px;
    }

    .tutor-demo .step-matrices {
        grid-template-columns: repeat(3, max-content);
        justify-content: start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .learn-list,
    .calculator-links {
        grid-template-columns: 1fr;
    }

    .faq-section {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===== 2026 strategic homepage refresh ===== */
.home-page .top-nav {
    justify-content: flex-end;
    gap: 14px;
}

.product-lead {
    max-width: 980px;
    margin-top: 18px;
    font-size: clamp(1.05rem, 1.55vw, 1.35rem);
}

.calculator-shell {
    padding-top: 14px;
    padding-bottom: 28px;
}

.main-row-container {
    padding-bottom: 0;
}

.wide-container {
    max-width: 1320px;
}

.main-row {
    display: block;
}

.calculator-main {
    width: min(100%, 1240px);
    max-width: 1240px;
    margin: 0 auto;
}

.quick-calculator {
    padding: clamp(16px, 2vw, 24px);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(27, 51, 72, 0.08);
}

.quick-heading {
    align-items: center;
    margin-bottom: 14px;
}

.quick-heading h2 {
    font-size: clamp(1.35rem, 1.8vw, 1.65rem);
}

.quick-heading p {
    max-width: 650px;
    text-align: right;
}

.matrix-calculator {
    padding: 14px 18px 16px;
    background: #f6f8fb;
    border-radius: 10px;
}

.matrix-calculator .main-2m-with-swap {
    max-width: 1120px;
    column-gap: clamp(16px, 2.4vw, 34px);
}

.matrix-calculator .controls {
    justify-content: center;
    gap: 4px;
}

.matrix-calculator .matrix-container {
    align-items: center;
    min-width: 300px;
    min-height: 178px;
    padding: 14px;
}

.matrix-calculator .matrix {
    gap: 4px;
}

.matrix-calculator .matrix input {
    width: 48px;
    height: 50px;
    font-family: Cambria, Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    font-weight: 400;
}

.matrix-calculator .swap-mid-col {
    align-items: center;
    padding-top: 28px;
}

.matrix-calculator .swap-icon-btn {
    width: 44px;
    height: 44px;
}

.input-hint,
.home-operation-area {
    width: min(100%, 1080px);
}

.input-hint {
    margin-top: 10px;
    font-size: 0.88rem;
}

.home-small-op,
.home-button-wall button {
    cursor: pointer;
}

.home-small-op:hover,
.home-small-op:focus-visible,
.home-button-wall button:hover,
.home-button-wall button:focus-visible {
    color: var(--home-accent-strong);
    background: #eaf5fc;
    border-color: #8db9dc;
}

.home-common-ops.is-open .home-more-panel {
    position: relative;
    z-index: 12;
}

.section {
    width: min(100%, 1280px);
    margin: 0 auto;
    padding: clamp(44px, 5vw, 68px) 24px;
}

.centered-intro {
    max-width: 760px;
    margin: 0 auto 24px;
    text-align: center;
}

.eyebrow {
    margin-bottom: 7px !important;
    color: var(--home-accent) !important;
    font-size: 0.78rem !important;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.understand-section {
    border-top: 1px solid var(--home-line);
}

.understand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.feature-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    min-width: 0;
    padding: clamp(20px, 2.3vw, 30px);
    background: #fff;
    border: 1px solid var(--home-line);
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(27, 51, 72, 0.07);
}

.steps-feature {
    border-top: 4px solid #2b86bf;
}

.tutor-feature {
    border-top: 4px solid #78b989;
}

.feature-copy h3 {
    margin-bottom: 7px;
    color: #142631;
    font-size: clamp(1.3rem, 1.8vw, 1.62rem);
}

.feature-copy p {
    margin-bottom: 0;
    color: var(--home-muted);
}

.feature-demo {
    display: grid;
    align-content: center;
    gap: 20px;
    min-height: 275px;
    padding: 22px 16px;
    overflow: hidden;
    background: #fbfcfd;
    border: 1px solid #e5ecef;
    border-radius: 12px;
}

.feature-matrix-product {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(9px, 1.35vw, 17px);
    min-width: max-content;
}

.feature-matrix-group {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.feature-matrix-label {
    color: #314a5c;
    font-size: 0.92rem;
    font-weight: 700;
}

.feature-bracket {
    position: relative;
    padding: 8px 13px;
}

.feature-bracket::before,
.feature-bracket::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 9px;
}

.feature-bracket::before {
    left: 0;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    border-left: 2px solid #333;
}

.feature-bracket::after {
    right: 0;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 43px);
    grid-auto-rows: 43px;
    gap: 5px;
}

.feature-grid span {
    display: grid;
    place-items: center;
    color: #19252d;
    border: 2px solid transparent;
    border-radius: 5px;
    font-family: Cambria, Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 400;
}

.feature-row-highlight span:nth-child(-n + 2) {
    background: #e4f1fa;
}

.feature-column-highlight span:nth-child(odd) {
    background: #fff1cb;
}

.feature-grid span.is-active {
    border-color: #005792;
    box-shadow: 0 0 0 3px rgba(0, 87, 146, 0.14);
}

.feature-result-grid span {
    color: #62717b;
    background: #f4f7f9;
    border-color: #e8eef2;
}

.feature-result-grid span.is-target {
    color: #123b21;
    background: #edf7ef;
    border-color: #6eb47e;
    box-shadow: 0 0 0 3px rgba(67, 145, 86, 0.12);
}

.feature-operator {
    color: var(--home-accent-strong);
    font-family: Cambria, Georgia, serif;
    font-size: 1.85rem;
    line-height: 1;
}

.worked-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 15px;
    color: #293b48;
    background: #fff;
    border: 1px solid #d8e5ed;
    border-radius: 10px;
    font-family: Cambria, Georgia, serif;
}

.worked-step span {
    color: #567080;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 700;
}

.worked-step strong {
    font-size: clamp(1.05rem, 1.5vw, 1.28rem);
    font-weight: 400;
}

.feature-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    gap: 8px;
    min-height: 44px;
    padding: 10px 15px;
    color: #1f5e9d;
    background: #fff;
    border: 1px solid #bfd3eb;
    border-radius: 12px;
    font-weight: 750;
    text-decoration: none;
}

.feature-action:hover,
.feature-action:focus-visible {
    color: #134b83;
    background: #f5faff;
    border-color: #8fb4dc;
    box-shadow: 0 0 0 3px rgba(0, 102, 170, 0.1);
}

.tutor-preview {
    gap: 16px;
}

.compact-product .feature-grid {
    grid-template-columns: repeat(2, 36px);
    grid-auto-rows: 36px;
}

.compact-product .feature-grid span {
    font-size: 1.12rem;
}

.tutor-formula {
    display: grid;
    justify-items: center;
    gap: 9px;
    font-family: Cambria, Georgia, "Times New Roman", serif;
}

.formula-source,
.formula-answer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.formula-source span,
.formula-answer span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #21323e;
    background: #fff;
    border: 1px solid #cbd8df;
    border-radius: 5px;
    font-size: 1.12rem;
}

.formula-source b,
.formula-answer b {
    font-size: 1.15rem;
    font-weight: 400;
}

.formula-source .formula-result,
.formula-answer .formula-result {
    color: #123b21;
    background: #edf7ef;
    border-color: #84bd90;
}

.formula-answer .answer-input {
    width: 55px;
    border: 2px solid #005792;
    box-shadow: 0 0 0 3px rgba(0, 87, 146, 0.15);
}

.formula-answer .answer-waiting {
    width: 55px;
    background: #f4f7f9;
    border-color: #dfe7ec;
}

.answer-guide {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: -70px;
    padding: 6px 9px;
    color: #5a4523;
    background: #fffaf0;
    border: 1px solid #efd9ad;
    border-radius: 12px;
    font-family: Cambria, Georgia, serif;
}

.guide-arrow {
    color: #2f61b5;
    font-size: 1.55rem;
    line-height: 1;
}

.guide-help {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #2f61b5;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 650;
}

.learn-practice-section {
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
    gap: 28px;
}

body.home-page .learn-practice-section {
    grid-template-columns: 1fr;
}

body.home-page .matrix-multiplication-path__steps {
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
}

body.home-page .matrix-multiplication-path__step {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #d9e6ee;
    border-radius: 10px;
    box-shadow: 0 5px 14px rgba(27, 51, 72, 0.04);
    cursor: pointer;
    transition: flex-grow 0.36s ease, background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

body.home-page .matrix-multiplication-path__step.is-active {
    flex-grow: 2.55;
    background: var(--home-accent-soft);
    border-color: var(--home-accent);
    box-shadow: 0 10px 22px rgba(27, 51, 72, 0.08);
}

body.home-page .matrix-multiplication-path__step + .matrix-multiplication-path__step {
    border-left: 1px solid #d9e6ee;
}

body.home-page .matrix-multiplication-path__step:not(:last-child)::after {
    content: none;
}

body.home-page .matrix-multiplication-path__step:hover {
    border-color: #9fc4dc;
    box-shadow: 0 8px 18px rgba(27, 51, 72, 0.07);
}

body.home-page .matrix-multiplication-path__trigger {
    display: grid;
    gap: 11px;
    width: 100%;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

body.home-page .matrix-multiplication-path__trigger:focus-visible {
    outline: 3px solid rgba(0, 102, 170, 0.28);
    outline-offset: 5px;
    border-radius: 6px;
}

body.home-page .matrix-multiplication-path__summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

body.home-page .matrix-multiplication-path__number {
    color: var(--home-accent-strong);
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1.45;
}

body.home-page .matrix-multiplication-path__title {
    display: block;
    min-width: 0;
    color: #1f2d35;
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.3;
    overflow-wrap: break-word;
}

body.home-page .matrix-multiplication-path__arrow {
    color: var(--home-accent);
    font-weight: 850;
    line-height: 1.35;
    transition: transform 0.22s ease;
}

body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__arrow {
    transform: translateX(2px);
}

body.home-page .matrix-multiplication-path__details {
    display: grid;
    gap: 10px;
}

body.home-page .matrix-multiplication-path__details[hidden] {
    display: none;
}

body.home-page .matrix-multiplication-path__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__body {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.9fr);
    align-items: center;
}

body.home-page .matrix-multiplication-path__step p {
    color: #5d6f7a;
}

body.home-page .matrix-multiplication-path__actions {
    align-items: flex-start;
}

body.home-page .matrix-multiplication-path__link {
    max-width: 100%;
    background: #ffffff;
}

body.home-page .matrix-multiplication-path__visual {
    display: block;
    align-self: end;
    justify-self: center;
    width: min(100%, 168px);
    height: auto;
    min-width: 0;
    opacity: 0.96;
}

body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__visual {
    justify-self: end;
    width: min(100%, 210px);
}

body.home-page .matrix-multiplication-path__visual--tutor {
    width: min(100%, 188px);
}

body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__visual--tutor {
    width: min(100%, 238px);
}

body.home-page .matrix-multiplication-path__visual .mini-matrix rect:first-child,
body.home-page .matrix-multiplication-path__visual .mini-paper {
    fill: #ffffff;
    stroke: #8db9dc;
    stroke-width: 2;
}

body.home-page .matrix-multiplication-path__visual .mini-matrix path,
body.home-page .matrix-multiplication-path__visual .mini-paper-fold,
body.home-page .matrix-multiplication-path__visual .mini-rule {
    fill: none;
    stroke: #bfd3eb;
    stroke-width: 1.5;
}

body.home-page .matrix-multiplication-path__visual .mini-highlight-row {
    fill: #eaf4fb;
    stroke: #1677B8;
    stroke-width: 1;
}

body.home-page .matrix-multiplication-path__visual .mini-highlight-column {
    fill: #fff3dc;
    stroke: #d7a94a;
    stroke-width: 1;
}

body.home-page .matrix-multiplication-path__visual .mini-highlight-target,
body.home-page .matrix-multiplication-path__visual .mini-step-dot {
    fill: #edf7ef;
    stroke: #6eb47e;
    stroke-width: 1.5;
}

body.home-page .matrix-multiplication-path__visual .mini-symbol {
    fill: var(--home-accent-strong);
    font-family: Cambria, Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    text-anchor: middle;
}

body.home-page .matrix-multiplication-path__visual .mini-label {
    fill: #567080;
    font-size: 12px;
    font-weight: 750;
    text-anchor: middle;
}

body.home-page .matrix-multiplication-path__visual .mini-guide-line,
body.home-page .matrix-multiplication-path__visual .mini-arrow-line,
body.home-page .matrix-multiplication-path__visual .mini-arrow-head,
body.home-page .matrix-multiplication-path__visual .mini-check {
    fill: none;
    stroke: var(--home-accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

body.home-page .matrix-multiplication-path__visual .mini-dot {
    fill: var(--home-accent);
}

@media (max-width: 900px) {
    body.home-page .matrix-multiplication-path__steps {
        flex-direction: column;
    }

    body.home-page .matrix-multiplication-path__step,
    body.home-page .matrix-multiplication-path__step.is-active {
        flex: 1 1 auto;
    }

    body.home-page .matrix-multiplication-path__step + .matrix-multiplication-path__step {
        border-top: 1px solid #d9e6ee;
        border-left: 1px solid #d9e6ee;
    }

    body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__body {
        grid-template-columns: minmax(0, 1fr) minmax(96px, 150px);
    }

    body.home-page .matrix-multiplication-path__visual,
    body.home-page .matrix-multiplication-path__visual--tutor,
    body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__visual,
    body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__visual--tutor {
        width: min(100%, 150px);
    }
}

@media (max-width: 520px) {
    body.home-page .matrix-multiplication-path__step {
        padding: 16px;
    }

    body.home-page .matrix-multiplication-path__summary {
        gap: 8px;
    }

    body.home-page .matrix-multiplication-path__number {
        font-size: 0.78rem;
    }

    body.home-page .matrix-multiplication-path__actions {
        align-items: stretch;
    }

    body.home-page .matrix-multiplication-path__body,
    body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__body {
        grid-template-columns: minmax(0, 1fr);
    }

    body.home-page .matrix-multiplication-path__visual,
    body.home-page .matrix-multiplication-path__visual--tutor,
    body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__visual,
    body.home-page .matrix-multiplication-path__step.is-active .matrix-multiplication-path__visual--tutor {
        justify-self: end;
        width: min(58vw, 150px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.home-page .matrix-multiplication-path__step,
    body.home-page .matrix-multiplication-path__arrow {
        transition-duration: 0.01ms;
    }
}

.learn-panel,
.practice-panel {
    padding: clamp(20px, 2.3vw, 28px);
    background: #fff;
    border: 1px solid var(--home-line);
    border-radius: 16px;
}

.learn-list {
    gap: 10px;
    margin-bottom: 0;
}

.learn-list a {
    display: grid;
    gap: 5px;
    min-height: 84px;
    padding: 13px 14px;
    color: var(--home-text);
    background: #fbfcfd;
    border: 1px solid #dce5e8;
    border-radius: 9px;
    text-align: left;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.learn-list a:hover,
.learn-list a:focus-visible {
    border-color: #9fc4dc;
    box-shadow: 0 7px 18px rgba(27, 51, 72, 0.07);
    transform: translateY(-1px);
}

.learn-list a strong {
    color: #23323a;
    font-size: 0.96rem;
}

.learn-list a span {
    color: var(--home-muted);
    font-size: 0.86rem;
}

.practice-panel {
    display: grid;
    align-content: start;
    gap: 18px;
    background: #f4f9fd;
    border-color: #cfe0eb;
}

.practice-benefits {
    display: grid;
    gap: 10px;
}

.practice-benefits span {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #334b5d;
    font-weight: 650;
}

.practice-benefits b {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: #256b3b;
    background: #e7f5ea;
    border-radius: 50%;
    font-size: 0.8rem;
}

.practice-action {
    justify-self: stretch;
    color: #fff;
    background: linear-gradient(135deg, #1677B8 0%, #1E80C1 100%);
    border-color: #1677B8;
}

.practice-action:hover,
.practice-action:focus-visible {
    color: #fff;
    background: #126ca8;
    border-color: #126ca8;
}

.game-link {
    color: #526b7c;
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.4;
    text-decoration: none;
}

.game-link:hover,
.game-link:focus-visible {
    color: var(--home-accent);
    text-decoration: underline;
}

.calculators-section {
    padding-top: clamp(44px, 5vw, 62px);
    padding-bottom: clamp(42px, 4.5vw, 58px);
}

.calculators-section .section-intro {
    max-width: 720px;
}

.calculator-links {
    gap: 10px;
}

.calculator-links a,
.calculator-links a:first-child {
    color: #31434b;
    background: #fff;
    border-color: #d7e0dd;
    font-weight: 750;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.calculator-links a.is-featured {
    color: var(--home-accent-strong);
    background: var(--home-accent-soft);
    border-color: #a9c9dd;
    font-weight: 850;
}

.calculator-links a:hover,
.calculator-links a:focus-visible {
    border-color: #92b9d1;
    box-shadow: 0 6px 16px rgba(27, 51, 72, 0.06);
    transform: translateY(-1px);
}

.button-link {
    justify-self: start;
    padding: 0;
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.faq-section {
    max-width: 1040px;
}

.faq-list details {
    padding: 14px 16px;
}

@media (max-width: 1080px) {
    .matrix-calculator .matrix-container {
        min-width: 250px;
    }

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

    .feature-card {
        grid-template-columns: minmax(220px, 0.72fr) minmax(430px, 1.28fr);
        grid-template-rows: auto auto;
        align-items: center;
    }

    .feature-demo {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .feature-action {
        grid-column: 1;
    }
}

@media (max-width: 980px) {
    .home-page .top-nav {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .quick-heading p {
        text-align: left;
    }

    .matrix-calculator .swap-mid-col {
        padding-top: 0;
    }

    .matrix-calculator .matrix-container {
        min-width: 0;
        min-height: 168px;
    }

    .learn-practice-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .section {
        padding-inline: 16px;
    }

    .feature-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .feature-demo,
    .feature-action {
        grid-column: 1;
        grid-row: auto;
    }

    .feature-demo {
        min-height: 0;
        overflow-x: auto;
    }

    .feature-matrix-product {
        justify-content: flex-start;
        padding: 0 6px;
    }

    .learn-list,
    .calculator-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .site-header {
        grid-template-columns: 1fr;
    }

    .home-page .top-nav {
        gap: 9px 12px;
    }

    .home-page .top-nav a {
        font-size: 0.84rem;
    }

    .matrix-calculator {
        padding-inline: 8px;
    }

    .matrix-calculator .matrix input {
        width: 42px;
        height: 46px;
        font-size: 1rem;
    }

    .home-core-ops {
        grid-template-columns: 1fr 1fr;
    }

    .home-op-primary {
        grid-column: 1 / -1;
    }

    .feature-card {
        padding: 18px 14px;
    }

    .feature-demo {
        padding-inline: 10px;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 36px);
        grid-auto-rows: 36px;
    }

    .feature-grid span {
        font-size: 1.1rem;
    }

    .feature-operator {
        font-size: 1.5rem;
    }

    .worked-step {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .formula-source span,
    .formula-answer span {
        width: 31px;
        height: 34px;
    }

    .formula-answer .answer-input,
    .formula-answer .answer-waiting {
        width: 44px;
    }

    .answer-guide {
        margin-left: -48px;
    }
}

/* Homepage final alignment fixes */
.product-lead {
    max-width: 1250px;
}

.calculators-section .section-intro p {
    margin-left: 0;
    margin-right: 0;
}

/* Homepage full-width bands */
body.home-page main {
    padding-bottom: 0;
}

body.home-page .site-header {
    margin-bottom: 0;
}

.home-band {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(42px, 4.5vw, 64px) 0;
    border-top: 0;
}

.home-band__inner {
    width: min(100%, 1320px);
    margin: 0 auto;
    padding: 0 24px;
}

.home-band--calculator {
    padding-top: 18px;
    background: linear-gradient(
        var(--home-calculator-angle),
        var(--home-calculator-start),
        var(--home-calculator-end)
    );
}

.home-band--path {
    background: linear-gradient(
        var(--home-path-angle),
        var(--home-path-start),
        var(--home-path-end)
    );
}

.home-band--learn {
    background: linear-gradient(
        var(--home-learn-angle),
        var(--home-learn-start),
        var(--home-learn-end)
    );
}

.home-band--tools {
    background: linear-gradient(
        var(--home-tools-angle),
        var(--home-tools-start),
        var(--home-tools-end)
    );
}

.home-band--faq {
    background: linear-gradient(
        var(--home-faq-angle),
        var(--home-faq-start),
        var(--home-faq-end)
    );
}

.home-band--calculator .product-lead {
    margin: 0 auto clamp(18px, 2.6vw, 28px);
    padding: 0;
    color: rgba(255, 255, 255, 0.88);
}

.home-band--calculator .main-row-container {
    padding-bottom: 0;
    background: transparent;
    background-color: transparent;
    background-image: none;
    border: 0;
    box-shadow: none;
}

.home-band--calculator .wide-container {
    max-width: none;
    padding: 0;
    background: transparent;
    background-color: transparent;
    background-image: none;
    border: 0;
    box-shadow: none;
}

.home-band--calculator .main-row,
.home-band--calculator .calculator-main {
    background: transparent;
    background-color: transparent;
    background-image: none;
    border: 0;
    box-shadow: none;
}

.home-band--calculator .quick-calculator {
    padding: clamp(16px, 2vw, 24px);
    background: rgba(255, 255, 255, 0.97);
    background-color: rgba(255, 255, 255, 0.97);
    background-image: none;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(5, 48, 78, 0.18);
}

.home-band--calculator .matrix-calculator {
    padding: 0;
    background: transparent;
    background-color: transparent;
    background-image: none;
    border-radius: 0;
}

.home-band--calculator .quick-heading {
    display: block;
    margin: 0;
}

.home-band--calculator .quick-heading h2,
.home-band--calculator .matrix-label {
    color: var(--home-text);
}

.home-band--calculator .quick-heading p,
.home-band--calculator .matrix-dimension,
.home-band--calculator .control-label,
.home-band--calculator .size-display,
.home-band--calculator .input-hint {
    color: var(--home-muted);
}

.home-band--path .matrix-multiplication-path {
    padding: 0;
    background: transparent;
    background-color: transparent;
    background-image: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.home-band--path .matrix-multiplication-path__intro h2,
.home-band--path .matrix-multiplication-path__intro p {
    color: var(--home-path-ink);
}

.home-band--learn .learn-panel {
    padding: 0;
    background: transparent;
    background-color: transparent;
    background-image: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.home-band--learn .section-intro h2,
.home-band--learn .section-intro p {
    color: var(--home-learn-ink);
}

.home-band--learn .home-band__inner {
    display: grid;
    grid-template-columns: 1fr;
}

.home-band--tools .home-band__inner,
.home-band--faq .home-band__inner {
    display: grid;
    gap: 16px;
}

.home-band--faq .home-band__inner {
    max-width: 1040px;
}

.home-band--tools .section-intro h2,
.home-band--tools .section-intro p {
    color: var(--home-tools-ink);
}

.home-band--faq .section-intro h2 {
    color: var(--home-faq-ink);
}

.home-band--faq .section-intro p {
    color: rgba(255, 255, 255, 0.86);
}

body.home-page .site-footer {
    max-width: none;
    margin: 0;
    padding: 18px 24px;
    color: rgba(255, 255, 255, 0.82);
    background: linear-gradient(
        var(--home-faq-angle),
        var(--home-faq-start),
        var(--home-faq-end)
    );
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
}

body.home-page .site-footer p {
    margin: 0;
}

@media (max-width: 760px) {
    .home-band {
        padding-block: clamp(34px, 8vw, 46px);
    }

    .home-band__inner {
        padding-inline: 16px;
    }
}
