:root {
    --bg: #f4efe6;
    --bg-strong: #e5d4b8;
    --surface: rgba(255, 250, 242, 0.82);
    --surface-strong: #fffaf2;
    --ink: #1f2a30;
    --muted: #5b6770;
    --accent: #0f766e;
    --accent-strong: #0a4f51;
    --accent-soft: rgba(15, 118, 110, 0.14);
    --warning: #b45309;
    --danger: #b42318;
    --shadow: 0 22px 44px rgba(31, 42, 48, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.22), transparent 28%),
        radial-gradient(circle at 90% 10%, rgba(180, 83, 9, 0.18), transparent 24%),
        linear-gradient(135deg, var(--bg) 0%, #f8f4ed 42%, var(--bg-strong) 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.brand strong,
h1,
h2 {
    font-family: Georgia, Cambria, "Times New Roman", serif;
}

.brand strong {
    font-size: 1.75rem;
}

.brand-kicker,
.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-card,
.question-shell,
.result-shell {
    display: grid;
    gap: 24px;
}

.hero-card {
    grid-template-columns: 1.4fr 1fr;
    align-items: stretch;
}

.panel,
.hero-copy,
.progress-card,
.result-summary {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-copy,
.panel,
.progress-card,
.result-summary {
    padding: 28px;
}

.hero-copy h1,
.result-summary h1,
.progress-card h1 {
    margin: 10px 0 12px;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1;
}

.hero-copy p,
.question-intro p,
.callout,
.panel p {
    color: var(--muted);
}

.feature-list,
.summary-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
}

.feature-list li,
.summary-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(31, 42, 48, 0.08);
}

.stack-form,
.question-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stack-form label,
.ranking-row,
.binary-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

input,
select {
    width: 100%;
    border: 1px solid rgba(31, 42, 48, 0.18);
    border-radius: 16px;
    padding: 14px 16px;
    font: inherit;
    color: var(--ink);
    background: var(--surface-strong);
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    padding: 12px 20px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.primary-button {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 12px 26px rgba(15, 118, 110, 0.28);
}

.ghost-button {
    border: 1px solid rgba(31, 42, 48, 0.14);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.5);
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.flash,
.error-box,
.callout {
    border-radius: 18px;
    padding: 14px 16px;
}

.flash-info,
.flash-warning,
.callout {
    background: rgba(180, 83, 9, 0.1);
    color: #7c3a03;
}

.error-box {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
}

.progress-card,
.result-summary,
.panel-inline,
.section-heading,
.form-actions,
.summary-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.progress-track,
.bar-track {
    width: 100%;
    background: rgba(31, 42, 48, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-track {
    width: min(280px, 50vw);
    height: 10px;
}

.progress-track span,
.bar-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #f59e0b);
}

.ranking-grid,
.binary-grid,
.stats-grid,
.table-grid {
    display: grid;
    gap: 18px;
}

.ranking-row,
.binary-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(31, 42, 48, 0.08);
    border-radius: 20px;
}

.ranking-row {
    grid-template-columns: 110px 1fr auto;
    align-items: center;
    display: grid;
}

.ranking-select {
    max-width: 96px;
}

.ranking-text {
    font-weight: 700;
}

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

.binary-card {
    position: relative;
    cursor: pointer;
}

.binary-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.binary-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.helper-text {
    margin: 0;
    color: var(--danger);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(31, 42, 48, 0.08);
}

th {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chart-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bar-row {
    display: grid;
    grid-template-columns: 130px 1fr 48px;
    align-items: center;
    gap: 12px;
}

.bar-track {
    height: 14px;
}

.result-summary {
    align-items: end;
}

.summary-stat {
    flex-direction: column;
    align-items: flex-start;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

.pill-ok {
    background: rgba(15, 118, 110, 0.14);
    color: var(--accent-strong);
}

.pill-warn {
    background: rgba(180, 83, 9, 0.12);
    color: #7c3a03;
}

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

.summary-list small {
    color: var(--muted);
}

.error-panel {
    max-width: 640px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .hero-card,
    .table-grid,
    .stats-grid,
    .binary-grid {
        grid-template-columns: 1fr;
    }

    .progress-card,
    .result-summary,
    .section-heading,
    .panel-inline,
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ranking-row,
    .bar-row {
        grid-template-columns: 1fr;
    }

    .progress-track {
        width: 100%;
    }
}

