/* ============================================================
   THEME TOKENS  — edit colors here
   ============================================================ */
:root{
  /* sidebar stays dark in both themes (matches reference) */
  --sidebar-bg:#0e1626;
  --nav-text:#a6b2c6;
  --nav-text-hover:#e7ecf4;
  --nav-active-bg:#1c2841;
  --nav-active-text:#ffffff;
  --name-color:#ffffff;
  --title-color:#5b9bff;
  --accent:#3b82f6;

  /* main / light theme */
  --bg:#eef1f5;
  --card:#ffffff;
  --card-border:#e6e9ef;
  --heading:#0f172a;
  --text:#374151;
  --muted:#64748b;
  --rule:#dde3ec;
  --pill-bg:#eaf1ff;
  --pill-text:#2158c9;
  --pill-border:#d6e3ff;
  --link:#2563eb;
  --shadow:0 1px 2px rgba(15,23,42,.05), 0 10px 28px rgba(15,23,42,.05);

  --scroll-offset:28px;
  --sidebar-w:288px;
}
html[data-theme="dark"]{
  --bg:#0a111e;
  --card:#111c2e;
  --card-border:#1f2c42;
  --heading:#f1f5f9;
  --text:#c6d1df;
  --muted:#8794a8;
  --rule:#23324a;
  --pill-bg:#16243b;
  --pill-text:#8fb3f7;
  --pill-border:#26385a;
  --link:#7ea9ff;
  --shadow:0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.4);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  font-family:"Inter",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  transition:background .25s ease,color .25s ease;
}
a{color:var(--link);text-decoration:none;}
.skip-link{
  position:absolute;left:-999px;top:0;z-index:200;
  background:var(--accent);color:#fff;padding:10px 16px;border-radius:0 0 8px 0;font-weight:600;
}
.skip-link:focus{left:0;}
a:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px;}

/* ============================================================
   PAGE SHELL (centered two-column layout)
   ============================================================ */
.page{
  display:grid;
  grid-template-columns:var(--sidebar-w) minmax(0,1fr);
  gap:28px;
  align-items:start;
  max-width:1120px;
  margin:0 auto;
  padding:28px 24px 90px;
}

/* ============================================================
   SIDEBAR (sticky next to content)
   ============================================================ */
