/* Aurelia & Family — a candle-lit portrait gallery. */

:root {
    --bg: #0e0a0b;
    --bg-2: #161012;
    --panel: #1c1416;
    --line: rgba(216, 180, 106, .22);
    --gold: #d8b46a;
    --gold-2: #f0d9a4;
    --wine: #6b1426;
    --wine-2: #8e2236;
    --text: #ece3d6;
    --muted: #b0a394;
    --serif: "Cormorant Garamond", Georgia, serif;
    --sans: "Inter", system-ui, -apple-system, sans-serif;
    --radius: 14px;
    --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 50% -200px, rgba(142, 34, 54, .25), transparent 70%),
        var(--bg);
    color: var(--text);
    font: 16px/1.65 var(--sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }

a { color: var(--gold-2); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .55em;
    padding: .85em 1.6em;
    border-radius: 999px;
    border: 1px solid transparent;
    font: 600 .95rem/1 var(--sans);
    letter-spacing: .02em;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.btn--gold {
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    color: #2a1a10;
    box-shadow: 0 6px 24px rgba(216, 180, 106, .25);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(216, 180, 106, .38); }
.btn--ghost { border-color: var(--line); color: var(--muted); background: transparent; }
.btn--ghost:hover { color: var(--text); border-color: var(--gold); }
.btn svg { width: 1.1em; height: 1.1em; }

/* 18+ gate */
.gate {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 5, 6, .88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.gate[hidden] { display: none; }
.gate__card {
    max-width: 420px;
    padding: 40px 32px;
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.gate__badge {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold-2);
    font: 700 1.3rem var(--serif);
}
.gate__title { font: 600 2rem/1.1 var(--serif); margin: 0 0 10px; }
.gate__text { color: var(--muted); margin: 0 0 26px; }
.gate__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px max(20px, calc((100% - var(--max)) / 2));
    background: rgba(14, 10, 11, .78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(216, 180, 106, .1);
}
.header__logo, .footer__logo {
    font: 600 1.35rem var(--serif);
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.header__logo span, .footer__logo span { color: var(--gold); font-style: italic; }
.header__nav { display: flex; gap: 22px; margin-left: auto; }
.header__nav a { color: var(--muted); text-decoration: none; font-size: .92rem; transition: color .2s; }
.header__nav a:hover { color: var(--gold-2); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang__btn {
    display: inline-block;
    padding: 6px 12px;
    text-decoration: none;
    background: none;
    border: 0;
    color: var(--muted);
    font: 600 .78rem var(--sans);
    cursor: pointer;
}
.lang__btn.is-active { background: var(--gold); color: #2a1a10; }

/* Hero */
.hero {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: 110px 20px 90px;
    text-align: center;
}
.hero__glow {
    position: absolute;
    left: 50%;
    top: 40px;
    width: 340px;
    height: 340px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(240, 190, 110, .18), transparent 65%);
    animation: flicker 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes flicker {
    0%, 100% { opacity: .85; transform: translateX(-50%) scale(1); }
    40% { opacity: 1; transform: translateX(-50%) scale(1.04); }
    60% { opacity: .75; transform: translateX(-50%) scale(.98); }
}
.hero__eyebrow {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: .75rem;
    margin: 0 0 18px;
}
.hero__title { font-size: clamp(2.8rem, 7vw, 5rem); margin-bottom: 22px; }
.hero__title em { color: var(--gold-2); font-weight: 500; }
.hero__lead { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto 34px; }
.hero__row { display: flex; justify-content: center; margin-bottom: 38px; }
.hero__row img {
    width: 64px;
    height: 64px;
    margin-left: -12px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--gold);
    object-fit: cover;
    transition: transform .25s ease;
}
.hero__row img:first-child { margin-left: 0; }
.hero__row img:hover { transform: translateY(-6px); z-index: 1; }

/* Sections */
section { scroll-margin-top: 70px; }
.section-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    text-align: center;
    margin-bottom: 12px;
}
.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 1px;
    margin: 16px auto 0;
    background: var(--gold);
}
.section-lead { color: var(--muted); text-align: center; max-width: 560px; margin: 0 auto 60px; }

/* Character portraits */
.characters { max-width: var(--max); margin: 0 auto; padding: 60px 20px; }
.character {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    margin-bottom: 120px;
    transition: opacity .8s ease, transform .8s ease;
}
/* Hidden until scrolled into view only when the script runs; crawlers and
   visitors without JavaScript see every portrait. */
.js-reveal .character:not(.is-visible) { opacity: 0; transform: translateY(30px); }
.character.is-flipped .character__frame { order: 2; }
.character[hidden] { display: none; }

.character__frame {
    position: relative;
    padding: 14px;
    border-radius: 6px;
    background: linear-gradient(145deg, #3a2a14, #8a6a34 30%, #3b2913 55%, #a07e40 80%, #3a2a14);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 230, 170, .25);
}
.character__frame::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(255, 230, 170, .35);
    border-radius: 3px;
    pointer-events: none;
}
.character__frame img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 2px;
    filter: saturate(.95) contrast(1.02);
}
.character__plate {
    position: absolute;
    left: 50%;
    bottom: -16px;
    transform: translateX(-50%);
    padding: 5px 18px;
    background: linear-gradient(180deg, #c9a45a, #8a6a34);
    color: #22160c;
    font: 700 .78rem var(--sans);
    letter-spacing: .18em;
    text-transform: uppercase;
    border-radius: 2px;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .5);
}

.character__meta {
    color: var(--gold);
    font-size: .8rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    margin: 0 0 10px;
}
.character__name { font-size: clamp(2.6rem, 5vw, 3.6rem); margin-bottom: 6px; }
.character__native { color: var(--muted); font: italic 500 1.2rem var(--serif); margin: 0 0 22px; }
.character__quote {
    margin: 0 0 22px;
    padding-left: 18px;
    border-left: 2px solid var(--wine-2);
    font: italic 500 1.35rem/1.4 var(--serif);
    color: var(--gold-2);
}
.character__text p { margin: 0 0 14px; color: var(--text); }
.character__text p:last-child { margin-bottom: 0; }
.character__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 26px; padding: 0; list-style: none; }
.character__tags li {
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .82rem;
}
.character__family { color: var(--muted); font-size: .9rem; margin: 0 0 22px; }
.character__family strong { color: var(--text); font-weight: 500; }
.character__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.character__handle { color: var(--muted); font-size: .88rem; }

