/* ==========================================================================
   Divine Melodies — site styles
   ========================================================================== */

:root {
    --ink: #070a1f;
    --navy: #0d1236;
    --indigo: #1c2466;
    --indigo-2: #2a3490;
    --gold: #e9c979;
    --gold-light: #fff1c4;
    --gold-deep: #c8913a;
    --cream: #f7efd9;
    --paper: #fbf7ee;
    --text: #e8e9f5;
    --muted: #a9afd4;
    --text-dark: #1b1f3b;
    --muted-dark: #555b7e;

    --gold-gradient: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 40%, var(--gold-deep) 100%);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(233, 201, 121, 0.22);

    --font-display: 'Fraunces', Georgia, serif;
    --font-caps: 'Cinzel', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --radius: 20px;
    --header-h: 72px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--ink);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a {
    color: inherit;
}

strong {
    font-weight: 600;
    color: var(--gold);
}

::selection {
    background: var(--gold);
    color: var(--ink);
}

.container {
    width: min(1180px, 100% - 48px);
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 16px;
    background: var(--gold);
    color: var(--ink);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 16px;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- Typography helpers ---------- */

.eyebrow {
    font-family: var(--font-caps);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.section .eyebrow {
    color: var(--gold);
}

.eyebrow::before {
    content: "";
    width: 36px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    line-height: 1.12;
    letter-spacing: -0.005em;
    word-spacing: 0.04em;
    margin-bottom: 24px;
    font-variation-settings: "opsz" 72;
}

.lead {
    font-size: 1.2rem;
    line-height: 1.8;
}

section p + p {
    margin-top: 1.1em;
}

/* ---------- Buttons ---------- */

.btn {
    --shine: -120%;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s, color 0.35s;
}

.btn-gold {
    background: var(--gold-gradient);
    color: var(--ink);
    box-shadow: 0 10px 30px -10px rgba(233, 201, 121, 0.6);
}

.btn-gold::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
    transform: translateX(var(--shine));
    transition: transform 0.8s var(--ease);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -12px rgba(233, 201, 121, 0.75);
}

.btn-gold:hover::after {
    --shine: 120%;
    transform: translateX(120%);
}

.btn-ghost {
    background: var(--glass);
    color: var(--cream);
    border-color: rgba(247, 239, 217, 0.3);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.7;
    cursor: progress;
}

/* ---------- Header / Nav ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
}

/* Backdrop lives on a pseudo-element so the fixed mobile menu isn't trapped
   inside the header's containing block (backdrop-filter creates one). */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(7, 10, 31, 0.88);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 1px 0 rgba(233, 201, 121, 0.14);
    opacity: 0;
    transition: opacity 0.4s;
}

.site-header.scrolled::before {
    opacity: 1;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: var(--font-caps);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cream);
}

.brand img {
    width: 40px;
    height: 40px;
    transition: transform 0.6s var(--ease);
}

.brand:hover img {
    transform: rotate(-12deg) scale(1.06);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    position: relative;
    display: block;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-decoration: none;
    color: var(--muted);
    border-radius: 999px;
    transition: color 0.3s;
}

.nav-links a:not(.nav-cta)::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 3px;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--cream);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-links .nav-cta {
    margin-left: 10px;
    color: var(--gold);
    border: 1px solid var(--glass-border);
}

.nav-links .nav-cta:hover,
.nav-links .nav-cta.active {
    background: var(--gold);
    color: var(--ink);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass);
    cursor: pointer;
    position: relative;
    z-index: 110;
}

.nav-toggle span {
    position: absolute;
    left: 12px;
    right: 12px;
    height: 1.5px;
    background: var(--cream);
    transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}

.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }

.nav-toggle[aria-expanded="true"] span:first-child {
    top: 21px;
    transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
    top: 21px;
    transform: rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 40px) 0 140px;
    overflow: hidden;
    isolation: isolate;
    background: radial-gradient(ellipse 120% 80% at 50% 0%, #161c52 0%, var(--ink) 70%);
}

.aurora {
    position: absolute;
    inset: 0;
    z-index: -2;
    filter: blur(90px);
    opacity: 0.75;
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: drift 22s ease-in-out infinite alternate;
}

