/* bable.pro - Coastal Cottage Workshop + Software Documentation Portal */
/* Cottagecore meets technical manual */

:root {
    /* Coastal Blend Palette */
    --bg-primary: #f5f0e8;         /* Tide Linen */
    --bg-secondary: #faf7f2;       /* Shell White */
    --text-primary: #3d4f5f;       /* Slate Depth */
    --text-secondary: #6b7f8d;     /* Kelp Grey */
    --accent-primary: #6a9fb5;     /* Tide Pool Blue */
    --accent-secondary: #c4a882;   /* Driftwood Gold */
    --accent-tertiary: #8db5a0;    /* Sea Glass Green */
    --border: #d9d2c7;             /* Foam Line */
    --card-bg: #f0ece4;            /* Parchment Warm */
    --hover-state: #e2eff5;        /* Morning Fog */

    /* Typography */
    --font-display: 'Nunito', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-code: 'Source Code Pro', monospace;

    /* Spacing */
    --grid-gap: clamp(16px, 3vw, 32px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* =============================================
   NOTEBOOK GRID OVERLAY
   ============================================= */

.notebook-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 27px,
            rgba(61, 79, 95, 0.02) 27px,
            rgba(61, 79, 95, 0.02) 28px
        );
    display: none;
}

@media (min-width: 1200px) {
    .notebook-grid {
        display: block;
    }
}

/* =============================================
   RADIAL NAVIGATION
   ============================================= */

.nav-trigger {
    position: fixed;
    top: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: background-color 300ms ease, transform 300ms ease;
    box-shadow: 0 2px 8px rgba(61, 79, 95, 0.08);
}

.nav-trigger:hover {
    background: var(--hover-state);
    transform: scale(1.05);
}

.nav-trigger.active {
    background: var(--accent-primary);
}

.nav-trigger.active .nav-icon {
    color: var(--bg-secondary);
}

.nav-icon {
    font-size: 1.4rem;
    color: var(--text-secondary);
    line-height: 1;
    user-select: none;
}

.radial-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    clip-path: circle(0px at 48px 48px);
    background: rgba(245, 240, 232, 0.96);
    transition: clip-path 500ms cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.radial-nav.open {
    clip-path: circle(150% at 48px 48px);
    pointer-events: all;
}

.nav-link {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease, transform 400ms ease, color 200ms ease;
}

.radial-nav.open .nav-link {
    opacity: 1;
    transform: translateY(0);
}

.radial-nav.open .nav-link[data-index='0'] { transition-delay: 100ms; }
.radial-nav.open .nav-link[data-index='1'] { transition-delay: 180ms; }
.radial-nav.open .nav-link[data-index='2'] { transition-delay: 260ms; }
.radial-nav.open .nav-link[data-index='3'] { transition-delay: 340ms; }

.nav-link:hover {
    color: var(--accent-primary);
}

/* =============================================
   THE THRESHOLD
   ============================================= */

.threshold {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background:
        linear-gradient(125deg, rgba(196, 168, 130, 0.05) 0%, transparent 40%),
        linear-gradient(235deg, rgba(106, 159, 181, 0.04) 0%, transparent 35%),
        radial-gradient(ellipse at 20% 80%, rgba(141, 181, 160, 0.06) 0%, transparent 50%),
        var(--bg-primary);
}

.threshold-inner {
    text-align: center;
    position: relative;
    z-index: 1;
}

.threshold-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 3rem;
}

.chevron-container {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(6px); }
}

/* =============================================
   THE COLLECTION
   ============================================= */

.collection {
    padding: clamp(40px, 8vw, 100px) clamp(20px, 5vw, 80px);
    position: relative;
    z-index: 1;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--grid-gap);
    max-width: 1400px;
    margin: 0 auto;
}

