/* ============================================================
   Catharisis — landing (loads after style.css + theme.css)
   ============================================================ */

html { scroll-behavior: smooth; }

body.home-page { font-size: 17px; line-height: 1.6; }

/* ---------- scroll progress ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.04);
}

#scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #8a6d1f, var(--gold), var(--gold-2));
    box-shadow: 0 0 12px rgba(212, 168, 87, 0.6);
    transition: width 0.1s linear;
}

/* ---------- nav ---------- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    border-bottom: 1px solid transparent;
    transition: background 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
}

.site-nav.scrolled {
    background: rgba(14, 14, 17, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--line);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.nav-links {
    display: flex;
    gap: 1.6rem;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--gold-2); }

.nav-cta {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--gold);
    text-decoration: none;
    padding: 0.6rem 1.1rem;
    border-radius: 99px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background: var(--gold-2);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(212, 168, 87, 0.3);
}

/* ---------- layout ---------- */
.wrap {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section { padding: clamp(3.5rem, 9vh, 6rem) 0; }

h1.display {
    font-size: clamp(2.8rem, 7vw, 4.6rem);
    margin: 0 0 1.2rem;
    text-wrap: balance;
}

h2 {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #fdfaf2;
    margin: 0 0 0.8rem;
    text-wrap: balance;
}

.lede { max-width: 58ch; margin: 0; }
p { max-width: 65ch; }

/* ornament: fading rule with a lozenge */
.rule {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 auto;
    max-width: 420px;
    color: var(--accent, var(--gold));
}

.rule::before,
.rule::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line));
}

.rule::after { background: linear-gradient(90deg, var(--line), transparent); }

.rule i {
    width: 8px;
    height: 8px;
    border: 1px solid currentColor;
    transform: rotate(45deg);
    display: block;
}

/* corner ticks */
.ticks { position: relative; }

.ticks > b {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 0 solid var(--accent, var(--gold));
    opacity: 0.8;
    pointer-events: none;
}

.ticks > b:nth-child(1) { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.ticks > b:nth-child(2) { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.ticks > b:nth-child(3) { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.ticks > b:nth-child(4) { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }

/* ---------- hero: moods ---------- */
#hero-section.hero {
    position: relative;
    padding: clamp(7rem, 16vh, 10rem) 0 0;
    overflow: visible;
    border-radius: 0;
    margin: 0;
}

#bloom-effect {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(212, 168, 87, 0.13) 0%, transparent 65%);
}

.hero > * { position: relative; z-index: 1; }

.moods {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 2.2rem 0 1.6rem;
}

.mood {
    --tint: var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    width: auto;
    padding: 0.65rem 1.1rem 0.65rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: 400 0.9rem/1 var(--body);
    cursor: pointer;
    transition: border-color 0.25s, background-color 0.25s, transform 0.2s, box-shadow 0.25s;
}

.mood i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tint);
    box-shadow: 0 0 10px var(--tint);
    display: block;
}

.mood:hover {
    border-color: var(--tint);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.mood[aria-pressed="true"] {
    border-color: var(--tint);
    background: color-mix(in srgb, var(--tint) 18%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--tint) 40%, transparent) inset;
    font-weight: 500;
}

.passage {
    position: relative;
    background: linear-gradient(160deg, var(--card-2), var(--card) 60%, #111116);
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    padding: 2.8rem 2.5rem 2.4rem;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity 0.35s ease, border-color 0.5s;
}

.passage::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.045) 45%, transparent 60%);
    pointer-events: none;
}

.passage.is-swapping { opacity: 0; }

.passage .quote {
    font-family: var(--display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.4rem, 3.2vw, 1.9rem);
    line-height: 1.4;
    color: #fdfaf2;
    margin: 0;
    text-align: center;
    text-wrap: balance;
    max-width: none;
}

.passage .ref {
    margin: 1.4rem 0 0;
    text-align: center;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent, var(--gold));
    max-width: none;
}

.passage .empty {
    color: var(--muted);
    text-align: center;
    font-family: var(--display);
    font-style: italic;
    font-size: 1.5rem;
    margin: 0;
    max-width: none;
}

.passage .top-rule { margin: 0 auto 1.6rem; max-width: 220px; }

.again {
    margin: 1.1rem 0 0;
    display: flex;
    justify-content: center;
}

.again button {
    width: auto;
    background: none;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.4rem 0.1rem;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s;
}

.again button:hover { color: var(--gold-2); border-bottom-color: var(--gold); transform: none; background: none; }
.again button[disabled] { opacity: 0.35; cursor: default; }

