﻿:root{
  --li-blue:#0A66C2;
  --li-blue-dark:#004182;
  --bg:#F3F2EF;
  --card:#FFFFFF;
  --text:#1F2328;
  --muted:#5C6770;
  --border:rgba(0,0,0,.10);
  --shadow:0 8px 20px rgba(0,0,0,.08);
  --radius:16px;
  --max:1100px;
}

/* Dark theme overrides */
:root[data-theme="dark"]{
  --bg:#0B0F14;
  --card:#0F1621;
  --text:#E7EDF5;
  --muted:#A7B2C0;
  --border:rgba(231,237,245,.12);
  --shadow:0 10px 28px rgba(0,0,0,.45);

  --li-blue:#4FA3FF;
  --li-blue-dark:#B9DCFF;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* Themed links (does NOT affect .nav a or .btn) */
.small a,
.modal-body a{
  color: var(--li-blue-dark);
  text-decoration: none;
  font-weight: 900;
  display: inline-block;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 8px;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.small a:hover,
.modal-body a:hover{
  color: var(--li-blue-dark);
  background: rgba(10,102,194,.10);
  box-shadow: 0 0 0 1px rgba(10,102,194,.18) inset;
}
.small a:focus-visible,
.modal-body a:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 4px rgba(10,102,194,.12),
    0 0 0 1px rgba(10,102,194,.28) inset;
  background: rgba(10,102,194,.10);
}

/* Top bar */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(243,242,239,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
:root[data-theme="dark"] .topbar{
  background: rgba(11,15,20,.72);
}

.topbar-inner{
  max-width:var(--max);
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  align-items:center;
  gap:14px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.2px;
}

/* ✅ Restore nav styles (this was bugged) */
.nav{
  margin-left:auto;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;

  border:1px solid var(--border);
  background: rgba(255,255,255,.72);
  padding:6px;
  border-radius:14px;
  backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .nav{
  background: rgba(255,255,255,.06);
}

.nav a{
  text-decoration:none;
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
  font-weight:800;
  opacity:.90;
}

.nav a:hover{
  background: rgba(10,102,194,.12);
  color: var(--li-blue-dark);
}

.nav a:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(10,102,194,.12), 0 0 0 1px rgba(10,102,194,.28) inset;
}

/* ✅ Theme toggle button (separate from nav) */
.theme-toggle{
  border:1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
:root[data-theme="dark"] .theme-toggle{
  background: rgba(255,255,255,.06);
}
.theme-toggle:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(10,102,194,.35);
}
.theme-toggle:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(10,102,194,.12), 0 0 0 1px rgba(10,102,194,.28) inset;
}

.badge{
  width:34px;height:34px;
  border-radius:10px;
  display:grid;place-items:center;
  color:#fff;background:var(--li-blue);
  box-shadow: 0 8px 16px rgba(10,102,194,.25);
  font-weight:900;
}
.nav{
  margin-left: 6px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
:root[data-theme="dark"] .theme-toggle{
  background: rgba(255,255,255,.06);
}
.theme-toggle:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(10,102,194,.35);
}
.theme-toggle:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(10,102,194,.12), 0 0 0 1px rgba(10,102,194,.28) inset;
}

.nav{
  margin-left:auto;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.nav a{
  text-decoration:none;
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
  font-weight:600;
  opacity:.85;
}
.nav a:hover{ background:rgba(10,102,194,.10); color:var(--li-blue-dark); }

.container{
  max-width:var(--max);
  margin:0 auto;
  padding:20px 16px 60px;
  display:grid;
  gap:18px;
}

/* Cards */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: 0 2px 0 rgba(0,0,0,.02);
  overflow:hidden;
}
.card-pad{ padding:22px; }

/* Hero */
.hero{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:18px;
  align-items:stretch;
}
@media (max-width: 900px){
  .hero{ grid-template-columns:1fr; }
}

.hero-title{
  font-size:48px;
  line-height:1.05;
  margin:0 0 10px;
  letter-spacing:-.8px;
}
.hero-title .accent{ color:var(--li-blue); }
.subtitle{
  margin:0 0 14px;
  color:var(--muted);
  font-weight:600;
}
.about-text{
  margin:0;
  color:var(--text);
  opacity:.92;
  line-height:1.65;
}

.callouts{
  margin-top:16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--card);
  font-weight:700;
  color:var(--text);
}
.pill .dot{
  width:10px;height:10px;border-radius:50%;
  background:var(--li-blue);
  box-shadow: 0 0 0 4px rgba(10,102,194,.15);
}

