/* ============================================
   bable.pro - Neomorphism Soft UI
   Palette from DESIGN.md
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg: #f0f0f3;
    --surface: #ffffff;
    --shadow-dark: #d1d5db;
    --shadow-light: #ffffff;
    --primary: #6366f1;
    --positive: #22c55e;
    --caution: #f59e0b;
    --negative: #ef4444;
    --text: #1f2937;
    --muted: #9ca3af;

    --neu-raised: 6px 6px 12px #d1d5db, -6px -6px 12px #ffffff;
    --neu-raised-lg: 8px 8px 16px #d1d5db, -8px -8px 16px #ffffff;
    --neu-pressed: inset 4px 4px 8px #d1d5db, inset -4px -4px 8px #ffffff;

    --radius-card: 16px;
    --radius-hero: 24px;
    --radius-full: 50%;

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-data: 'Rubik', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

.rubik {
    font-family: var(--font-data);
    font-weight: 500;
}

/* --- Confidence Meter (top bar) --- */
#confidence-meter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--shadow-dark);
    z-index: 1000;
    overflow: hidden;
}

#confidence-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--negative), var(--caution), var(--positive));
    transition: width 0.6s ease;
}

#confidence-label {
    position: fixed;
    top: 7px;
    right: 20px;
    font-size: 0.75rem;
    color: var(--muted);
    z-index: 1001;
    opacity: 0.8;
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    position: relative;
}

.section-container {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--text);
    margin-bottom: 16px;
    text-align: center;
}

.section-body {
    font-size: 1.1rem;
    color: var(--muted);
    text-align: center;
    max-width: 640px;
    margin: 0 auto 48px;
    line-height: 1.8;
}

.section-body strong {
    color: var(--primary);
}

/* --- Hero Section --- */
#hero {
    flex-direction: column;
    overflow: hidden;
    min-height: 100vh;
}

.bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(99,102,241,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(245,158,11,0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(34,197,94,0.02) 0%, transparent 40%);
    pointer-events: none;
}

/* --- Central Lens --- */
#lens {
    width: clamp(240px, 40vw, 360px);
    height: clamp(240px, 40vw, 360px);
    border-radius: var(--radius-full);
    background: radial-gradient(circle at 40% 35%, #ffffff 0%, #f0f0f3 70%);
    box-shadow: var(--neu-raised-lg), inset 2px 2px 6px rgba(255,255,255,0.8), inset -2px -2px 6px rgba(209,213,219,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

#lens-inner {
    text-align: center;
}

.domain-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    color: var(--text);
    display: block;
    letter-spacing: -0.02em;
}

.domain-name .dot {
    color: var(--primary);
}

.tagline {
    display: block;
    margin-top: 8px;
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--muted);
    font-style: italic;
}

/* --- Floating Orbs (Hero) --- */
.orb-ring {
    position: absolute;
    width: clamp(400px, 60vw, 600px);
    height: clamp(400px, 60vw, 600px);
    z-index: 1;
}

.orb {
    position: absolute;
    font-family: var(--font-data);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--primary);
    background: var(--bg);
    padding: 8px 18px;
    border-radius: 999px;
    box-shadow: var(--neu-raised);
    white-space: nowrap;
    animation: orbFloat var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
    offset-path: circle(calc(clamp(400px, 60vw, 600px) / 2) at 50% 50%);
    offset-rotate: 0deg;
}

.orb:nth-child(1) { offset-distance: 0%; }
.orb:nth-child(2) { offset-distance: 16.67%; }
.orb:nth-child(3) { offset-distance: 33.33%; }
.orb:nth-child(4) { offset-distance: 50%; }
.orb:nth-child(5) { offset-distance: 66.67%; }
.orb:nth-child(6) { offset-distance: 83.33%; }

@keyframes orbFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Fallback for browsers without offset-path */
@supports not (offset-path: circle(200px)) {
    .orb:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
    .orb:nth-child(2) { top: 20%; right: 0; }
    .orb:nth-child(3) { top: 60%; right: 5%; }
    .orb:nth-child(4) { bottom: 0; left: 50%; transform: translateX(-50%); }
    .orb:nth-child(5) { top: 60%; left: 5%; }
    .orb:nth-child(6) { top: 20%; left: 0; }
}

/* --- Confidence Spectrum Divider --- */
.confidence-spectrum {
    max-width: 480px;
    margin: 48px auto 0;
    position: relative;
}

.spectrum-bar {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--negative), var(--caution), var(--positive));
    box-shadow: var(--neu-pressed);
}

.spectrum-marker {
    position: absolute;
    top: -4px;
    left: var(--position);
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: var(--surface);
    box-shadow: var(--neu-raised);
    transform: translateX(-50%);
    transition: left 0.5s ease;
}

.spectrum-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--muted);
}

/* --- Scenario Cards Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.scenario-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--neu-raised-lg);
    padding: 32px;
    text-align: center;
    transition: box-shadow 0.3s ease;
}

.scenario-card:hover {
    box-shadow: var(--neu-pressed);
}

.card-gauge {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--bg);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1.2s ease, stroke 0.6s ease;
}

.gauge-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
    color: var(--text);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}

/* --- Interactive Gauge --- */
.interactive-panel {
    background: var(--surface);
    border-radius: var(--radius-hero);
    box-shadow: var(--neu-raised-lg);
    padding: 48px;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

.interactive-gauge-wrap {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 32px;
}

.interactive-gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg-lg {
    fill: none;
    stroke: var(--bg);
    stroke-width: 10;
}

.gauge-fill-lg {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 553.00;
    stroke-dashoffset: 276.50;
    transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease;
}

.interactive-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: var(--text);
}

/* --- Slider --- */
.slider-wrap {
    max-width: 360px;
    margin: 0 auto 24px;
}

.neu-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--bg);
    box-shadow: var(--neu-pressed);
    outline: none;
    cursor: pointer;
}

.neu-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--surface);
    box-shadow: var(--neu-raised);
    cursor: pointer;
    border: 3px solid var(--primary);
    transition: border-color 0.3s ease;
}

.neu-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--surface);
    box-shadow: var(--neu-raised);
    cursor: pointer;
    border: 3px solid var(--primary);
    transition: border-color 0.3s ease;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--muted);
}

.slider-feedback {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.7;
}

.slider-feedback strong {
    color: var(--primary);
}

/* --- Tips Grid --- */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.tip-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--neu-raised-lg);
    padding: 32px 24px;
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tip-card:hover {
    box-shadow: var(--neu-pressed);
    transform: translateY(-2px);
}

.tip-icon {
    margin-bottom: 16px;
}

.tip-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}

.tip-body {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}

/* --- Footer --- */
#footer {
    min-height: auto;
    padding: 64px 24px;
    background: var(--bg);
}

.footer-content {
    text-align: center;
}

.footer-lens {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    background: radial-gradient(circle at 40% 35%, #ffffff 0%, #f0f0f3 70%);
    box-shadow: var(--neu-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.domain-name-sm {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.domain-name-sm .dot {
    color: var(--primary);
}

.footer-text {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 24px;
}

.footer-orbs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-orb {
    font-size: 0.8rem;
    color: var(--primary);
    background: var(--bg);
    padding: 6px 16px;
    border-radius: 999px;
    box-shadow: var(--neu-raised);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 60px 16px;
    }

    .interactive-panel {
        padding: 32px 20px;
    }

    .orb-ring {
        width: 320px;
        height: 320px;
    }
}

@media (max-width: 480px) {
    #confidence-label {
        display: none;
    }

    .orb {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}
