/* ============================================================
   Promodeling — Investor Briefing
   Custom styles (Tailwind handles utilities; this handles
   component-level and animation styles not expressible in
   Tailwind utility classes alone)
   ============================================================ */

:root {
    --accent:   #D4A373;
    --text:     #1F2937;
    --bg:       #F9F8F6;
    --card:     #FFFFFF;
    --border:   #F3F4F6;
    --surface:  #F9FAFB;
    --muted:    #6B7280;
    --grid:     #F3F4F6;
}

html.dark {
    --accent:  #A78BFA;
    --bg:      #111827;
    --card:    #1F2937;
    --border:  #374151;
    --surface: #1F2937;
    --text:    #F9FAFB;
    --muted:   #9CA3AF;
    --grid:    #374151;
}

/* ── Dark mode structural overrides ─────────────────────────── */

/* ── Dark mode overrides (Tailwind utility classes need !important to win) ── */

html.dark body                          { background-color: var(--bg)      !important; color: var(--text) !important; }
html.dark header, html.dark #main-nav  { background-color: rgba(17,24,39,.95) !important; border-color: var(--border) !important; }
html.dark #theme-toggle                { border-color: var(--border) !important; color: var(--muted) !important; }

html.dark .bg-white                    { background-color: var(--card)    !important; }
html.dark .bg-gray-50                  { background-color: var(--surface) !important; }
html.dark .bg-gray-100                 { background-color: var(--border)  !important; }

html.dark .text-gray-900,
html.dark .text-gray-800,
html.dark .text-gray-700,
html.dark .text-brand-text             { color: var(--text)   !important; }

html.dark .text-gray-600,
html.dark .text-gray-500,
html.dark .text-gray-400,
html.dark .text-brand-muted            { color: var(--muted)  !important; }

html.dark .text-brand-accent           { color: var(--accent) !important; }

html.dark .border-gray-100,
html.dark .border-gray-200             { border-color: var(--border) !important; }

html.dark .kpi-card                    { background: var(--card) !important; border-color: var(--border) !important; }
html.dark .platform-btn                { background: var(--card) !important; border-color: var(--border) !important; }
html.dark .platform-btn.active         { background-color: rgba(167,139,250,.12) !important; border-color: var(--accent) !important; }
html.dark .platform-btn.active .platform-btn-name { color: var(--accent) !important; }

html.dark .progress-track              { background: var(--border) !important; }
html.dark .roadmap-badge               { background: rgba(167,139,250,.15) !important; color: var(--accent) !important; }
html.dark .placeholder-box             { background-color: var(--card) !important; border-color: var(--border) !important; color: var(--muted) !important; }
html.dark .platform-list::-webkit-scrollbar-track { background: var(--card); }
html.dark .border-brand-accent         { border-color: var(--accent) !important; }

/* ── Logo ───────────────────────────────────────────────────── */

html.dark img[alt="Promodeling"]       { filter: brightness(0) invert(1); }

/* ── Table dark mode fixes ──────────────────────────────────── */

html.dark .divide-gray-50 > * + *      { border-color: var(--border) !important; }
html.dark tr.hover\:bg-gray-50:hover   { background-color: rgba(255,255,255,.04) !important; }
html.dark .compare-part                { color: #C4B5FD !important; }

/* ── Base ───────────────────────────────────────────────── */

html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg); color: var(--text); }
h1, h2, h3, h4 { font-family: 'Merriweather', serif; }

/* Prevent horizontal overflow on all screens */
*, *::before, *::after { box-sizing: border-box; }
body { overflow-x: hidden; }

/* ── Skip link ──────────────────────────────────────────── */

