/* ===================================================
   rinji.org — Neomorphic Botanist's Workshop
   Palette: Creamy Pastel | Layout: Card Grid
   Typography: Condensed | Motifs: Floral Botanical
   =================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.75;
    color: #6B4E3D;
    background-color: #F5EDE0;
    background-image:
        repeating-linear-gradient(
            105deg,
            transparent,
            transparent 1.5px,
            rgba(180,160,130,0.035) 1.5px,
            rgba(180,160,130,0.035) 2.5px
        ),
        radial-gradient(
            ellipse at 50% 50%,
            transparent 60%,
            rgba(196,168,130,0.08) 100%
        );
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #6B4E3D;
    text-decoration: none;
    transition: color 200ms ease;
}

a:hover {
    color: #A67B5B;
}

/* --- Leather Surface Mixin (applied to cards/panels) --- */
.leather-surface {
    background-color: #F5EDE0;
    background-image:
        repeating-linear-gradient(
            105deg,
            transparent,
            transparent 2px,
            rgba(180,160,130,0.04) 2px,
            rgba(180,160,130,0.04) 3px
        ),
        radial-gradient(
            ellipse at 50% 50%,
            transparent 60%,
            rgba(196,168,130,0.08) 100%
        );
}

/* --- Neomorphic Shadow System --- */
.neo-raised {
    box-shadow:
        6px 6px 14px rgba(166,123,91,0.15),
        -6px -6px 14px rgba(255,255,255,0.8);
}

.neo-pressed {
    box-shadow:
        inset 4px 4px 8px rgba(166,123,91,0.2),
        inset -4px -4px 8px rgba(255,255,255,0.65);
}

.neo-recessed {
    box-shadow:
        inset 3px 3px 6px rgba(166,123,91,0.12),
        inset -3px -3px 6px rgba(255,255,255,0.5);
}

/* ===================================================
   BINDING STRIP NAVIGATION
   =================================================== */
.binding-strip {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    background: rgba(245,237,224,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 2px solid #C4A882;
    display: flex;
    align-items: center;
}

.nav-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: 0.06em;
    color: #5C3D2E;
    text-transform: uppercase;
}

.nav-brand:hover {
    color: #A67B5B;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-pill {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5C3D2E;
    padding: 6px 16px;
    border-radius: 20px;
    background: #F5EDE0;
    box-shadow:
        3px 3px 8px rgba(166,123,91,0.12),
        -3px -3px 8px rgba(255,255,255,0.7);
    transition: box-shadow 300ms ease, transform 300ms ease, color 200ms ease;
}

.nav-pill:hover {
    color: #A67B5B;
    box-shadow:
        4px 4px 10px rgba(166,123,91,0.18),
        -4px -4px 10px rgba(255,255,255,0.85);
    transform: scale(1.02);
}

.nav-pill:active {
    box-shadow:
        inset 3px 3px 6px rgba(166,123,91,0.18),
        inset -3px -3px 6px rgba(255,255,255,0.6);
    transform: scale(0.985);
}

/* ===================================================
   WORKTABLE HERO
   =================================================== */
