:root {
    color-scheme: light;
    --ink: #191714;
    --muted: #68635b;
    --line: #ded8cf;
    --paper: #f7f3ed;
    --white: #fffdf8;
    --gold: #e3af37;
    --red: #c94b3f;
    --blue: #426f84;
    --green: #2f7d65;
    --shadow: 0 18px 48px rgba(34, 27, 18, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(220px, 520px) auto;
    gap: 18px;
    align-items: center;
    padding: 16px clamp(18px, 4vw, 56px);
    background: rgba(247, 243, 237, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    font-weight: 850;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--gold);
}

.nav-search,
.hero-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.nav-search input,
.hero-search input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    outline: none;
}

.nav-search input {
    height: 42px;
    padding: 0 48px 0 16px;
    border-radius: 8px;
}

.nav-search button {
    position: absolute;
    right: 4px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: var(--ink);
    color: var(--white);
    cursor: pointer;
}

.nav-link,
.primary-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    font-weight: 750;
}

.hero {
    min-height: calc(100vh - 168px);
    display: grid;
    align-items: center;
    padding: clamp(48px, 8vw, 96px) clamp(18px, 5vw, 80px);
    background:
        linear-gradient(120deg, rgba(255, 253, 248, 0.92), rgba(255, 253, 248, 0.68)),
        radial-gradient(circle at 20% 20%, rgba(227, 175, 55, 0.35), transparent 34%),
        linear-gradient(135deg, #f7f3ed 0%, #efe2d2 46%, #ccdbe0 100%);
}

.hero-inner,
.page-shell,
.content-band {
    width: min(1120px, calc(100vw - 36px));
    margin: 0 auto;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--red);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(3.2rem, 11vw, 8.5rem);
    line-height: 0.88;
    letter-spacing: 0;
}

.hero-copy {
    max-width: 700px;
    margin: 24px 0;
    color: #3c3832;
    font-size: 1.2rem;
    line-height: 1.6;
}

.hero-search {
    max-width: 760px;
    align-items: stretch;
    gap: 10px;
}

.hero-search input {
    min-height: 66px;
    padding: 0 22px;
    border-radius: 8px;
    font-size: 1.05rem;
    box-shadow: var(--shadow);
}

.hero-search button {
    min-width: 128px;
    border: 0;
    border-radius: 8px;
    background: var(--red);
    color: var(--white);
    font-size: 1rem;
    font-weight: 850;
    cursor: pointer;
}

.example-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.example-row a,
.score-chip,
.select-label {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--line);
    color: #3c3832;
    font-size: 0.92rem;
    font-weight: 750;
}

.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    display: none;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.suggestions.is-open {
    display: block;
}

.suggestion {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--line);
}

.suggestion:last-child {
    border-bottom: 0;
}

.suggestion:hover {
    background: #f3eee6;
}

.suggestion img,
.result-item img,
.person-card img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    background: #ddd4c7;
}

.flag-tile {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff8e8;
    font-size: 1.35rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0;
}

.flag-tile-empty {
    background: var(--blue);
    color: var(--white);
    font-size: 1.05rem;
}

.suggestion img {
    width: 42px;
    height: 42px;
}

.suggestion .flag-tile {
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
}

.suggestion strong,
.suggestion span,
.result-copy strong,
.result-copy span,
.result-copy small {
    display: block;
}

.suggestion span,
.result-copy span,
.result-copy small,
.section-heading p,
.empty-state p,
.site-footer,
.model-note {
    color: var(--muted);
}

.page-shell,
.content-band {
    padding: clamp(36px, 7vw, 76px) 0;
}

.section-heading {
    margin-bottom: 26px;
}

.section-heading h1 {
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 0.96;
}

.section-heading h2,
.content-band h2 {
    margin: 0 0 12px;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.result-list {
    display: grid;
    gap: 12px;
}

.result-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.result-item:hover,
.person-card:hover {
    border-color: #b8a990;
    transform: translateY(-1px);
}

.avatar {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 8px;
    background: var(--blue);
    color: var(--white);
    font-weight: 850;
}

.avatar-large {
    width: 100%;
    height: 100%;
    min-height: 340px;
    font-size: 7rem;
}

.person-hero {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
    width: min(1180px, calc(100vw - 36px));
    margin: 0 auto;
    padding: clamp(28px, 4vw, 46px) 0 22px;
}

.person-media img {
    width: 100%;
    height: clamp(340px, 48vw, 520px);
    min-height: 0;
    object-fit: cover;
    object-position: 50% 35%;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.person-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 4px 0 0;
}

.person-panel h1 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 0.96;
}

