/* ========================================================
   murasaki.moe — Styles
   Palette: Duotone Aubergine-Ivory + Gold-Amber accent
   ======================================================== */

/* ── Variables ── */
:root {
    --deep-aubergine:    #2A1040;
    --mid-aubergine:     #4A2870;
    --dark-aubergine:    #3D2060;
    --violet-gray:       #7B5EA7;
    --bone-ivory:        #F5F0E8;
    --antique-white:     #EDE5D8;
    --light-warm:        #E8E0D5;
    --gold-amber:        #C9A84C;

    --font-display:      'Cormorant SC', serif;
    --font-body:         'DM Sans', sans-serif;
    --font-accent:       'Bebas Neue', sans-serif;

    --left-margin:       80px;
    --section-gap:       120px;
    --max-body-width:    65ch;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-aubergine);
    color: var(--bone-ivory);
    font-family: var(--font-body);
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* ── F-Spine — Persistent Left Vertical Accent ── */
.f-spine {
    position: fixed;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--gold-amber) 8%,
        var(--gold-amber) 90%,
        transparent 100%
    );
    opacity: 0.75;
    z-index: 100;
    pointer-events: none;
}

/* ── Page-level circuit overlay ── */
.circuit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

/* ── Circuit Paths — SVG draw-on animation ── */
.circuit-path {
    fill: none;
    stroke: var(--gold-amber);
    stroke-width: 1;
    opacity: 0.35;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

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

.solder-point {
    fill: var(--gold-amber);
    opacity: 0.5;
}

/* ── Specimen Sections ── */
.specimen-section {
    position: relative;
    min-height: 100vh;
    padding: var(--section-gap) var(--left-margin) var(--section-gap) calc(var(--left-margin) + 20px);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.specimen-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

/* ── Specimen Labels (Bebas Neue) ── */
.specimen-label {
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--gold-amber);
    display: block;
    margin-bottom: 24px;
}

.specimen-label-dark {
    color: var(--mid-aubergine);
}

/* ── SECTION 00 — Hero ── */
.specimen-00 {
    background-color: var(--deep-aubergine);
    align-items: stretch;
}

.specimen-00 .specimen-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 100vh;
    align-items: center;
}

.specimen-left {
    padding: 80px 40px 80px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.specimen-right {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Hero Title (Cormorant SC) ── */
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(56px, 7vw, 96px);
    font-weight: 500;
    color: var(--bone-ivory);
    letter-spacing: 0.15em;
    line-height: 1.0;
    margin-bottom: 32px;
    text-transform: uppercase;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--light-warm);
    line-height: 1.65;
    max-width: 52ch;
    margin-bottom: 40px;
}

/* ── Hero circuit traces SVG ── */
.hero-circuit-traces {
    position: absolute;
    left: 0;
    top: 0;
    width: 320px;
    height: 260px;
    pointer-events: none;
    overflow: visible;
    opacity: 0.7;
}

/* ── Circuit Annotation Boxes ── */
.circuit-annotation {
    display: inline-flex;
    flex-direction: column;
    border: 1px solid var(--gold-amber);
    padding: 8px 14px;
    gap: 4px;
    max-width: 340px;
}

.circuit-annotation-dark {
    border-color: var(--mid-aubergine);
}

.annotation-label {
    font-family: var(--font-accent);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--gold-amber);
}

.circuit-annotation-dark .annotation-label {
    color: var(--mid-aubergine);
}

.annotation-value {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--light-warm);
}

.circuit-annotation-dark .annotation-value {
    color: var(--dark-aubergine);
}

/* ── Blob Containers ── */
.blob-container {
    position: relative;
    overflow: hidden;
}

.blob-hero {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.blob-inner {
    width: 100%;
    height: 100%;
    transition: filter 0.4s ease-out, transform 0.4s ease-out;
}

.blob-hero .blob-inner {
    clip-path: polygon(
        15% 0%,
        85% 5%,
        100% 20%,
        95% 55%,
        100% 80%,
        80% 100%,
        30% 95%,
        5% 75%,
        0% 40%,
        8% 15%
    );
}

.blob-container:hover .blob-inner {
    filter: brightness(1.1);
    transform: scale(1.015);
}

/* ── Crystal SVG sizing ── */
.crystal-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Sunburst Watermark ── */
.sunburst-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--bone-ivory) 1deg,
        transparent 2deg,
        transparent 28deg,
        var(--bone-ivory) 29deg,
        transparent 30deg,
        transparent 58deg,
        var(--bone-ivory) 59deg,
        transparent 60deg,
        transparent 88deg,
        var(--bone-ivory) 89deg,
        transparent 90deg,
        transparent 118deg,
        var(--bone-ivory) 119deg,
        transparent 120deg,
        transparent 148deg,
        var(--bone-ivory) 149deg,
        transparent 150deg,
        transparent 178deg,
        var(--bone-ivory) 179deg,
        transparent 180deg,
        transparent 208deg,
        var(--bone-ivory) 209deg,
        transparent 210deg,
        transparent 238deg,
        var(--bone-ivory) 239deg,
        transparent 240deg,
        transparent 268deg,
        var(--bone-ivory) 269deg,
        transparent 270deg,
        transparent 298deg,
        var(--bone-ivory) 299deg,
        transparent 300deg,
        transparent 328deg,
        var(--bone-ivory) 329deg,
        transparent 330deg,
        transparent 358deg,
        var(--bone-ivory) 359deg,
        transparent 360deg
    );
    opacity: 0.06;
    pointer-events: none;
    animation: sunburst-rotate 120s linear infinite;
    border-radius: 50%;
    z-index: 1;
}