.hero-worktable {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-leather-surface {
    position: absolute;
    inset: 0;
    background-color: #F5EDE0;
    background-image:
        repeating-linear-gradient(
            105deg,
            transparent,
            transparent 2px,
            rgba(180,160,130,0.04) 2px,
            rgba(180,160,130,0.04) 3px
        ),
        radial-gradient(
            ellipse at 50% 50%,
            transparent 60%,
            rgba(196,168,130,0.08) 100%
        );
    opacity: 0;
    transition: opacity 600ms ease;
}

.hero-leather-surface.visible {
    opacity: 1;
}

/* Botanical decorations */
.botanical-decoration {
    position: absolute;
    pointer-events: none;
}

.botanical-top-left {
    top: 40px;
    left: 30px;
    width: 180px;
    height: 180px;
}

.botanical-top-right {
    top: 40px;
    right: 30px;
    width: 180px;
    height: 180px;
}

.botanical-bottom-left {
    bottom: 40px;
    left: 40px;
    width: 140px;
    height: 140px;
}

.botanical-bottom-right {
    bottom: 50px;
    right: 50px;
    width: 160px;
    height: 160px;
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.hero-embossed-panel {
    padding: 48px 64px;
    border-radius: 20px;
    background: #F5EDE0;
    box-shadow:
        inset 4px 4px 8px rgba(180,160,130,0.25),
        inset -4px -4px 8px rgba(255,255,255,0.7);
}

.hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: 0.06em;
    color: #5C3D2E;
    text-transform: uppercase;
    opacity: 0;
    transform: scale(1.3);
    filter: blur(6px);
    transition: opacity 800ms ease-out, transform 800ms ease-out, filter 800ms ease-out;
}

.hero-title.focused {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.hero-tagline-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    min-height: 1.6em;
}

.hero-tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    color: #A67B5B;
    letter-spacing: 0.02em;
    overflow: hidden;
    white-space: nowrap;
    border-right: none;
    width: 0;
}

.hero-tagline.typing {
    animation: typewriter 2s steps(48, end) forwards;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

.tagline-cursor {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    color: #A67B5B;
    animation: blink 800ms step-end infinite;
    margin-left: 2px;
}

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

/* ===================================================
   SECTION HEADINGS
   =================================================== */
.section-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5C3D2E;
    text-align: center;
    margin-bottom: 12px;
}

.section-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
    color: #6B4E3D;
    line-height: 1.75;
}

/* ===================================================
   SECTION DIVIDERS
   =================================================== */
.section-divider {
    display: flex;
    justify-content: center;
    padding: 32px 0;
    overflow: hidden;
}

.section-divider svg {
    width: min(600px, 90vw);
    height: auto;
}

.botanical-draw {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1200ms ease-out;
}

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

/* ===================================================
   SPECIMEN GRID
   =================================================== */
.specimen-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 32px;
}

/* --- Specimen Card --- */
.specimen-card {
    background: #F5EDE0;
    background-image:
        repeating-linear-gradient(
            105deg,
            transparent,
            transparent 1.5px,
            rgba(180,160,130,0.035) 1.5px,
            rgba(180,160,130,0.035) 2.5px
        ),
        radial-gradient(
            ellipse at 50% 50%,
            transparent 60%,
            rgba(196,168,130,0.08) 100%
        );
    border-radius: 16px;
    border-top: 2px solid #D4A59A;
    box-shadow:
        6px 6px 14px rgba(166,123,91,0.15),
        -6px -6px 14px rgba(255,255,255,0.8);
    padding: 28px;
    transition:
        box-shadow 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 300ms ease;
    cursor: pointer;
    /* Zoom-focus entrance defaults */
    opacity: 0;
    transform: scale(0.92);
    filter: blur(3px);
}

.specimen-card.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    transition:
        opacity 500ms ease-out,
        transform 500ms ease-out,
        filter 500ms ease-out,
        box-shadow 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 300ms ease;
}

.specimen-card:hover {
    box-shadow:
        8px 8px 18px rgba(166,123,91,0.22),
        -8px -8px 18px rgba(255,255,255,0.9);
    transform: scale(1.015);
    border-top-color: #8A9A7B;
}

.specimen-card:active {
    box-shadow:
        inset 4px 4px 8px rgba(166,123,91,0.2),
        inset -4px -4px 8px rgba(255,255,255,0.65);
    transform: scale(0.985);
}

