/* =====================
   Design Tokens
   ===================== */
:root {
  --bg: #0b1220;            /* dark: slate-950 */
  --panel: #0f172a;         /* dark: slate-900 */
  --text: #e5e7eb;          /* gray-200 */
  --muted: #94a3b8;         /* slate-400 */
  --brand: #38bdf8;         /* sky-400 */
  --ring: rgba(56, 189, 248, 0.35);
  --border: #1f2937;        /* gray-800 */
  --card: #111827;          /* gray-900 */
  --tag-bg: rgba(56, 189, 248, 0.15);
  --tag-border: rgba(56, 189, 248, 0.35);
  --tag-text: #e6f6ff;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --brand: #0369a1;
  --ring: rgba(3, 105, 161, 0.25);
  --border: #e5e7eb;
  --card: #ffffff;
  --tag-bg: #e0f2fe;
  --tag-border: rgba(3, 105, 161, 0.35);
  --tag-text: #0c4a6e;
  --shadow: 0 10px 24px rgba(2,6,23,.08);
}

/* =====================
   Base & Utilities
   ===================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1100px, 92%); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.h2 { margin: 0; font-size: clamp(1.1rem, 2vw, 1.25rem); }
.muted { color: var(--muted); }
.ul-tight { margin: .2rem 0 0 1rem; padding: 0; }

/* =====================
   Header / Nav
   ===================== */
header.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] header.site-header { background: rgba(255, 255, 255, 0.7); }

.nav { display: flex; align-items: center; justify-content: space-between; padding: .8rem 0; }
.brand { display:flex; align-items:center; gap:.75rem; font-weight:700; letter-spacing:.2px; }
.brand .dot { width:10px; height:10px; border-radius:50%; background:var(--brand); box-shadow: 0 0 0 6px var(--ring);} 
.nav a { color: var(--muted); font-weight: 600; padding:.3rem .6rem; border-radius: .5rem; }
.nav a:hover, .nav a.active { color: var(--text); background: rgba(56, 189, 248, 0.12); }

.theme-toggle { border:1px solid var(--border); background:transparent; color:var(--muted); padding:.45rem .7rem; border-radius:.6rem; cursor:pointer; }
.theme-toggle:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }

/* =====================
   Hero / Profile
   ===================== */
.hero { padding: 2.6rem 0 1.2rem; }
.hero-wrap { display:grid; grid-template-columns: 140px 1fr; gap:1.4rem; align-items:center; }
.avatar { width:140px; height:140px; border-radius: 1rem; overflow:hidden; border:1px solid var(--border); box-shadow: var(--shadow); background:var(--card); }
.headline h1 { margin:0 0 .25rem; font-size: clamp(1.6rem, 3.6vw, 2.1rem); }
.headline p { margin:.2rem 0 0; color: var(--muted); }
.meta { display:flex; flex-wrap:wrap; gap:.6rem .9rem; margin-top:.7rem; color:var(--muted); }
.meta a { color: var(--text); font-weight:600; }

/* =====================
   Sections / Cards
   ===================== */
section { padding: 2rem 0; }
.section-title { display:flex; align-items:center; gap:.6rem; margin:0 0 1rem; }
.section-title .bar { width:6px; height:22px; border-radius: 999px; background: var(--brand); box-shadow: 0 0 0 6px var(--ring); }
.card { background: var(--card); border:1px solid var(--border); border-radius: 1rem; box-shadow: var(--shadow); }

.summary { display:grid; gap:1rem; }
.summary .card { padding:1.1rem; }

/* =====================
   Timeline
   ===================== */
.timeline { position:relative; margin-left:.5rem; }
.timeline::before { content:""; position:absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.t-item { position:relative; padding-left: 2.8rem; margin: 1rem 0; }
.t-item::before { content:""; position:absolute; left: 6px; top:.45rem; width: 16px; height: 16px; border-radius:50%; background: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.t-card { padding:1rem; }
.t-head { display:flex; flex-wrap:wrap; gap:.5rem 1rem; align-items:baseline; }
.t-head .role { font-weight:700; }
.t-head .company { color: var(--muted); }
.t-head .period { margin-left:auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-head .location { color: var(--muted); }
.t-body { color: var(--muted); margin-top:.4rem; }

/* =====================
   Case Studies (Scalable list + modal) 
   ===================== */
.cs-layout { display:grid; grid-template-columns: 260px 1fr; gap: 1rem; }
.cs-filters { padding: .8rem; }
.filter-head { font-weight: 700; margin-bottom: .5rem; }
.filter-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .5rem; border: 1px solid var(--border); border-radius: 999px; margin: .25rem; cursor: pointer; }
.cs-list { display: grid; gap: .8rem; }
.cs-item { display:flex; align-items: center; justify-content: space-between; padding: .9rem; }
.cs-title { font-weight: 700; }
.cs-tags { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.2rem; }
.read-btn { white-space: nowrap; }

/* Modal */
.modal[aria-hidden="true"] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop { position:absolute; inset:0; background: rgba(0,0,0,.5); }
.modal-panel { position: absolute; inset: 5% 50% 5% 5%; background: var(--card); border:1px solid var(--border); border-radius: 1rem; box-shadow: var(--shadow); overflow: auto; padding: 1rem; }
.modal-close { position: absolute; top: .6rem; right: .8rem; border:1px solid var(--border); background: transparent; color: var(--muted); border-radius:.5rem; padding:.25rem .5rem; cursor: pointer; }
.reader-content h1, .reader-content h2, .reader-content h3 { margin-top: .2rem; }
.reader-content { color: var(--text); }
.reader-content .muted { color: var(--muted); }

/* Tags */
.tags, .cs-tags { display:flex; flex-wrap:wrap; gap:.35rem; }
.tag { display:inline-flex; align-items:center; gap:.35rem; font-size:.85rem; font-weight:600; padding:.2rem .5rem; border-radius:.6rem; background: var(--tag-bg); color: var(--tag-text); border: 1px solid var(--tag-border); }

/* Footer */
footer { padding:2rem 0 3rem; color: var(--muted); text-align:center; }

/* Buttons & utilities */
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.actions { display:flex; gap:.6rem; flex-wrap:wrap; }
.btn { display:inline-flex; align-items:center; gap:.5rem; padding:.55rem .8rem; border-radius:.6rem; border:1px solid var(--border); background:transparent; color: var(--text); font-weight:600; }
.btn:hover { border-color: rgba(56, 189, 248, 0.5); box-shadow: 0 0 0 4px var(--ring); }
/* Utilities */
.is-hidden { display: none !important; }

/* Responsive */
@media (max-width: 900px) {
  .cs-layout { grid-template-columns: 1fr; }
  .modal-panel { inset: 5% 5% 5% 5%; }
}
@media (max-width: 780px) {
  .hero-wrap { grid-template-columns: 96px 1fr; gap:1rem; }
  .avatar { width:96px; height:96px; border-radius:.75rem; }
  .grid-2 { grid-template-columns: 1fr; }
}
