/* GGOGGL.com - Botanical Surveillance Dashboard */

:root {
    --bg-deep: #0a1612;
    --bg-panel: #0f2318;
    --bg-panel-2: #142e1f;
    --accent-bio: #2ecc71;
    --accent-teal: #1abc9c;
    --accent-blue: #2980b9;
    --copper: #d4a574;
    --text-primary: #e8f0e8;
    --text-secondary: #7f9b8a;
    --alert: #c0392b;
    --trace: #3d6b5e;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 16px;
    line-height: 1.7;
}

body {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(26,188,156,0.06), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(46,204,113,0.04), transparent 60%),
        var(--bg-deep);
}

/* Hex micro-pattern background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.05;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='52' viewBox='0 0 60 52'><g fill='none' stroke='%237f9b8a' stroke-width='0.6'><polygon points='15,1 45,1 60,26 45,51 15,51 0,26'/></g></svg>");
    z-index: 0;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' /></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* Nav strip */
.nav-strip {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 32px;
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    gap: 22px;
    background: linear-gradient(180deg, rgba(15,35,24,0.85), rgba(10,22,18,0.85));
    border-right: 1px solid var(--trace);
    z-index: 20;
    backdrop-filter: blur(6px);
}

.nav-icon {
    width: 40px;
    height: 40px;
    display: block;
    cursor: pointer;
    position: relative;
    transition: transform 320ms var(--ease-spring);
}

.nav-icon .aperture {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.nav-icon .ap-ring {
    fill: none;
    stroke: var(--text-secondary);
    stroke-width: 1.2;
    transition: stroke 300ms ease;
}

.nav-icon .ap-blades {
    fill: var(--text-secondary);
    opacity: 0.55;
    transform-origin: 20px 20px;
    transition: transform 320ms var(--ease-spring), opacity 300ms ease, fill 300ms ease;
}

.nav-icon .ap-core {
    fill: var(--accent-bio);
    opacity: 0;
    transition: opacity 320ms ease;
}

.nav-icon:hover .ap-blades,
.nav-icon.active .ap-blades {
    transform: rotate(15deg) scale(0.92);
    fill: var(--accent-teal);
    opacity: 0.9;
}

.nav-icon:hover .ap-ring,
.nav-icon.active .ap-ring {
    stroke: var(--accent-bio);
}

.nav-icon.active .ap-core,
.nav-icon:hover .ap-core {
    opacity: 1;
}

.nav-icon::after {
    content: attr(data-tip);
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent-bio);
    background: var(--bg-panel);
    padding: 4px 8px;
    border: 1px solid var(--trace);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 220ms ease;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-icon:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.nav-brand {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--copper);
    font-size: 1.3rem;
}

.brand-vert {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    color: var(--text-secondary);
}

/* Dashboard grid */
.dashboard {
    position: fixed;
    left: 64px;
    right: 0;
    top: 0;
    bottom: 32px;
    display: grid;
    grid-template-columns: 60% 40%;
    grid-template-rows: 1.618fr 1fr 1fr;
    grid-template-areas:
        "viewport specimen-alpha"
        "viewport specimen-beta"
        "viewport readings"
        "viewport signal";
    grid-template-rows: 1.618fr 1fr 1fr 0.7fr;
    gap: 14px;
    padding: 14px;
    z-index: 5;
}

.panel {
    position: relative;
    background:
        linear-gradient(180deg, rgba(15,35,24,0.92), rgba(20,46,31,0.92));
    border: 1px solid var(--trace);
    overflow: hidden;
    animation: panel-breathe 60s ease-in-out infinite alternate;
}

.panel::before {
    /* corner nodes (PCB pads) */
    content: "";
    position: absolute;
    inset: -3px;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 0 0, var(--accent-teal) 2px, transparent 2.5px),
        radial-gradient(circle at 100% 0, var(--accent-teal) 2px, transparent 2.5px),
        radial-gradient(circle at 0 100%, var(--accent-teal) 2px, transparent 2.5px),
        radial-gradient(circle at 100% 100%, var(--accent-teal) 2px, transparent 2.5px);
    background-size: 12px 12px, 12px 12px, 12px 12px, 12px 12px;
    background-position: 0 0, 100% 0, 0 100%, 100% 100%;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 4px rgba(26,188,156,0.5));
}

