/* ==========================================================================
   lune.dev — A Lunar Conservatory
   Strict monochrome, Victorian ornament, slab-serif logotype, Garamond body.
   Palette: #F5F5F5 #C0C0C0 #808080 #2A2A2A #1A1A1A #FFFFFF #E8E8E8
   ========================================================================== */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --moon-white:        #F5F5F5;
    --silver:            #C0C0C0;
    --medium-gray:       #808080;
    --charcoal:          #2A2A2A;
    --near-black:        #1A1A1A;
    --pure-white:        #FFFFFF;
    --bubble-highlight:  #E8E8E8;

    --col-width: 680px;
    --pad-x: 24px;

    --font-slab: 'Arvo', Georgia, 'Times New Roman', serif;
    --font-body: 'EB Garamond', Garamond, Georgia, 'Times New Roman', serif;
    --font-orn:  'Bodoni Moda', 'EB Garamond', Garamond, Georgia, serif;

    --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html, body { height: 100%; }

body {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.1vw, 19px);
    line-height: 1.85;
    color: var(--near-black);
    background: var(--moon-white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    /* subtle paper warmth via near-imperceptible vignette */
    background-image:
        radial-gradient(circle at 50% 8%, rgba(255,255,255,0.6) 0%, rgba(245,245,245,0) 55%),
        radial-gradient(circle at 50% 100%, rgba(192,192,192,0.10) 0%, rgba(245,245,245,0) 60%);
    background-attachment: fixed;
}

::selection { background: var(--charcoal); color: var(--pure-white); }

p { margin: 0 0 1.1em; }
em { font-style: italic; }
strong { font-weight: 500; }

/* ---------- Reveal system ---------- */
.reveal-target {
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.6s var(--ease-soft),
        transform 0.6s var(--ease-soft);
    will-change: opacity, transform;
}
.reveal-target.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   OPENING VIEWPORT
   ========================================================================== */
.viewport-opening {
    position: relative;
    min-height: 100vh;
    padding: clamp(48px, 9vh, 88px) var(--pad-x) clamp(40px, 6vh, 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    overflow: hidden;
}

/* Bubble field */
.bubble-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.bubble {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%,
            rgba(255,255,255,0.95) 0%,
            rgba(232,232,232,0.55) 22%,
            rgba(192,192,192,0.18) 55%,
            rgba(128,128,128,0.20) 100%);
    box-shadow:
        inset 0 0 10px rgba(255,255,255,0.4),
        inset -2px -3px 6px rgba(128,128,128,0.18);
    opacity: 0;
    animation:
        bubble-fade 1.1s var(--ease-soft) forwards,
        bubble-float 4s ease-in-out infinite;
    animation-delay: var(--delay), calc(var(--delay) + 1s);
}
.bubble::after {
    content: "";
    position: absolute;
    top: 18%;
    left: 22%;
    width: 28%;
    height: 28%;
    background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(255,255,255,0));
    border-radius: 50%;
}

@keyframes bubble-fade {
    from { opacity: 0; transform: translateY(0) scale(0.7); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bubble-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-5px) scale(1.02); }
}

/* Logotype + brackets */
.logotype-row {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2.4vw, 28px);
    margin-top: clamp(40px, 8vh, 96px);
    width: 100%;
    max-width: 880px;
}
.bracket {
    width: clamp(120px, 22vw, 220px);
    height: auto;
    flex: 0 0 auto;
}
.bracket-strokes path,
.bracket-strokes circle {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: bracket-draw 1s var(--ease-soft) forwards;
    animation-delay: 0.5s;
}
.bracket-strokes circle {
    fill: none;
}
@keyframes bracket-draw {
    to { stroke-dashoffset: 0; }
}

.logotype {
    font-family: var(--font-slab);
    font-weight: 700;
    font-size: clamp(48px, 9vw, 110px);
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--near-black);
    opacity: 0;
    animation: fade-in 1s var(--ease-soft) forwards;
    animation-delay: 0.8s;
}
@keyframes fade-in { to { opacity: 1; } }