.sidebar{
  position:sticky;
  top:28px;
  max-height:calc(100vh - 56px);
  overflow-y:auto;
  width:100%;
  margin:0;
  background:var(--sidebar-bg);
  border-radius:20px;
  padding:34px 20px 24px;
  display:flex;flex-direction:column;
  scrollbar-width:thin;scrollbar-color:#2a3a58 transparent;
}
.sidebar::-webkit-scrollbar{width:8px;}
.sidebar::-webkit-scrollbar-thumb{background:#243350;border-radius:8px;}

.profile{text-align:center;margin-bottom:26px;}
.avatar{
  position:relative;width:132px;height:132px;margin:0 auto 18px;border-radius:50%;
  background:linear-gradient(150deg,#2b5bd7,#1c2b49);
  box-shadow:0 0 0 4px #0e1626,0 0 0 6px #2c4b86;
  overflow:hidden;
}
.avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
.avatar-fallback{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-family:"Sora",sans-serif;font-weight:700;font-size:2.6rem;color:#dfe8fb;letter-spacing:1px;
}
.name{
  font-family:"Sora",sans-serif;font-weight:700;font-size:1.42rem;line-height:1.25;
  color:var(--name-color);margin:0 0 6px;
}
.title{color:var(--title-color);font-weight:500;font-size:.98rem;margin:0;}

.nav{display:flex;flex-direction:column;gap:3px;flex:1;}
.nav-group-label{
  margin:20px 12px 8px;font-size:.72rem;font-weight:700;letter-spacing:1.4px;
  text-transform:uppercase;color:#5f6f8a;
}
.nav-link{
  display:flex;align-items:center;gap:12px;
  padding:9px 12px;border-radius:9px;
  color:var(--nav-text);font-size:.95rem;font-weight:500;
  transition:background .16s ease,color .16s ease;
}
.nav-link:hover{background:rgba(255,255,255,.045);color:var(--nav-text-hover);}
.nav-link.active{background:var(--nav-active-bg);color:var(--nav-active-text);}
.nav-ico{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex:none;}
.nav-ico svg{width:18px;height:18px;}
.nav-skill{padding-left:16px;font-size:.9rem;}
.nav-ico.dot{position:relative;}
.nav-ico.dot::before{
  content:"";width:6px;height:6px;border-radius:50%;
  background:currentColor;opacity:.5;
}
.nav-link.active .nav-ico.dot::before{opacity:1;background:var(--accent);}

.sidebar-footer{margin-top:22px;padding-top:20px;border-top:1px solid rgba(255,255,255,.07);}
.theme-toggle{
  display:flex;align-items:center;justify-content:center;gap:9px;width:100%;
  padding:10px 12px;border:none;border-radius:9px;cursor:pointer;
  background:rgba(255,255,255,.05);color:#c4cede;font-size:.9rem;font-weight:500;
  transition:background .16s ease;
}
.theme-toggle:hover{background:rgba(255,255,255,.1);}
.theme-toggle svg{width:17px;height:17px;}
html[data-theme="dark"] .icon-moon{display:none;}
html[data-theme="light"] .icon-sun{display:none;}

.socials{display:flex;justify-content:center;gap:8px;margin-top:16px;}
.social{
  display:inline-flex;align-items:center;justify-content:center;
  width:38px;height:38px;border-radius:9px;color:#9aa7bd;
  background:rgba(255,255,255,.04);transition:background .16s ease,color .16s ease;
}
.social:hover{background:rgba(255,255,255,.1);color:#fff;}
.social svg{width:19px;height:19px;}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main{margin:0;padding:8px 0 0;min-width:0;}
.section{scroll-margin-top:var(--scroll-offset);margin-bottom:52px;}
.section:last-child{margin-bottom:0;}
.section-title{
  display:flex;align-items:center;gap:22px;
  font-family:"Sora",sans-serif;font-weight:700;font-size:1.95rem;
  color:var(--heading);margin:0 0 24px;letter-spacing:-.3px;
}
.section-title::after{content:"";flex:1;height:1px;background:var(--rule);}

.card{
  background:var(--card);border:1px solid var(--card-border);border-radius:14px;
  padding:26px 30px;box-shadow:var(--shadow);
  transition:background .25s ease,border-color .25s ease;
}
.bio{margin:0;color:var(--text);font-size:1.02rem;line-height:1.7;}
.bio + .bio{margin-top:14px;}

.entry{
  --entry-accent:var(--accent);
  --entry-link:var(--link);
  --entry-pill-bg:var(--pill-bg);
  --entry-pill-text:var(--pill-text);
  --entry-pill-border:var(--pill-border);
  border-left:4px solid var(--entry-accent);
  margin-bottom:20px;
}
/* Unique accent per project card */
.entry[data-color="1"]{
  --entry-accent:#1e6bb8;
  --entry-link:#145ca3;
  --entry-pill-bg:#e7f0f8;
  --entry-pill-text:#18528b;
  --entry-pill-border:#cbdbeb;
}
.entry[data-color="2"]{
  --entry-accent:#1e45b8;
  --entry-link:#1438a3;
  --entry-pill-bg:#e7ebf8;
  --entry-pill-text:#18358b;
  --entry-pill-border:#cbd3eb;
}
.entry[data-color="3"]{
  --entry-accent:#1e1eb8;
  --entry-link:#1414a3;
  --entry-pill-bg:#e7e7f8;
  --entry-pill-text:#18188b;
  --entry-pill-border:#cbcbeb;
}
.entry[data-color="4"]{
  --entry-accent:#451eb8;
  --entry-link:#3814a3;
  --entry-pill-bg:#ebe7f8;
  --entry-pill-text:#35188b;
  --entry-pill-border:#d3cbeb;
}
.entry[data-color="5"]{
  --entry-accent:#6b1eb8;
  --entry-link:#5c14a3;
  --entry-pill-bg:#f0e7f8;
  --entry-pill-text:#52188b;
  --entry-pill-border:#dbcbeb;
}
.entry[data-color="6"]{
  --entry-accent:#921eb8;
  --entry-link:#8014a3;
  --entry-pill-bg:#f4e7f8;
  --entry-pill-text:#6e188b;
  --entry-pill-border:#e3cbeb;
}
.entry[data-color="7"]{
  --entry-accent:#b81eb8;
  --entry-link:#a314a3;
  --entry-pill-bg:#f8e7f8;
  --entry-pill-text:#8b188b;
  --entry-pill-border:#ebcbeb;
}
.entry[data-color="8"]{
  --entry-accent:#b81e92;
  --entry-link:#a31480;
  --entry-pill-bg:#f8e7f4;
  --entry-pill-text:#8b186e;
  --entry-pill-border:#ebcbe3;
}
.entry[data-color="9"]{
  --entry-accent:#b81e6b;
  --entry-link:#a3145c;
  --entry-pill-bg:#f8e7f0;
  --entry-pill-text:#8b1852;
  --entry-pill-border:#ebcbdb;
}
.entry[data-color="10"]{
  --entry-accent:#b81e45;
  --entry-link:#a31438;
  --entry-pill-bg:#f8e7eb;
  --entry-pill-text:#8b1835;
  --entry-pill-border:#ebcbd3;
}
.entry[data-color="11"]{
  --entry-accent:#b81e1e;
  --entry-link:#a31414;
  --entry-pill-bg:#f8e7e7;
  --entry-pill-text:#8b1818;
  --entry-pill-border:#ebcbcb;
}
.entry[data-color="12"]{
  --entry-accent:#b8451e;
  --entry-link:#a33814;
  --entry-pill-bg:#f8ebe7;
  --entry-pill-text:#8b3518;
  --entry-pill-border:#ebd3cb;
}
.entry[data-color="13"]{
  --entry-accent:#b86b1e;
  --entry-link:#a35c14;
  --entry-pill-bg:#f8f0e7;
  --entry-pill-text:#8b5218;
  --entry-pill-border:#ebdbcb;
}
.entry[data-color="14"]{
  --entry-accent:#b8921e;
  --entry-link:#a38014;
  --entry-pill-bg:#f8f4e7;
  --entry-pill-text:#8b6e18;
  --entry-pill-border:#ebe3cb;
}
.entry[data-color="15"]{
  --entry-accent:#b8b81e;
  --entry-link:#a3a314;
  --entry-pill-bg:#f8f8e7;
  --entry-pill-text:#8b8b18;
  --entry-pill-border:#ebebcb;
}
.entry[data-color="16"]{
  --entry-accent:#92b81e;
  --entry-link:#80a314;
  --entry-pill-bg:#f4f8e7;
  --entry-pill-text:#6e8b18;
  --entry-pill-border:#e3ebcb;
}
.entry[data-color="17"]{
  --entry-accent:#6bb81e;
  --entry-link:#5ca314;
  --entry-pill-bg:#f0f8e7;
  --entry-pill-text:#528b18;
  --entry-pill-border:#dbebcb;
}
.entry[data-color="18"]{
  --entry-accent:#45b81e;
  --entry-link:#38a314;
  --entry-pill-bg:#ebf8e7;
  --entry-pill-text:#358b18;
  --entry-pill-border:#d3ebcb;
}
.entry[data-color="19"]{
  --entry-accent:#1eb81e;
  --entry-link:#14a314;
  --entry-pill-bg:#e7f8e7;
  --entry-pill-text:#188b18;
  --entry-pill-border:#cbebcb;
}
.entry[data-color="20"]{
  --entry-accent:#1eb845;
  --entry-link:#14a338;
  --entry-pill-bg:#e7f8eb;
  --entry-pill-text:#188b35;
  --entry-pill-border:#cbebd3;
}
.entry[data-color="21"]{
  --entry-accent:#1eb86b;
  --entry-link:#14a35c;
  --entry-pill-bg:#e7f8f0;
  --entry-pill-text:#188b52;
  --entry-pill-border:#cbebdb;
}
.entry[data-color="22"]{
  --entry-accent:#1eb892;
  --entry-link:#14a380;
  --entry-pill-bg:#e7f8f4;
  --entry-pill-text:#188b6e;
  --entry-pill-border:#cbebe3;
}
.entry[data-color="23"]{
  --entry-accent:#1eb8b8;
  --entry-link:#14a3a3;
  --entry-pill-bg:#e7f8f8;
  --entry-pill-text:#188b8b;
  --entry-pill-border:#cbebeb;
}
.entry[data-color="24"]{
  --entry-accent:#1e92b8;
  --entry-link:#1480a3;
  --entry-pill-bg:#e7f4f8;
  --entry-pill-text:#186e8b;
  --entry-pill-border:#cbe3eb;
}
html[data-theme="dark"] .entry[data-color="1"]{
  --entry-accent:#5a9ee2;
  --entry-link:#81b2e4;
  --entry-pill-bg:#172430;
  --entry-pill-text:#90b8df;
  --entry-pill-border:#2b3d50;
}
html[data-theme="dark"] .entry[data-color="2"]{
  --entry-accent:#5a7ce2;
  --entry-link:#819ae4;
  --entry-pill-bg:#171d30;
  --entry-pill-text:#90a4df;
  --entry-pill-border:#2b3450;
}
html[data-theme="dark"] .entry[data-color="3"]{
  --entry-accent:#5a5ae2;
  --entry-link:#8181e4;
  --entry-pill-bg:#171730;
  --entry-pill-text:#9090df;
  --entry-pill-border:#2b2b50;
}
html[data-theme="dark"] .entry[data-color="4"]{
  --entry-accent:#7c5ae2;
  --entry-link:#9a81e4;
  --entry-pill-bg:#1d1730;
  --entry-pill-text:#a490df;
  --entry-pill-border:#342b50;
}
html[data-theme="dark"] .entry[data-color="5"]{
  --entry-accent:#9e5ae2;
  --entry-link:#b281e4;
  --entry-pill-bg:#241730;
  --entry-pill-text:#b890df;
  --entry-pill-border:#3d2b50;
}
html[data-theme="dark"] .entry[data-color="6"]{
  --entry-accent:#c05ae2;
  --entry-link:#cb81e4;
  --entry-pill-bg:#2a1730;
  --entry-pill-text:#cb90df;
  --entry-pill-border:#462b50;
}
html[data-theme="dark"] .entry[data-color="7"]{
  --entry-accent:#e25ae2;
  --entry-link:#e481e4;
  --entry-pill-bg:#301730;
  --entry-pill-text:#df90df;
  --entry-pill-border:#502b50;
}
html[data-theme="dark"] .entry[data-color="8"]{
  --entry-accent:#e25ac0;
  --entry-link:#e481cb;
  --entry-pill-bg:#30172a;
  --entry-pill-text:#df90cb;
  --entry-pill-border:#502b46;
}
html[data-theme="dark"] .entry[data-color="9"]{
  --entry-accent:#e25a9e;
  --entry-link:#e481b3;
  --entry-pill-bg:#301724;
  --entry-pill-text:#df90b8;
  --entry-pill-border:#502b3d;
}
html[data-theme="dark"] .entry[data-color="10"]{
  --entry-accent:#e25a7c;
  --entry-link:#e4819a;
  --entry-pill-bg:#30171d;
  --entry-pill-text:#df90a4;
  --entry-pill-border:#502b34;
}
html[data-theme="dark"] .entry[data-color="11"]{
  --entry-accent:#e25a5a;
  --entry-link:#e48181;
  --entry-pill-bg:#301717;
  --entry-pill-text:#df9090;
  --entry-pill-border:#502b2b;
}
html[data-theme="dark"] .entry[data-color="12"]{
  --entry-accent:#e27c5a;
  --entry-link:#e49a81;
  --entry-pill-bg:#301d17;
  --entry-pill-text:#dfa490;
  --entry-pill-border:#50342b;
}
html[data-theme="dark"] .entry[data-color="13"]{
  --entry-accent:#e29e5a;
  --entry-link:#e4b281;
  --entry-pill-bg:#302417;
  --entry-pill-text:#dfb890;
  --entry-pill-border:#503d2b;
}
html[data-theme="dark"] .entry[data-color="14"]{
  --entry-accent:#e2c05a;
  --entry-link:#e4cb81;
  --entry-pill-bg:#302a17;
  --entry-pill-text:#dfcb90;
  --entry-pill-border:#50462b;
}
html[data-theme="dark"] .entry[data-color="15"]{
  --entry-accent:#e2e25a;
  --entry-link:#e4e481;
  --entry-pill-bg:#303017;
  --entry-pill-text:#dfdf90;
  --entry-pill-border:#50502b;
}
html[data-theme="dark"] .entry[data-color="16"]{
  --entry-accent:#c0e25a;
  --entry-link:#cbe481;
  --entry-pill-bg:#2a3017;
  --entry-pill-text:#cbdf90;
  --entry-pill-border:#46502b;
}
html[data-theme="dark"] .entry[data-color="17"]{
  --entry-accent:#9ee25a;
  --entry-link:#b3e481;
  --entry-pill-bg:#243017;
  --entry-pill-text:#b8df90;
  --entry-pill-border:#3d502b;
}
html[data-theme="dark"] .entry[data-color="18"]{
  --entry-accent:#7ce25a;
  --entry-link:#9ae481;
  --entry-pill-bg:#1d3017;
  --entry-pill-text:#a4df90;
  --entry-pill-border:#34502b;
}
html[data-theme="dark"] .entry[data-color="19"]{
  --entry-accent:#5ae25a;
  --entry-link:#81e481;
  --entry-pill-bg:#173017;
  --entry-pill-text:#90df90;
  --entry-pill-border:#2b502b;
}
html[data-theme="dark"] .entry[data-color="20"]{
  --entry-accent:#5ae27c;
  --entry-link:#81e49a;
  --entry-pill-bg:#17301d;
  --entry-pill-text:#90dfa4;
  --entry-pill-border:#2b5034;
}
html[data-theme="dark"] .entry[data-color="21"]{
  --entry-accent:#5ae29e;
  --entry-link:#81e4b3;
  --entry-pill-bg:#173024;
  --entry-pill-text:#90dfb8;
  --entry-pill-border:#2b503d;
}
html[data-theme="dark"] .entry[data-color="22"]{
  --entry-accent:#5ae2c0;
  --entry-link:#81e4cb;
  --entry-pill-bg:#17302a;
  --entry-pill-text:#90dfcb;
  --entry-pill-border:#2b5046;
}
html[data-theme="dark"] .entry[data-color="23"]{
  --entry-accent:#5ae2e2;
  --entry-link:#81e4e4;
  --entry-pill-bg:#173030;
  --entry-pill-text:#90dfdf;
  --entry-pill-border:#2b5050;
}
html[data-theme="dark"] .entry[data-color="24"]{
  --entry-accent:#5ac0e2;
  --entry-link:#81cbe4;
  --entry-pill-bg:#172a30;
  --entry-pill-text:#90cbdf;
  --entry-pill-border:#2b4650;
}
.entry:last-child{margin-bottom:0;}
.entry-title{font-family:"Sora",sans-serif;font-weight:600;font-size:1.16rem;color:var(--heading);margin:0;}
.entry-title-accent{color:var(--entry-accent);}
.entry-meta{color:var(--entry-link);font-weight:500;font-size:.95rem;margin:5px 0 13px;}
.entry-desc{margin:0;color:var(--text);}
.entry-desc + .entry-desc{margin-top:10px;}
.entry-more{display:none;margin-top:12px;color:var(--text);}
.entry.open .entry-more{display:block;}
.readme{line-height:1.65;}
.readme > :first-child{margin-top:0;}
.readme h1,.readme h2,.readme h3,.readme h4,.readme h5{
  font-family:"Sora",sans-serif;color:var(--heading);line-height:1.3;margin:1.4em 0 .55em;
}
.readme h1{font-size:1.35rem;}
.readme h2{font-size:1.15rem;padding-bottom:6px;border-bottom:1px solid var(--rule);}
.readme h3{font-size:1.05rem;}
.readme h4,.readme h5{font-size:.98rem;}
.readme p{margin:0 0 12px;}
.readme ul,.readme ol{margin:0 0 12px;padding-left:1.25rem;}
.readme li{margin:4px 0;}
.readme hr{border:0;border-top:1px solid var(--rule);margin:18px 0;}
.readme blockquote{
  margin:0 0 12px;padding:10px 14px;
  border-left:3px solid var(--entry-accent);background:var(--entry-pill-bg);color:var(--text);
}
.readme blockquote p{margin:0;}
.readme pre{
  margin:0 0 12px;padding:12px 14px;overflow-x:auto;
  background:var(--entry-pill-bg);border:1px solid var(--card-border);border-radius:8px;
  font-size:.85rem;line-height:1.5;
}
.readme code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88em;}
.readme :not(pre) > code{
  background:var(--entry-pill-bg);border:1px solid var(--entry-pill-border);
  padding:1px 6px;border-radius:4px;
}
.readme table{width:100%;border-collapse:collapse;margin:0 0 12px;font-size:.92rem;}
.readme th,.readme td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--rule);}
.readme th{color:var(--heading);font-weight:600;}
.readme-status{color:var(--muted, var(--text));font-style:italic;margin:0;}
.show-more{
  display:flex;align-items:center;gap:5px;margin-top:14px;
  background:none;border:none;cursor:pointer;padding:0;
  color:var(--entry-link);font-family:inherit;font-size:.92rem;font-weight:600;
}
.show-more::after{content:"▾";font-size:.75rem;transition:transform .2s ease;}
.entry.open .show-more-top::after,
.entry.open .show-more-bottom::after{transform:rotate(180deg);}
/* One "Show more" when closed; two "Show less" (top + bottom) when open */
.show-more-bottom{display:none;}
.entry.open .show-more-bottom{display:flex;}

.tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;}
.pill{
  background:var(--entry-pill-bg);color:var(--entry-pill-text);border:1px solid var(--entry-pill-border);
  padding:5px 12px;border-radius:999px;font-size:.83rem;font-weight:500;
  transition:transform .12s ease;
}
.pill:hover{transform:translateY(-1px);}
.entry-link{display:inline-flex;align-items:center;gap:6px;margin-top:16px;font-weight:600;font-size:.94rem;color:var(--entry-link);}
.entry-link svg{width:15px;height:15px;}

/* skill cards share .card.entry sizing with projects */
#skills .entry{scroll-margin-top:var(--scroll-offset);}
#skills .entry .tags{margin-top:12px;}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:900px){
  .page{
    grid-template-columns:1fr;
    gap:20px;
    padding:16px 16px 70px;
  }
  .sidebar{
    position:static;
    max-height:none;
    overflow:visible;
  }
  .main{padding:0;}
}
@media (max-width:640px){
  .section-title{font-size:1.62rem;}
  .card{padding:22px 22px;}
  .page{padding:16px 16px 60px;}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  *{transition:none !important;}
}