:root {
    color-scheme: light;
    --bg: #f6f2ec;
    --ink: #1e1a16;
    --muted: rgba(30, 26, 22, 0.65);
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: #ffffff;
    --line: rgba(30, 26, 22, 0.12);
    --accent: #e76f51;
    --accent-strong: #c2543b;
    --accent-soft: #f4a261;
    --shadow: 0 20px 50px rgba(30, 26, 22, 0.12);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #fff1e7 0%, transparent 52%),
        radial-gradient(circle at 20% 90%, #fdebd1 0%, transparent 45%),
        linear-gradient(135deg, #f6f2ec 0%, #fbe8dd 45%, #f7efe8 100%);
    color: var(--ink);
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    padding: 56px 20px 80px;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(30, 26, 22, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    opacity: 0.25;
}

body.loaded .hero,
body.loaded .results {
    opacity: 1;
    transform: translateY(0);
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(0.5px);
    opacity: 0.7;
    animation: float 12s ease-in-out infinite;
}

.orb--one {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, #f4a261 0%, rgba(244, 162, 97, 0.1) 70%);
    top: -60px;
    right: 10%;
}

.orb--two {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #e76f51 0%, rgba(231, 111, 81, 0.08) 70%);
    bottom: -120px;
    left: -60px;
    animation-delay: -3s;
}

.orb--three {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #2a9d8f 0%, rgba(42, 157, 143, 0.08) 70%);
    top: 45%;
    left: 65%;
    animation-delay: -6s;
}

.shell {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.brand-mark {
    font-family: 'Fraunces', 'Times New Roman', serif;
    font-size: 24px;
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 14px;
    color: var(--muted);
}

.status-pill {
    background: rgba(30, 26, 22, 0.07);
    border: 1px solid rgba(30, 26, 22, 0.08);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0.4px;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    align-items: stretch;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    color: var(--accent-strong);
    margin: 0;
}

.hero h1 {
    font-family: 'Fraunces', 'Times New Roman', serif;
    font-size: clamp(32px, 4vw, 48px);
    margin: 0;
}

.subtitle {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.hero-stats div {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(30, 26, 22, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-weight: 700;
    font-size: 20px;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
}

.hero-panel {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid rgba(30, 26, 22, 0.12);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.panel-header h2 {
    margin: 0;
    font-size: 20px;
}

.ghost {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: border 0.2s ease, color 0.2s ease;
}

.ghost:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.control span {
    font-weight: 600;
    color: var(--ink);
}

select {
    appearance: none;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    padding: 10px 12px;
    font-size: 14px;
    background: var(--panel-strong);
    color: var(--ink);
    font-family: inherit;
}

input,
textarea {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    padding: 10px 12px;
    font-size: 14px;
    background: var(--panel-strong);
    color: var(--ink);
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.preview {
    border-radius: var(--radius-md);
    border: 1px dashed rgba(30, 26, 22, 0.2);
    background: rgba(255, 255, 255, 0.6);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

.preview-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-title {
    margin: 0;
    font-weight: 600;
    color: var(--ink);
}

.preview-desc {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.preview img {
    width: 100%;
    height: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

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

.chip {
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 8px 14px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip.is-active {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(231, 111, 81, 0.3);
}

.cta {
    border: none;
    border-radius: 999px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #e76f51, #f4a261);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(231, 111, 81, 0.3);
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.results-header h2 {
    margin: 0;
    font-size: 26px;
}

.results-note {
    background: rgba(255, 255, 255, 0.65);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(30, 26, 22, 0.08);
    font-size: 13px;
    color: var(--muted);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.contact {
    background: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(30, 26, 22, 0.1);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.comments {
    background: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(30, 26, 22, 0.1);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.comments-header h2 {
    margin: 0;
    font-size: 24px;
}

.comments-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    max-width: 320px;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.contact-header h2 {
    margin: 0;
    font-size: 24px;
}

.contact-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    max-width: 320px;
}

.contact-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.control--full {
    grid-column: 1 / -1;
}

.form-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}


.card {
    background: var(--panel-strong);
    border-radius: var(--radius-md);
    border: 1px solid rgba(30, 26, 22, 0.08);
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 180px;
    opacity: 0;
    transform: translateY(12px);
}

.card.is-visible {
    animation: fadeUp 0.5s ease forwards;
}

.card h3 {
    margin: 0;
    font-size: 18px;
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(231, 111, 81, 0.12);
    color: var(--accent-strong);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

.confidence-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
}

.confidence-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(231, 111, 81, 0.12);
    overflow: hidden;
}

.confidence-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(135deg, #e76f51, #f4a261);
    border-radius: 999px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(18px);
    }
    100% {
        transform: translateY(0px);
    }
}

@media (max-width: 960px) {
    body {
        padding: 40px 16px 60px;
    }

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

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .comments-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 680px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        padding: 22px;
    }

    .results-note {
        width: 100%;
    }

    .contact {
        padding: 24px;
    }

    .contact-subtitle {
        max-width: none;
    }

    .comments {
        padding: 24px;
    }

    .comments-subtitle {
        max-width: none;
    }
}
