/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #edece8;
    --surface: #ffffff;
    --surface-alt: #f5f4f0;
    --text: #2b3330;
    --text-muted: #7a7974;
    --border: #d9d8d3;
    --success: #3d7a52;
    --warning: #a87832;
    --danger: #9b3535;
    --success-bg: #edf5f0;
    --warning-bg: #fdf6ea;
    --danger-bg: #faecec;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Nav ---- */
nav {
    padding: 24px 48px;
    border-bottom: 1px solid var(--border);
}

.brand {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}

/* ---- Container ---- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 48px;
}

/* ---- Hero ---- */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 80px 0 64px;
    gap: 48px;
}

.hero h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 5rem;
    font-weight: 500;
    line-height: 1.05;
    color: var(--text);
    flex: 1;
}

.hero-right {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 8px;
}

.hero-right p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ---- Buttons ---- */
.btn-primary {
    padding: 14px 32px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid var(--text);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--text);
    color: var(--bg);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.btn-primary:hover {
    background: transparent;
    color: var(--text);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-outline {
    display: inline-block;
    padding: 12px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid var(--text);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text);
    letter-spacing: 0.02em;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--text);
    color: var(--bg);
}

/* ---- Main / Form ---- */
main {
    border-top: 1px solid var(--border);
    padding: 48px 0;
}

.analysis-form {
    margin-bottom: 32px;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

#urlInput {
    flex: 1;
    padding: 14px 22px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s;
}

#urlInput:focus {
    outline: none;
    border-color: var(--text);
}

#urlInput::placeholder {
    color: var(--text-muted);
}

.hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding-left: 8px;
}

/* ---- Loading ---- */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 20px;
    border: 3px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-subtext {
    font-size: 0.875rem;
    margin-top: 8px;
}

/* ---- Error ---- */
.error-state {
    text-align: center;
    padding: 48px 20px;
}

.error-state h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 500;
    color: var(--danger);
    margin-bottom: 12px;
}

.error-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ---- Results ---- */
.results-section {
    animation: fadeIn 0.4s ease;
}

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

.result-card {
    background: var(--surface);
    border-radius: 4px;
    padding: 32px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.result-card h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.result-card h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 1.4rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Score Card */
.score-card {
    background: var(--text);
    border-color: var(--text);
    text-align: center;
}

.score-card h2 {
    color: rgba(237, 236, 232, 0.6);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 28px;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(237, 236, 232, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
}

.score-circle.high  { border-color: var(--success); }
.score-circle.medium { border-color: var(--warning); }
.score-circle.low   { border-color: var(--danger); }

#scoreValue {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 500;
    line-height: 1;
    color: var(--bg);
}

.score-label {
    font-size: 1rem;
    color: rgba(237, 236, 232, 0.5);
}

.score-interpretation {
    font-size: 0.9rem;
    color: rgba(237, 236, 232, 0.75);
    max-width: 400px;
}

/* Assessment Grid */
.assessment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.assessment-card {
    background: var(--surface);
    border-radius: 4px;
    padding: 28px;
    border: 1px solid var(--border);
}

.assessment-card h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
    color: var(--text);
}

.status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.status-badge.yes       { background: var(--danger-bg);  color: var(--danger); }
.status-badge.no        { background: var(--success-bg); color: var(--success); }
.status-badge.uncertain { background: var(--warning-bg); color: var(--warning); }

.explanation {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Detailed Analysis */
.analysis-section {
    margin-bottom: 28px;
}

.analysis-section:last-child {
    margin-bottom: 0;
}

.analysis-section h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text);
}

.concerns-list,
.indicators-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.concerns-list li {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    background: var(--danger-bg);
    color: var(--danger);
    border-left: 3px solid var(--danger);
}

.indicators-list li {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    background: var(--success-bg);
    color: var(--success);
    border-left: 3px solid var(--success);
}

#summaryText {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    padding: 20px;
    background: var(--surface-alt);
    border-radius: 4px;
}

.content-description {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Metadata */
.metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 20px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    border-top: 1px solid var(--border);
}

/* Action Buttons */
.action-buttons {
    text-align: center;
    padding-bottom: 16px;
}

/* ---- Footer ---- */
footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- Utility ---- */
.hidden {
    display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    nav {
        padding: 20px 24px;
    }

    .container {
        padding: 0 24px;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 48px 0 40px;
        gap: 32px;
    }

    .hero h1 {
        font-size: 3.2rem;
    }

    .hero-right {
        flex: none;
        width: 100%;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
    }

    .assessment-grid {
        grid-template-columns: 1fr;
    }
}
