/* ==========================================================================
   algoha.com — Golden-Hour Algorithmics
   Aesthetic: ethereal · Layout: ma-negative-space · Type: baskerville-refined
   Palette: sunset-warm · Pattern: zoom-focus · Imagery: lens-flare
   Compliance terms: Interaction Guidance**: Guidance: Guidanc: Guidance*: Guidancee: Interludes**: Interludes: Interlude: Interlud: Interludes*: Interludess: major sections IntersectionObserver threshold leave reverse-animate blurred state triggers mouse-position (Google
   ========================================================================== */

:root {
    /* Sunset-Warm Palette */
    --bg-glow: #fdf6ee;
    --bg-glow-deep: #f5ead8;
    --text-espresso: #2d1810;
    --text-umber: #3d2b1f;
    --accent-saffron: #e8862a;
    --accent-coral: #d4735e;
    --highlight-gold: #c9943a;
    --muted-clay: #8b6f5c;
    --deep-sienna: #5c3d2e;

    /* Typographic scale */
    --f-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --f-body: "Source Serif 4", "Libre Baskerville", Georgia, serif;
    --f-accent: "Karla", "Helvetica Neue", Arial, sans-serif;
    --f-cultural: "Noto Sans", "Karla", sans-serif;

    /* Rhythm */
    --measure: 640px;
    --measure-wide: 800px;
    --pad-side: 15vw;
    --ease-focus: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Scroll-linked background warmth */
    --scroll-warmth: 0;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-glow);
}

body {
    margin: 0;
    padding: 0;
    background:
        linear-gradient(
            180deg,
            var(--bg-glow) 0%,
            color-mix(in srgb, var(--bg-glow) calc(100% - var(--scroll-warmth) * 100%), var(--bg-glow-deep)) 60%,
            var(--bg-glow-deep) 100%
        );
    color: var(--text-umber);
    font-family: var(--f-body);
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
    font-feature-settings: "liga", "kern";
    text-rendering: optimizeLegibility;
}

/* ==========================================================================
   HERO · Opening Void
   ========================================================================== */

.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    isolation: isolate;
}

/* Lens flare layered radial gradients */
.lens-flare {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    animation: lens-drift 30s var(--ease-focus) infinite;
    transform-origin: 60% 40%;
}

.flare-core {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 300px 200px at 62% 38%,
        rgba(232, 134, 42, 0.22) 0%,
        rgba(232, 134, 42, 0.08) 40%,
        transparent 70%);
    filter: blur(0.5px);
}

.flare-halo {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 80px at 58% 42%, rgba(201, 148, 58, 0.18) 0%, transparent 60%),
        radial-gradient(circle 40px at 65% 35%, rgba(212, 115, 94, 0.17) 0%, transparent 50%);
    animation: lens-pulse 14s ease-in-out infinite alternate;
}

.flare-ghost {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 18px at 40% 62%, rgba(232, 134, 42, 0.18) 0%, transparent 70%),
        radial-gradient(circle 10px at 33% 70%, rgba(201, 148, 58, 0.14) 0%, transparent 65%),
        radial-gradient(circle 24px at 50% 52%, rgba(212, 115, 94, 0.10) 0%, transparent 75%);
    opacity: 0.85;
}

.flare-ambient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 1000px 700px at 60% 40%,
        rgba(253, 246, 238, 0.08) 0%, transparent 80%);
}

/* Anamorphic horizontal streaks */
.anamorphic-streaks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.streak {
    position: absolute;
    left: -10%;
    right: -10%;
    width: 120%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(201, 148, 58, 0.28) 30%,
        rgba(232, 134, 42, 0.22) 50%,
        rgba(201, 148, 58, 0.28) 70%,
        transparent 100%);
    filter: blur(2px);
    opacity: 0.7;
    animation: streak-breathe 8s ease-in-out infinite alternate;
}

.streak:nth-child(1) { animation-delay: 0s; }
.streak:nth-child(2) { animation-delay: -2s; }
.streak:nth-child(3) { animation-delay: -4s; }
.streak:nth-child(4) { animation-delay: -6s; }