@keyframes sunburst-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Art Deco Divider Rules ── */
.deco-rule {
    padding: 0 var(--left-margin);
    margin: 0;
    position: relative;
    z-index: 5;
}

.deco-rule-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.deco-line {
    flex: 1;
    height: 1px;
    background: var(--gold-amber);
    opacity: 0.4;
    position: relative;
}

.deco-line::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gold-amber);
    opacity: 0.25;
}

.deco-line-dark {
    background: var(--mid-aubergine);
}

.deco-diamond {
    font-size: 14px;
    color: var(--gold-amber);
    line-height: 1;
    opacity: 0.7;
}

.deco-diamond-dark {
    color: var(--mid-aubergine);
}

.deco-rule-inline {
    padding: 0;
    margin: 32px 0;
}

/* ── Section 01 — Vascular Systems ── */
.specimen-01 {
    background-color: var(--mid-aubergine);
    flex-direction: column;
    align-items: flex-start;
    padding-top: var(--section-gap);
}

.f-stroke-top {
    width: 100%;
    margin-bottom: 48px;
}

.blob-leaf {
    width: 55%;
    min-height: 360px;
    margin-bottom: 32px;
}

.blob-leaf .blob-inner {
    clip-path: ellipse(48% 44% at 52% 50%);
    background: var(--deep-aubergine);
}

.leaf-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.f-stroke-label {
    margin-bottom: 24px;
}

.f-spine-content {
    max-width: var(--max-body-width);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Section 02 — Analysis Layer (light) ── */
.specimen-02 {
    background-color: var(--antique-white);
    flex-direction: column;
    align-items: flex-start;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: 0.12em;
    line-height: 1.05;
    text-transform: uppercase;
}

.section-title-light {
    font-size: clamp(36px, 4.5vw, 64px);
    color: var(--bone-ivory);
}

.section-title-dark {
    font-size: clamp(36px, 4.5vw, 64px);
    color: var(--deep-aubergine);
}

/* ── Specimen Tray Grid ── */
.specimen-tray {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 16px;
    width: 100%;
}

.specimen-card {
    position: relative;
    padding: 28px 24px 24px;
    background: var(--light-warm);
    clip-path: polygon(
        0% 5%,
        3% 0%,
        97% 0%,
        100% 5%,
        100% 95%,
        97% 100%,
        3% 100%,
        0% 95%
    );
    transition: transform 0.4s ease-out, filter 0.4s ease-out;
    overflow: hidden;
}

.specimen-card:hover {
    transform: translateY(-4px) scale(1.01);
    filter: brightness(1.02);
}

/* Corner bracket ornaments via pseudo-elements */
.specimen-card::before,
.specimen-card::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.specimen-card:hover::before {
    top: 8px;
    left: 8px;
    border-top: 1px solid var(--gold-amber);
    border-left: 1px solid var(--gold-amber);
    opacity: 1;
}

.specimen-card:hover::after {
    bottom: 8px;
    right: 8px;
    border-bottom: 1px solid var(--gold-amber);
    border-right: 1px solid var(--gold-amber);
    opacity: 1;
}

/* Circuit frame border on cards */
.card-circuit-frame {
    position: absolute;
    inset: 0;
    border: 1px solid var(--violet-gray);
    opacity: 0.25;
    pointer-events: none;
    clip-path: inherit;
}

.card-label {
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--gold-amber);
    display: block;
    margin-bottom: 10px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--deep-aubergine);
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    line-height: 1.2;
}

.card-text {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--dark-aubergine);
    line-height: 1.65;
}

/* ── Section 03 — Cross-Section (dark + dendritic) ── */
.specimen-03 {
    background-color: var(--deep-aubergine);
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
}

.dendritic-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.specimen-03 .specimen-inner {
    z-index: 5;
}

/* Oversized stat / Japanese character */
.oversized-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: clamp(80px, 14vw, 180px);
    font-weight: 300;
    color: var(--bone-ivory);
    letter-spacing: 0.05em;
    line-height: 1;
    position: relative;
    display: inline-block;
    /* Tracking marks beneath as pseudo overlay */
}

