/* ============================================
   HORIZONS THEME
   EPCOT-poster indigo ground, sunrise accents.
   Utilities come from compiled Tailwind; this file
   holds the ground, prose, and composed components.
   ============================================ */

:root {
    --void: #050510;
    --deep-space: #0A1628;
    --horizon-blue: #1A3A5F;
    --dusk-violet: #333178;
    --magenta-dusk: #5C2A63;
    --indigo-deep: #16173F;
    --periwinkle: #A9B4EF;
    --periwinkle-soft: #9AA3E8;
    --periwinkle-dim: #6F77A9;
    --gold: #F4C95D;
    --gold-pale: #F9E08A;
    --coral: #EF7B45;
    --magenta: #C94277;
    --moon: #D6D7EA;
    --dusk: #BFC3DE;
    --hairline: rgba(169, 180, 239, 0.18);
}

/* ============================================
   SKY — fixed gradient ground with faint stars
   ============================================ */

#sky {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        /* gutter stars — left and right margins, brighter low to balance the top */
        radial-gradient(1.5px 1.5px at 3% 15%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 6% 52%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 4% 74%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 9% 34%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(2px 2px at 8% 88%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1.5px 1.5px at 2% 62%, rgba(255, 255, 255, 0.38), transparent),
        radial-gradient(1.5px 1.5px at 95% 20%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(2px 2px at 97% 56%, rgba(255, 255, 255, 0.42), transparent),
        radial-gradient(2px 2px at 93% 82%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 96% 38%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1.5px 1.5px at 91% 68%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 98% 91%, rgba(255, 255, 255, 0.38), transparent),
        /* a distant moon, low in the left gutter — counterweight to the planet */
        radial-gradient(circle at 6.5% 78%, rgba(214, 220, 248, 0.20) 0, rgba(169, 180, 239, 0.12) 22px, rgba(169, 180, 239, 0.05) 30px, transparent 33px),
        radial-gradient(1.5px 1.5px at 12% 24%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 78% 12%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1px 1px at 88% 48%, rgba(255, 255, 255, 0.35), transparent),
        /* mid-field stars sit behind the reading column — keep them near-subliminal */
        radial-gradient(1px 1px at 30% 65%, rgba(255, 255, 255, 0.18), transparent),
        radial-gradient(1.5px 1.5px at 55% 30%, rgba(255, 255, 255, 0.22), transparent),
        radial-gradient(1px 1px at 42% 8%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 65% 78%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(1px 1px at 8% 85%, rgba(255, 255, 255, 0.2), transparent),
        /* the sun below the horizon: a faint warm glow at the very bottom */
        radial-gradient(ellipse 90% 28% at 50% 104%, rgba(239, 123, 69, 0.16) 0%, rgba(201, 66, 119, 0.10) 45%, transparent 70%),
        /* the old site's night: void black into deep-space blue — landing in the new magenta dawn */
        linear-gradient(180deg, var(--void) 0%, var(--deep-space) 38%, var(--horizon-blue) 68%, var(--dusk-violet) 88%, var(--magenta-dusk) 100%);
}

/* ============================================
   HERO
   ============================================ */

/* Sunrise gradient text — reserve for the homepage headline */
.sunrise-text {
    background: linear-gradient(135deg, var(--gold-pale) 0%, var(--gold) 30%, var(--coral) 65%, var(--magenta) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* The planet: indigo sphere lit from below by a sun that hasn't risen yet */
.planet {
    position: absolute;
    top: -44px;
    right: -235px;
    opacity: 0.65;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 32% 28%, #35507E 0%, #1F3554 38%, #122238 65%, #0A1628 100%);
    box-shadow:
        inset -34px -44px 90px rgba(244, 201, 93, 0.22),
        inset 22px 22px 60px rgba(169, 180, 239, 0.14),
        inset 0 -22px 44px rgba(239, 123, 69, 0.28),
        0 0 90px rgba(244, 201, 93, 0.14),
        0 0 220px rgba(201, 66, 119, 0.12);
}

/* ============================================
   PROSE / CONTENT TYPOGRAPHY
   ============================================ */

.prose-custom {
    color: var(--dusk);
    font-size: 1.0625rem;
    max-width: 65ch;
}

.prose-custom h1,
.prose-custom h2,
.prose-custom h3,
.prose-custom h4,
.prose-custom h5,
.prose-custom h6 {
    font-family: 'Days One', Futura, system-ui, sans-serif;
    font-weight: 400;
    color: #ffffff;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.prose-custom h1 { font-size: 1.9rem; margin: 0 0 1em; }
.prose-custom h2 { font-size: 1.35rem; margin: 2em 0 0.8em; }
.prose-custom h3 { font-size: 1.15rem; margin: 1.75em 0 0.7em; }
.prose-custom h4,
.prose-custom h5,
.prose-custom h6 { font-size: 1rem; margin: 1.5em 0 0.5em; }

.prose-custom p {
    line-height: 1.75;
    margin-bottom: 1.25em;
}

.prose-custom ul,
.prose-custom ol {
    margin: 1.25em 0;
    padding-left: 1.5em;
}

.prose-custom ul ul,
.prose-custom ol ol {
    margin: 0.5em 0;
    padding-left: 1.25em;
}

.prose-custom li { margin: 0.5em 0; line-height: 1.7; }
.prose-custom ul li { list-style-type: disc; }
.prose-custom ol li { list-style-type: decimal; }
.prose-custom li::marker { color: var(--periwinkle-dim); }

.prose-custom strong { font-weight: 600; color: var(--moon); }
.prose-custom em { font-style: italic; }

.prose-custom hr {
    border: none;
    border-top: 1px solid var(--hairline);
    margin: 2.5em auto;
    width: 50%;
}

.prose-custom a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(244, 201, 93, 0.35);
    transition: color 0.2s, border-color 0.2s;
}

.prose-custom a:hover {
    color: var(--gold-pale);
    border-bottom-color: var(--gold-pale);
}

.prose-custom blockquote {
    border-left: 3px solid var(--coral);
    padding: 0.25rem 0 0.25rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--moon);
    font-style: italic;
}

.prose-custom img {
    border-radius: 8px;
    margin: 1.5rem auto;
    max-width: 100%;
}

.prose-custom code {
    background: rgba(169, 180, 239, 0.12);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.9em;
}

/* ============================================
   SYNTAX HIGHLIGHTING
   ============================================ */

.highlight {
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--hairline);
}

.highlight pre {
    margin: 0;
    padding: 1rem;
    background: rgba(10, 10, 30, 0.7) !important;
    border-radius: 8px;
}

.highlight code {
    background: transparent !important;
    color: #e6edf3;
    font-size: 0.9em;
    line-height: 1.5;
    padding: 0;
}

.highlight .lntd {
    vertical-align: top;
    padding: 0;
    margin: 0;
    border: 0;
}

.highlight .lnt {
    margin-right: 0.8em;
    padding: 0 0.4em;
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* Pill button — the one CTA style */
.btn-pill {
    display: inline-block;
    font-family: 'Days One', Futura, system-ui, sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid rgba(244, 201, 93, 0.5);
    border-radius: 999px;
    padding: 0.65rem 1.5rem;
    transition: background 0.2s, color 0.2s;
}

.btn-pill:hover {
    background: rgba(244, 201, 93, 0.12);
    color: var(--gold-pale);
}

/* Hairline rule between river entries */
.entry-rule {
    border: none;
    border-top: 1px solid var(--hairline);
    margin: 2.75rem 0;
}

/* Googie horizon: a barely-tilted sunrise line for page boundaries */
.googie-horizon {
    height: 2px;
    max-width: 42rem;
    margin-inline: auto;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 25%, var(--coral) 62%, transparent 100%);
    transform: rotate(-1.4deg);
}

/* Header variant: fainter and cooler, a canopy edge rather than a sunrise */
.googie-horizon--top {
    height: 1.5px;
    max-width: none;
    background: linear-gradient(90deg, transparent 0%, rgba(169, 180, 239, 0.4) 30%, rgba(244, 201, 93, 0.75) 60%, rgba(239, 123, 69, 0.5) 80%, transparent 100%);
    transform: rotate(-1.1deg);
}

/* ============================================
   NEWSLETTER
   ============================================ */

/* Googie roofline: the card's top edge sweeps up like a mid-century canopy.
   The ::before draws a thin sunrise-gradient line along the slanted edge. */
.newsletter-card {
    position: relative;
    border: 1px solid var(--hairline);
    border-top: none;
    border-radius: 0 0 12px 12px;
    background: rgba(22, 23, 63, 0.55);
    padding: calc(1.5rem + 22px) 2rem 1.75rem;
    clip-path: polygon(0 22px, 100% 0, 100% 100%, 0 100%);
}

.newsletter-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--coral) 60%, var(--magenta) 100%);
    clip-path: polygon(0 22px, 100% 0, 100% 2px, 0 24px);
    pointer-events: none;
}