.logotype-subtitle {
    margin-top: clamp(18px, 2.4vh, 28px);
    font-family: var(--font-orn);
    font-style: italic;
    font-weight: 500;
    color: var(--medium-gray);
    font-size: clamp(13px, 1.05vw, 16px);
    letter-spacing: 0.05em;
    z-index: 2;
}
.caps {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-style: normal;
    font-family: var(--font-orn);
    font-weight: 500;
}
.tiny { font-size: 0.78em; }

/* Moon figure */
.moon-figure {
    position: relative;
    z-index: 1;
    margin-top: clamp(36px, 5vh, 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(16px, 2vh, 24px);
}

.moon-mask {
    width: clamp(220px, 36vw, 360px);
    aspect-ratio: 1 / 1;
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 0%);
            mask-image: radial-gradient(circle, #000 0%, transparent 0%);
    -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
    transition:
        -webkit-mask-image 2s var(--ease-soft),
        mask-image 2s var(--ease-soft);
}
.moon-mask.lit {
    -webkit-mask-image: radial-gradient(circle, #000 100%, transparent 100%);
            mask-image: radial-gradient(circle, #000 100%, transparent 100%);
}
.moon {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 12px 30px rgba(26,26,26,0.10));
}
.crater-set, .crater-inner { mix-blend-mode: multiply; }

.moon-caption {
    font-family: var(--font-orn);
    font-style: italic;
    font-weight: 500;
    color: var(--medium-gray);
    font-size: 0.92em;
    max-width: 32em;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.ornamental-label {
    font-family: var(--font-orn);
    font-weight: 500;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.72em;
    color: var(--medium-gray);
}

/* Scroll cue */
.scroll-cue {
    margin-top: clamp(36px, 6vh, 64px);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--medium-gray);
}
.scroll-dot {
    transform-origin: 12px 12px;
    animation: scroll-pulse 2.4s ease-in-out infinite;
}
@keyframes scroll-pulse {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%      { transform: translateY(10px); opacity: 0.3; }
}

/* ==========================================================================
   ORNAMENT DIVIDERS
   ========================================================================== */
.ornament-divider {
    max-width: 720px;
    width: calc(100% - 2 * var(--pad-x));
    margin: clamp(40px, 6vh, 72px) auto;
    display: block;
}
.ornament-divider svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   CENTERED CONTENT COLUMN
   ========================================================================== */
.centered-column {
    max-width: var(--col-width);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}

.prose-section {
    padding: clamp(48px, 8vh, 88px) 0;
}

.prose-section .ornamental-label {
    display: block;
    text-align: center;
    margin-bottom: 0.8em;
}

.section-heading {
    font-family: var(--font-slab);
    font-weight: 400;
    font-size: clamp(28px, 4vw, 56px);
    line-height: 1.15;
    letter-spacing: -0.005em;
    color: var(--near-black);
    text-align: center;
    margin-bottom: 1em;
}

.lede {
    font-size: 1.08em;
    text-align: justify;
    hyphens: auto;
}

.dropcap {
    float: left;
    font-family: var(--font-slab);
    font-weight: 700;
    font-size: 4.6em;
    line-height: 0.85;
    padding: 6px 10px 0 0;
    color: var(--near-black);
}

/* ==========================================================================
   STUDY LIST
   ========================================================================== */
.study-list {
    list-style: none;
    margin: 1.6em 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vh, 32px);
}
.study {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 18px;
    align-items: baseline;
    padding-top: 18px;
    border-top: 1px solid var(--silver);
}
.study:first-child { border-top: none; padding-top: 0; }
.study-num {
    font-family: var(--font-orn);
    font-style: italic;
    font-weight: 500;
    font-size: 1.15em;
    color: var(--medium-gray);
    text-align: right;
}
.study-title {
    font-family: var(--font-slab);
    font-weight: 400;
    font-size: 1.4em;
    line-height: 1.3;
    color: var(--near-black);
    margin: 0 0 0.2em;
    letter-spacing: -0.005em;
}
.study-meta {
    font-family: var(--font-orn);
    font-style: italic;
    font-weight: 500;
    font-size: 0.82em;
    color: var(--medium-gray);
    margin: 0 0 0.6em;
}
.study-body p:last-child { margin-bottom: 0; }

.footnote {
    margin-top: 2em;
    font-size: 0.88em;
    color: var(--medium-gray);
    text-align: center;
    font-style: italic;
    border-top: 1px dashed var(--silver);
    padding-top: 1em;
}

/* ==========================================================================
   LEATHER PANEL — Pull quote
   ========================================================================== */
.leather-panel {
    position: relative;
    margin: clamp(28px, 4vh, 48px) auto;
    padding: clamp(36px, 6vw, 56px) clamp(28px, 5vw, 48px);
    background-color: var(--charcoal);
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18)),
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.06), transparent 60%);
    color: var(--pure-white);
    border-radius: 4px;
    box-shadow:
        inset 0 0 0 1px rgba(192,192,192,0.18),
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.5),
        0 18px 32px -16px rgba(26,26,26,0.45);
    overflow: hidden;
    isolation: isolate;
}
/* SVG-noise leather texture */
.leather-noise {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.45;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch' seed='3'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.16  0 0 0 0 0.16  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 280px 280px;
    mix-blend-mode: overlay;
}
.leather-corner {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(192,192,192,0.45);
    z-index: 1;
}
.leather-corner--tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.leather-corner--tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.leather-corner--bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.leather-corner--br { bottom: 10px; right: 10px; border-left: none; border-top: none; }