.hero-note {
    margin: 2.2rem 0 0;
    font-size: 0.92rem;
    color: var(--muted);
}

/* ---------- ledger ---------- */
.ledger {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.ledger > div { padding: 1.6rem 1.2rem 1.6rem 0; border-bottom: 1px solid var(--line); }

.ledger b {
    display: block;
    font-family: var(--display);
    font-weight: 300;
    font-size: 2.8rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(115deg, #fdfaf2 25%, var(--gold) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ledger span {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.45;
}

@media (min-width: 620px) {
    .ledger > div { border-bottom: 0; }
    .ledger > div + div { border-left: 1px solid var(--line); padding-left: 1.2rem; }
}

/* ---------- names ---------- */
.name-form { display: flex; gap: 10px; margin: 1.6rem 0 1.4rem; max-width: 480px; }

.name-form input {
    flex: 1;
    width: 100%;
    font-family: var(--display);
    font-size: 1.4rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.name-form input::placeholder { color: #5f5a51; font-style: italic; }

.name-form input:focus {
    border-color: rgba(212, 168, 87, 0.6);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

.name-result { min-height: 120px; }
.name-result .head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }

.name-result .the-name {
    font-family: var(--display);
    font-size: 2.4rem;
    line-height: 1;
    text-transform: capitalize;
    color: #fdfaf2;
}

.name-result .origin {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
}

.name-result .meaning {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.35;
    margin: 0.6rem 0 0;
    color: var(--text);
}

.name-result .summary { margin: 0.8rem 0 0; color: #b3ac9f; max-width: 58ch; }
.name-result .miss { color: var(--muted); font-style: italic; }
.name-hint { font-size: 0.9rem; color: var(--muted); margin: 0; }

.name-hint button {
    width: auto;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--text);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--gold);
}

.name-hint button:hover { color: var(--gold-2); transform: none; background: none; }

/* ---------- philosophy ---------- */
.authors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-top: 1.8rem;
}

.author {
    padding: 1.4rem 1.2rem 1.3rem;
    transition: transform 0.4s var(--ease), border-color 0.4s;
}

.author:hover { transform: translateY(-4px); border-color: rgba(212, 168, 87, 0.4); }

.author .medallion {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 87, 0.5);
    background: var(--gold-dim);
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-size: 1.5rem;
    color: var(--gold-2);
    margin-bottom: 1rem;
}

.author h3 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.3rem;
    line-height: 1.15;
    margin: 0;
    color: #fdfaf2;
}

.author .years {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0.3rem 0 0.7rem;
}

.author .work { font-style: italic; color: #b3ac9f; font-size: 0.92rem; margin: 0; }

.author .badge {
    display: inline-block;
    margin-top: 0.8rem;
    font-family: var(--mono);
    font-size: 0.56rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
}

/* ---------- privacy ---------- */
.claims { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.9rem; max-width: 62ch; }
.claims li { padding-left: 1.6rem; position: relative; color: #cfc8bb; }

.claims li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 0.1em;
    color: var(--gold);
    font-size: 0.75rem;
}

/* ---------- download ---------- */
.download { text-align: center; }

.download .cta-card {
    position: relative;
    padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3.5rem);
    border-radius: 1.6rem;
    border: 1px dashed rgba(212, 168, 87, 0.35);
    background: linear-gradient(160deg, rgba(27, 27, 33, 0.9), rgba(17, 17, 22, 0.9));
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.download .cta-card h2 { margin-bottom: 1.6rem; }

.download .platforms {
    max-width: 640px;
    margin: 0 auto;
    grid-template-columns: 1fr 1fr;
    text-align: left;
}

.langs {
    margin: 1.6rem 0 0;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- footer ---------- */
.site-footer {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem var(--gutter) 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
}

.footer-brand { font-family: var(--display); font-size: 1.2rem; color: var(--text); margin: 0; }
.footer-tag { font-size: 0.85rem; color: var(--muted); margin: 0; }

.admin-row a {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
}

.admin-row a:hover { color: var(--gold); }

/* ---------- reveals: scroll-driven, no JS ----------
   ponytail: gated behind @supports so a browser without view() timelines
   never hides anything. Nothing can leave the page blank. */
@keyframes rise-in {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: none; }
}

@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .reveal {
            animation: rise-in linear both;
            animation-timeline: view();
            animation-range: entry 0% cover 20%;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .passage, .mood { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
    .nav-links { display: none; }
    .download .platforms { grid-template-columns: 1fr; }
    .passage { padding: 2.2rem 1.4rem 2rem; }
}

@media (max-width: 560px) {
    .nav-cta { display: none; }
}
