:root{
  --bg:#f3f5f9;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --muted2:#94a3b8;
  --border:#e6eaf2;
  --shadow:0 18px 55px rgba(17,24,39,.08);
  --shadow2:0 8px 22px rgba(17,24,39,.06);

  --blue1:#2c7be5;
  --blue2:#39a0ff;
  --green:#22c55e;
  --red:#ef4444;

  --radius:16px;
  --radius2:20px;
}

html.dark{
  --bg:#0b1220;
  --card:#0f172a;
  --text:#e5e7eb;
  --muted:#a1a1aa;
  --muted2:#7c8596;
  --border:rgba(255,255,255,.10);
  --shadow:0 22px 80px rgba(0,0,0,.45);
  --shadow2:0 10px 34px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:var(--bg);
}

a{color:inherit;text-decoration:none}
a:hover{opacity:.95}

.container{
  width:min(1120px, calc(100% - 48px));
  margin:0 auto;
}

/* ===== TOPBAR ===== */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  height:64px;
  display:flex;
  align-items:center;
  background:linear-gradient(90deg,var(--blue1),var(--blue2));
  box-shadow:0 18px 60px rgba(44,123,229,.22);
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:1000;
  letter-spacing:-.03em;
  color:#fff;
}

.brand-mark{
  width:34px;
  height:34px;
  border-radius:12px;
  background:rgba(255,255,255,.22);
  border:1px solid rgba(255,255,255,.25);
  display:grid;
  place-items:center;
  font-size:14px;
}

.brand-text{font-size:14px;opacity:.95}

.nav{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.nav a{
  color:#fff;
  font-size:13px;
  font-weight:900;
  padding:10px 12px;
  border-radius:999px;
  opacity:.95;
}

.nav a:hover{background:rgba(255,255,255,.16)}
.nav a.active{
  background:rgba(255,255,255,.22);
  border:1px solid rgba(255,255,255,.25);
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

/* ===== Buttons ===== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:999px;
  padding:10px 14px;
  font-size:13px;
  font-weight:900;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.14);
  color:#fff;
  transition: transform .08s ease, filter .2s ease, background .2s ease;
}
.btn:hover{background:rgba(255,255,255,.18); transform:translateY(-1px)}
.btn-primary{
  border:0;
  color:#0b1220;
  background:linear-gradient(135deg,#ffffff,rgba(255,255,255,.75));
}
.btn-ghost{
  background:transparent;
  border:1px solid rgba(255,255,255,.30);
  color:#fff;
}

.icon-btn{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.12);
  color:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.icon-btn:hover{background:rgba(255,255,255,.18)}

/* ===== PAGE ===== */
.page{ padding:22px 0 36px; }

.page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  margin: 18px 0;
}

.eyebrow{
  margin:0 0 10px;
  font-size:12px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--muted2);
}

.page-title{
  margin:0;
  font-size:38px;
  letter-spacing:-.03em;
}

.page-sub{
  margin:10px 0 0;
  color:var(--muted);
  max-width:60ch;
  line-height:1.6;
}

.page-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* ===== CARD / PANEL ===== */
.card, .panel{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius2);
  box-shadow:var(--shadow);
}

.card-inner{ padding:18px; }
.panel{ padding:18px; box-shadow:var(--shadow2); }

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.panel-title{ font-weight:1000; letter-spacing:-.02em; }

.legend{ display:flex; gap:14px; color:var(--muted); font-size:13px; font-weight:900; }
.dot{ width:10px; height:10px; border-radius:999px; display:inline-block; margin-right:6px; }
.dot.green{ background:var(--green); }
.dot.blue{ background:var(--blue1); }

.small{ font-size:12px; color:var(--muted); font-weight:700; }
.nowrap{ white-space:nowrap; }

/* ===== HERO ===== */
.hero{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap:18px;
  align-items:stretch;
}