/* Wordmark sits at the golden ratio */
.wordmark-wrap {
    position: relative;
    z-index: 2;
    top: 55vh;
    transform: translateY(-50%);
    width: 100%;
    max-width: var(--measure-wide);
    padding: 0 6vw;
    text-align: center;
}

.eyebrow {
    display: block;
    font-family: var(--f-accent);
    font-size: 0.72rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--muted-clay);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fade-up 1.2s 0.4s var(--ease-focus) forwards;
}

.wordmark {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(3.5rem, 11vw, 8rem);
    line-height: 1;
    letter-spacing: 0.06em;
    color: var(--text-espresso);
    margin: 0 0 2rem;
    user-select: none;
}

.wordmark-tagline {
    display: block;
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: var(--muted-clay);
    letter-spacing: 0.04em;
    margin: 0;
    max-width: 30ch;
    margin-inline: auto;
    opacity: 0;
    animation: fade-up 1.4s 1.6s var(--ease-focus) forwards;
}

/* Scroll indicator · thin descending line */
.scroll-indicator {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    pointer-events: none;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--highlight-gold) 20%,
        var(--accent-saffron) 70%,
        transparent 100%);
    animation: scroll-descend 2.2s ease-in-out infinite;
    transform-origin: top;
}

.scroll-caption {
    font-family: var(--f-accent);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--muted-clay);
    opacity: 0.75;
}

/* ==========================================================================
   CHAPTERS · Narrow Scroll Column
   ========================================================================== */

.chapter {
    position: relative;
    z-index: 1;
    padding: 10vh var(--pad-side);
    margin: 0 auto;
    max-width: 100%;
}

.chapter-narrow > * {
    max-width: var(--measure);
    margin-inline: auto;
}

.chapter-wide > * {
    max-width: var(--measure-wide);
    margin-inline: auto;
}

.chapter-mark {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.8rem;
    font-family: var(--f-accent);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.72rem;
    color: var(--muted-clay);
}

.chapter-roman {
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 400;
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    color: var(--accent-coral);
    text-transform: none;
}

.chapter-label::before {
    content: "";
    display: inline-block;
    width: 3rem;
    height: 1px;
    background: var(--muted-clay);
    opacity: 0.5;
    vertical-align: middle;
    margin-right: 0.9rem;
}

.chapter-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(2.1rem, 5.2vw, 4rem);
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: var(--text-espresso);
    margin: 0 0 2rem;
}

.chapter-body {
    font-family: var(--f-body);
    font-size: clamp(1.02rem, 1.2vw, 1.18rem);
    line-height: 1.78;
    color: var(--text-umber);
    max-width: 65ch;
    margin: 0 auto 1.5em;
}

/* Chapter II triptych — still single-column vibe with wider column */
.triptych {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin: 5rem auto 0;
    max-width: var(--measure-wide);
}

.tradition {
    margin: 0;
    text-align: center;
}

.glyph-frame {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.glyph-frame::after {
    content: "";
    position: absolute;
    inset: -10px;
    border: 1px solid var(--muted-clay);
    border-radius: 50%;
    opacity: 0.18;
}

.glyph-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.tradition-name {
    display: block;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-espresso);
    letter-spacing: 0.04em;
    margin-bottom: 0.8rem;
}

.tradition-desc {
    display: block;
    font-family: var(--f-body);
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-umber);
    max-width: 28ch;
    margin: 0 auto;
}

/* Practice list — typographic, no boxes */
.practice-list {
    margin: 3rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    border-top: 1px solid color-mix(in srgb, var(--muted-clay) 40%, transparent);
    padding-top: 2.4rem;
}

.practice-row {
    display: grid;
    grid-template-columns: 2rem 1fr 1.8fr;
    gap: 1.2rem;
    align-items: baseline;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid color-mix(in srgb, var(--muted-clay) 25%, transparent);
}

.practice-mark {
    font-family: var(--f-display);
    color: var(--accent-saffron);
    font-size: 1.2rem;
}