.person-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.person-meta span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: #454039;
    font-size: 0.9rem;
    font-weight: 700;
}

.score-layout {
    display: grid;
    grid-template-columns: 148px 1fr;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
}

.score-ring {
    display: grid;
    width: 148px;
    height: 148px;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--paper) 58%, transparent 59%),
        conic-gradient(var(--green) calc(var(--score) * 1%), var(--red) 0);
}

.score-ring.is-loading {
    animation: scorePulse 1.4s ease-in-out infinite;
    background:
        radial-gradient(circle at center, var(--paper) 58%, transparent 59%),
        conic-gradient(var(--gold), var(--blue), var(--red), var(--gold));
}

.score-ring span {
    font-size: 3rem;
    font-weight: 900;
}

.score-ring small {
    margin-top: -40px;
    color: var(--muted);
    font-weight: 800;
}

.verdict {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 850;
}

.disclaimer {
    margin-top: 18px;
    padding: 14px 16px;
    border-left: 4px solid var(--red);
    background: var(--white);
    color: #453d35;
}

.calculation-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 750;
}

.loading-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.loading-steps span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.loading-steps span.is-active {
    border-color: var(--gold);
    background: #fff4cc;
    color: var(--ink);
}

.source-link {
    width: fit-content;
    margin-top: 10px;
    color: var(--blue);
    font-weight: 800;
}

.source-link.is-disabled {
    pointer-events: none;
    color: var(--muted);
    opacity: 0.68;
}

.related-people {
    margin-top: 22px;
}

.related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.related-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 850;
}

.related-controls {
    display: inline-flex;
    gap: 8px;
}

.related-controls button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 850;
}

.related-controls button:hover {
    border-color: var(--blue);
}

.redo-score-button {
    min-height: 36px;
    margin-top: 8px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--ink);
    color: var(--white);
    font-weight: 850;
    cursor: pointer;
}

.redo-score-button:hover {
    background: #302b25;
}

.redo-score-button:disabled {
    cursor: wait;
    opacity: 0.68;
}

.redo-score-status {
    min-height: 18px;
    margin-top: 8px;
}

.related-track {
    display: grid;
    grid-auto-columns: minmax(188px, 228px);
    grid-auto-flow: column;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 2px 2px 12px;
    scroll-snap-type: inline mandatory;
    scrollbar-color: var(--blue) rgba(66, 111, 132, 0.14);
    scrollbar-width: thin;
}

.related-track::-webkit-scrollbar {
    height: 10px;
}

.related-track::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(66, 111, 132, 0.14);
}

.related-track::-webkit-scrollbar-thumb {
    border: 2px solid rgba(255, 253, 248, 0.9);
    border-radius: 999px;
    background: var(--blue);
}

.related-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 76px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.82);
    scroll-snap-align: start;
}

.related-card:hover {
    border-color: var(--blue);
}

.related-card img,
.related-card .flag-tile {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    object-position: 50% 35%;
}

.related-card strong,
.related-card small {
    display: block;
}

.related-card strong {
    font-size: 0.94rem;
    line-height: 1.2;
}

.related-card small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.related-card-loading {
    pointer-events: none;
}

