/* luminary.dev — Y2K-futurism palimpsest journal */

:root {
    --foxed-cream: #f0e6d4;
    --warm-parchment: #e3d5c1;
    --aged-tan: #d4b896;
    --golden-oxide: #c4a97d;
    --terracotta-blush: #c49a8b;
    --stone-grey: #8a7e6f;
    --deep-umber: #3b3228;
    --silver-ash: #b8b0a3;
    --faded-violet: #9b8bb4;

    --font-handwritten: 'Caveat', cursive;
    --font-serif: 'Libre Baskerville', serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--foxed-cream);
    color: var(--deep-umber);
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Noise overlay for paper texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='64' height='64' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 64px 64px;
}

/* Foxing spots */
.foxing-spots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.foxing-spot {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(196, 154, 139, 0.15) 0%, transparent 70%);
}

/* Navigation sigil */
.nav-sigil {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 900;
    background: none;
    border: none;
    font-family: var(--font-handwritten);
    font-size: 2rem;
    color: var(--stone-grey);
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    line-height: 1;
}

.nav-sigil:hover {
    transform: rotate(72deg) scale(1.2);
    color: var(--faded-violet);
}

.nav-sigil.active {
    transform: rotate(144deg);
    color: var(--terracotta-blush);
}

/* Navigation overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 80vw;
    height: 100vh;
    z-index: 800;
    background-color: var(--warm-parchment);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='64' height='64' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 64px 64px;
    transition: right 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -10px 0 40px rgba(59, 50, 40, 0.1);
}

.nav-overlay.open {
    right: 0;
}

.nav-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--deep-umber);
    font-family: var(--font-handwritten);
    font-size: 1.6rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-link:hover {
    color: var(--faded-violet);
    transform: translateX(5px);
}

.nav-thumb {
    font-size: 1.2rem;
    color: var(--stone-grey);
    width: 2rem;
    text-align: center;
}

/* Journal pages */
.journal-page {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.page-content {
    max-width: 720px;
    width: 100%;
    position: relative;
}

.page-content-centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Torn edges */
.torn-edge {
    position: absolute;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 5;
}

.torn-edge-bottom {
    bottom: 0;
    background: linear-gradient(to bottom, var(--foxed-cream) 0%, transparent 100%);
    clip-path: polygon(
        0% 0%, 3% 45%, 7% 20%, 12% 55%, 18% 15%, 23% 60%, 28% 25%, 33% 50%, 
        38% 10%, 43% 55%, 48% 20%, 53% 60%, 58% 30%, 63% 55%, 68% 15%, 
        73% 50%, 78% 25%, 83% 60%, 88% 20%, 93% 55%, 97% 30%, 100% 0%
    );
}

.torn-edge-top {
    top: 0;
    background: linear-gradient(to top, var(--foxed-cream) 0%, transparent 100%);
    clip-path: polygon(
        0% 100%, 3% 55%, 7% 80%, 12% 45%, 18% 85%, 23% 40%, 28% 75%, 33% 50%, 
        38% 90%, 43% 45%, 48% 80%, 53% 40%, 58% 70%, 63% 45%, 68% 85%, 
        73% 50%, 78% 75%, 83% 40%, 88% 80%, 93% 45%, 97% 70%, 100% 100%
    );
}

/* Hero */
.hero-title {
    font-family: var(--font-handwritten);
    font-size: clamp(4rem, 12vw, 9rem);
    font-weight: 700;
    line-height: 1.05;
    color: var(--deep-umber);
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.2s ease forwards 0.3s;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--stone-grey);
    margin-top: 1rem;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.8s;
}

.hero-annotation {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.2s;
}

.annotation-line {
    width: 40px;
    height: 1px;
    background-color: var(--terracotta-blush);
}

.annotation-text {
    font-family: var(--font-handwritten);
    font-size: 1.1rem;
    color: var(--stone-grey);
    font-style: italic;
}

.waveform-decoration {
    margin-top: 4rem;
    height: 60px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.5s;
}

/* Section headings */
.section-heading {
    font-family: var(--font-handwritten);
    font-size: clamp(2.8rem, 7vw, 6rem);
    font-weight: 400;
    line-height: 1.05;
    color: var(--deep-umber);
    margin-bottom: 2rem;
}

/* Journal entries */
.journal-entry {
    margin-top: 1.5rem;
}

.entry-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--stone-grey);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.entry-text {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--deep-umber);
    margin-bottom: 1rem;
}

/* Margin notes */
.margin-note {
    position: absolute;
    left: -120px;
    top: 50%;
    transform: translateY(-50%) rotate(-2deg);
    width: 100px;
    text-align: right;
}

.margin-note-right {
    left: auto;
    right: -120px;
    text-align: left;
    transform: translateY(-50%) rotate(1.5deg);
}

.margin-note-mark {
    font-family: var(--font-handwritten);
    font-size: 1.4rem;
    color: var(--terracotta-blush);
    display: block;
}

.margin-note-text {
    font-family: var(--font-handwritten);
    font-size: 0.95rem;
    color: var(--stone-grey);
    line-height: 1.3;
}

/* Work grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.work-card {
    padding: 1.5rem;
    border: 1px solid var(--silver-ash);
    border-radius: 2px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: rgba(240, 230, 212, 0.5);
}

.work-card:hover {
    transform: translateY(-4px) rotate(-0.5deg);
    box-shadow: 4px 6px 20px rgba(59, 50, 40, 0.08);
}

.work-card-sketch {
    height: 80px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sketch-svg {
    width: 100%;
    height: 100%;
}

.work-card-title {
    font-family: var(--font-handwritten);
    font-size: 1.4rem;
    color: var(--deep-umber);
    margin-bottom: 0.5rem;
}

.work-card-desc {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    color: var(--stone-grey);
    line-height: 1.5;
}

/* Signal section */
.signal-waveform {
    height: 80px;
    margin-bottom: 2rem;
    position: relative;
}

.signal-list {
    list-style: none;
    margin-top: 1rem;
}

.signal-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--silver-ash);
}

.signal-list li:last-child {
    border-bottom: none;
}

.mono-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--deep-umber);
}

/* Closing */
.closing-glyph {
    font-size: 3rem;
    color: var(--faded-violet);
    margin-bottom: 2rem;
    animation: pulse 3s ease-in-out infinite;
}

.closing-text {
    font-family: var(--font-handwritten);
    font-size: 1.5rem;
    color: var(--deep-umber);
    line-height: 1.5;
    margin-bottom: 2rem;
}

.closing-colophon {
    color: var(--stone-grey);
    font-size: 0.8rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

/* Scroll reveal */
.journal-page .page-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.journal-page.visible .page-content {
    opacity: 1;
    transform: translateY(0);
}

#hero .page-content {
    opacity: 1;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .margin-note {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        transform: rotate(-1deg);
        width: 100%;
        text-align: left;
        margin-top: 2rem;
        padding-left: 1rem;
        border-left: 2px solid var(--terracotta-blush);
    }

    .margin-note-right {
        left: auto;
        right: auto;
        transform: rotate(0deg);
    }

    .work-grid {
        grid-template-columns: 1fr;
    }

    .journal-page {
        padding: 3rem 1.5rem;
    }
}