/* Quick filter */
.filters {
    position: sticky;
    top: 62px;
    z-index: 40;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: -30px auto 60px;
    padding: 10px;
    width: fit-content;
    max-width: 100%;
    background: rgba(14, 10, 11, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(216, 180, 106, .12);
    border-radius: 999px;
}
.filter {
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: 500 .85rem var(--sans);
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
}
.filter span { opacity: .6; font-size: .75rem; margin-left: 2px; }
.filter:hover { color: var(--text); border-color: var(--gold); }
.filter.is-active { background: var(--gold); border-color: var(--gold); color: #2a1a10; }
.filter.is-active span { opacity: .75; }
.filter:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* Family tree */
.family {
    padding: 100px 20px;
    background: linear-gradient(180deg, transparent, var(--bg-2) 20%, var(--bg-2) 80%, transparent);
}
.tree { max-width: 760px; margin: 0 auto; text-align: center; }
.tree__top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(10px, 3vw, 28px);
}
.tree__side { display: flex; align-items: center; justify-content: flex-end; gap: clamp(10px, 3vw, 28px); }
.tree__row { display: flex; justify-content: center; align-items: center; gap: clamp(14px, 4vw, 48px); flex-wrap: wrap; }
.tree__node a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font: 600 1.2rem var(--serif);
}
.tree__node img {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
    box-shadow: 0 0 0 5px var(--bg-2), 0 0 0 6px var(--line);
    transition: transform .25s ease;
}
.tree__node--root img { width: 140px; height: 140px; }
.tree__node a:hover img { transform: scale(1.05); }
.tree__node small { display: block; color: var(--muted); font: 400 .8rem var(--sans); }
.tree__link--friend {
    position: relative;
    min-width: 90px;
    color: var(--gold);
    font: italic 500 1rem var(--serif);
}
.tree__link--friend::before {
    content: "";
    display: block;
    height: 1px;
    margin-bottom: 6px;
    background: repeating-linear-gradient(90deg, var(--gold) 0 6px, transparent 6px 12px);
}
.tree__branch { display: flex; justify-content: center; margin: 18px 0 0; }
.tree__branch span { width: 1px; height: 36px; background: var(--gold); }
.tree__caption { color: var(--gold); font: italic 500 1rem var(--serif); margin: 6px 0 22px; }
.tree__row--kids { position: relative; padding-top: 22px; }
.tree__row--kids::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16%;
    right: 16%;
    height: 1px;
    background: var(--gold);
}
.tree__row--kids + .tree__caption { margin-top: 26px; color: var(--muted); font-size: .95rem; }

