/* adhoc.quest - Zen Dashboard Design */
/* Colors: Tidal Blue #4A7C8F, Deep Inlet #2B3A42, Salt Mist #E8EDF0,
   Driftwood #C4A882, Shallow Water #A3C9D3, Marble Fog #F4F6F8,
   Kelp Shadow #1A2E38, Steel Blue #7BA7BC */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: #2B3A42;
    background-color: #E8EDF0;
}

/* ---- Noise Texture Layer ---- */
.noise-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.05;
}

/* ---- Cursor Lantern ---- */
.lantern {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74,124,143,0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lantern.visible {
    opacity: 1;
}

/* ---- Menu Trigger ---- */
.menu-trigger {
    position: fixed;
    top: 28px;
    right: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(123, 167, 188, 0.25);
    background: rgba(244, 246, 248, 0.8);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-menu 4s ease-in-out infinite;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.menu-trigger:hover {
    border-color: #4A7C8F;
    background: rgba(244, 246, 248, 1);
}

.menu-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4A7C8F;
}

@keyframes pulse-menu {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ---- Radial Overlay ---- */
.radial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 46, 56, 0.92);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.radial-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.radial-menu {
    position: relative;
    width: 300px;
    height: 300px;
}

.radial-link {
    position: absolute;
    color: #E8EDF0;
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.radial-overlay.active .radial-link {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

.radial-link:hover {
    color: #C4A882;
}

.radial-link[data-index='0'] { top: 0; left: 50%; transform: translateX(-50%); }
.radial-link[data-index='1'] { top: 20%; right: 0; }
.radial-link[data-index='2'] { bottom: 20%; right: 0; }
.radial-link[data-index='3'] { bottom: 0; left: 50%; transform: translateX(-50%); }
.radial-link[data-index='4'] { bottom: 20%; left: 0; }
.radial-link[data-index='5'] { top: 20%; left: 0; }

.radial-overlay.active .radial-link[data-index='0'] { transition-delay: 0.1s; }
.radial-overlay.active .radial-link[data-index='1'] { transition-delay: 0.15s; }
.radial-overlay.active .radial-link[data-index='2'] { transition-delay: 0.2s; }
.radial-overlay.active .radial-link[data-index='3'] { transition-delay: 0.25s; }
.radial-overlay.active .radial-link[data-index='4'] { transition-delay: 0.3s; }
.radial-overlay.active .radial-link[data-index='5'] { transition-delay: 0.35s; }

/* ---- Dashboard Grid ---- */
.dashboard {
    width: 100%;
    height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 24px;
    position: relative;
    z-index: 2;
}

/* ---- Panel Base ---- */
.panel {
    position: relative;
    background: #F4F6F8;
    border: 2px solid rgba(123, 167, 188, 0.25);
    border-radius: 6px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    animation: panel-enter 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
}

.panel:hover .marble-veins {
    opacity: 0.12;
}

@keyframes panel-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panel stagger delays */
.panel-hero { animation-delay: 0.1s; }
#story1 { animation-delay: 0.3s; }
#story2 { animation-delay: 0.5s; }
#story3 { animation-delay: 0.7s; }
.panel-data { animation-delay: 0.9s; }
.panel-accent { animation-delay: 1.1s; }

/* Panel noise overlay */
.panel-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="4"/></filter><rect width="100%25" height="100%25" filter="url(%23n)"/></svg>');
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

/* Marble veining */
.marble-veins {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(163,201,211,0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(163,201,211,0.3) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 80%, rgba(163,201,211,0.2) 0%, transparent 45%);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.marble-hero {
    opacity: 0.15;
    background:
        radial-gradient(ellipse at 15% 40%, rgba(163,201,211,0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 25%, rgba(163,201,211,0.4) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 70%, rgba(163,201,211,0.3) 0%, transparent 40%),
        conic-gradient(from 45deg at 30% 60%, transparent 0%, rgba(163,201,211,0.15) 10%, transparent 20%),
        conic-gradient(from 200deg at 70% 30%, transparent 0%, rgba(163,201,211,0.1) 8%, transparent 16%);
}

.panel-content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 48px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Custom scrollbar */
.panel-content::-webkit-scrollbar {
    width: 4px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #A3C9D3;
    border-radius: 2px;
}

/* ---- Grid Placement ---- */
.panel-hero {
    grid-column: 1 / 6;
    grid-row: 1 / 4;
}

#story1 {
    grid-column: 6 / 9;
    grid-row: 1 / 3;
}

#story2 {
    grid-column: 9 / 12;
    grid-row: 1 / 3;
}

#story3 {
    grid-column: 6 / 9;
    grid-row: 3 / 5;
}

.panel-data {
    grid-column: 1 / 6;
    grid-row: 4 / 5;
}

.panel-accent {
    grid-column: 9 / 13;
    grid-row: 3 / 5;
}

/* ---- Hero Panel ---- */
.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 56px;
    letter-spacing: -0.03em;
    color: #2B3A42;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-phrase {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #4A7C8F;
    max-width: 380px;
    line-height: 1.7;
}

.wave-divider {
    position: absolute;
    bottom: 24px;
    left: 48px;
    right: 48px;
    height: 12px;
    overflow: visible;
}

.wave-path {
    fill: none;
    stroke: #A3C9D3;
    stroke-width: 1.5;
    opacity: 0.4;
    animation: wave-drift 20s linear infinite;
}

@keyframes wave-drift {
    from { transform: translateX(0); }
    to { transform: translateX(-120px); }
}

/* ---- Story Panels ---- */
.stone-icon {
    width: 32px;
    height: 32px;
    color: #2B3A42;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.panel-story:hover .stone-icon {
    color: #4A7C8F;
}

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 32px;
    letter-spacing: -0.02em;
    color: #2B3A42;
    margin-bottom: 12px;
    line-height: 1.2;
}