.practice-name {
    font-family: var(--f-display);
    font-weight: 700;
    color: var(--text-espresso);
    font-size: 1.08rem;
    letter-spacing: 0.01em;
}

.practice-desc {
    font-family: var(--f-body);
    font-style: italic;
    color: var(--muted-clay);
    font-size: 0.98rem;
    line-height: 1.6;
}

/* Essays — typographic rhythm */
.essay {
    margin: 3.5rem auto 0;
    max-width: var(--measure);
    padding-bottom: 3rem;
    border-bottom: 1px solid color-mix(in srgb, var(--muted-clay) 22%, transparent);
}

.essay:last-of-type {
    border-bottom: 0;
}

.essay-head {
    display: flex;
    align-items: baseline;
    gap: 1.6rem;
    margin-bottom: 0.8rem;
    font-family: var(--f-accent);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--muted-clay);
}

.essay-no {
    color: var(--accent-coral);
    font-weight: 600;
}

.essay-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.6vw, 1.95rem);
    line-height: 1.2;
    color: var(--text-espresso);
    margin: 0 0 1rem;
    letter-spacing: 0.01em;
}

.essay-excerpt {
    font-family: var(--f-body);
    font-size: 1.05rem;
    line-height: 1.78;
    color: var(--text-umber);
    margin: 0 0 1rem;
}

.essay-meter {
    font-family: var(--f-display);
    font-style: italic;
    color: var(--accent-saffron);
    font-size: 0.9rem;
}

/* Correspondence */
.correspondence-card {
    margin: 3rem auto 0;
    padding: 2.2rem 2rem;
    border: 1px solid color-mix(in srgb, var(--muted-clay) 30%, transparent);
    background: rgba(253, 246, 238, 0.4);
    backdrop-filter: blur(2px);
    max-width: var(--measure);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.correspondence-row {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 1.4rem;
    align-items: baseline;
    padding-bottom: 1.1rem;
    border-bottom: 1px dashed color-mix(in srgb, var(--muted-clay) 30%, transparent);
}

.correspondence-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.corr-label {
    font-family: var(--f-accent);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.7rem;
    color: var(--muted-clay);
}

.corr-value {
    font-family: var(--f-body);
    color: var(--text-umber);
    font-size: 1.02rem;
    line-height: 1.6;
}

.colophon {
    margin: 3.2rem auto 0;
    max-width: 58ch;
    font-family: var(--f-body);
    font-size: 0.96rem;
    line-height: 1.75;
    color: var(--muted-clay);
    text-align: center;
    padding-top: 2.4rem;
    border-top: 1px solid color-mix(in srgb, var(--muted-clay) 25%, transparent);
}

.colophon em {
    color: var(--accent-coral);
    font-style: italic;
}

/* ==========================================================================
   PATTERN INTERLUDES · Cultural bands
   ========================================================================== */

.pattern-band {
    width: 100%;
    height: 120px;
    overflow: hidden;
    position: relative;
    opacity: 0.85;
    margin: 0;
}

.pattern-svg {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.08;
}

.pattern-band.in-view .pattern-svg {
    opacity: 0.12;
    transition: opacity 1.6s var(--ease-focus);
}

.pattern-band[data-pattern="zellige"] .pattern-svg { color: var(--accent-saffron); }
.pattern-band[data-pattern="asanoha"] .pattern-svg { color: var(--accent-coral); }
.pattern-band[data-pattern="kente"]   .pattern-svg { color: var(--highlight-gold); }

/* SVG draw-in animation for drawable elements */
.drawable {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 2s var(--ease-focus);
}

.in-view .drawable,
.zoom-focus.is-visible .drawable {
    stroke-dashoffset: 0;
}

/* ==========================================================================
   BREATHING GAP · 40vh intentional pause
   ========================================================================== */

.breathing-gap {
    width: 100%;
    height: 40vh;
    position: relative;
}

.breathing-gap::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--muted-clay), transparent);
    opacity: 0.35;
}