/* How it works */
.how { max-width: var(--max); margin: 0 auto; padding: 100px 20px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 0; margin: 0 0 40px; list-style: none; }
.step {
    padding: 30px 26px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.step__num { color: var(--gold); font: 600 1.6rem var(--serif); }
.step h3 { font-size: 1.6rem; margin: 10px 0; }
.step p { margin: 0; color: var(--muted); }
.commands {
    padding: 28px 26px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}
.commands h3 { font-size: 1.5rem; margin-bottom: 16px; }
.commands dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 30px; margin: 0; }
.commands dl div { display: flex; gap: 14px; align-items: baseline; }
.commands dt { color: var(--gold-2); font: 600 .95rem ui-monospace, Menlo, monospace; min-width: 64px; }
.commands dd { margin: 0; color: var(--muted); }

/* About (search-friendly summary) */
.about { max-width: 760px; margin: 0 auto; padding: 40px 20px 20px; text-align: center; }
.about .section-title { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.about p { color: var(--muted); margin: 0 0 16px; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; padding: 60px 20px 110px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
    list-style: none;
    cursor: pointer;
    padding: 22px 36px 22px 0;
    position: relative;
    font: 600 1.35rem var(--serif);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
    content: "+";
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font: 400 1.6rem var(--sans);
    transition: transform .2s ease;
}
.faq__item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq__item p { margin: 0 0 22px; color: var(--muted); }

/* Footer */
.footer {
    padding: 50px 20px 60px;
    text-align: center;
    border-top: 1px solid rgba(216, 180, 106, .1);
    color: var(--muted);
    font-size: .88rem;
}
.footer p { margin: 0 0 10px; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.footer__links a { color: var(--muted); text-decoration: none; }
.footer__links a:hover { color: var(--gold-2); }

.noscript { text-align: center; color: var(--muted); padding: 20px; }

/* Responsive */
@media (max-width: 860px) {
    .header__nav { display: none; }
    .lang { margin-left: auto; }
    .character { grid-template-columns: 1fr; margin-bottom: 90px; }
    .character.is-flipped .character__frame { order: 0; }
    .character__frame { max-width: 420px; margin: 0 auto; width: 100%; }
    .character__body { text-align: left; }
    .steps { grid-template-columns: 1fr; }
    .commands dl { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .hero { padding: 70px 16px 60px; }
    .filters { border-radius: var(--radius); top: 58px; }
    .filter { padding: 6px 11px; font-size: .8rem; }
    .tree__node img { width: 72px; height: 72px; }
    .tree__node--root img { width: 96px; height: 96px; }
    .tree__side { gap: 8px; }
    .tree__link--friend { min-width: 0; width: 56px; font-size: .85rem; line-height: 1.2; }
    .tree__node a { font-size: 1.05rem; }
    .tree__row--kids::before { left: 12%; right: 12%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero__glow { animation: none; }
    .js-reveal .character:not(.is-visible) { opacity: 1; transform: none; }
    .character { transition: none; }
}
