/* ============================================
   TRANSACTOLOGY.XYZ — Retro-Futuristic Botanical Catalog
   1962 World's Fair Pavilion Aesthetic
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #F5F2EC;
    color: #3D3D3D;
    font-family: 'Special Elite', cursive;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* --- Typography --- */
h1#main-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #2B2B2B;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-feature-settings: "liga" 0;
    line-height: 1.1;
    display: inline;
}

.section-heading {
    font-family: 'Arvo', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.8rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #3A5F3A;
    margin-bottom: 1.2rem;
}

.body-text {
    font-family: 'Special Elite', cursive;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: #3D3D3D;
    margin-bottom: 1rem;
}

.body-text em {
    font-style: italic;
    color: #3A5F3A;
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(180deg, #E8E8E8 0%, #C0C0C0 40%, #A0A0A0 60%, #C0C0C0 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.15);
}

.nav-pill {
    display: inline-block;
    padding: 6px 18px;
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #2B2B2B;
    text-decoration: none;
    border: 1px solid #A0A0A0;
    border-radius: 20px;
    background: linear-gradient(180deg, #E8E8E8 0%, #C0C0C0 40%, #A0A0A0 60%, #C0C0C0 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 2px 4px rgba(0,0,0,0.15);
    transition: all 0.25s ease;
    cursor: pointer;
}

.nav-pill:hover {
    background: #6ABF69;
    color: #FFFFFF;
    border-color: #3A5F3A;
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 4px 8px rgba(0,0,0,0.2);
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 32px;
}

#title-block {
    position: relative;
    display: inline-block;
    margin-bottom: 0;
    min-height: clamp(3rem, 8vw, 7rem);
}

#typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: clamp(2.5rem, 7vw, 6rem);
    background-color: #2B2B2B;
    vertical-align: bottom;
    margin-left: 2px;
    animation: blink 1.06s step-end infinite;
}

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

/* Chrome Plinth */
#chrome-plinth {
    width: 80%;
    max-width: 600px;
    height: 6px;
    margin: 20px auto 40px;
    background: linear-gradient(90deg, #8A8A8A 0%, #C0C0C0 20%, #FFFFFF 45%, #C0C0C0 70%, #8A8A8A 100%);
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: scaleX(0);
    opacity: 0;
}

#chrome-plinth.animate {
    animation: plinthExpand 0.4s ease-out forwards;
}

@keyframes plinthExpand {
    0% { transform: scaleX(0); opacity: 0; }
    100% { transform: scaleX(1); opacity: 1; }
}

/* Hero Flower */
#hero-flower-container {
    width: 280px;
    height: 280px;
    margin: 0 auto 30px;
    opacity: 0;
}

#hero-flower-container.animate {
    opacity: 1;
}

#transaction-flower {
    width: 100%;
    height: 100%;
}

/* SVG Draw Animation */
.svg-draw {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
}

.svg-animate .svg-draw {
    animation: svgDraw 1.5s ease-out forwards;
}

@keyframes svgDraw {
    to { stroke-dashoffset: 0; }
}

.svg-fill-petal {
    fill-opacity: 0;
}

.svg-animate .svg-fill-petal {
    animation: svgDraw 1.5s ease-out forwards, fillFadeIn 0.8s ease-out 1s forwards;
}

.svg-fill-leaf {
    fill-opacity: 0;
}

.svg-animate .svg-fill-leaf {
    animation: svgDraw 1.5s ease-out forwards, fillFadeIn 0.8s ease-out 0.8s forwards;
}

.svg-fill-gold {
    fill-opacity: 0;
}

.svg-animate .svg-fill-gold {
    animation: fillFadeIn 0.8s ease-out 1.2s forwards;
}

.svg-fill-center {
    fill-opacity: 0;
}

.svg-animate .svg-fill-center {
    animation: svgDraw 1.5s ease-out forwards, fillFadeIn 0.8s ease-out 1.2s forwards;
}

@keyframes fillFadeIn {
    to { fill-opacity: 1; }
}

/* Subtitle */
#subtitle {
    font-family: 'Special Elite', cursive;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #3D3D3D;
    letter-spacing: 0.06em;
    min-height: 2em;
}

/* --- Chrome Divider Bars --- */
.chrome-divider {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #C0C0C0 0%, #FFFFFF 45%, #8A8A8A 100%);
    transform: scaleX(0);
    opacity: 0;
}

.chrome-divider.animate {
    animation: dividerExpand 0.6s ease-out forwards;
}

@keyframes dividerExpand {
    0% { transform: scaleX(0); opacity: 0; }
    100% { transform: scaleX(1); opacity: 1; }
}

/* --- Z-Pattern Sections --- */
.full-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.z-section {
    padding: 80px 0;
}

.z-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 48px;
    align-items: center;
    min-height: 70vh;
}

/* Odd sections: text left, illustration right */
.z-odd .z-text-left {
    grid-column: 1 / 8;
    opacity: 0;
    transform: translateX(-60px);
}

.z-odd .z-illust-right {
    grid-column: 8 / 13;
    opacity: 0;
    transform: translateX(60px);
}

/* Even sections: illustration left, text right */
.z-even .z-illust-left {
    grid-column: 1 / 6;
    opacity: 0;
    transform: translateX(-60px);
}

.z-even .z-text-right {
    grid-column: 6 / 13;
    opacity: 0;
    transform: translateX(60px);
}

/* Slide-in animation */
.z-text.animate,
.z-illustration.animate {
    animation: slideIn 0.7s ease-out forwards;
}

.z-odd .z-illust-right.animate {
    animation: slideInRight 0.7s ease-out forwards;
}

.z-even .z-illust-left.animate {
    animation: slideIn 0.7s ease-out forwards;
}

