/* ==== Design tokens (professional palette) ==== */
:root{
  --bg: #f7f9fb;
  --surface: #ffffff;
  --ink: #0f172a;        /* slate-900 */
  --muted: #5b6b82;      /* slate-600 */
  --line: #e6eaf0;       /* subtle borders */
  --brand: #2563eb;      /* blue-600 */
  --brand-2: #1e40af;    /* blue-800 */
  --accent: #00b686;     /* teal accent for KPIs */
  --radius: 14px;
  --shadow-1: 0 6px 18px rgba(2,8,23,.06);
  --shadow-2: 0 18px 42px rgba(2,8,23,.12);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, #fff 0, #f6f9ff 40%, #eef3fb 100%);
}

/* Containers & sections */
.container{max-width:1100px; margin:0 auto; padding:0 20px}
.section{padding:72px 0; position:relative; z-index:1}
.section.alt{background:#fbfdff}

/* Header */
.site-header{position:sticky; top:0; width:100%; backdrop-filter:saturate(140%) blur(6px); background:rgba(255,255,255,.7); border-bottom:1px solid var(--line); z-index:50}
.header-row{display:flex; align-items:center; justify-content:space-between; min-height:64px}
.brand{display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink)}
.brand-mark{width:14px;height:14px;border-radius:4px;background:linear-gradient(135deg,var(--brand),#7c9cff)}
.brand-text{font-weight:800}
.brand-sub{color:var(--muted); font-size:.95rem; margin-left:4px}
.nav{display:flex; gap:20px}
.nav a{color:var(--ink); text-decoration:none; font-weight:600; opacity:.9}
.nav a:hover{color:var(--brand)}

/* Hero */
.hero{padding:84px 0 36px}
.hero-grid{display:grid; grid-template-columns:1.3fr .7fr; gap:32px; align-items:center}
.hero h1{font-size: clamp(2rem,3.2vw,3rem); line-height:1.15; margin:0}
.accent{color:var(--brand)}
.lead{color:var(--muted); margin:12px 0 18px}
.cta{display:flex; gap:12px; flex-wrap:wrap}
.btn{border-radius:999px; font-weight:700; padding:10px 16px; border:1px solid transparent; cursor:pointer}
.btn.primary{background:var(--brand); color:#fff; box-shadow:var(--shadow-2)}
.btn.ghost{background:var(--surface); border-color:var(--line)}
.btn.link{background:transparent; color:var(--brand); padding:10px 4px}

.kpi-list{display:flex; gap:28px; margin:22px 0 0; padding:0; list-style:none}
.kpi-list li{display:flex; flex-direction:column; gap:4px}
.kpi{font-size:1.8rem; font-weight:800; color:var(--accent)}
.kpi::after{content:"%"; margin-left:2px; font-size:1.1rem; color:var(--muted)}
.kpi + small{color:var(--muted); font-weight:600}

.hero-card{padding:18px; border-radius:var(--radius); background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-1)}
.pill-row{display:flex; flex-wrap:wrap; gap:8px; padding:0; list-style:none}
.pill-row li{padding:6px 10px; border-radius:999px; background:#f3f7ff; color:#1f3b8f; border:1px solid #d8e3ff}

/* Section headers */
.section-head{display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:18px}
.section-head h2{margin:0}

/* === Carousel (sleek coverflow) === */
.carousel-wrap{position:relative}
.carousel{position:relative; display:grid; grid-auto-flow:column; gap:24px; align-items:center; overflow:hidden; padding:8px}
.slide{position:relative; width:640px; max-width:86vw; height:360px; border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:var(--shadow-2); transform-origin:center; transition:transform .5s, box-shadow .3s, filter .3s; overflow:hidden}
.slide img{width:100%; height:100%; object-fit:cover}
.slide .badge{position:absolute; left:12px; bottom:12px; background:rgba(255,255,255,.9); border:1px solid var(--line); padding:8px 12px; border-radius:10px; font-weight:700}
.slide.is-center{transform:scale(1.02); filter:saturate(1.03)}
.ctrl{position:absolute; top:50%; transform:translateY(-50%); width:40px; height:40px; border-radius:999px; border:1px solid var(--line); background:#fff; color:var(--ink); box-shadow:var(--shadow-1); cursor:pointer}
.ctrl.prev{left:-6px}
.ctrl.next{right:-6px}
.carousel-caption{margin-top:10px; color:var(--muted); font-weight:600}

/* Lightbox */
.lightbox{position:fixed; inset:0; display:none; place-items:center; background:rgba(2,8,23,.7); z-index:60; padding:24px}
.lightbox.open{display:grid}
.lightbox img{max-width:min(1200px,92vw); max-height:82vh; border-radius:16px; box-shadow:var(--shadow-2)}
.lightbox-caption{margin-top:12px; color:#fff; font-weight:700}
.lightbox-close{position:absolute; top:16px; right:16px; border:none; background:#fff; color:#111; border-radius:999px; padding:8px 12px; font-weight:900; cursor:pointer}

/* Projects grid */
.filters{display:flex; gap:12px; flex-wrap:wrap; align-items:center}
#search{padding:10px 12px; border-radius:10px; border:1px solid var(--line); background:#fff; min-width:260px}
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{border-radius:999px; padding:6px 12px; border:1px solid var(--line); background:#fff; cursor:pointer; font-weight:600}
.chip[aria-selected="true"]{outline:2px solid var(--brand)}
.card-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; margin-top:16px}
.card{padding:16px; border-radius:14px; border:1px solid var(--line); background:#fff; box-shadow:var(--shadow-1); display:flex; flex-direction:column; gap:10px}
.card .tags{display:flex; flex-wrap:wrap; gap:6px}
.card .tag{font-size:.82rem; background:#eef3ff; padding:4px 8px; border-radius:999px; border:1px solid #d9e3ff; color:#1f3b8f}
.card footer{margin-top:auto; display:flex; gap:8px; flex-wrap:wrap}

/* Resume */
.resume-grid{display:grid; grid-template-columns: 320px 1fr; gap:24px}
.resume-aside h3{margin:0 0 8px}
.resume-main details{background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px 16px; margin-bottom:12px}
.resume-main summary{cursor:pointer; font-weight:800; outline:none}
.resume-main ul{margin:10px 0 0 18px}
iframe{width:100%; height:72vh; border:none; border-radius:12px; background:#fff}
.note{color:var(--muted)}

/* Charts & contact */
.chart-grid{display:grid; grid-template-columns:1fr 1fr; gap:16px}
.chart-card{padding:16px; border:1px solid var(--line); border-radius:14px; background:#fff}
.contact-form .grid{display:grid; grid-template-columns:1fr 1fr; gap:12px}
label{display:block; color:var(--muted); font-weight:700}
input, textarea{width:100%; margin-top:6px; background:#fff; color:var(--ink); border:1px solid var(--line); border-radius:10px; padding:10px 12px}
.foot{color:var(--muted); text-align:center; margin-top:18px}

/* Glass utility */
.glass{background:rgba(255,255,255,.75); backdrop-filter: blur(8px) saturate(130%)}

/* Scroll reveal (subtle) */
.reveal { opacity:0; transform: translateY(22px) scale(.985); transition: transform 600ms cubic-bezier(.2,.7,.1,1), opacity 600ms cubic-bezier(.2,.7,.1,1); will-change: transform, opacity; }
.reveal.in { opacity:1; transform:none; }

/* Swirl canvas (intro) */
#bg-swirl{ position:fixed; inset:0; z-index:0; opacity:0; pointer-events:none; transition:opacity 1800ms ease; }
#bg-swirl.show{ opacity:.55; }
#bg-swirl.fade{ opacity:.55; }

/* Responsive */
@media (max-width: 980px){
  .hero-grid{grid-template-columns:1fr}
  .resume-grid{grid-template-columns:1fr}
  .chart-grid{grid-template-columns:1fr}
  .ctrl.prev{left:4px} .ctrl.next{right:4px}
}

/* Resume-driven portfolio additions */
html{scroll-behavior:smooth}
a{color:inherit}
.eyebrow{margin:0 0 8px; color:var(--brand); font-size:.78rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase}
.hero .lead{max-width:760px; line-height:1.75}
.hero-card h3{margin:4px 0 14px; font-size:1.35rem; line-height:1.3}
.kpi.plain::after{content:"+"; color:var(--muted); font-size:1.1rem; margin-left:2px}
.section-head > div:first-child > .eyebrow{margin-bottom:6px}
.section-head > p{color:var(--muted); margin:0}

.role-slide{height:390px; background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(242,247,255,.96)); overflow:visible}
.role-inner{height:100%; padding:30px; display:flex; flex-direction:column}
.role-period{color:var(--brand); font-weight:800; font-size:.86rem; letter-spacing:.04em; text-transform:uppercase}
.role-company{color:var(--muted); font-weight:700; margin-top:14px}
.role-slide h3{font-size:1.65rem; line-height:1.2; margin:7px 0 12px}
.role-slide p{color:var(--muted); line-height:1.65; margin:0}
.role-tags{display:flex; flex-wrap:wrap; gap:7px; margin-top:18px}
.role-tags span{padding:5px 9px; border-radius:999px; background:#eef3ff; border:1px solid #d9e3ff; color:#1f3b8f; font-size:.78rem; font-weight:700}
.role-metric{margin-top:auto; padding-top:18px; color:var(--accent); font-size:1.05rem; font-weight:800}

.card .company{color:var(--brand); font-size:.8rem; font-weight:800; text-transform:uppercase; letter-spacing:.06em}
.card h3{margin:0; line-height:1.3}
.card p{color:var(--muted); line-height:1.6; margin:0}
.metric-tag{font-size:.82rem; background:#ecfdf8; padding:5px 9px; border-radius:999px; border:1px solid #c4f1e4; color:#08745b; font-weight:800}

.resume-aside{padding:20px; border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-1)}
.resume-aside p{color:var(--muted); line-height:1.6}
.resume-aside h3:not(:first-child){margin-top:22px}
.resume-main details li{line-height:1.65; color:#34445b}
.resume-main summary{line-height:1.5}
.tabs{display:flex; gap:8px}
.tab{border:1px solid var(--line); background:#fff; border-radius:999px; padding:7px 12px; cursor:pointer; font-weight:700}
.tab.active{background:var(--brand); color:#fff; border-color:var(--brand)}

.impact-copy{display:flex; flex-direction:column}
.stat-stack{display:grid; gap:12px; margin-top:8px}
.stat-stack div{display:grid; grid-template-columns:100px 1fr; align-items:center; gap:14px; padding:12px 0; border-bottom:1px solid var(--line)}
.stat-stack div:last-child{border-bottom:0}
.stat-stack strong{font-size:1.6rem; color:var(--accent)}
.stat-stack span{color:var(--muted); line-height:1.45}

.skill-groups{display:grid; grid-template-columns:repeat(2,1fr); gap:16px}
.skill-card{padding:20px; border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-1)}
.skill-card h3{margin:0 0 9px}
.skill-card p{margin:0; color:var(--muted); line-height:1.75}

@media (max-width: 760px){
  .site-header{position:relative}
  .header-row{align-items:flex-start; gap:14px; padding-top:14px; padding-bottom:14px}
  .brand{flex-wrap:wrap}
  .brand-sub{width:100%; margin-left:24px; margin-top:-5px}
  .nav{display:none}
  .section{padding:54px 0}
  .hero{padding-top:54px}
  .hero h1{font-size:2.2rem}
  .kpi-list{display:grid; grid-template-columns:1fr; gap:14px}
  .section-head{align-items:flex-start; flex-direction:column}
  .filters{width:100%}
  #search{width:100%; min-width:0}
  .role-slide{height:460px; width:86vw}
  .role-inner{padding:24px}
  .role-slide h3{font-size:1.4rem}
  .resume-grid{grid-template-columns:1fr}
  .skill-groups{grid-template-columns:1fr}
  .stat-stack div{grid-template-columns:86px 1fr}
}