.b1 {
    width: 46vw;
    height: 46vw;
    left: -10vw;
    top: -8vw;
    background: radial-gradient(circle, #3b3fb0 0%, transparent 65%);
}

.b2 {
    width: 40vw;
    height: 40vw;
    right: -8vw;
    top: 10vh;
    background: radial-gradient(circle, rgba(233, 201, 121, 0.55) 0%, transparent 65%);
    animation-duration: 26s;
    animation-delay: -6s;
}

.b3 {
    width: 50vw;
    height: 50vw;
    left: 25vw;
    bottom: -30vw;
    background: radial-gradient(circle, #6b2f8f 0%, transparent 65%);
    animation-duration: 30s;
    animation-delay: -12s;
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(6vw, 4vh) scale(1.12); }
    100% { transform: translate(-4vw, -3vh) scale(0.95); }
}

.stars {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 241, 196, 0.9), transparent),
        radial-gradient(1px 1px at 28% 68%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1.5px 1.5px at 44% 14%, rgba(255, 241, 196, 0.8), transparent),
        radial-gradient(1px 1px at 58% 82%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 72% 30%, rgba(255, 241, 196, 0.9), transparent),
        radial-gradient(1px 1px at 86% 58%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1.5px 1.5px at 93% 12%, rgba(255, 241, 196, 0.8), transparent),
        radial-gradient(1px 1px at 6% 86%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 36% 40%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 66% 52%, rgba(255, 241, 196, 0.6), transparent);
    animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { opacity: 0.45; }
    to   { opacity: 1; }
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) 1.15fr;
    align-items: center;
    gap: clamp(40px, 6vw, 90px);
}

.hero-logo {
    position: relative;
    justify-self: center;
    width: min(420px, 80vw);
    aspect-ratio: 1;
}

.hero-logo img {
    position: relative;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
    animation: float 8s ease-in-out infinite;
}

.logo-glow {
    position: absolute;
    inset: -12%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 20%, rgba(233, 201, 121, 0.55) 30%, transparent 45% 70%, rgba(120, 130, 255, 0.45) 82%, transparent 95%);
    filter: blur(28px);
    animation: spin 18s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3.2rem, 8vw, 6.4rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    color: var(--cream);
    font-variation-settings: "opsz" 144;
}

.hero h1 em {
    display: block;
    font-style: italic;
    font-weight: 400;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: 0.08em;
}

.hero-tagline {
    font-family: var(--font-caps);
    font-size: 0.95rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 18px;
}

.verse-card {
    position: relative;
    margin: 36px 0 34px;
    padding: 28px 30px 24px 34px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    max-width: 620px;
}

.verse-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22px;
    bottom: 22px;
    width: 3px;
    border-radius: 3px;
    background: var(--gold-gradient);
}

.verse-card blockquote {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.08rem, 1.6vw, 1.28rem);
    line-height: 1.7;
    color: var(--cream);
}

.verse-card figcaption {
    margin-top: 14px;
    font-family: var(--font-caps);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* Animated sound wave built from JS-generated bars */
.soundwave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 110px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    padding: 0 12px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
    opacity: 0.55;
}