.panel::after {
    /* hex texture */
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.05;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='26' viewBox='0 0 30 26'><g fill='none' stroke='%237f9b8a' stroke-width='0.5'><polygon points='7.5,0.5 22.5,0.5 30,13 22.5,25.5 7.5,25.5 0,13'/></g></svg>");
}

@keyframes panel-breathe {
    0% { background: linear-gradient(180deg, rgba(15,35,24,0.92), rgba(20,46,31,0.92)); }
    100% { background: linear-gradient(180deg, rgba(20,46,31,0.92), rgba(15,35,24,0.92)); }
}

.viewport-panel { grid-area: viewport; padding: 0; }
#specimenAlpha { grid-area: specimen-alpha; }
#specimenBeta { grid-area: specimen-beta; }
#readingsPanel { grid-area: readings; }
#signalPanel { grid-area: signal; }

/* Panel header */
.panel-header {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 18px 8px;
    border-bottom: 1px dashed rgba(61, 107, 94, 0.4);
}

.viewport-panel .panel-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    border-bottom: none;
    background: linear-gradient(180deg, rgba(10,22,18,0.85), transparent);
    padding: 18px 24px;
    z-index: 4;
}

.panel-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--copper);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.viewport-panel .panel-title {
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-style: italic;
}

.specimen-panel .panel-title,
.readings-panel .panel-title,
.signal-panel .panel-title {
    font-size: 1.6rem;
}

.panel-status {
    margin-left: auto;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent-bio);
    letter-spacing: 0.2em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--accent-bio);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-bio);
    animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Viewport */
#generativeCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.viewport-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    opacity: 0.35;
}

.ch-h, .ch-v {
    position: absolute;
    background: var(--accent-teal);
}

.ch-h { top: 50%; left: 0; right: 0; height: 1px; }
.ch-v { left: 50%; top: 0; bottom: 0; width: 1px; }

.ch-circle {
    position: absolute;
    inset: 25%;
    border: 1px solid var(--accent-teal);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(26,188,156,0.4);
    animation: ch-pulse 3s ease-in-out infinite;
}

@keyframes ch-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0.2; }
}

.vp-corners .corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px solid var(--copper);
}

.corner.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.corner.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.corner.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.corner.br { bottom: 14px; right: 14px; border-left: none; border-top: none; }

.vp-meta {
    position: absolute;
    bottom: 18px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
}

.vp-time { color: var(--accent-bio); }

/* Circuit traces */
.circuit-trace {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 38px;
    overflow: visible;
    pointer-events: none;
    z-index: 2;
}

.circuit-trace path {
    fill: none;
    stroke: var(--accent-teal);
    stroke-width: 1;
    opacity: 0.55;
    filter: drop-shadow(0 0 4px rgba(26,188,156,0.4));
}

.data-packet {
    fill: var(--accent-bio);
    filter: drop-shadow(0 0 6px var(--accent-bio));
    offset-rotate: 0deg;
    animation: packet-travel 4s linear infinite;
}

.trace-alpha .data-packet { animation-name: travel-alpha; }
.trace-beta .data-packet { animation-name: travel-beta; }
.trace-readings .data-packet { animation-name: travel-readings; }

@keyframes travel-alpha {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 1; }
    20% { transform: translate(40px, 0); }
    30% { transform: translate(60px, -20px); }
    60% { transform: translate(120px, -20px); }
    70% { transform: translate(140px, 0); }
    90% { opacity: 1; }
    100% { transform: translate(200px, 0); opacity: 0; }
}

@keyframes travel-beta {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 1; }
    30% { transform: translate(60px, 0); }
    40% { transform: translate(80px, 20px); }
    70% { transform: translate(140px, 20px); }
    80% { transform: translate(160px, 0); }
    90% { opacity: 1; }
    100% { transform: translate(200px, 0); opacity: 0; }
}

