/* ============================================
   aei.st — Styles
   A digital shoebox. Warm analog nostalgia.
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-floral-white: #FFFAF0;
    --bg-warm-parchment: #F5E6C8;
    --bg-deep-parchment: #E8D5B7;
    --text-dark-umber: #3B2F2F;
    --text-warm-brown: #8B7355;
    --accent-burnt-sienna: #C67A4B;
    --accent-faded-burgundy: #8B4049;
    --border-khaki-mist: #D4C4A8;
    --highlight-amber-glow: #D4A053;
    --shadow-sepia-dark: #5C4A3A;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    color: var(--text-dark-umber);
    background-color: var(--bg-floral-white);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    padding-bottom: 20px;
}

/* --- Paper Grain Overlay --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.06;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* --- Navigation --- */
#main-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    z-index: 100;
}

.nav-link a {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-warm-brown);
    text-decoration: none;
    letter-spacing: 0.04em;
    position: relative;
    background-image: linear-gradient(var(--accent-burnt-sienna), var(--accent-burnt-sienna));
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
    padding-bottom: 2px;
}

.nav-link a:hover {
    background-size: 100% 2px;
}

.nav-link a:visited {
    color: var(--accent-faded-burgundy);
}

.nav-sep {
    color: var(--border-khaki-mist);
    font-size: 0.6rem;
    user-select: none;
}

/* --- Hero Region --- */
#hero {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-warm-parchment);
    position: relative;
}

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

#hero-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 8vw;
    color: var(--text-dark-umber);
    letter-spacing: 0.04em;
    line-height: 1.2;
    display: inline-block;
}

#hero-title .char {
    display: inline-block;
    opacity: 0;
    transition: none;
}

#hero-title .char.visible {
    opacity: 1;
}

#typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 0.8em;
    background-color: var(--text-warm-brown);
    vertical-align: baseline;
    margin-left: 4px;
    animation: none;
}

#typewriter-cursor.blink {
    animation: cursorBlink 1.06s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.8s ease 1.2s;
}

.hero-rule.visible {
    opacity: 1;
}

.rule-line {
    display: block;
    width: 15vw;
    height: 1px;
    background-color: var(--text-warm-brown);
}

.hero-stamp {
    font-family: 'Quicksand', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--text-warm-brown);
    letter-spacing: 0.08em;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--border-khaki-mist);
    border-radius: 8px;
    white-space: nowrap;
}

/* --- Content Regions --- */
.content-region {
    padding: 4rem 2rem;
}

/* --- Module Grid --- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Block Base --- */
.block {
    padding: 16px;
    border: 2px solid var(--border-khaki-mist);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* --- Fade-Reveal --- */
.fade-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-block.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Text Block --- */
.text-block {
    background-color: var(--bg-floral-white);
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 27px,
        rgba(139, 115, 85, 0.08) 27px,
        rgba(139, 115, 85, 0.08) 28px
    );
}

.text-block:nth-child(even) {
    background-color: var(--bg-warm-parchment);
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 27px,
        rgba(139, 115, 85, 0.08) 27px,
        rgba(139, 115, 85, 0.08) 28px
    );
}

.block-heading {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: var(--text-dark-umber);
    margin-bottom: 1rem;
}

h3.block-heading {
    font-size: clamp(1.2rem, 3vw, 2rem);
}

.block-body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--text-dark-umber);
    margin-bottom: 1rem;
}

.block-body:last-child {
    margin-bottom: 0;
}

.block-note {
    font-style: italic;
    font-weight: 300;
}

/* --- Index Card Tabs --- */
.index-tab {
    position: absolute;
    top: -10px;
    left: 24px;
    width: 40px;
    height: 10px;
    background-color: var(--border-khaki-mist);
    border-radius: 4px 4px 0 0;
    font-family: 'Caveat', cursive;
    font-size: 0.55rem;
    color: var(--text-warm-brown);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-bottom: 1px;
}

/* --- Photo Block --- */
.photo-block {
    padding: 0;
    border: none;
    background: transparent;
}

.photo-frame {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-khaki-mist);
    box-shadow: inset 0 0 4px rgba(92, 74, 58, 0.2);
}

.photo-frame.featured {
    border: 4px dashed var(--text-warm-brown);
    padding: 2px;
}

.photo-frame.featured::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid var(--border-khaki-mist);
    border-radius: 10px;
    pointer-events: none;
}

.photo-placeholder {
    width: 100%;
    display: block;
    background-color: var(--bg-deep-parchment);
    border-radius: 10px;
    overflow: hidden;
    filter: sepia(0.3) saturate(0.85) contrast(1.05) brightness(0.98);
    transition: filter 0.4s ease;
}

