/* storiographer.net - Scandinavian / Glassmorphic Masonry */

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

:root {
    --bg: #EDF2F7;
    --glass: rgba(240, 244, 248, 0.65);
    --glass-opaque: rgba(240, 244, 248, 0.80);
    --chrome-light: #D0D8E0;
    --chrome-mid: #A8B0B8;
    --chrome-dark: #6A7580;
    --text-primary: #2A3038;
    --text-body: #4A5058;
    --accent: #B8A890;
    --meta: #8090A0;
    --cursor: #5A7090;
    --patina: #A89878;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    background-image: linear-gradient(180deg, #EDF2F7 0%, #E4E9EF 100%);
    color: var(--text-body);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Northern Light */
.northern-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Entrance */
.entrance {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.entrance__title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-primary);
    min-height: 1.5em;
}

.entrance__title .cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--cursor);
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s step-end infinite;
}

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

.entrance__subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1rem;
    color: var(--meta);
    margin-top: 0.75rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.entrance__subtitle.visible {
    opacity: 1;
}

/* Masonry Grid */
.masonry {
    column-count: 3;
    column-gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
    position: relative;
    z-index: 1;
}

/* Story Card */
.story-card {
    break-inside: avoid;
    margin-bottom: 24px;
    position: relative;
    padding: 28px 24px 24px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(120, 130, 140, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.story-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.story-card--short {
    min-height: 120px;
}

.story-card--medium {
    min-height: 240px;
}

.story-card--tall {
    min-height: 400px;
}

.story-card--featured {
    background: var(--glass-opaque);
    column-span: all;
}

/* Chrome Rail */
.chrome-rail {
    position: absolute;
    top: -10px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: linear-gradient(90deg, var(--chrome-mid), var(--chrome-light), var(--chrome-mid));
    border-radius: 1px;
}

.chrome-rail--double {
    box-shadow: 0 4px 0 var(--chrome-mid);
}

.chrome-rail--bare {
    position: relative;
    top: 0;
    width: 200px;
    margin: 0 auto;
}

/* Rivets */
.rivet {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, var(--chrome-light), var(--chrome-mid));
    border: 1px solid var(--meta);
    top: -13px;
}

.rivet--tl { left: 16px; }
.rivet--tr { right: 16px; }

/* Typography */
.card-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.card-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-body);
}

.card-meta {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--meta);
    display: block;
    margin-bottom: 0.75rem;
}

/* Typewriter Text */
.card-typewriter {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1rem;
    min-height: 3.6em;
}

.card-typewriter .cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--cursor);
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s step-end infinite;
}

/* Vintage Motif */
.vintage-motif {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
}

.vintage-motif--large {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
}

.vintage-motif--bare {
    position: relative;
    bottom: auto;
    right: auto;
    margin: 16px auto 0;
    display: block;
    opacity: 0.15;
}

/* Empty Fixture / Footer */
.empty-fixture {
    text-align: center;
    padding: 40px 24px 80px;
    position: relative;
    z-index: 1;
}

.footer-domain {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--meta);
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .masonry {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .masonry {
        column-count: 1;
    }

    .story-card--featured {
        column-span: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.3s !important;
    }

    .story-card {
        opacity: 1;
        transform: none;
    }

    .entrance__subtitle {
        opacity: 1;
    }
}