@keyframes travel-readings {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 1; }
    20% { transform: translate(40px, 0); }
    30% { transform: translate(60px, 20px); }
    70% { transform: translate(140px, 20px); }
    80% { transform: translate(160px, 0); }
    90% { opacity: 1; }
    100% { transform: translate(200px, 0); opacity: 0; }
}

/* Specimen card */
.specimen-card {
    position: relative;
    z-index: 2;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    align-items: center;
    transition: transform 300ms ease-out;
    height: calc(100% - 56px);
}

.specimen-panel:hover .specimen-card {
    transform: scale(1.03);
}

.specimen-panel:hover {
    border-color: var(--accent-bio);
    box-shadow: 0 0 24px rgba(46,204,113,0.15);
}

.specimen-panel:hover .circuit-trace path {
    opacity: 1;
    stroke: var(--accent-bio);
}

.botanical {
    width: 130px;
    height: auto;
    overflow: visible;
}

.botanical .bot-stem path,
.botanical .bot-roots path {
    fill: none;
    stroke: var(--accent-bio);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: draw-line 3.6s var(--ease-out) 0.4s forwards;
    filter: drop-shadow(0 0 3px rgba(46,204,113,0.4));
}

.botanical .bot-roots path {
    stroke: var(--copper);
    filter: drop-shadow(0 0 2px rgba(212,165,116,0.4));
}

.botanical .bot-leaves ellipse,
.botanical .bot-leaves path {
    fill: rgba(46,204,113,0.18);
    stroke: var(--accent-teal);
    stroke-width: 0.8;
    opacity: 0;
    animation: leaf-fade 800ms ease-out forwards;
    transform-origin: center;
}

.botanical .bot-leaves ellipse:nth-child(1) { animation-delay: 2.2s; }
.botanical .bot-leaves ellipse:nth-child(2) { animation-delay: 2.4s; }
.botanical .bot-leaves ellipse:nth-child(3) { animation-delay: 2.6s; }
.botanical .bot-leaves ellipse:nth-child(4) { animation-delay: 2.8s; }
.botanical .bot-leaves ellipse:nth-child(5) { animation-delay: 3.0s; }
.botanical .bot-leaves path:nth-child(1) { animation-delay: 2.4s; }
.botanical .bot-leaves path:nth-child(2) { animation-delay: 2.6s; }

.bot-bloom {
    fill: var(--copper) !important;
    stroke: var(--accent-bio) !important;
    animation: bloom-pulse 2.4s ease-in-out infinite, leaf-fade 800ms ease-out 3.2s forwards !important;
}

@keyframes bloom-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

.botanical .bot-nodes circle {
    fill: var(--accent-bio);
    opacity: 0;
    animation: leaf-fade 600ms ease-out 3.4s forwards;
}

@keyframes draw-line {
    to { stroke-dashoffset: 0; }
}

@keyframes leaf-fade {
    to { opacity: 1; }
}

.specimen-panel:hover .botanical .bot-leaves ellipse,
.specimen-panel:hover .botanical .bot-leaves path {
    animation: leaf-flutter 1.8s ease-in-out infinite;
}

@keyframes leaf-flutter {
    0%, 100% { transform: rotate(0); }
    50% { transform: rotate(6deg); }
}

.specimen-quote {
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.5;
}

.specimen-quote em {
    font-style: normal;
    color: var(--accent-bio);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    padding: 0 2px;
}

.specimen-data {
    grid-column: 1 / -1;
    display: flex;
    gap: 18px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dotted rgba(61, 107, 94, 0.5);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
}

.specimen-data > div {
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.data-key { color: var(--text-secondary); letter-spacing: 0.15em; }
.data-val { color: var(--copper); font-weight: 500; }

/* Readings */
.readings-grid {
    position: relative;
    z-index: 2;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reading {
    display: grid;
    grid-template-columns: 1fr 100px 56px;
    align-items: center;
    gap: 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
}

.reading-label {
    order: -1;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.reading-bar {
    height: 4px;
    background: rgba(61, 107, 94, 0.3);
    position: relative;
    overflow: hidden;
}

.bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--w);
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-bio));
    box-shadow: 0 0 8px rgba(46,204,113,0.5);
    animation: bar-grow 1.6s var(--ease-out) forwards;
    transform-origin: left;
    transform: scaleX(0);
}