.btns{
  margin-top:16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.btn{
  border:1px solid var(--border);
  background:var(--card);
  padding:11px 14px;
  border-radius:12px;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  color:var(--text);
  display:inline-flex;
  align-items:center;
  gap:10px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(10,102,194,.35);
}
.btn.primary{
  background:var(--li-blue);
  color:#fff;
  border-color: rgba(10,102,194,.55);
}
.btn.primary:hover{
  background:var(--li-blue-dark);
  border-color: rgba(0,65,130,.75);
}

.tip-text{ margin-top:10px; }

.portrait{
  height:100%;
  min-height:240px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:
    radial-gradient(80% 70% at 30% 25%, rgba(10,102,194,.18), transparent 60%),
    linear-gradient(135deg, rgba(0,0,0,.03), rgba(0,0,0,.00)),
    var(--card);
  display:grid;
  place-items:center;
  padding:18px;
}

/* Replace the old .avatar block with an <img> */
.avatar-img{
  width:118px;
  height:118px;
  border-radius:28px;
  border:1px solid var(--border);
  object-fit: cover;
  display:block;
  background: linear-gradient(135deg, rgba(10,102,194,.18), rgba(10,102,194,.04));
}

.portrait-inner{
  width:100%;
  display:grid;
  gap:12px;
  align-items:center;
  justify-items:center;
  text-align:center;
}
.portrait-name{ font-weight:900; }
.portrait small{ color:var(--muted); font-weight:700; }

/* Section header */
.section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:16px 22px;
  border-bottom:1px solid var(--border);
  background: linear-gradient(180deg, #fff, rgba(255,255,255,.92));
}
.section-title h2{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
}
.section-title .tag{
  font-size:12px;
  font-weight:900;
  color:var(--li-blue-dark);
  background: rgba(10,102,194,.10);
  border:1px solid rgba(10,102,194,.20);
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;
}

/* Skills grid */
.grid{
  display:grid;
  gap:14px;
  padding:18px 22px 22px;
}
.skills{
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 980px){ .skills{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px){ .skills{ grid-template-columns: repeat(2, 1fr); } }

.tile{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
  padding:14px;
  display:flex;
  gap:12px;
  align-items:center;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  cursor:default;
}
.tile:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(10,102,194,.30);
}
.icon{
  width:44px;height:44px;
  border-radius:14px;
  display:grid;place-items:center;
  background: rgba(10,102,194,.10);
  border:1px solid rgba(10,102,194,.20);
  color: var(--li-blue-dark);
  font-weight:900;
}
.tile b{ display:block; font-size:14px; }
.tile span{ display:block; font-size:12px; color:var(--muted); font-weight:700; margin-top:2px; }

/* Experience */
.exp{
  /* Turn the grid into a horizontal scroller */
  display: flex;
  gap: 14px;
  padding: 18px 22px 22px;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;

  scroll-snap-type: x mandatory;
  scroll-padding: 22px;

  /* optional: makes the scroll area feel nicer */
  overscroll-behavior-x: contain;
}

.exp > .job{
  /* Each card has a consistent width, so scrolling feels intentional */
  flex: 0 0 min(360px, 85vw);
  scroll-snap-align: start;
}

@media (max-width: 980px){
  .exp{
    padding: 16px;
    scroll-padding: 16px;
  }
  .exp > .job{
    flex-basis: 88vw;
  }
}

/* optional: subtle scrollbar styling (supported in modern browsers) */
.exp{
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.18) transparent;
}
.exp::-webkit-scrollbar{ height: 10px; }
.exp::-webkit-scrollbar-track{ background: transparent; }
.exp::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.job{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
  padding:16px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.job[data-modal]{
  cursor: pointer;
}
.job:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(10,102,194,.30);
}
.job:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 4px rgba(10,102,194,.12),
    0 0 0 1px rgba(10,102,194,.28) inset,
    var(--shadow);
  border-color: rgba(10,102,194,.30);
}
.job .top{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
  margin-bottom:10px;
}
.job h3{ margin:0; font-size:16px; }
.job .meta{ color:var(--muted); font-weight:700; font-size:12px; }
.job ul{
  margin:10px 0 0;
  padding-left:18px;
  color: var(--text);
  opacity: .92;
}

.job li{ margin:6px 0; }

/* Contact */
.contact{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:18px;
  padding:18px 22px 22px;
}
@media (max-width: 900px){ .contact{ grid-template-columns:1fr; } }

.contact-card{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
  padding:16px;
}
.contact-name{ font-weight:900; font-size:16px; }
.contact-role{ margin-top:6px; }
.spacer-12{ height:12px; }

.field{
  display:grid;
  gap:6px;
  margin:10px 0;
}
label{
  font-weight:800;
  font-size:12px;
  color:var(--muted);
}
input, textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  font-size:14px;
  outline:none;
}
input:focus, textarea:focus{
  border-color: rgba(10,102,194,.55);
  box-shadow: 0 0 0 4px rgba(10,102,194,.10);
}
textarea{ min-height:140px; resize:vertical; }
.small{
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}

/* Footer */
footer{
  max-width:var(--max);
  margin:0 auto;
  padding:0 16px 40px;
  color:var(--muted);
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

/* Modal */
.modal-backdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:100;
}
.modal{
  width:min(820px, 100%);
  background:var(--card);
  border-radius:18px;
  border:1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow:hidden;
  transform: translateY(8px);
  opacity:0;
  transition: .15s ease;
}
.modal-backdrop.show{ display:flex; }
.modal-backdrop.show .modal{
  transform: translateY(0);
  opacity:1;
}
.modal-head{
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--border);
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,.00));
}
:root[data-theme="dark"] .section-title{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.00));
}
.modal-head b{ font-size:14px; }
.close{
  border:1px solid var(--border);
  background:var(--card);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:900;
}
.modal-body{ padding:16px; }
.modal-body ul{ margin:10px 0; padding-left:18px; }
.modal-body li{ margin:6px 0; }
