html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
}

body {
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  position: relative;
  /* Subtle slate-dot texture around the main card, with faint cyan +
     emerald glows so the area outside the card has a textured feel
     rather than being flat. */
  background-image:
    radial-gradient(circle, rgba(100, 116, 139, 0.32) 1.1px, transparent 1.1px),
    radial-gradient(ellipse at top right, rgba(8, 145, 178, 0.10), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(5, 150, 105, 0.08), transparent 55%);
  background-size: 22px 22px, 100% 100%, 100% 100%;
  /* background-attachment: fixed caused iOS Safari quirks that leaked
     horizontal overflow; keep it scroll-local instead. */
}

main {
  max-width: 100%;
}

/* Plotly charts must never overflow their container — forcing width
   100% both on the wrapper and the inner SVG so the first-paint render
   (before Plotly's responsive handler fires) can't push content wider
   than the viewport and hide the hamburger on mobile. */
[id^="chart-"],
[id^="chart-"] > .js-plotly-plot,
.js-plotly-plot,
.js-plotly-plot .main-svg,
.js-plotly-plot .svg-container {
  max-width: 100% !important;
  width: 100% !important;
}

/* Chart wrapper cards should hide any overflow so a transiently wide
   Plotly render never escapes the card. */
.chart-wrap {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

[x-cloak] { display: none !important; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: linear-gradient(90deg, #22d3ee, #6366f1);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-link.active { color: #0f172a; }
.nav-link.active::after { transform: scaleX(1); }

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

details summary::-webkit-details-marker { display: none; }
details summary { list-style: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #cbd5e1, #94a3b8);
  border-radius: 10px;
  border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #0891b2, #1d4ed8); }

.js-plotly-plot .plotly .xtick text,
.js-plotly-plot .plotly .ytick text,
.js-plotly-plot .plotly .legendtext,
.js-plotly-plot .plotly .gtitle { fill: #1e293b !important; }

/* Plotly's built-in hover label is disabled at the trace level via
   `hoverinfo='none'` in charts.py — that suppresses the visible label
   while still firing plotly_hover events, which our custom HTML
   #chart-tooltip listens to for the rounded popover. No CSS needed;
   hiding .hoverlayer with display:none here broke Plotly's hit
   detection entirely (no events fired). */

img[src*="profile_photo"] { filter: saturate(1.05); }

/* Card info panel slides up from above the footer. No extra CSS needed —
   AlpineJS x-show / x-transition handle visibility and animation. */