.bar-fill.warn {
    background: linear-gradient(90deg, var(--copper), var(--alert));
    box-shadow: 0 0 8px rgba(192,57,43,0.4);
}

@keyframes bar-grow {
    to { transform: scaleX(1); }
}

.reading-num {
    color: var(--accent-bio);
    text-align: right;
    font-weight: 500;
}

/* Signal panel */
.signal-text {
    position: relative;
    z-index: 2;
    padding: 12px 18px 6px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.signal-text em {
    font-style: italic;
    color: var(--copper);
}

.signal-message {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-bio);
    background: rgba(46,204,113,0.08);
    padding: 1px 6px;
    border-left: 2px solid var(--accent-bio);
    letter-spacing: 0.05em;
}

.signal-wave {
    position: relative;
    z-index: 2;
    padding: 0 18px 14px;
    height: 60px;
}

.signal-wave svg {
    width: 100%;
    height: 100%;
}

.signal-wave path {
    fill: none;
    stroke: var(--accent-teal);
    stroke-width: 1.2;
    filter: drop-shadow(0 0 4px rgba(26,188,156,0.6));
}

/* Ticker bar */
.ticker-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--bg-deep);
    border-top: 1px solid var(--trace);
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 30;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
}

.ticker-label {
    flex-shrink: 0;
    padding: 0 14px;
    color: var(--copper);
    letter-spacing: 0.2em;
    background: var(--bg-panel);
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--trace);
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: ticker-scroll 80s linear infinite;
    color: var(--text-secondary);
}

.ticker-content {
    padding-right: 60px;
}

.ticker-content span.k {
    color: var(--accent-bio);
}

.ticker-content span.sep {
    color: var(--trace);
    padding: 0 12px;
}

.ticker-content span.alert {
    color: var(--alert);
}

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

/* Entry animations */
.viewport-panel { animation: panel-breathe 60s ease-in-out infinite alternate, fade-in 1.4s ease-out; }
#specimenAlpha { animation: panel-breathe 60s ease-in-out infinite alternate, slide-right 1s var(--ease-out) 0.6s both; }
#specimenBeta { animation: panel-breathe 60s ease-in-out infinite alternate, slide-right 1s var(--ease-out) 0.9s both; }
#readingsPanel { animation: panel-breathe 60s ease-in-out infinite alternate, slide-right 1s var(--ease-out) 1.2s both; }
#signalPanel { animation: panel-breathe 60s ease-in-out infinite alternate, slide-right 1s var(--ease-out) 1.5s both; }
.ticker-bar { animation: slide-up 0.9s var(--ease-out) 1.8s both; }
.nav-strip { animation: slide-left 0.9s var(--ease-out) 0.3s both; }

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-right {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-left {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(32px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 900px) {
    html, body { overflow: auto; height: auto; }
    .nav-strip {
        position: fixed;
        flex-direction: row;
        width: 100%;
        height: 56px;
        bottom: 32px;
        top: auto;
        padding: 0 12px;
        gap: 14px;
        border-right: none;
        border-top: 1px solid var(--trace);
    }
    .nav-icon { width: 32px; height: 32px; }
    .nav-icon::after { display: none; }
    .nav-brand { margin-left: auto; flex-direction: row; }
    .brand-vert { writing-mode: horizontal-tb; transform: none; }
    .dashboard {
        position: relative;
        left: 0; right: 0; top: 0; bottom: 0;
        grid-template-columns: 1fr;
        grid-template-rows: 60vh repeat(4, auto);
        grid-template-areas:
            "viewport"
            "specimen-alpha"
            "specimen-beta"
            "readings"
            "signal";
        padding-bottom: 100px;
    }
    .viewport-panel .panel-title { font-size: clamp(2rem, 8vw, 3rem); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .botanical .bot-stem path,
    .botanical .bot-roots path { stroke-dashoffset: 0; }
    .botanical .bot-leaves ellipse,
    .botanical .bot-leaves path,
    .botanical .bot-nodes circle { opacity: 1; }
    .bar-fill { transform: scaleX(1); }
}