.photo-placeholder svg {
    display: block;
    width: 100%;
    height: auto;
}

.photo-block:hover .photo-placeholder {
    filter: sepia(0.5) saturate(0.85) contrast(1.05) brightness(0.92);
}

.annotation {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-warm-brown);
    position: absolute;
    bottom: 8px;
    right: 12px;
}

.margin-note {
    position: static;
    display: block;
    margin-top: 0.5rem;
}

/* --- Quote Block --- */
.quote-block {
    background-color: var(--bg-floral-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    position: relative;
}

.quote-mark {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 4rem;
    color: var(--text-warm-brown);
    opacity: 0.3;
    line-height: 1;
    position: absolute;
}

.quote-mark-open {
    top: 10px;
    left: 16px;
}

.quote-mark-close {
    bottom: 10px;
    right: 16px;
}

.block-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: 2rem;
    line-height: 1.5;
    color: var(--text-dark-umber);
    margin: 0.5rem 0;
    max-width: 90%;
}

.block-attribution {
    font-family: 'Quicksand', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--text-warm-brown);
    letter-spacing: 0.04em;
    margin-top: 0.75rem;
}

/* --- Wax Seal --- */
.wax-seal {
    position: absolute;
    bottom: 12px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: var(--accent-faded-burgundy);
    opacity: 0.15;
    box-shadow:
        inset 2px 2px 4px rgba(255, 250, 240, 0.3),
        inset -1px -1px 3px rgba(59, 47, 47, 0.2);
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.quote-block:hover .wax-seal {
    transform: rotate(5deg) scale(1.05);
    opacity: 0.25;
}

/* --- Stamp Block --- */
.stamp-block {
    background-color: var(--bg-warm-parchment);
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: radial-gradient(circle, var(--border-khaki-mist) 1px, transparent 1px);
    background-size: 16px 16px;
}

.stamp-motif svg {
    width: 80px;
    height: 80px;
}

/* --- Divider Block --- */
.divider-block {
    border: none;
    padding: 0.5rem 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.divider-pattern {
    width: 100%;
    height: 8px;
    background-image: repeating-linear-gradient(
        to right,
        var(--border-khaki-mist) 0px,
        var(--border-khaki-mist) 12px,
        transparent 12px,
        transparent 20px
    );
    border-radius: 4px;
    opacity: 0.5;
}

/* --- Footer --- */
#site-footer {
    background-color: var(--bg-deep-parchment);
    padding: 3rem 2rem 2rem;
    text-align: center;
    margin-top: 2rem;
    border-radius: 12px 12px 0 0;
}

.footer-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.footer-dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background-color: var(--border-khaki-mist);
}

.footer-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    color: var(--text-warm-brown);
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.footer-sub {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-warm-brown);
    opacity: 0.7;
}

/* --- Film Strip Border --- */
#film-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 16px;
    background-color: var(--text-dark-umber);
    z-index: 1000;
    overflow: hidden;
}

.film-strip-inner {
    display: flex;
    gap: 8px;
    padding: 3px 0;
    height: 100%;
    align-items: center;
    will-change: transform;
}

.film-perf {
    display: block;
    flex-shrink: 0;
    width: 8px;
    height: 4px;
    background-color: var(--border-khaki-mist);
    border-radius: 2px;
    opacity: 0.6;
}

/* --- Links in Content --- */
.block a {
    color: var(--accent-burnt-sienna);
    text-decoration: none;
    background-image: linear-gradient(var(--accent-burnt-sienna), var(--accent-burnt-sienna));
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
}

.block a:hover {
    background-size: 100% 2px;
}

.block a:visited {
    color: var(--accent-faded-burgundy);
}

/* --- Responsive: Single Column Below 768px --- */
@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .block {
        grid-column: 1 !important;
    }

    #hero-title {
        font-size: 14vw;
    }

    .rule-line {
        width: 25vw;
    }

    .block-quote {
        font-size: 1.4rem;
    }

    #main-nav {
        padding: 1rem;
        gap: 0.5rem;
    }

    .nav-link a {
        font-size: 0.8rem;
    }

    .content-region {
        padding: 2rem 1rem;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .fade-block {
        opacity: 1;
        transform: none;
        transition: none;
    }

    #hero-title .char {
        opacity: 1;
    }

    .hero-rule {
        opacity: 1;
        transition: none;
    }

    #typewriter-cursor {
        display: none;
    }

    .photo-placeholder {
        transition: none;
    }

    .wax-seal {
        transition: none;
    }

    .nav-link a {
        transition: none;
    }
}