/* Featured card: spans 2 columns */
.specimen-card.featured {
    grid-column: span 2;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='260' viewBox='0 0 200 260'%3E%3Cpath d='M100,240 Q100,180 95,140 Q90,100 100,60 Q110,30 100,10' fill='none' stroke='%23A67B5B' stroke-width='1.5' opacity='0.05'/%3E%3Cpath d='M95,140 Q70,130 55,110' fill='none' stroke='%23A67B5B' stroke-width='1' opacity='0.05'/%3E%3Cpath d='M95,140 Q120,125 135,108' fill='none' stroke='%23A67B5B' stroke-width='1' opacity='0.05'/%3E%3Cpath d='M98,100 Q75,90 60,75' fill='none' stroke='%23A67B5B' stroke-width='1' opacity='0.05'/%3E%3Cpath d='M98,100 Q122,88 138,72' fill='none' stroke='%23A67B5B' stroke-width='1' opacity='0.05'/%3E%3Cpath d='M100,60 Q80,50 65,38' fill='none' stroke='%23A67B5B' stroke-width='1' opacity='0.05'/%3E%3Cpath d='M100,60 Q120,50 135,38' fill='none' stroke='%23A67B5B' stroke-width='1' opacity='0.05'/%3E%3C/svg%3E"),
        repeating-linear-gradient(
            105deg,
            transparent,
            transparent 1.5px,
            rgba(180,160,130,0.035) 1.5px,
            rgba(180,160,130,0.035) 2.5px
        ),
        radial-gradient(
            ellipse at 50% 50%,
            transparent 60%,
            rgba(196,168,130,0.08) 100%
        );
    background-repeat: no-repeat, repeat, no-repeat;
    background-position: right 20px bottom 20px, 0 0, center;
    background-size: 160px auto, auto, 100%;
    background-color: #F5EDE0;
}

/* --- Card Internals --- */
.card-thumbnail {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 50%;
    background: #F5EDE0;
    box-shadow:
        inset 3px 3px 6px rgba(166,123,91,0.12),
        inset -3px -3px 6px rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 16px;
    transition: transform 400ms ease;
}

.specimen-card.featured .card-thumbnail {
    margin-bottom: 0;
}

.specimen-card:hover .card-thumbnail {
    transform: scale(1.08);
}

.card-thumbnail svg {
    width: 48px;
    height: 48px;
}

.card-content {
    flex: 1;
}

.card-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.1vw, 0.85rem);
    color: #A67B5B;
    display: block;
    margin-bottom: 8px;
}

.card-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    letter-spacing: 0.06em;
    color: #5C3D2E;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-description {
    color: #6B4E3D;
    line-height: 1.75;
    margin-bottom: 12px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5C3D2E;
    background: #F0D5C8;
    padding: 4px 12px;
    border-radius: 14px;
    box-shadow:
        2px 2px 5px rgba(166,123,91,0.1),
        -2px -2px 5px rgba(255,255,255,0.6);
    transition: box-shadow 300ms ease, transform 300ms ease;
}

.tag-pill:hover {
    box-shadow:
        inset 2px 2px 4px rgba(166,123,91,0.15),
        inset -2px -2px 4px rgba(255,255,255,0.55);
    transform: scale(0.97);
}

/* ===================================================
   TUTORIAL SECTION
   =================================================== */
.tutorial-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.tutorial-timeline {
    position: relative;
    margin-top: 32px;
}

.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #C4A882;
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 1200ms ease-out;
}

.timeline-line.growing {
    transform: scaleY(1);
}

.tutorial-step {
    display: flex;
    gap: 24px;
    margin-bottom: 36px;
    position: relative;
    /* Zoom-focus entrance */
    opacity: 0;
    transform: scale(0.92);
    filter: blur(3px);
}

.tutorial-step.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    transition:
        opacity 500ms ease-out,
        transform 500ms ease-out,
        filter 500ms ease-out;
}

.step-badge {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: #F5EDE0;
    box-shadow:
        4px 4px 10px rgba(166,123,91,0.15),
        -4px -4px 10px rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.step-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #A67B5B;
}

.step-card {
    flex: 1;
    background: #F5EDE0;
    background-image:
        repeating-linear-gradient(
            105deg,
            transparent,
            transparent 1.5px,
            rgba(180,160,130,0.035) 1.5px,
            rgba(180,160,130,0.035) 2.5px
        );
    border-radius: 16px;
    border-top: 2px solid #D4A59A;
    box-shadow:
        6px 6px 14px rgba(166,123,91,0.15),
        -6px -6px 14px rgba(255,255,255,0.8);
    padding: 24px;
    transition: box-shadow 300ms ease, transform 300ms ease, border-color 300ms ease;
}