.newsletter-card h3 {
    font-family: 'Days One', Futura, system-ui, sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    color: #ffffff;
    margin: 0 0 0.35rem;
}

.newsletter-card p {
    color: var(--periwinkle-soft);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.newsletter-form {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.newsletter-input {
    flex: 1;
    min-width: 200px;
    background: rgba(10, 10, 30, 0.6);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--moon);
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
}

.newsletter-input::placeholder { color: var(--periwinkle-dim); }

.newsletter-input:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
    border-color: transparent;
}

.newsletter-btn {
    font-family: 'Days One', Futura, system-ui, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #16173F;
    background: linear-gradient(135deg, var(--gold) 0%, var(--coral) 100%);
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    transition: filter 0.2s;
}

.newsletter-btn:hover { filter: brightness(1.1); }

/* ============================================
   RIVER INDEX — jump-list in the left gutter
   ============================================ */

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

.river-index {
    position: fixed;
    top: 9.5rem;
    left: calc(50vw - 24rem - 14.5rem);
    width: 12.5rem;
    font-size: 0.78rem;
    line-height: 1.4;
}

.river-index-label {
    font-family: 'Days One', Futura, system-ui, sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--periwinkle-dim);
    margin-bottom: 0.8rem;
}

.river-index ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--hairline);
}

.river-index li a {
    display: block;
    padding: 0.35rem 0 0.35rem 0.85rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--periwinkle-soft);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.river-index li a:hover {
    color: var(--moon);
}

.river-index li a.is-current {
    color: var(--gold);
    border-left-color: var(--gold);
}

.river-index-archive {
    display: inline-block;
    margin-top: 1rem;
    padding-left: 0.85rem;
    color: var(--periwinkle-soft);
    text-decoration: none;
    font-weight: 600;
}

.river-index-archive:hover { color: var(--gold); }

.river-index-keys {
    margin-top: 0.9rem;
    padding-left: 0.85rem;
    font-size: 0.62rem;
    color: var(--periwinkle-dim);
}

.river-index-keys kbd {
    display: inline-block;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.6rem;
    line-height: 1.5;
    color: var(--periwinkle-soft);
    background: rgba(10, 10, 30, 0.5);
    border: 1px solid var(--hairline);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0 0.35rem;
    margin-right: 0.3rem;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