.soundwave i {
    flex: 0 0 4px;
    height: var(--h, 30%);
    border-radius: 4px 4px 0 0;
    background: linear-gradient(to top, rgba(233, 201, 121, 0.05), rgba(233, 201, 121, 0.8));
    transform-origin: bottom;
    animation: wave var(--d, 1.4s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes wave {
    from { transform: scaleY(0.25); }
    to   { transform: scaleY(1); }
}

/* ---------- Sections ---------- */

.section {
    position: relative;
    padding: clamp(90px, 12vw, 150px) 0;
}

.section-head {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.section-head .eyebrow::after {
    content: "";
    width: 36px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

/* Light "paper" section */
.section-light {
    background:
        radial-gradient(ellipse 60% 50% at 100% 0%, rgba(233, 201, 121, 0.18), transparent 70%),
        var(--paper);
    color: var(--text-dark);
}

.section-light .section-title {
    color: var(--text-dark);
}

.section-light .eyebrow,
.section-light strong {
    color: #9a6b22;
}

.section-light p {
    color: var(--muted-dark);
}

.section-light .lead {
    color: var(--text-dark);
}

.about-body {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.about-body .eyebrow::after {
    content: "";
    width: 36px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.statement {
    position: relative;
    margin-top: clamp(70px, 9vw, 110px);
    padding: clamp(40px, 6vw, 72px) clamp(28px, 7vw, 96px);
    border-radius: 28px;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(233, 201, 121, 0.22), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(107, 47, 143, 0.35), transparent 55%),
        var(--navy);
    color: var(--cream);
    text-align: center;
    overflow: hidden;
    box-shadow: 0 40px 80px -40px rgba(13, 18, 54, 0.7);
}

.statement::before {
    content: "\201C";
    position: absolute;
    top: -40px;
    left: 30px;
    font-family: var(--font-display);
    font-size: 14rem;
    line-height: 1;
    color: var(--gold);
    opacity: 0.18;
}

.statement p {
    position: relative;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.3rem, 2.4vw, 1.9rem);
    line-height: 1.55;
    color: var(--cream);
}

/* Dark sections */
.section-dark {
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(42, 52, 144, 0.45), transparent 70%),
        var(--ink);
}

.section-dark .lead {
    color: var(--muted);
}

.section-dark .section-title {
    color: var(--cream);
}

/* Foundation */
.section-foundation {
    background:
        radial-gradient(ellipse 55% 70% at 25% 50%, rgba(42, 52, 144, 0.4), transparent 70%),
        var(--ink);
    border-top: 1px solid rgba(233, 201, 121, 0.1);
}

.section-foundation p {
    color: var(--muted);
}

.section-foundation .section-title {
    color: var(--cream);
}

.foundation-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(40px, 7vw, 100px);
    align-items: center;
}

.foundation-verse {
    position: relative;
    text-align: center;
}

.big-ref {
    display: block;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(7rem, 18vw, 13rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variation-settings: "opsz" 144;
}

.big-book {
    display: block;
    margin-top: 12px;
    font-family: var(--font-caps);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.6em;
    padding-left: 0.6em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Contact */
.contact {
    background:
        radial-gradient(ellipse 50% 60% at 0% 100%, rgba(233, 201, 121, 0.12), transparent 70%),
        radial-gradient(ellipse 50% 50% at 100% 45%, rgba(42, 52, 144, 0.45), transparent 70%),
        var(--ink);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 7vw, 90px);
    align-items: start;
}

.contact-intro p {
    color: var(--muted);
}

.contact-form {
    padding: clamp(28px, 4vw, 44px);
    border-radius: 26px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7);
}

.field {
    position: relative;
    margin-bottom: 18px;
}

.field input,
.field textarea,
.captcha input {
    width: 100%;
    padding: 24px 18px 10px;
    font: inherit;
    font-size: 1rem;
    color: var(--cream);
    background: rgba(7, 10, 31, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.field textarea {
    resize: vertical;
    min-height: 140px;
}

.field label {
    position: absolute;
    left: 19px;
    top: 17px;
    font-size: 1rem;
    color: var(--muted);
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.25s var(--ease), color 0.25s;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
    transform: translateY(-10px) scale(0.76);
    color: var(--gold);
}

.field input:focus,
.field textarea:focus,
.captcha input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(7, 10, 31, 0.8);
    box-shadow: 0 0 0 4px rgba(233, 201, 121, 0.15);
}

.field input.invalid,
.field textarea.invalid,
.captcha input.invalid {
    border-color: #ff8a8a;
}

.captcha {
    margin: 6px 0 24px;
}

.captcha label {
    display: block;
    color: var(--cream);
    font-weight: 500;
}

.captcha label strong {
    color: var(--gold);
}

.captcha .hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 4px 0 12px;
    line-height: 1.5;
}

.captcha input {
    padding: 14px 18px;
}

.form-status {
    min-height: 1.5em;
    margin-top: 16px;
    text-align: center;
    font-size: 0.95rem;
}

.form-status.success { color: #9fe3b4; }
.form-status.error { color: #ff9f9f; }

/* ---------- Footer ---------- */

.site-footer {
    padding: 64px 0 48px;
    background: #04061a;
    border-top: 1px solid rgba(233, 201, 121, 0.12);
    text-align: center;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-verse {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--cream);
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--delay, 0s);
}

.js .reveal.visible {
    opacity: 1;
    transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .hero-inner,
    .foundation-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-inner {
        text-align: center;
    }

    .hero-logo {
        width: min(280px, 64vw);
    }

    .hero .eyebrow::after {
        content: "";
        width: 36px;
        height: 1px;
        background: currentColor;
        opacity: 0.7;
    }

    .verse-card {
        margin-inline: auto;
        text-align: left;
    }

    .hero-actions {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        inset: 0;
        flex-direction: column;
        justify-content: center;
        gap: 10px;
        background: rgba(7, 10, 31, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s var(--ease), visibility 0.4s;
    }

    .nav-links.open {
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        font-family: var(--font-display);
        font-size: 1.8rem;
        color: var(--cream);
    }

    .nav-links .nav-cta {
        margin: 12px 0 0;
        padding: 10px 32px;
    }

    .brand span {
        font-size: 0.9rem;
    }

    .soundwave {
        height: 70px;
    }
}

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

    .js .reveal {
        opacity: 1;
        transform: none;
    }
}