.hero-title{
  margin:0;
  font-size:22px;
  letter-spacing:-.02em;
}
.hero-sub{
  margin:10px 0 0;
  color:var(--muted);
  line-height:1.6;
}
.hero-actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.hero-badges{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.badge-pill{
  font-size:12px;
  font-weight:900;
  color:var(--text);
  background:rgba(17,24,39,.06);
  border:1px solid var(--border);
  padding:8px 10px;
  border-radius:999px;
}
html.dark .badge-pill{ background:rgba(255,255,255,.06); }

.mini-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
.mini-card{
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(17,24,39,.03);
  padding:14px;
}
html.dark .mini-card{ background:rgba(255,255,255,.04); }
.mini-kpi{ font-size:20px; font-weight:1000; }
.mini-label{ margin-top:6px; color:var(--muted); font-weight:800; font-size:12px; }

/* ===== GRIDS ===== */
.grid-3{
  display:grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap:18px;
  margin-top:18px;
}

/* More space between cards */
.grid-gap-lg{ gap: 22px !important; }

/* ===== PROJECT CARDS ===== */
.project-card{ padding:18px; }

.project-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.project-title{
  font-weight:1000;
  letter-spacing:-.02em;
  font-size:16px;
}

/* Tags */
.tag-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.tag-pill{
  font-size:12px;
  font-weight:900;
  color: var(--text);
  background: rgba(17,24,39,.06);
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:999px;
}
html.dark .tag-pill{
  background: rgba(255,255,255,.06);
}

/* Compact gallery thumbs */
.gallery{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-top:14px;
}

.thumb{
  border:0;
  padding:0;
  background:transparent;
  cursor:pointer;
  border-radius:14px;
  overflow:hidden;
  position:relative;
  height:82px;
  border:1px solid var(--border);
  box-shadow: var(--shadow2);
  transition: transform .08s ease;
}
.thumb:hover{ transform: translateY(-1px); }

.thumb-bg{
  position:absolute;
  inset:0;
  display:block;
}

.thumb-more{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-weight:1000;
  color:#fff;
  background: rgba(0,0,0,.40);
  backdrop-filter: blur(6px);
}

.meta-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

/* ===== LIGHTBOX ===== */
.lightbox{
  position:fixed;
  inset:0;
  display:none;
  z-index:9999;
}
.lightbox.open{ display:block; }

.lightbox-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
}

.lightbox-panel{
  position:relative;
  width:min(980px, calc(100% - 28px));
  margin: 6vh auto 0;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.lb-close{
  position:absolute;
  top:10px;
  right:10px;
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(17,24,39,.03);
  cursor:pointer;
  font-weight:1000;
}
html.dark .lb-close{ background: rgba(255,255,255,.04); }

.lb-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 4px 48px 10px 8px;
}
.lb-title{ font-weight:1000; letter-spacing:-.02em; }
.lb-counter{ color: var(--muted); font-weight:900; font-size:12px; }

.lb-stage{
  display:grid;
  grid-template-columns: 50px 1fr 50px;
  gap:10px;
  align-items:center;
}

.lb-nav{
  height:56px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(17,24,39,.03);
  cursor:pointer;
  font-size:26px;
  font-weight:1000;
}
html.dark .lb-nav{ background: rgba(255,255,255,.04); }

.lb-image{
  height: 460px;
  border-radius: 18px;
  border:1px solid var(--border);
  background: linear-gradient(135deg,#e5e7eb,#cbd5e1);
  box-shadow: var(--shadow2);
}

.lb-thumbs{
  display:flex;
  gap:10px;
  overflow:auto;
  padding: 12px 6px 4px;
}
.lb-thumb{
  width:72px;
  height:54px;
  border-radius:12px;
  border:1px solid var(--border);
  cursor:pointer;
  flex: 0 0 auto;
}
.lb-thumb.active{
  outline: 3px solid rgba(44,123,229,.25);
}

/* ===== FOOTER ===== */
.footer{
  margin-top:16px;
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
}
.footer .dot{opacity:.6}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px){
  .hero{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: 1fr; }
}

@media (max-width: 820px){
  .container{ width:calc(100% - 32px); }
  .nav{ display:none; }
  .page-head{ flex-direction:column; align-items:flex-start; }
}
