
:root {
    color-scheme: light;
    --background: #f5f7fc;
    --surface: #ffffff;
    --text: #192338;
    --muted: #68748a;
    --border: #e1e7f0;
    --primary: #3659d9;
    --primary-hover: #2745b8;
    --soft-blue: #edf2ff;
    --green: #18794e;
    --orange: #a45a08;
    --red: #b42318;
    --radius: 15px;
    --shadow: 0 8px 28px rgba(23, 35, 58, 0.055);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    font-size: 16px;
    line-height: 1.65;
}

button,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--primary);
}

.container {
    width: min(1080px, calc(100% - 32px));
    margin-inline: auto;
}

/* Header */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.header-note {
    color: var(--muted);
    font-size: 0.88rem;
}

/* Hero */

.hero {
    padding: 54px 0 34px;
    text-align: center;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 820px;
    margin: 0 auto 16px;
    font-size: clamp(2rem, 5vw, 3.35rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.055em;
}

.hero p {
    max-width: 680px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 1.05rem;
}

main {
    padding-bottom: 45px;
}

/* General panels */

.panel {
    margin-bottom: 24px;
    padding: clamp(20px, 4vw, 32px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section-heading {
    margin: 0 0 18px;
    font-size: 1.45rem;
    line-height: 1.35;
    letter-spacing: -0.025em;
}

.section-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.section-top .section-heading {
    margin-bottom: 0;
}

/* Text editor */

label {
    display: block;
    margin-bottom: 9px;
    font-weight: 700;
}

textarea {
    display: block;
    width: 100%;
    min-height: 260px;
    padding: 16px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    line-height: 1.75;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

textarea::placeholder {
    color: #98a2b3;
}

textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(54, 89, 217, 0.13);
}

.editor-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 9px 0 20px;
    color: var(--muted);
    font-size: 0.87rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Buttons */

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.4;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.button:active {
    transform: translateY(1px);
}

.button:focus-visible {
    outline: 3px solid #a9baff;
    outline-offset: 3px;
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-secondary {
    background: #f0f3f9;
    border-color: #e0e6f0;
    color: var(--text);
}

.button-secondary:hover {
    background: #e6ebf5;
}

/* Notices */

.notice {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #f0d29a;
    border-radius: 9px;
    background: #fff6e5;
    color: #77440b;
}

/* Statistics */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin: 22px 0 30px;
}

.stat-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f8faff;
}

.stat-value {
    display: block;
    overflow-wrap: anywhere;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.04em;
}

.stat-label {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.84rem;
}

/* Score cards */

.scores-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.score-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.score-card h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 750;
}

.score-value {
    margin-bottom: 6px;
    font-size: 2.15rem;
    font-weight: 850;
    line-height: 1.25;
    letter-spacing: -0.05em;
}

.score-label {
    display: inline-flex;
    margin: 5px 0 10px;
    padding: 4px 10px;
    border-radius: 30px;
    background: var(--soft-blue);
    color: #294ab6;
    font-size: 0.82rem;
    font-weight: 750;
}

.score-unavailable {
    color: var(--orange);
    font-size: 0.92rem;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.88rem;
}

.score-card p {
    margin-bottom: 0;
}

/* Suggestions */

.suggestion-list {
    margin: 0;
    padding-left: 22px;
}

.suggestion-list > li {
    margin-bottom: 17px;
    padding-left: 4px;
}

.suggestion-list > li:last-child {
    margin-bottom: 0;
}

.sentence-item {
    margin-top: 12px;
    list-style: disc;
}

.sentence-count {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.sentence-text {
    display: block;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8faff;
    overflow-wrap: anywhere;
}

/* Explanatory content */

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.info-grid h3 {
    margin: 0 0 7px;
    font-size: 1rem;
}

.info-grid p {
    margin-top: 0;
    margin-bottom: 0;
}

/* Hidden content */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Footer */

.site-footer {
    padding: 25px 0 35px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.site-footer p {
    margin: 5px 0;
}

.site-footer .small {
    max-width: 850px;
}

/* Responsive layout */

@media (max-width: 760px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hero {
        padding-top: 40px;
    }
}

@media (max-width: 540px) {
    .container {
        width: min(100% - 22px, 1080px);
    }

    .header-inner {
        min-height: 62px;
    }

    .header-note {
        font-size: 0.75rem;
        text-align: right;
    }

    .hero {
        padding: 34px 0 26px;
    }

    .hero h1 {
        font-size: 2.1rem;
    }

    .hero p {
        font-size: 0.96rem;
    }

    .panel {
        padding: 19px 15px;
        border-radius: 12px;
    }

    .section-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid {
        gap: 9px;
    }

    .stat-card {
        padding: 13px;
    }

    .stat-label {
        font-size: 0.78rem;
    }

    .scores-grid {
        grid-template-columns: 1fr;
    }

    .actions .button {
        flex: 1 1 auto;
    }

    #copy-summary {
        width: 100%;
    }

    textarea {
        min-height: 220px;
        padding: 13px;
    }
}

@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;
    }
}