.skip-link {
    position: absolute; top: -100%; left: 1rem; z-index: 9999;
    background: var(--text); color: #fff; padding: .5rem 1rem;
    border-radius: 0 0 .5rem .5rem; font-size: .875rem; font-family: 'Inter', sans-serif;
    transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ── Reading progress bar ───────────────────────────────── */

#progress-bar {
    position: fixed; top: 0; left: 0; height: 3px;
    background: var(--accent); width: 0%; z-index: 9999;
    transition: width .1s linear;
}

/* ── Charts ─────────────────────────────────────────────── */

.chart-container {
    position: relative; width: 100%; max-width: 800px;
    margin: 0 auto; height: 260px; max-height: 450px;
}

@media (min-width: 480px) {
    .chart-container { height: 300px; }
}

@media (min-width: 640px) {
    .chart-container { height: 340px; }
}

@media (min-width: 768px) {
    .chart-container { height: 380px; }
}

/* ── Navigation ─────────────────────────────────────────── */

.nav-item {
    cursor: pointer; border-bottom: 3px solid transparent;
    transition: color .2s ease, border-color .2s ease; user-select: none;
    background: transparent; border-left: none; border-right: none; border-top: none;
}
.nav-item:hover { color: #1F2937; }
.nav-item.active { border-bottom-color: var(--accent); color: #1F2937; font-weight: 700; }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 2px; }

/* Hide scrollbar on nav strip */
#nav-scroll::-webkit-scrollbar { display: none; }
#nav-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Sections ───────────────────────────────────────────── */

.view-section { animation: fadeUp .4s ease-out both; }
.view-section.hidden { display: none; animation: none; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Scroll reveal ──────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ── Placeholders ───────────────────────────────────────── */

.placeholder-box {
    background-color: #E5E7EB; border: 2px dashed #9CA3AF;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; color: #6B7280; text-align: center;
    border-radius: .75rem; transition: all .3s ease;
}
.placeholder-box:hover { background-color: #D1D5DB; border-color: var(--accent); }
.placeholder-logo   { width: 60px;  height: 60px;  border-radius: .5rem; font-size: .75rem; }
.placeholder-avatar { width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 1.5rem; }

/* ── Platform list scrollbar ────────────────────────────── */

.platform-list::-webkit-scrollbar { width: 5px; }
.platform-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.platform-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* ── Platform button active state ───────────────────────── */

.platform-btn.active { border-color: var(--accent) !important; background-color: #FEF9F4 !important; }
.platform-btn.active .platform-btn-name { color: #B08355; }

/* ── KPI card ───────────────────────────────────────────── */

.kpi-card {
    background: var(--card); padding: 0.625rem; border-radius: .75rem;
    border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border-left: 4px solid var(--accent);
}

@media (min-width: 640px) {
    .kpi-card { padding: 1.25rem; }
}

/* ── Geo progress bars ──────────────────────────────────── */

.progress-track { background: #E5E7EB; border-radius: 9999px; height: 8px; overflow: hidden; }
.progress-fill {
    background: var(--accent); height: 100%; border-radius: 9999px;
    width: 0%; transition: width 1s cubic-bezier(.22,1,.36,1);
}

/* ── Roadmap badge ──────────────────────────────────────── */

.roadmap-badge {
    display: inline-block; font-size: .65rem; font-family: 'Inter', sans-serif;
    font-weight: 700; color: var(--accent); background: rgba(212,163,115,.12);
    padding: .15rem .5rem; border-radius: 9999px; vertical-align: middle; margin-left: .4rem;
}

/* ── Comparison table ───────────────────────────────────── */

.compare-tick  { color: #16A34A; font-weight: 800; }
.compare-cross { color: #EF4444; }
.compare-part  { color: #9CA3AF; font-size: .75rem; font-style: italic; }

/* ── Focus ring ─────────────────────────────────────────── */

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* ── Print ──────────────────────────────────────────────── */

@media print {
    #progress-bar, nav { display: none; }
    header { position: static; }
    .view-section.hidden { display: block !important; animation: none; }
    .reveal { opacity: 1 !important; transform: none !important; }
}