.quote-text {
    position: relative;
    z-index: 2;
    font-family: var(--font-orn);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(20px, 2.4vw, 28px);
    line-height: 1.45;
    color: var(--pure-white);
    text-align: center;
    margin-bottom: 1em;
}
.quote-attrib {
    position: relative;
    z-index: 2;
    color: var(--silver);
    text-align: center;
    font-size: 0.74em;
}

/* ==========================================================================
   CREED LIST
   ========================================================================== */
.creed-list {
    list-style: none;
    margin: 1.4em 0 0;
    padding: 0;
}
.creed-list li {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--silver);
    align-items: baseline;
}
.creed-list li:last-child { border-bottom: none; }
.creed-num {
    font-family: var(--font-orn);
    font-style: italic;
    font-weight: 500;
    color: var(--medium-gray);
    text-align: right;
}

/* ==========================================================================
   ADDRESS CARD
   ========================================================================== */
.address-card {
    margin: 1.6em auto 0;
    max-width: 460px;
    padding: clamp(24px, 4vw, 36px);
    border: 1px solid var(--silver);
    border-radius: 2px;
    text-align: center;
    font-style: normal;
    background: rgba(255,255,255,0.4);
    box-shadow:
        inset 0 0 0 4px var(--moon-white),
        inset 0 0 0 5px var(--silver);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.address-line { display: block; }
.address-mono {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.05em;
    color: var(--near-black);
    margin-bottom: 0.4em;
}
.address-mono em {
    font-family: var(--font-body);
    font-size: 0.95em;
    color: var(--medium-gray);
}
.address-rule {
    display: block;
    height: 1px;
    background: var(--silver);
    margin: 8px auto;
    width: 60%;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.page-footer {
    max-width: var(--col-width);
    margin: 0 auto;
    padding: clamp(48px, 8vh, 88px) var(--pad-x);
    text-align: center;
    color: var(--medium-gray);
}
.footer-ornament {
    margin-bottom: 18px;
    display: flex;
    justify-content: center;
}
.footer-ornament svg {
    width: clamp(180px, 30vw, 280px);
    height: auto;
}
.footer-line {
    font-family: var(--font-orn);
    font-style: italic;
    font-weight: 500;
    font-size: 0.86em;
    margin: 4px 0;
    letter-spacing: 0.04em;
}
.footer-line .caps { font-style: normal; font-size: 0.95em; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
    .logotype-row {
        gap: 6px;
        margin-top: clamp(24px, 6vh, 56px);
    }
    .bracket {
        width: clamp(80px, 24vw, 130px);
    }
    .study {
        grid-template-columns: 36px 1fr;
        gap: 12px;
    }
    .creed-list li {
        grid-template-columns: 32px 1fr;
        gap: 10px;
    }
    .lede { text-align: left; }
    .dropcap {
        font-size: 3.6em;
        padding: 4px 8px 0 0;
    }
}

@media (max-width: 400px) {
    .logotype { font-size: 56px; }
    .bracket { width: 70px; }
}