.specimen-card {
    position: relative;
    background:
        linear-gradient(
            calc(125deg + var(--marble-seed, 0) * 60deg),
            rgba(196, 168, 130, 0.05) 0%, transparent 40%
        ),
        linear-gradient(
            calc(235deg - var(--marble-seed, 0) * 40deg),
            rgba(106, 159, 181, 0.04) 0%, transparent 35%
        ),
        radial-gradient(
            ellipse at var(--marble-x, 20%) var(--marble-y, 80%),
            rgba(141, 181, 160, 0.06) 0%, transparent 50%
        ),
        var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: clamp(24px, 3vw, 40px);
    padding-top: clamp(32px, 4vw, 48px);
    box-shadow: 0 1px 3px rgba(61, 79, 95, 0.08);
    transition:
        transform 600ms cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 600ms cubic-bezier(0.23, 1, 0.32, 1),
        background-color 600ms ease;
    overflow: hidden;
}

.specimen-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 32px rgba(61, 79, 95, 0.12);
}

.specimen-card:hover .pressed-flower {
    opacity: 0.15;
}

.specimen-card.featured {
    grid-column: span 2;
}

@media (max-width: 700px) {
    .specimen-card.featured {
        grid-column: span 1;
    }
}

.specimen-gap {
    visibility: hidden;
}

.card-motif {
    position: absolute;
    top: 16px;
    right: 16px;
}

.pressed-flower {
    transition: opacity 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.specimen-number {
    display: block;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 6rem;
    color: var(--accent-secondary);
    opacity: 0.1;
    position: absolute;
    top: -10px;
    left: 10px;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.card-description {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.card-annotation {
    display: inline-block;
    font-family: var(--font-code);
    font-weight: 400;
    font-size: 0.8em;
    color: #5a7a8a;
    background: rgba(240, 236, 228, 0.6);
    padding: 2px 8px;
    border-left: 2px solid var(--accent-primary);
    position: relative;
    z-index: 1;
}

/* Shell Divider */
.shell-divider {
    max-width: 800px;
    margin: clamp(40px, 6vw, 80px) auto;
    text-align: center;
}

/* =============================================
   THE ANNOTATION
   ============================================= */

.annotation {
    padding: clamp(60px, 10vw, 120px) clamp(20px, 5vw, 80px);
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
}

.annotation-inner {
    max-width: 65ch;
    margin: 0 auto;
    position: relative;
}

.section-watermark {
    display: block;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 6rem;
    color: var(--accent-secondary);
    opacity: 0.1;
    position: absolute;
    top: -40px;
    left: -40px;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.annotation-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.annotation-content p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.annotation-subheading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.code-annotation {
    background: var(--card-bg);
    border-left: 3px solid #8fb3c4;
    padding: 16px 20px;
    margin: 1.5rem 0;
    border-radius: 2px;
}

.code-annotation code {
    display: block;
    font-family: var(--font-code);
    font-weight: 400;
    font-size: 0.9em;
    color: #5a7a8a;
    line-height: 2;
}

/* =============================================
   THE COLOPHON
   ============================================= */

.colophon {
    padding: clamp(40px, 6vw, 80px) clamp(20px, 5vw, 80px);
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
}

.colophon-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.colophon-label {
    text-align: center;
    padding: 24px 40px;
    border: 1px solid var(--border);
    border-width: 1px 2px;
    position: relative;
}

.colophon-label::before,
.colophon-label::after {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    height: 1px;
    background: var(--border);
}

.colophon-label::before { top: 3px; }
.colophon-label::after { bottom: 3px; }

.label-ornament {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.colophon-name {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.colophon-coords {
    display: block;
    font-family: var(--font-code);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.colophon-date {
    display: block;
    font-family: var(--font-code);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */

@media (max-width: 600px) {
    .collection-grid {
        grid-template-columns: 1fr;
    }

    .specimen-gap {
        display: none;
    }

    .section-watermark {
        font-size: 4rem;
        top: -20px;
        left: -10px;
    }

    .nav-trigger {
        top: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
    }

    .radial-nav {
        clip-path: circle(0px at 36px 36px);
    }

    .radial-nav.open {
        clip-path: circle(150% at 36px 36px);
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================
   SELECTION & SCROLLBAR
   ============================================= */

::selection {
    background: var(--hover-state);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