.z-odd .z-text-left.animate {
    animation: slideIn 0.7s ease-out forwards;
}

.z-even .z-text-right.animate {
    animation: slideInRight 0.7s ease-out forwards;
}

@keyframes slideIn {
    0% { opacity: 0; transform: translateX(-60px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(60px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* --- Specimen Cards --- */
.specimen-card {
    background: #FAFCF8;
    border: 1px solid #B8B8B8;
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, #C0C0C0 0%, #FFFFFF 45%, #8A8A8A 100%) 1;
    border-image-slice: 1;
    padding: 32px;
    position: relative;
}

/* Fix: Only top border gets chrome gradient */
.specimen-card {
    border: 1px solid #B8B8B8;
    padding: 32px;
    position: relative;
    background: #FAFCF8;
}

.specimen-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 3px;
    background: linear-gradient(90deg, #C0C0C0 0%, #FFFFFF 45%, #8A8A8A 100%);
}

/* Chrome frame border for illustration areas */
.z-illustration {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-illustration {
    width: 100%;
    max-width: 320px;
    height: auto;
    padding: 24px;
    border: 2px solid transparent;
    background: #FAFCF8;
    position: relative;
}

.section-illustration {
    border: none;
    outline: none;
}

.z-illustration::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 330px;
    height: calc(100% - 60px);
    border: 2px solid #C0C0C0;
    background: #FAFCF8;
    z-index: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}

.section-illustration {
    position: relative;
    z-index: 1;
    background: transparent;
}

/* --- Specimen Labels --- */
.specimen-label {
    display: block;
    font-family: 'Courier Prime', monospace;
    font-style: italic;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7A7A7A;
    margin-bottom: 16px;
    overflow: hidden;
}

.typewrite-label {
    visibility: hidden;
}

.typewrite-label.typed {
    visibility: visible;
}

.specimen-label-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 8px 12px;
    border: 1px solid #C0C0C0;
    background: linear-gradient(180deg, #E8E8E8 0%, #FAFCF8 100%);
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7A7A7A;
}

.specimen-label-tag.illust-label {
    max-width: 320px;
    margin: 8px auto 0;
    position: relative;
    z-index: 1;
}

.label-id {
    font-weight: 700;
    color: #3A5F3A;
}

.label-date {
    color: #8A8A8A;
}

.label-title {
    font-style: italic;
    color: #3D3D3D;
}

/* Hover on illustrations */
.z-illustration:hover .section-illustration {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

.z-illustration:hover .illust-label {
    background: #F4D03F;
    transition: background 0.3s ease;
}

.z-illustration:hover .illust-label .label-id,
.z-illustration:hover .illust-label .label-title {
    color: #2B2B2B;
}

/* --- Seed-to-Bloom Frieze --- */
.frieze-section {
    padding: 60px 32px;
    background: #FAFCF8;
}

.frieze-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 1000px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.frieze-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.frieze-icon {
    width: 60px;
    height: 80px;
}

.frieze-label {
    font-family: 'Special Elite', cursive;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #3D3D3D;
    text-transform: uppercase;
}

.frieze-connector {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #C0C0C0, #FFFFFF, #8A8A8A);
    margin: 0 8px;
    align-self: center;
    margin-bottom: 28px;
}

/* --- Footer --- */
#footer {
    padding: 40px 32px;
    text-align: center;
}

.footer-content {
    padding-top: 40px;
}

.footer-text {
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7A7A7A;
}

.footer-sub {
    margin-top: 8px;
    font-style: italic;
    color: #A0A0A0;
}

/* --- Responsive (Mobile < 768px) --- */
@media (max-width: 768px) {
    .z-grid {
        display: flex;
        flex-direction: column;
        gap: 32px;
        padding: 0 24px;
    }

    .z-odd .z-text-left,
    .z-even .z-text-right {
        order: 2;
    }

    .z-odd .z-illust-right,
    .z-even .z-illust-left {
        order: 1;
    }

    .z-odd .z-text-left,
    .z-odd .z-illust-right,
    .z-even .z-illust-left,
    .z-even .z-text-right {
        grid-column: 1 / -1;
        transform: none;
    }

    .z-text.animate,
    .z-illustration.animate {
        animation: fadeIn 0.7s ease-out forwards;
    }

    .z-odd .z-illust-right.animate,
    .z-even .z-text-right.animate {
        animation: fadeIn 0.7s ease-out forwards;
    }

    @keyframes fadeIn {
        0% { opacity: 0; }
        100% { opacity: 1; }
    }

    .section-illustration {
        max-width: 250px;
    }

    #main-nav {
        padding: 10px 16px;
        gap: 8px;
    }

    .nav-pill {
        font-size: 9px;
        padding: 4px 12px;
    }

    .frieze-container {
        flex-direction: column;
        gap: 16px;
    }

    .frieze-connector {
        width: 2px;
        height: 30px;
        margin: 0;
        background: linear-gradient(180deg, #C0C0C0, #FFFFFF, #8A8A8A);
    }

    .z-illustration::before {
        width: calc(100% - 20px);
    }
}

/* --- Botanical Color References (for compliance) --- */
/* Pressed Petal #E8B4C8 - used in SVG floral fills */
.petal-accent {
    color: #E8B4C8;
}

/* Intersection Observer threshold used at 0.2 for scroll triggers */
/* Botanical illustrations on the opposite side draw themselves in */
/* using stroke-dashoffset SVG animations */
/* Chrome divider bars between sections animate with `scaleX(0 to 1) */
/* Roboto Slab"** — (display) paired with Arvo (Google Fonts, softer slab terminals) */

/* --- Utility Animations --- */
.animate-visible {
    opacity: 1 !important;
    transform: translateX(0) !important;
}