.panel-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: #2B3A42;
    opacity: 0;
    transform: translateY(8px);
    animation: text-fade-in 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
}

#story1 .panel-text { animation-delay: 0.5s; }
#story2 .panel-text { animation-delay: 1.1s; }
#story3 .panel-text { animation-delay: 1.7s; }

@keyframes text-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Data Panel ---- */
.data-points {
    display: flex;
    gap: 48px;
    align-items: center;
    height: 100%;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-label {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7BA7BC;
}

.data-value {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 28px;
    letter-spacing: 0.02em;
    color: #2B3A42;
}

.panel-data .panel-content {
    padding: 24px 48px;
    flex-direction: row;
    align-items: center;
}

/* ---- Accent Panel ---- */
.panel-accent .panel-content {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.enso-container {
    width: 100px;
    height: 100px;
    margin-bottom: 24px;
}

.enso-svg {
    width: 100%;
    height: 100%;
}

.enso-path {
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: draw-enso 3s cubic-bezier(0.25, 0.1, 0.25, 1.0) 1.2s forwards;
}

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

.haiku {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.haiku-line {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: #4A7C8F;
    line-height: 1.8;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .dashboard {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 16px;
        gap: 16px;
    }

    .panel {
        min-height: 280px;
    }

    .panel-hero {
        min-height: 360px;
    }

    .panel-data {
        min-height: 180px;
    }

    .panel-content {
        padding: 32px 24px;
    }

    .panel-data .panel-content {
        padding: 20px 24px;
    }

    .hero-title {
        font-size: 40px;
    }

    .panel-title {
        font-size: 26px;
    }

    .data-points {
        flex-wrap: wrap;
        gap: 24px;
    }

    .data-value {
        font-size: 22px;
    }

    .lantern {
        display: none;
    }

    .wave-divider {
        left: 24px;
        right: 24px;
    }

    .menu-trigger {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .data-points {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}