:root {
    color-scheme: light;
    font-family: Inter, ui-rounded, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ink: #17233d;
    --muted: #68748c;
    --paper: #fffdf8;
    --cream: #f7f1e6;
    --blue: #2859b8;
    --blue-dark: #163f91;
    --yellow: #ffc857;
    --coral: #f06f5e;
    --line: #dce3ef;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 12%, rgb(255 200 87 / 30%) 0 110px, transparent 111px),
        radial-gradient(circle at 95% 88%, rgb(240 111 94 / 18%) 0 170px, transparent 171px),
        var(--cream);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    opacity: 0.22;
    background-image: linear-gradient(#c7bda8 1px, transparent 1px), linear-gradient(90deg, #c7bda8 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.page-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(430px, 1.12fr);
    gap: clamp(3rem, 7vw, 7rem);
    align-items: center;
    width: min(1180px, calc(100% - 3rem));
    min-height: calc(100vh - 70px);
    margin: 0 auto;
    padding: 4rem 0 2rem;
}

.intro__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.8rem;
    color: var(--blue-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgb(255 255 255 / 68%);
    border: 1px solid rgb(40 89 184 / 20%);
    border-radius: 999px;
}

.intro h1 {
    margin: 1.25rem 0 1.2rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.3rem, 6vw, 5.8rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.055em;
}

.intro h1 span {
    color: var(--blue);
}

.intro > p {
    max-width: 38rem;
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.intro__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding: 0;
    margin: 2.2rem 0 0;
    list-style: none;
}

.intro__facts li {
    display: flex;
    align-items: baseline;
    gap: 0.42rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.intro__facts strong {
    color: var(--ink);
    font-size: 1.2rem;
}

.generator-card {
    position: relative;
    padding: clamp(1.5rem, 3vw, 2.6rem);
    background: rgb(255 253 248 / 94%);
    border: 1px solid rgb(255 255 255 / 90%);
    border-radius: 28px;
    box-shadow: 0 28px 70px rgb(38 45 63 / 14%), 0 4px 14px rgb(38 45 63 / 6%);
    backdrop-filter: blur(10px);
}

.generator-card::after {
    position: absolute;
    top: -12px;
    right: 36px;
    width: 72px;
    height: 24px;
    content: "";
    background: rgb(255 200 87 / 68%);
    transform: rotate(3deg);
}

.generator-card__heading {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.step-number {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    color: white;
    font-weight: 800;
    place-items: center;
    background: var(--blue);
    border-radius: 14px;
    transform: rotate(-3deg);
}

.generator-card h2 {
    margin: 0;
    font-size: 1.45rem;
}

.generator-card__heading p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.alert {
    padding: 0.85rem 1rem;
    margin-bottom: 1.2rem;
    color: #8a2d22;
    font-weight: 650;
    background: #fff0ed;
    border: 1px solid #f3b7ae;
    border-radius: 12px;
}

.field-group {
    margin-bottom: 1.25rem;
}

.field-group > label,
.content-choice > legend {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.9rem;
    font-weight: 800;
}

input[type="text"],
select {
    width: 100%;
    height: 52px;
    padding: 0 0.95rem;
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    background: white;
    border: 1px solid #cfd8e8;
    border-radius: 12px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgb(40 89 184 / 12%);
}

.field-hint,
.advanced-choice > p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.content-choice {
    padding: 0;
    margin: 1.5rem 0 0;
    border: 0;
}

.choice-card {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    padding: 0.8rem;
    cursor: pointer;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.choice-card:hover {
    border-color: #aebddd;
    transform: translateY(-1px);
}

.choice-card:has(input:checked) {
    background: #f4f7ff;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgb(40 89 184 / 10%);
}

.choice-card input {
    position: absolute;
    opacity: 0;
}

.choice-card__mark {
    display: grid;
    flex: 0 0 auto;
    min-width: 48px;
    height: 48px;
    padding: 0 0.45rem;
    color: var(--blue-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 700;
    place-items: center;
    background: #e8efff;
    border-radius: 12px;
}

.choice-card strong,
.choice-card small {
    display: block;
}

.choice-card strong {
    margin-bottom: 0.15rem;
    font-size: 0.92rem;
}

.choice-card small {
    color: var(--muted);
    font-size: 0.76rem;
}

.suggestions {
    margin-top: 0.95rem;
}

.suggestions__title {
    margin: 0 0 0.5rem;
    color: var(--blue-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.suggestions__list {
    display: grid;
    gap: 0.5rem;
}

.advanced-choice {
    margin-top: 0.8rem;
}

.advanced-choice summary {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.phoneme-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.phoneme-grid label {
    cursor: pointer;
}

.phoneme-grid input {
    position: absolute;
    opacity: 0;
}

.phoneme-grid span {
    display: grid;
    min-height: 40px;
    font-size: 0.9rem;
    font-weight: 750;
    place-items: center;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.phoneme-grid input:checked + span {
    color: white;
    background: var(--blue);
    border-color: var(--blue);
}

.form-status {
    min-height: 1.3em;
    margin: 1rem 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 0.8rem 1.1rem;
    color: white;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    background: var(--blue);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 9px 22px rgb(40 89 184 / 22%);
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.submit-button:hover {
    background: var(--blue-dark);
    box-shadow: 0 12px 28px rgb(40 89 184 / 28%);
    transform: translateY(-1px);
}

.submit-button:active {
    transform: translateY(1px);
}

.submit-button svg {
    width: 21px;
    margin-left: 0.55rem;
}

footer {
    padding: 0 1rem 1.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    text-align: center;
}

@media (max-width: 900px) {
    .page-shell {
        grid-template-columns: 1fr;
        gap: 2.8rem;
        width: min(680px, calc(100% - 2rem));
        padding-top: 2.5rem;
    }

    .intro h1 {
        font-size: clamp(3.2rem, 12vw, 5rem);
    }
}

@media (max-width: 520px) {
    .page-shell {
        width: min(100% - 1rem, 680px);
        padding-top: 1.5rem;
    }

    .intro {
        padding: 0 0.5rem;
    }

    .intro__facts {
        gap: 0.55rem 1rem;
    }

    .generator-card {
        padding: 1.15rem;
        border-radius: 20px;
    }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
