:root {
    color-scheme: dark;
    --bg-start: #07111f;
    --bg-mid: #102a43;
    --bg-end: #0f766e;
    --panel: rgba(14, 23, 39, 0.56);
    --panel-strong: rgba(18, 30, 50, 0.78);
    --border: rgba(255, 255, 255, 0.15);
    --text: #e9eef7;
    --muted: rgba(233, 238, 247, 0.74);
    --accent: #8be9fd;
    --accent-strong: #ffd166;
    --danger: #ff9aa2;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(139, 233, 253, 0.22), transparent 34%),
        radial-gradient(circle at top right, rgba(255, 209, 102, 0.18), transparent 28%),
        linear-gradient(135deg, var(--bg-start), var(--bg-mid) 52%, var(--bg-end));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 96%);
}

.page-shell {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(8, 17, 31, 0.58);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: var(--shadow);
    position: sticky;
    top: 16px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}

.brand strong,
.brand small {
    display: block;
}

.brand small,
.eyebrow,
.panel-head p,
.hero-copy p,
.micro-copy,
.workflow-card p,
.file-copy span,
.result-card p,
.detail-list dd {
    color: var(--muted);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(139, 233, 253, 0.95), rgba(255, 209, 102, 0.84));
    color: #07111f;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.topbar-link {
    color: var(--text);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

.content-wrap {
    display: grid;
    gap: 24px;
    padding-top: 24px;
}

.glass-panel {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(24px) saturate(170%);
    box-shadow: var(--shadow);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.hero-copy,
.form-panel,
.workflow-card,
.result-card {
    border-radius: 28px;
    padding: 28px;
}

.hero-copy h1 {
    margin: 14px 0 16px;
    max-width: 12ch;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2.5rem, 5vw, 4.7rem);
    line-height: 0.95;
}

.hero-copy p {
    max-width: 62ch;
    font-size: 1.02rem;
    line-height: 1.7;
}

.eyebrow {
    display: inline-flex;
    padding: 8px 14px;
    border: 1px solid rgba(139, 233, 253, 0.22);
    border-radius: 999px;
    background: rgba(139, 233, 253, 0.08);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.hero-metrics div,
.workflow-card,
.score-card,
.detail-list div,
.chip,
.primary-button,
.topbar-link {
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.hero-metrics div {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(5, 12, 25, 0.26);
}

.hero-metrics strong,
.workflow-card h3,
.result-card h3,
.result-card h2 {
    display: block;
    margin-bottom: 8px;
}

.form-panel .panel-head h2,
.result-card h2,
.result-card h3,
.workflow-card h3 {
    font-family: "Fraunces", Georgia, serif;
}

.analysis-form {
    display: grid;
    gap: 18px;
}

.field-group {
    display: grid;
    gap: 10px;
}

.field-group > span {
    font-size: 0.94rem;
    font-weight: 600;
}

.file-dropzone {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    background: rgba(5, 12, 25, 0.24);
}

.file-input,
.textarea-input {
    width: 100%;
    color: var(--text);
    font: inherit;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(7, 15, 28, 0.66);
    outline: none;
}

.file-input {
    padding: 14px;
}

.textarea-input {
    min-height: 300px;
    padding: 16px;
    resize: vertical;
    line-height: 1.6;
}

.file-copy strong {
    display: block;
    font-size: 0.98rem;
    margin-bottom: 4px;
}

.field-error {
    color: var(--danger);
    font-size: 0.92rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.export-form {
    margin-top: 14px;
}

.primary-button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 14px 20px;
    color: #07111f;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.ghost-button {
    appearance: none;
    border: 1px solid rgba(139, 233, 253, 0.3);
    border-radius: 999px;
    padding: 11px 16px;
    color: var(--text);
    background: rgba(139, 233, 253, 0.08);
    font-weight: 700;
    cursor: pointer;
}

.primary-button:hover,
.ghost-button:hover,
.hero-metrics div:hover,
.workflow-card:hover,
.topbar-link:hover,
.chip:hover {
    transform: translateY(-2px);
}

.workflow-strip,
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.workflow-card span {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(139, 233, 253, 0.1);
    color: var(--accent);
    font-weight: 700;
}

.results-grid {
    grid-template-areas:
        "score score snapshot"
        "strengths gaps tips";
}

.score-card { grid-area: score; }

.result-card:nth-child(2) { grid-area: snapshot; }
.result-card:nth-child(3) { grid-area: strengths; }
.result-card:nth-child(4) { grid-area: gaps; }
.result-card:nth-child(5) { grid-area: tips; }

.wide-card {
    grid-column: span 1;
}

.full-width-card {
    grid-column: 1 / -1;
}

.score-ring {
    --ring-size: 148px;
    width: var(--ring-size);
    height: var(--ring-size);
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(7, 17, 31, 0.92) 55%, transparent 56%),
        conic-gradient(var(--accent) calc(var(--score) * 1%), rgba(255, 255, 255, 0.12) 0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.score-ring span {
    font-size: 2rem;
    font-weight: 800;
}

.score-ring small {
    margin-top: 38px;
    font-size: 0.82rem;
    color: var(--muted);
}

.detail-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.detail-list div {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(7, 17, 31, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-list dt {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.detail-list dd,
.result-list {
    margin: 0;
}

.result-list,
.ordered-list {
    display: grid;
    gap: 10px;
    padding-left: 20px;
    line-height: 1.6;
}

.tailored-textarea {
    width: 100%;
    min-height: 230px;
    padding: 14px;
    color: var(--text);
    line-height: 1.55;
    font-size: 0.95rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(7, 17, 31, 0.35);
    overflow-x: auto;
    overflow-y: auto;
    resize: both;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(139, 233, 253, 0.1);
    border: 1px solid rgba(139, 233, 253, 0.18);
}

.flash-stack {
    display: grid;
    gap: 10px;
}

.flash {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 960px) {
    .hero-grid,
    .workflow-strip,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-areas: none;
    }

    .result-card:nth-child(n) {
        grid-area: auto;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .topbar {
        position: static;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 12px;
    }

    .hero-copy,
    .form-panel,
    .workflow-card,
    .result-card {
        padding: 20px;
        border-radius: 22px;
    }

    .hero-copy h1 {
        max-width: none;
        font-size: clamp(2.2rem, 13vw, 3.6rem);
    }
}
