/* quietjoon.com - Swiss Greenhouse HUD */

@property --wonk {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
}

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

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

body {
    font-family: "Source Serif 4", Georgia, serif;
    font-optical-sizing: auto;
    font-weight: 400;
    line-height: 1.72;
    color: #d4c9b0;
    background: linear-gradient(to bottom, #2c2416 0%, #2c2416 40%, #3a3122 60%, #1a1610 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Central Spine ===== */
#spine {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100vh;
    background: #8b7355;
    z-index: 1;
    transform: translateX(-0.5px);
}

/* ===== HUD Overlay ===== */
#hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100vw;
    height: 1px;
    background: #706750;
    opacity: 0.15;
    animation: scanDrift 60s linear infinite;
}
.scan-line-1 { top: 20%; animation-delay: 0s; }
.scan-line-2 { top: 50%; animation-delay: -15s; }
.scan-line-3 { top: 75%; animation-delay: -30s; }
.scan-line-4 { top: 90%; animation-delay: -45s; }

@keyframes scanDrift {
    0% { transform: translateY(100vh); }
    100% { transform: translateY(-10px); }
}

/* ===== Main Content ===== */
#content {
    position: relative;
    z-index: 0;
    width: 100%;
}

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

/* ===== Zone 0: The Crown ===== */
#zone-0 {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #2c2416;
}

.crown-identity {
    text-align: center;
    position: relative;
    z-index: 1;
}

.domain-name {
    font-family: "Fraunces", serif;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 400;
    color: #c5a55a;
    letter-spacing: -0.02em;
    --wonk: 0;
    font-variation-settings: "WONK" var(--wonk), "SOFT" 50;
    transition: --wonk 400ms ease, font-weight 400ms ease;
    cursor: default;
}

.domain-name:hover {
    --wonk: 1;
    font-weight: 700;
}

.crossbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 16px;
}

.crossbar-left, .crossbar-right {
    display: block;
    width: 120px;
    height: 1px;
    background: #8b7355;
}

/* ===== Fern Frond ===== */
.fern-frond {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 40px;
}