.related-skeleton-media,
.related-skeleton-line {
    display: block;
    border-radius: 8px;
    background: linear-gradient(90deg, #e8dfd2 0%, #f8f3ec 44%, #e8dfd2 88%);
    background-size: 220% 100%;
    animation: shimmer 1.35s linear infinite;
}

.related-skeleton-media {
    width: 54px;
    height: 54px;
}

.related-skeleton-line {
    width: 100%;
    max-width: 96px;
    height: 13px;
}

.related-skeleton-line.short {
    width: 68%;
    max-width: 72px;
    margin-top: 9px;
}

.person-page-section.content-band {
    padding-top: 24px;
    padding-bottom: 32px;
}

.two-column,
.moral-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.two-column article,
.evidence-panel,
.empty-state {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.evidence-panel {
    position: relative;
    overflow: hidden;
    min-height: 230px;
}

.evidence-panel h2 {
    display: flex;
    gap: 10px;
    align-items: center;
}

.evidence-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.52;
}

.evidence-panel-hell {
    border-color: #d99b91;
    background: #fff7f3;
}

.evidence-panel-hell::before {
    background:
        linear-gradient(180deg, transparent 0%, rgba(201, 75, 63, 0.1) 100%),
        radial-gradient(ellipse at 14% 110%, rgba(201, 75, 63, 0.32) 0 14%, transparent 34%),
        radial-gradient(ellipse at 42% 112%, rgba(227, 175, 55, 0.26) 0 12%, transparent 30%),
        radial-gradient(ellipse at 72% 112%, rgba(201, 75, 63, 0.28) 0 16%, transparent 34%);
}

.evidence-panel-hell h2 {
    color: #8f2e26;
}

.evidence-panel-heaven {
    border-color: #89baa8;
    background: #f3fff9;
}

.evidence-panel-heaven::before {
    background:
        linear-gradient(180deg, rgba(47, 125, 101, 0.1) 0%, transparent 42%),
        radial-gradient(circle at 88% 16%, rgba(47, 125, 101, 0.2), transparent 30%);
}

.evidence-panel-heaven h2 {
    color: #1f654f;
}

.evidence-panel > * {
    position: relative;
}

.panel-note {
    margin: -4px 0 16px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.evidence-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    color: #37332e;
    line-height: 1.65;
}

.evidence-list li {
    margin: 0 0 12px;
    padding: 0;
}

.skeleton-line {
    display: block;
    width: min(100%, 520px);
    height: 18px;
    margin: 8px 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #e8dfd2 0%, #f8f3ec 44%, #e8dfd2 88%);
    background-size: 220% 100%;
    animation: shimmer 1.35s linear infinite;
    color: transparent;
}

.skeleton-line.short {
    width: min(68%, 360px);
}

.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.person-card {
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 190px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.person-card img,
.person-card .avatar {
    width: 100%;
    height: 112px;
}

.card-title {
    font-weight: 850;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.trending-card {
    --trend: var(--blue);
    --trend-soft: #eef5f7;
    --trend-line: rgba(66, 111, 132, 0.34);
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 12px;
    min-height: 270px;
    padding: 12px;
    border: 1px solid var(--trend-line);
    border-top: 4px solid var(--trend);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--trend-soft), var(--white) 58%);
    box-shadow: 0 14px 34px rgba(34, 27, 18, 0.1);
}

.trending-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(34, 27, 18, 0.14);
}

.trending-card-low {
    --trend: var(--red);
    --trend-soft: #fff0ec;
    --trend-line: rgba(201, 75, 63, 0.42);
}

.trending-card-mid {
    --trend: var(--gold);
    --trend-soft: #fff8e6;
    --trend-line: rgba(227, 175, 55, 0.5);
}

.trending-card-high {
    --trend: var(--green);
    --trend-soft: #ecf8f1;
    --trend-line: rgba(47, 125, 101, 0.42);
}

.trending-media {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #ddd4c7;
}

.trending-media img,
.trending-media .avatar {
    width: 100%;
    height: 138px;
    object-fit: cover;
}

.trending-media .avatar {
    display: grid;
    font-size: 2rem;
}

.trending-copy {
    display: grid;
    gap: 4px;
    align-content: start;
}

.trending-copy small {
    color: var(--muted);
    font-weight: 700;
}

.trending-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trending-score {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--trend-line);
    border-radius: 999px;
    background: var(--white);
    color: var(--trend);
    font-weight: 850;
}

.trending-score-bar {
    display: block;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(25, 23, 20, 0.1);
}

.trending-score-bar span {
    display: block;
    width: var(--score-width, 50%);
    height: 100%;
    border-radius: inherit;
    background: var(--trend);
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 24px;
    padding: 28px 18px;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
}

@keyframes shimmer {
    from {
        background-position: 120% 0;
    }
    to {
        background-position: -120% 0;
    }
}

@keyframes scorePulse {
    0%,
    100% {
        transform: scale(1);
        filter: saturate(1);
    }
    50% {
        transform: scale(1.03);
        filter: saturate(1.2);
    }
}

@media (max-width: 760px) {
    .site-header {
        grid-template-columns: 1fr auto;
    }

    .nav-search {
        grid-column: 1 / -1;
        order: 3;
    }

    .hero-search,
    .person-hero,
    .score-layout,
    .two-column,
    .moral-columns {
        grid-template-columns: 1fr;
    }

    .hero-search {
        display: grid;
    }

    .hero-search button {
        min-height: 52px;
    }

    .person-media img {
        min-height: 320px;
        max-height: 460px;
    }

    .result-item {
        grid-template-columns: 58px 1fr;
    }

    .select-label {
        grid-column: 2;
        width: fit-content;
    }
}