.stat-number::after {
    content: '— — — — — —';
    position: absolute;
    bottom: -10px;
    left: 0;
    font-size: 18px;
    letter-spacing: 0.35em;
    color: var(--bone-ivory);
    opacity: 0.05;
    font-family: var(--font-body);
    white-space: nowrap;
}

.stat-unit {
    font-family: var(--font-accent);
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--gold-amber);
    display: block;
    margin-top: 16px;
}

.specimen-03-top {
    margin-bottom: 60px;
}

.f-stroke-2 {
    max-width: 70ch;
}

.body-text-wide {
    max-width: 70ch;
    margin-bottom: 32px;
}

/* ── Section 04 — Specimen Field ── */
.specimen-04 {
    background-color: var(--deep-aubergine);
    flex-direction: column;
    align-items: flex-start;
}

.specimen-field-circuit {
    width: 100%;
    max-width: 1100px;
    margin-bottom: 32px;
    display: block;
}

.specimen-field-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
    flex-wrap: wrap;
}

.field-specimen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 160px;
}

.blob-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 200px;
}

.blob-thumb .blob-inner {
    width: 100%;
    height: 100%;
    clip-path: ellipse(44% 46% at 50% 50%);
    background: var(--mid-aubergine);
    transition: transform 0.4s ease-out, filter 0.4s ease-out;
    animation: blob-pulse 1.2s ease-in-out infinite alternate;
    animation-play-state: paused;
}

.blob-thumb-2 .blob-inner {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--mid-aubergine);
}

.blob-thumb-3 .blob-inner {
    clip-path: ellipse(42% 48% at 48% 52%);
    background: var(--dark-aubergine);
}

.blob-thumb-4 .blob-inner {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    background: var(--mid-aubergine);
}

.blob-thumb-5 .blob-inner {
    clip-path: ellipse(46% 43% at 53% 50%);
    background: var(--dark-aubergine);
}

.field-specimen:hover .blob-inner {
    animation-play-state: running;
    filter: brightness(1.1);
}

@keyframes blob-pulse {
    from { transform: scale(1); }
    to   { transform: scale(1.02); }
}

.field-label {
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--gold-amber);
    text-align: center;
}

/* ── Section 05 — Archive Closes (light, inverted) ── */
.specimen-05 {
    background-color: var(--bone-ivory);
    align-items: stretch;
    position: relative;
}

.specimen-05-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 100vh;
    align-items: center;
}

.specimen-05-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.specimen-05-right {
    padding: 80px 0 80px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blob-closing {
    min-height: 480px;
}

.blob-crystal-light .blob-inner {
    clip-path: polygon(
        20% 5%,
        80% 0%,
        100% 25%,
        92% 60%,
        100% 85%,
        72% 100%,
        25% 92%,
        0% 70%,
        5% 35%,
        12% 12%
    );
    background: var(--antique-white);
}

.closing-title {
    font-size: clamp(36px, 4vw, 56px);
    margin: 16px 0 24px;
}

.body-text-dark {
    color: var(--dark-aubergine);
    max-width: var(--max-body-width);
    margin-bottom: 32px;
}

/* Archive close label — Bebas Neue gold */
.archive-close-label {
    font-family: var(--font-accent);
    font-size: 20px;
    letter-spacing: 4px;
    color: var(--gold-amber);
    margin-top: 8px;
}

/* F-spine fade at closing section */
.f-spine-fade {
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(
        to bottom,
        var(--gold-amber) 0%,
        transparent 100%
    );
    opacity: 0.6;
    pointer-events: none;
    z-index: 10;
}

/* ── Body Text ── */
.body-text {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--light-warm);
    line-height: 1.65;
    max-width: var(--max-body-width);
}

/* ── Reveal Animations ── */
.reveal-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-fade-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stat number letter-spacing animation for specimen-03 */
.stat-number {
    transition: letter-spacing 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-number.revealed {
    letter-spacing: 0.12em;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    :root {
        --left-margin: 40px;
    }

    .f-spine {
        left: 16px;
    }

    .specimen-00 .specimen-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .specimen-05-inner {
        grid-template-columns: 1fr;
    }

    .specimen-05-left {
        display: none;
    }

    .specimen-tray {
        grid-template-columns: repeat(2, 1fr);
    }

    .specimen-field-row {
        flex-wrap: wrap;
    }

    .field-specimen {
        min-width: 120px;
    }

    .hero-title {
        font-size: clamp(40px, 8vw, 70px);
    }
}

@media (max-width: 600px) {
    :root {
        --left-margin: 24px;
        --section-gap: 72px;
    }

    .specimen-tray {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: clamp(36px, 10vw, 56px);
    }
}
