/* =============================================
   kkaji.com — Botanical Field Journal / Naturalist's Collection
   ============================================= */

:root {
    --paper: #f7f2e8;
    --card: #faf6ed;
    --ink: #3d2b1f;
    --sepia: #8b6f47;
    --persimmon: #d4723c;
    --teal: #2a7f72;
    --plum: #c46b8a;
    --bark: #1e1a15;
    --twig: #c8a97e;
    --paper-dark: #ede6d5;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--paper);
    background-image: radial-gradient(circle at 50% 50%, rgba(139,111,71,0.03) 1px, transparent 1px);
    background-size: 4px 4px;
    color: var(--ink);
    font-family: 'Nunito', -apple-system, sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.section {
    position: relative;
    width: 100%;
}

.section-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--ink);
    text-align: center;
    padding: 80px 20px 40px;
    letter-spacing: -0.01em;
}

/* =============================================
   1. HERO — THE OPENING SPECIMEN
   ============================================= */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--paper);
}

.hero-layout {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    gap: 40px;
    width: 100%;
}

.hero-text {
    width: 38%;
}

.hero-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 9rem);
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1;
    margin-bottom: 8px;
}

.hand-underline {
    width: 200px;
    height: 12px;
    display: block;
    margin-bottom: 24px;
}

.underline-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.2s ease-out;
}

.underline-path.drawn {
    stroke-dashoffset: 0;
}

.hero-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: var(--sepia);
    max-width: 36ch;
}

.hero-illustration {
    width: 62%;
}

.magpie-svg {
    width: 100%;
    height: auto;
    max-height: 80vh;
}

.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3.5s ease;
}

.draw-path.drawn {
    stroke-dashoffset: 0;
}

.fill-area {
    transition: fill-opacity 1s ease 3.5s;
}

.fill-area.filled {
    fill-opacity: 0.2;
}

/* =============================================
   2. THE COLLECTION GRID
   ============================================= */
#collection {
    padding: 60px 40px 100px;
    max-width: 1200px;
    margin: 0 auto;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.specimen-card {
    background: var(--card);
    border: 1px solid var(--twig);
    padding: 30px;
    transform: rotate(var(--card-rotation));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 2px 3px 8px rgba(61,43,31,0.08);
    opacity: 0;
    cursor: default;
}

.specimen-card.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--card-rotation));
}

.specimen-card:hover {
    transform: translateY(-6px) rotate(var(--card-rotation));
    box-shadow: 3px 6px 16px rgba(61,43,31,0.15);
}

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

.specimen-label {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--sepia);
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

.specimen-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.specimen-body {
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    max-width: 55ch;
}

/* =============================================
   3. THE FIELD NOTES
   ============================================= */
#field-notes {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 40px 100px;
}

.field-entry {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.field-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.entry-date {
    font-family: 'Inconsolata', monospace;
    font-size: 14px;
    color: var(--sepia);
    white-space: nowrap;
    min-width: 90px;
    padding-top: 4px;
}

.entry-content p {
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    max-width: 55ch;
}

.twig-divider {
    text-align: center;
    margin: 30px 0;
}

.divider-svg {
    width: 80px;
    height: 20px;
}

/* =============================================
   4. THE MAGPIE'S BRIDGE
   ============================================= */
#bridge {
    padding: 80px 0;
    overflow: hidden;
    background: var(--paper-dark);
}

.bridge-container {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.bridge-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200px;
    transition: transform 0.1s linear;
}

.bridge-text {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--sepia);
    text-align: center;
    max-width: 40ch;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.bridge-text.visible {
    opacity: 1;
}

/* =============================================
   5. THE KEEPER'S SIGNATURE
   ============================================= */
#footer {
    padding: 80px 40px;
    text-align: center;
}

.footer-content {
    max-width: 400px;
    margin: 0 auto;
}

.wax-seal {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--persimmon), var(--sepia));
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(61,43,31,0.2);
    position: relative;
}

.wax-seal:active {
    transform: scale(0.95);
}

.seal-inner {
    width: 60px;
    height: 60px;
    border: 1px solid rgba(247,242,232,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-initials {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--paper);
    text-shadow: 1px 1px 2px rgba(30,26,21,0.3);
}

.footer-text {
    font-family: 'Inconsolata', monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--sepia);
    text-transform: uppercase;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero-layout {
        flex-direction: column;
    }

    .hero-text,
    .hero-illustration {
        width: 100%;
    }

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

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

    .field-entry {
        flex-direction: column;
        gap: 8px;
    }
}