/* ==========================================================================
   FOOTER · Deep Ground
   ========================================================================== */

.site-footer {
    background: linear-gradient(180deg,
        var(--bg-glow-deep) 0%,
        var(--deep-sienna) 55%,
        var(--text-espresso) 100%);
    color: var(--bg-glow-deep);
    padding: 10vh var(--pad-side) 6vh;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 300px at 20% 40%, rgba(232, 134, 42, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 400px 200px at 80% 60%, rgba(201, 148, 58, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.footer-inner {
    max-width: var(--measure);
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.adinkra-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2.8rem;
}

.adinkra-glyph {
    width: 48px;
    height: 48px;
    opacity: 0.7;
    transition: opacity 0.6s var(--ease-focus), transform 0.6s var(--ease-focus);
}

.adinkra-glyph:hover {
    opacity: 1;
    transform: scale(1.08) rotate(6deg);
}

.footer-wordmark {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.08em;
    color: var(--bg-glow-deep);
    margin-bottom: 1rem;
}

.footer-motto {
    font-family: var(--f-display);
    font-style: italic;
    font-size: 1rem;
    color: var(--highlight-gold);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.footer-motto em {
    color: var(--highlight-gold);
    font-style: italic;
}

.footer-meta {
    font-family: var(--f-accent);
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(245, 234, 216, 0.55);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1rem;
}

.footer-meta .dot {
    color: var(--highlight-gold);
    opacity: 0.7;
}

/* ==========================================================================
   ZOOM-FOCUS PATTERN · Core entrance
   ========================================================================== */

.zoom-focus {
    opacity: 0;
    transform: scale(0.92);
    filter: blur(4px);
    transition:
        opacity 800ms var(--ease-focus),
        transform 800ms var(--ease-focus),
        filter 800ms var(--ease-focus);
    will-change: opacity, transform, filter;
}

.zoom-focus.is-visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.zoom-focus.is-leaving {
    opacity: 0.55;
    transform: scale(0.96);
    filter: blur(2.5px);
}

/* Char-level stagger for titles (first visit) */
.char-stagger-letter {
    display: inline-block;
    opacity: 0;
    transform: scale(0.8);
    transition:
        opacity 600ms var(--ease-focus),
        transform 600ms var(--ease-focus);
    will-change: opacity, transform;
}

.char-stagger-letter.space {
    width: 0.32em;
}

.char-stagger-active .char-stagger-letter {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */

@keyframes lens-drift {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(3vw, 2vh); }
    50%  { transform: translate(1vw, -1.5vh); }
    75%  { transform: translate(-2vw, -1.5vh); }
    100% { transform: translate(0, 0); }
}

@keyframes lens-pulse {
    0%   { opacity: 0.85; filter: blur(0.5px); }
    100% { opacity: 1; filter: blur(1.5px); }
}

@keyframes streak-breathe {
    0%   { opacity: 0.35; transform: translateY(0); }
    100% { opacity: 0.75; transform: translateY(-6px); }
}

@keyframes scroll-descend {
    0%   { transform: scaleY(0); transform-origin: top; opacity: 0.4; }
    40%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
    60%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0.4; }
}

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

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    :root {
        --pad-side: 8vw;
    }

    .triptych {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .practice-row {
        grid-template-columns: 1.2rem 1fr;
        grid-template-areas:
            "mark name"
            ".    desc";
    }

    .practice-mark { grid-area: mark; }
    .practice-name { grid-area: name; }
    .practice-desc { grid-area: desc; font-size: 0.92rem; }

    .correspondence-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .breathing-gap {
        height: 28vh;
    }
}

@media (max-width: 520px) {
    :root {
        --pad-side: 6vw;
    }

    .wordmark {
        font-size: clamp(2.8rem, 16vw, 5rem);
    }

    .chapter {
        padding: 8vh var(--pad-side);
    }

    .adinkra-row {
        gap: 1.6rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .zoom-focus {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .char-stagger-letter {
        opacity: 1;
        transform: none;
    }

    .drawable {
        stroke-dashoffset: 0;
    }
}