.step-card:hover {
    box-shadow:
        8px 8px 18px rgba(166,123,91,0.22),
        -8px -8px 18px rgba(255,255,255,0.9);
    transform: scale(1.01);
    border-top-color: #8A9A7B;
}

/* Code blocks */
.code-block {
    background: #EDE4D6;
    box-shadow:
        inset 2px 2px 4px rgba(166,123,91,0.12),
        inset -2px -2px 4px rgba(255,255,255,0.6);
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 12px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.3vw, 0.95rem);
    color: #A67B5B;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===================================================
   JOURNAL SECTION
   =================================================== */
.journal-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.journal-entries {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.journal-entry {
    background: #F5EDE0;
    background-image:
        repeating-linear-gradient(
            105deg,
            transparent,
            transparent 1.5px,
            rgba(180,160,130,0.035) 1.5px,
            rgba(180,160,130,0.035) 2.5px
        );
    border-radius: 16px;
    border-top: 2px solid #D4A59A;
    box-shadow:
        6px 6px 14px rgba(166,123,91,0.15),
        -6px -6px 14px rgba(255,255,255,0.8);
    padding: 28px;
    transition:
        box-shadow 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 300ms ease;
    /* Zoom-focus entrance */
    opacity: 0;
    transform: scale(0.92);
    filter: blur(3px);
}

.journal-entry.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    transition:
        opacity 500ms ease-out,
        transform 500ms ease-out,
        filter 500ms ease-out,
        box-shadow 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 300ms ease;
}

.journal-entry:hover {
    box-shadow:
        8px 8px 18px rgba(166,123,91,0.22),
        -8px -8px 18px rgba(255,255,255,0.9);
    transform: scale(1.01);
    border-top-color: #8A9A7B;
}

.journal-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.3vw, 0.95rem);
    color: #A67B5B;
    display: block;
    margin-bottom: 8px;
}

.journal-link {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    color: #6B4E3D;
    display: inline-block;
    position: relative;
    padding-bottom: 2px;
    background-image: linear-gradient(#A67B5B, #A67B5B);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 300ms ease, color 200ms ease;
}

.journal-link:hover {
    color: #A67B5B;
    background-size: 100% 1px;
}

/* ===================================================
   FOOTER ENDPAPER
   =================================================== */
.endpaper {
    background-color: #E8D5C0;
    background-image:
        radial-gradient(
            circle at 50% 40%,
            rgba(166,123,91,0.08) 1.5px,
            transparent 1.5px
        ),
        linear-gradient(
            to bottom,
            rgba(166,123,91,0.08) 0px,
            rgba(166,123,91,0.08) 2px,
            transparent 2px
        );
    background-size: 32px 32px;
    background-position: 0 0;
    padding: 60px 24px 32px;
    margin-top: 40px;
}

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

.footer-brand {
    text-align: center;
    margin-bottom: 40px;
}

.footer-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.06em;
    color: #5C3D2E;
    text-transform: uppercase;
}

.footer-tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    color: #A67B5B;
    margin-top: 4px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5C3D2E;
    margin-bottom: 4px;
}

.footer-col a {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #6B4E3D;
    transition: color 200ms ease;
}

.footer-col a:hover {
    color: #A67B5B;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(166,123,91,0.15);
}

.footer-copy {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    color: #A67B5B;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-links {
        gap: 32px;
    }

    .botanical-top-left,
    .botanical-top-right,
    .botanical-bottom-left,
    .botanical-bottom-right {
        width: 100px;
        height: 100px;
    }
}

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

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

    .nav-links {
        gap: 4px;
    }

    .nav-pill {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .hero-embossed-panel {
        padding: 32px 24px;
        margin: 0 16px;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .footer-col {
        align-items: center;
    }

    .tutorial-step {
        gap: 16px;
    }

    .step-card {
        padding: 16px;
    }
}
