/* ===== Theme ===== */
:root{
  --bg:#0b0f15; --bg-2:#101620;
  --panel:#151c27; --panel-2:#1a2230;
  --line:#2a3548;
  --text:#f4f7fb; --muted:#c9d3df;
  --link:#80cfff; --link-2:#a8e4ff;
  --pill:#1d2736; --accent:#7cc7ff;
  --ring:0 0 0 6px rgb(124 199 255 / 20%);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;scroll-behavior:smooth}
.no-js .reveal{opacity:1!important;transform:none!important}

body{
  background: radial-gradient(1200px 700px at 50% -20%, #142030 0%, transparent 65%), var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
  font-size:16.5px; line-height:1.75; font-weight:400;
}

/* links */
a{color:var(--link);text-decoration:underline;text-underline-offset:2px}
a:hover{color:var(--link-2)}
a:focus-visible{outline:var(--ring);border-radius:8px;text-decoration:none}

/* ===== Sticky Nav ===== */
.site-nav{
  position:sticky; top:0; z-index:50;
  backdrop-filter:saturate(140%) blur(10px);
  background:rgba(15,20,28,.85);
  border-bottom:1px solid var(--line);
}
.nav-inner{
  margin:0 auto;max-width:1100px;
  padding:10px 20px;
  display:flex;align-items:center;justify-content:space-between;gap:16px
}
.brand{display:flex;align-items:center;gap:12px}
.brand-avatar{width:40px;height:40px;border-radius:12px;object-fit:cover}
.brand-name{font-weight:600;letter-spacing:.2px}
.brand-sub{color:var(--muted);font-size:14px}

/* pills row (desktop) – one line, centered, no scrollbar */
.links{
  display:flex; gap:12px; flex-wrap:nowrap; overflow:hidden; justify-content:center;
}
.links a{ white-space:nowrap; }

.pill{
  display:inline-block;padding:8px 14px;border-radius:999px;
  background:var(--pill);color:var(--text);
  text-decoration:none;font-weight:500;border:1px solid var(--line)
}
.pill:hover{outline:var(--ring)}
.links a.active{background:#243248}

/* Give anchored sections breathing room under the sticky header */
section[id] { scroll-margin-top: 88px; }
@media (max-width: 600px){ section[id] { scroll-margin-top: 96px; } }

/* ===== Sections ===== */
section{margin:0 auto;max-width:1100px;padding:72px 20px}
.h-section{font-size:clamp(28px,3vw,40px);margin:0 0 6px;font-weight:600}
.h-sub{color:var(--muted);margin:0 0 22px}

/* ===== Hero ===== */
.hero{
  margin-top:24px;border-radius:28px;padding:50px 24px 66px;
  background: radial-gradient(1200px 600px at 50% -20%, #1f2d42 0%, transparent 65%), var(--bg-2);
  border:1px solid var(--line); text-align:center;
}
.hero .avatar{width:96px;height:96px;border-radius:28px;object-fit:cover;display:block;margin:0 auto 16px;border:1px solid #2c3b52}
.hero h1{font-weight:600;font-size:clamp(30px,5vw,54px);margin:8px 0 0;letter-spacing:.2px}
.sublede{
  display:inline-block;margin-top:12px;padding:12px 18px;border-radius:14px;
  background:#1a2330;border:1px solid var(--line);color:var(--muted);
}

/* ===== Typed bullets ===== */
.typed-bullets{list-style:disc;padding-left:22px;margin:0}
.typed-bullets .bullet{margin:.6rem 0}
.bullet-label{font-weight:700;white-space:nowrap;overflow:hidden;display:inline;border-right:0;}
.bullet-label.typing{border-right:2px solid var(--accent);animation: caret 1s steps(1,end) infinite;}
.bullet-rest{display:inline;opacity:0;transition:opacity .35s ease .05s;margin-left:6px;}
@keyframes caret{0%,100%{border-right-color:transparent}50%{border-right-color:var(--accent)}}

/* ===== Tech cards ===== */
.tech-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.tech-card{background:linear-gradient(180deg,#151c27,#0f141c);border:1px solid var(--line);border-radius:16px;padding:16px}
.tech-card h3{margin:0 0 6px;font-weight:600}
.pill-wrap{display:flex;flex-wrap:wrap;gap:8px}
.pill{padding:6px 10px;border-radius:999px;background:rgba(125,211,252,.12);border:1px solid rgba(125,211,252,.25);font-size:.88rem}

/* ===== Timeline ===== */
.timeline{position:relative;margin-left:6px; padding-right:6px}
.timeline::before{content:"";position:absolute;left:10px;top:0;bottom:0;width:2px;background:#2c3b52}
.node{
  position:relative;margin:22px 0 22px 36px;padding:14px 16px;border-radius:14px;
  background:#1a2330;border:1px solid var(--line);overflow-wrap:anywhere;
}
.node{max-width:100%}
.node::before{content:"";position:absolute;left:-30px;top:16px;width:12px;height:12px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 6px rgb(124 199 255 / 20%)}
.node .title{font-weight:600;margin:0 0 4px}
.meta{color:var(--muted);font-size:14px;margin-bottom:6px}

/* ===== Projects (cards) ===== */
.proj-grid{display:grid;gap:16px;grid-template-columns:repeat(3,minmax(0,1fr))}
.proj-card{
  position:relative;display:flex;gap:14px;align-items:flex-start;
  padding:16px;border-radius:16px;background:#1a2330;border:1px solid var(--line);
  text-decoration:none;color:var(--text);transition:outline .2s ease,background .2s ease
}
.proj-card:hover{outline:var(--ring)}
.proj-icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:rgba(0,0,0,.25);border:1px solid var(--line);font-size:24px}
.proj-meta{position:relative;z-index:1}
.proj-title{margin:2px 0 4px;font-weight:600;font-size:18px}
.proj-desc{margin:0;opacity:.95}

/* Hover image preview */
.hover-preview{
  position:fixed;left:24px;top:24px;width:min(420px,40vw);height:230px;
  border-radius:16px;overflow:hidden;border:1px solid #2a3548;background:#101820;
  box-shadow:0 20px 50px rgba(0,0,0,.4);
  opacity:0;transform:translateY(8px);transition:opacity .25s ease,transform .25s ease,left .05s linear,top .05s linear;
  pointer-events:none;z-index:60
}
.hover-preview.in{opacity:1;transform:translateY(0)}
.hover-preview img{width:100%;height:100%;object-fit:cover;display:block}

/* ===== Buttons (CTA links restored) ===== */
.btn-cta{
  display:inline-block;padding:10px 16px;border-radius:12px;
  background:#2a7df3;color:#fff;text-decoration:none;font-weight:700;border:1px solid #2a7df3
}
.btn-cta:hover{filter:brightness(1.08)}
.btn-ghost{
  display:inline-block;padding:10px 16px;border-radius:12px;
  background:transparent;color:var(--text);text-decoration:none;font-weight:700;border:1px solid var(--line)
}
.btn-ghost:hover{background:#16202c}

/* ===== Gallery (uniform tiles) ===== */
.gallery{
  display:grid;
  gap:18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items:stretch;
}
.gallery figure{ margin:0; }

.tile{
  background: linear-gradient(180deg,#1a2330,#0f141c);
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
}

/* Default tile is a 4:3 box */
.tile .overflow-container{
  width:100%;
  aspect-ratio: 4 / 3;
  overflow:hidden;
  border-radius:12px;
}

/* Wide feature tile (e.g., DEI) */
.tile--wide .overflow-container{ aspect-ratio: 16 / 9; }
@media (min-width: 900px){ .tile--wide{ grid-column: span 2; } }

/* Images fill tiles by default */
.tile img{
  display:block;
  width:100%;
  height:100%;
  object-fit: cover; /* fills uniformly */
}

/* Use this class on IMG when you need the whole image (no crop) */
.tile img.fit-contain{
  object-fit: contain;
  background:#0f141c; /* pleasant backdrop for transparent PNGs */
}

/* ===== Contact tiles ===== */
.cta-grid{
  margin-top:14px; display:grid; gap:14px;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.cta-tile{
  display:grid; place-content:center; min-height:120px; border-radius:16px;
  text-decoration:none; color:var(--text);
  background:linear-gradient(180deg,#1a2330,#0f141c);
  border:1px solid var(--line);
  box-shadow:0 1px 0 rgba(255,255,255,.04) inset;
  transition:transform .12s ease, box-shadow .12s ease, outline .12s ease, background .2s ease;
}
.cta-tile:hover{ outline:var(--ring); transform:translateY(-1px) }
.cta-title{ font-weight:700; font-size:1.05rem; letter-spacing:.2px }
.cta-sub{ color:var(--muted); font-size:.92rem; margin-top:2px }

/* ===== Footer ===== */
.site-footer{text-align:center;color:var(--muted);padding:24px;border-top:1px solid var(--line);margin-top:40px}

/* ===== Reveal ===== */
.reveal{opacity:0;transform:translateY(16px);transition:opacity .6s ease,transform .6s ease}
.reveal.in{opacity:1;transform:translateY(0)}

/* ===== Mobile menu (drawer) ===== */
.menu-btn{
  display:none; align-items:center;justify-content:center;
  width:42px;height:36px;border-radius:10px;border:1px solid var(--line);
  background:var(--pill);color:var(--text); font-size:18px;cursor:pointer;
}
.mobile-drawer{
  display:none;gap:8px;flex-wrap:wrap;
  padding:10px 16px 14px;
  background:rgba(15,20,28,.98);
  border-top:1px solid var(--line); border-bottom:1px solid var(--line);
}
.mobile-drawer.open{display:flex}
.mobile-drawer .pill{text-decoration:none}

/* ===== Responsive ===== */
@media (max-width: 900px){
  .tech-grid,.proj-grid,.gallery{grid-template-columns:1fr}
  .hover-preview{display:none}
  .cta-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:720px){
  .links{display:none}
  .menu-btn{display:flex}
}
@media (max-width:600px){
  .hero h1{font-size:clamp(28px,8vw,38px)}
  .h-section{font-size:clamp(22px,5.5vw,30px)}
  .node{padding:16px}
  .timeline .node ul{padding-left:18px}
  .cta-grid{ grid-template-columns:1fr; }
  .cta-tile{ min-height:100px; }
}

/* --- Gallery: per-image fit modes --- */
.tile .fit-contain,
.tile .fit-cover {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #0f141c; /* same panel bg to hide any tiny gaps */
}

.tile .fit-contain img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* show 100% of the image, letterbox if needed */
  display: block;
}

.tile .fit-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* fill tile, crop small slivers if necessary */
  display: block;
}