.fern-segment {
    position: absolute;
    width: 48px;
    height: 12px;
    border-radius: 50% 50% 50% 0;
    background: radial-gradient(ellipse at 30% 50%, #5a7247, #3a3122);
    transform-origin: 0% 100%;
    opacity: 0;
    animation: unfurl 800ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.fern-seg-1 {
    left: 98px;
    top: 80px;
    transform: rotate(0deg) scale(0.68);
    animation-delay: 120ms;
}

.fern-seg-2 {
    left: 61px;
    top: 98px;
    transform: rotate(138deg) scale(0.76);
    animation-delay: 240ms;
}

.fern-seg-3 {
    left: 83px;
    top: 46px;
    transform: rotate(275deg) scale(0.84);
    animation-delay: 360ms;
}

.fern-seg-4 {
    left: 106px;
    top: 113px;
    transform: rotate(53deg) scale(0.92);
    animation-delay: 480ms;
}

.fern-seg-5 {
    left: 31px;
    top: 71px;
    transform: rotate(190deg) scale(1.00);
    animation-delay: 600ms;
}

.fern-seg-6 {
    left: 129px;
    top: 49px;
    transform: rotate(328deg) scale(1.08);
    animation-delay: 720ms;
}

.fern-seg-7 {
    left: 63px;
    top: 144px;
    transform: rotate(105deg) scale(1.16);
    animation-delay: 840ms;
}

.fern-seg-8 {
    left: 46px;
    top: 14px;
    transform: rotate(243deg) scale(1.24);
    animation-delay: 960ms;
}

@keyframes unfurl {
    0% { opacity: 0; transform: rotate(0deg) scale(0); }
    100% { opacity: 0.85; }
}

/* ===== Zone Leaf (1 & 2) ===== */
.zone-leaf {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
}

.spine-node {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.node-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c5a55a;
}

.node-pulse {
    animation: nodePulse 4s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(197, 165, 90, 0.3); }
    50% { box-shadow: 0 0 8px rgba(197, 165, 90, 0.7); }
}

/* Connectors */
.connector {
    position: absolute;
    top: 50%;
    height: 2px;
    z-index: 1;
}

.connector-left {
    right: 50%;
    left: 55%;
    width: auto;
}

.connector-right {
    left: 50%;
    right: 55%;
    width: auto;
}

.connector-line {
    width: 100%;
    height: 2px;
    border-top: 2px dashed #a0936e;
}

/* Leaf Content */
.leaf-content {
    width: 45%;
    padding: 48px 40px;
    position: relative;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.leaf-content.revealed {
    opacity: 1;
    transform: translateX(0) !important;
}

.leaf-left {
    margin-right: auto;
    margin-left: 3%;
    transform: translateX(-30px);
}

.leaf-right {
    margin-left: auto;
    margin-right: 3%;
    transform: translateX(30px);
}

.section-title {
    font-family: "Fraunces", serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 600;
    color: #c5a55a;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    --wonk: 0;
    font-variation-settings: "WONK" var(--wonk);
    transition: --wonk 400ms ease;
}

.section-title:hover {
    --wonk: 1;
}

.leaf-content p {
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    margin-bottom: 16px;
    color: #d4c9b0;
}

.leaf-content p em {
    font-style: italic;
    color: #a0936e;
}

.leaf-content p strong {
    font-weight: 600;
    color: #c5a55a;
}

/* ===== HUD Readouts ===== */
.hud-readout {
    position: absolute;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    color: #706750;
    opacity: 0.7;
    letter-spacing: 0.08em;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
}

.hud-top-right {
    top: 8px;
    right: 0;
    text-align: right;
}

.hud-top-left {
    top: 8px;
    left: 0;
    text-align: left;
}

/* ===== Zone 3: Branching ===== */
.zone-branching {
    min-height: 120vh;
    position: relative;
    background: #3a3122;
    padding: 80px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

.branch-left-line, .branch-right-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: #8b7355;
}

.branch-left-line {
    left: 35%;
}

.branch-right-line {
    left: 65%;
}

.branch-gap {
    position: absolute;
    left: 35%;
    width: 30%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.leaf-cross-section {
    width: 180px;
    height: 180px;
    animation: slowRotate 18000s linear infinite;
}

@keyframes slowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.data-ticker {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    margin-top: 24px;
}

.ticker-text {
    display: inline-block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    color: #706750;
    letter-spacing: 0.08em;
    animation: tickerScroll 40s linear infinite;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.branch-content {
    width: 32%;
    padding: 48px 32px;
    position: relative;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.branch-content.revealed {
    opacity: 1;
    transform: translateX(0) !important;
}

.branch-content-left {
    margin-left: 1%;
    transform: translateX(-30px);
}

.branch-content-right {
    margin-left: auto;
    margin-right: 1%;
    transform: translateX(30px);
}

.branch-content h3 {
    font-family: "Fraunces", serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 600;
    color: #c5a55a;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.branch-content p {
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    margin-bottom: 16px;
    color: #d4c9b0;
    line-height: 1.72;
}

.branch-content p strong {
    font-weight: 600;
    color: #c5a55a;
}

/* ===== Zone 4: Root System ===== */
.zone-roots {
    min-height: 60vh;
    position: relative;
    background: linear-gradient(to bottom, #3a3122, #1a1610);
    padding: 0 0 80px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spine-taper {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #8b7355, transparent);
    margin: 0 auto;
}

.root-system {
    width: 80%;
    max-width: 800px;
    height: auto;
    margin: 0 auto;
}

.root-path {
    opacity: 0.6;
}

.root-nodes {
    position: relative;
    width: 80%;
    max-width: 800px;
    height: 300px;
    margin: -200px auto 0;
}

.root-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.root-node:hover {
    transform: scale(1.1);
}

.node-glow {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, #c5a55a 30%, transparent 70%);
    transition: width 300ms cubic-bezier(0.34, 1.56, 0.64, 1), height 300ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 300ms ease;
}

.root-node:hover .node-glow {
    width: 20px;
    height: 20px;
    box-shadow: 0 0 0 2px #b85c38;
}

.root-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    color: #706750;
    letter-spacing: 0.08em;
    margin-top: 8px;
    text-transform: uppercase;
    transition: color 300ms ease;
}

.root-node:hover .root-label {
    color: #b85c38;
}

/* ===== Footer ===== */
.root-footer {
    text-align: center;
    margin-top: 80px;
    padding-bottom: 48px;
}

.footer-year {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    color: #706750;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.footer-line {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    color: #a0936e;
    font-style: italic;
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 768px) {
    #spine {
        left: 24px;
    }

    .leaf-content,
    .leaf-left,
    .leaf-right {
        width: calc(100% - 56px);
        margin-left: 48px;
        margin-right: 8px;
        padding: 32px 24px;
    }

    .connector {
        display: none;
    }

    .spine-node {
        left: 24px;
    }

    .branch-left-line {
        left: 24px;
    }

    .branch-right-line {
        display: none;
    }

    .branch-gap {
        position: relative;
        left: 0;
        width: 100%;
        transform: none;
        padding: 32px 48px;
    }

    .branch-content,
    .branch-content-left,
    .branch-content-right {
        width: calc(100% - 56px);
        margin-left: 48px;
        margin-right: 8px;
        padding: 32px 24px;
    }

    .zone-branching {
        flex-direction: column;
        min-height: auto;
        padding: 48px 0;
    }

    .root-nodes {
        width: 95%;
    }

    .fern-frond {
        width: 120px;
        height: 120px;
    }
}