:root {
    --bg: #eef3f4;
    --ink: #162033;
    --muted: #5d6b7c;
    --panel: #ffffff;
    --blue: #2f95d3;
    --blue-dark: #1f6f9f;
    --line: #c8d5dc;
    --green: #2fa866;
    --red: #df4b43;
    --shadow: 0 20px 60px rgba(34, 54, 74, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.landing-page {
    min-height: 100vh;
    padding: 28px clamp(20px, 4vw, 64px);
    overflow: hidden;
    position: relative;
}

.landing-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(22, 32, 51, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 32, 51, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.landing-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
    font-size: 20px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--blue);
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(22, 32, 51, 0.12);
    position: relative;
}

.brand-mark::before,
.brand-mark::after {
    content: '';
    position: absolute;
    background: #ffffff;
}

.brand-mark::before {
    width: 15px;
    height: 3px;
    left: 6px;
    top: 9px;
}

.brand-mark::after {
    width: 3px;
    height: 15px;
    left: 12px;
    top: 3px;
}

.login-link,
.secondary-link {
    border: none;
    background: transparent;
    color: var(--blue-dark);
    font-weight: 700;
    padding: 8px 0;
}

.hero {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 88px);
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(480px, 1.08fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
}

.hero-copy {
    max-width: 680px;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--blue-dark);
    font-weight: 800;
    font-size: 15px;
}

h1 {
    margin: 0;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: 0;
}

.hero-text {
    max-width: 620px;
    margin: 24px 0 0;
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.45;
    color: var(--muted);
}

.hero-actions {
    margin-top: 36px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.primary-action {
    width: min(260px, 70vw);
    min-height: 58px;
    border: none;
    border-radius: 8px;
    background: var(--blue);
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(47, 149, 211, 0.34);
}

.primary-action:hover,
.auth-submit:hover {
    background: var(--blue-dark);
}

.product-scene {
    position: relative;
    min-height: 620px;
}

.scene-toolbar {
    position: absolute;
    left: 0;
    top: 0;
    width: 190px;
    height: 560px;
    background: #314a63;
    box-shadow: var(--shadow);
    padding: 58px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scene-toolbar span {
    height: 38px;
    border-radius: 5px;
    background: var(--blue);
}

.worksheet-preview {
    position: absolute;
    right: 0;
    top: 54px;
    width: min(620px, 82%);
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 54px;
}

.preview-title {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 34px;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 18px;
    max-width: 420px;
}

.answer-grid div {
    min-height: 54px;
    border: 2px solid #9fb2ba;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c3e50;
    font-size: 20px;
}

.answer-grid .is-correct {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(47, 168, 102, 0.18);
    font-weight: 800;
}

.drop-preview {
    position: absolute;
    right: 56px;
    bottom: 120px;
    width: 210px;
    height: 110px;
    border: 3px dashed var(--blue);
    background: rgba(47, 149, 211, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
    color: #3b4b57;
}

.drag-preview {
    position: absolute;
    right: 310px;
    bottom: 148px;
    width: 150px;
    height: 58px;
    border: 2px solid #d35400;
    border-radius: 8px;
    background: #fef3c7;
    color: #7a3e00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.input-preview {
    position: absolute;
    left: 54px;
    bottom: 58px;
    width: 280px;
    height: 58px;
    border: 2px solid #9fb2ba;
    border-radius: 10px;
    color: #9fb2ba;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.stats-preview {
    position: absolute;
    right: 26px;
    bottom: 16px;
    width: 240px;
    background: #162033;
    color: #ffffff;
    padding: 18px;
    box-shadow: var(--shadow);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

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

.stats-row span {
    color: #b9c8d4;
}

.auth-modal[hidden] {
    display: none;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 20, 32, 0.52);
}

.auth-dialog {
    position: relative;
    width: min(440px, 100%);
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 28px;
    border-radius: 8px;
}

.auth-close {
    position: absolute;
    right: 12px;
    top: 10px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 28px;
    color: var(--muted);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 22px;
}

.auth-tab {
    border: 1px solid var(--line);
    background: #f7fafb;
    color: var(--ink);
    min-height: 40px;
    border-radius: 6px;
    font-weight: 700;
}

.auth-tab.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #ffffff;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin: 0 0 18px;
    font-size: 28px;
}

.auth-form label {
    display: block;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--ink);
}

.auth-form input {
    display: block;
    width: 100%;
    height: 44px;
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 12px;
    outline: none;
}

.auth-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(47, 149, 211, 0.14);
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 6px;
    background: var(--blue);
    color: #ffffff;
    font-weight: 800;
    margin-top: 8px;
}

.auth-status {
    min-height: 22px;
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.35;
}

@media (max-width: 980px) {
    .landing-page {
        min-height: auto;
        overflow: visible;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 48px 0 28px;
    }

    .product-scene {
        min-height: 520px;
    }

    .scene-toolbar {
        width: 150px;
        height: 460px;
    }

    .worksheet-preview {
        width: 82%;
        padding: 36px;
    }
}

@media (max-width: 620px) {
    .landing-page {
        padding: 20px;
    }

    .hero {
        min-height: auto;
    }

    .hero-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-scene {
        min-height: 420px;
    }

    .scene-toolbar {
        display: none;
    }

    .worksheet-preview {
        inset: 0 auto auto 0;
        width: 100%;
        padding: 24px;
    }

    .preview-title {
        font-size: 22px;
    }

    .answer-grid {
        grid-template-columns: 1fr;
        max-width: 230px;
        gap: 10px;
    }

    .drop-preview,
    .drag-preview,
    .input-preview,
    .stats-preview {
        display: none;
    }
}
