/* ====== Base / Theme ====== */
:root{
  --bg: #0b0f17;
  --surface: rgba(255,255,255,0.06);
  --surface-2: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --faint: rgba(255,255,255,0.55);
  --border: rgba(255,255,255,0.14);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --accent: #7c5cff;
  --accent-2: #18c3ff;
  --ring: rgba(124,92,255,0.35);
  --radius: 18px;
  --maxw: 1080px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

[data-theme="light"]{
  --bg: #f7f8fb;
  --surface: rgba(0,0,0,0.04);
  --surface-2: rgba(0,0,0,0.06);
  --text: rgba(0,0,0,0.88);
  --muted: rgba(0,0,0,0.65);
  --faint: rgba(0,0,0,0.52);
  --border: rgba(0,0,0,0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.10);
  --ring: rgba(124,92,255,0.22);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 800px at 10% 10%, rgba(124,92,255,0.20), transparent 55%),
              radial-gradient(1000px 700px at 90% 0%, rgba(24,195,255,0.18), transparent 50%),
              var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link{
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus{ left: 10px; }

header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.10));
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] header{
  background: linear-gradient(to bottom, rgba(255,255,255,0.75), rgba(255,255,255,0.40));
}

.nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}
/* ===== Brand Logo Image ===== */
.logo-img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;      /* circular face */
  margin-right: 8px;
  border: 1px solid var(--border);
}

.brand{
  display:flex; align-items:center; gap:10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.logo{
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(124,92,255,0.35);
}
.navlinks{
  display:flex; gap: 16px; align-items:center;
  flex-wrap: wrap;
}
.navlinks a{
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--muted);
}
.navlinks a:hover{
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
}
.nav-actions{ display:flex; gap:10px; align-items:center; }


/* ===== Accent: Reference Button (Greenish-Blue) ===== */
.btn.reference {
  border: none;
  background: linear-gradient(135deg, #18c3a8, #18c3ff);
  color: white;
}

.btn.reference:hover {
  filter: brightness(1.05);
}


.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease;
}
.btn:hover{ background: var(--surface-2); text-decoration:none; }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}
.btn.primary:hover{ filter: brightness(1.03); }
.icon-btn{
  width: 42px; height: 42px;
  padding: 0;
  border-radius: 14px;
}

main{ padding: 34px 0 56px; }

.hero{
  display:grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 20px;
  align-items: stretch;
  margin-top: 14px;
}
@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
}

.card{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad{ padding: 22px; }

.kicker{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(124,92,255,0.12);
  border: 1px solid rgba(124,92,255,0.22);
  padding: 6px 10px;
  border-radius: 999px;
}
.title{
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  margin: 14px 0 10px;
  letter-spacing: -0.4px;
}
.subtitle{
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 16px;
}

.row{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pills{
  display:flex; flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.pill{
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  padding: 6px 10px;
  border-radius: 999px;
}

.hero-side{
  display:flex;
  flex-direction: column;
  gap: 14px;
}
.stat{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}
.stat strong{ font-size: 14px; }
.stat span{ color: var(--muted); font-size: 14px; }

.section{
  margin-top: 28px;
}
.section h2{
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: -0.2px;
}
.section p{ margin: 0; color: var(--muted); }

.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
}
.project{
  display:flex;
  flex-direction: column;
  overflow:hidden;
}
.project .thumb{
  height: 150px;
  background: linear-gradient(135deg, rgba(124,92,255,0.30), rgba(24,195,255,0.24));
  border-bottom: 1px solid var(--border);
  position: relative;
}
.project .thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
  opacity: 0.92;
}
.project .content{ padding: 16px; }
.project h3{
  margin: 0 0 6px;
  font-size: 16px;
}
.project p{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}
.meta{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items:center;
  margin-top: 10px;
}
.small{
  font-size: 12px;
  color: var(--faint);
}

hr.sep{
  border: none;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

.footer{
  padding: 22px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.footer .row{ justify-content: space-between; align-items:center; }

.input{
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
}
.input:focus{
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-color: transparent;
}

.badge{
  font-size: 12px;
  color: white;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.20);
  padding: 4px 10px;
  border-radius: 999px;
}

.breadcrumbs{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 12px;
}
.breadcrumbs a{ color: var(--muted); }
.breadcrumbs a:hover{ color: var(--text); text-decoration: none; }

.prose h1{ margin: 6px 0 10px; font-size: 28px; letter-spacing: -0.2px; }
.prose h2{ margin: 18px 0 8px; font-size: 18px; }
.prose p{ color: var(--muted); margin: 0 0 10px; }
.prose ul{ margin: 8px 0 12px 18px; color: var(--muted); }
.prose li{ margin: 6px 0; }

/* ===== Dropdown ===== */
.dropdown{ position: relative; display: inline-flex; }
.dropbtn{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;     /* wider */
  min-width: 140px;      /* <-- makes the tab longer */
  text-align: center;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
}

.dropbtn:hover{
  background: var(--surface);
  color: var(--text);
}
.dropbtn.projects-cta:hover{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.dropmenu{
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 340px;     /* <-- wider dropdown */
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  z-index: 100;
}
/* Make Projects button stand out */
.dropbtn.projects-cta{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  font-weight: 700;
}

.dropbtn.projects-cta:hover{
  filter: brightness(1.06);
}

.dropmenu a{
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
}
.dropmenu a:hover{
  background: var(--surface);
  color: var(--text);
}
.dropdown.open .dropmenu{ display: block; }

/* ===== Image Carousel ===== */
.carousel {
  position: relative;
  width: 100%;
  background: transparent; /* remove black box */
}


.carousel img,
.carousel video {
  width: 100%;
  height: auto;        /* key line */
  display: block;
  border-radius: 12px;
  background: none;
}

.carousel-media {
  display: block;   /* NOT flex */
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  border: none;
  color: white;
  font-size: 28px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 10px;
  z-index: 10;
}

.carousel-btn.left { left: 10px; }
.carousel-btn.right { right: 10px; }

.carousel-btn:hover {
  background: rgba(0,0,0,0.75);
}

.carousel-media{
  width: 100%;
  height: auto;           /* let the image define height */
  display: block;         /* no flex stretching */
  background: transparent; /* no black box */
}


.carousel-media img,
.carousel-media video {
  width: 100%;
  height: auto;
  max-height: 600px;        /* ← cap the size */
  object-fit: contain;     /* preserve aspect ratio */
  display: block;
}


/* Make citation line smaller in carousel captions */
.carousel-caption div:last-child {
  font-size: 12px;
  color: var(--faint);
  line-height: 1.4;
  margin-top: 6px;
}
.carousel-caption div:last-child {
  font-size: 12px;
  color: var(--faint);
  font-style: italic;
}
.carousel-caption {
  word-break: break-word;
}
.prose ul ul {
  margin-left: 18px;
}

.profile-pic{
  width: clamp(180px, 28vw, 520px);
  height: clamp(180px, 28vw, 520px);
  object-fit: cover;
  border-radius: 18px;
  margin: 18px 0 10px;
  border: 1px solid var(--border);
}
.hero .profile-pic{
  box-shadow: var(--shadow);
}


/* ===== Carousel background fix ===== */
.carousel,
.carousel-media,
.carousel img,
.carousel video {
  background: transparent !important;
}
.carousel img,
.carousel video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}
/* ===== Mobile / Tablet ===== */
@media (max-width: 900px) {
  .container { padding: 0 16px; }

  /* HERO: stack instead of side-by-side */
  .hero {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .hero-side { width: 100%; }

  /* NAV: allow wrapping */
  .nav {
    flex-wrap: wrap;
    gap: 10px;
  }
  .navlinks {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
  }

  /* Projects dropdown should not overflow */
  .dropmenu {
    min-width: min(92vw, 360px);
    left: 0;
  }

  /* Cards grid -> single column */
  .grid,
  .projects-grid,
  .cards {
    grid-template-columns: 1fr !important;
  }

  /* Buttons */
  .row { flex-wrap: wrap; }
  .btn { width: auto; }
}

/* ===== Small phones ===== */
@media (max-width: 520px) {
  .title { font-size: 34px; } /* optional: reduce big hero title */
  .subtitle { font-size: 15px; }

  /* Make pills wrap nicely */
  .pills { flex-wrap: wrap; }

  /* Make dropdown button fit */
  .dropbtn { min-width: 0; padding: 8px 12px; }

  /* Carousel buttons won’t push layout */
  .carousel-btn { width: 40px; height: 40px; }
}
img, video {
  max-width: 100%;
  height: auto;
}
@media (max-width: 720px){
  .nav{
    flex-wrap: wrap;
    align-items: center;
  }

  /* each row takes full width */
  .brand,
  .navlinks,
  .nav-actions{
    width: 100%;
  }

  .navlinks{
    justify-content: flex-start;
  }

  .nav-actions{
    justify-content: flex-start;
  }
}

@media (max-width: 520px){
  /* buttons become easier to tap */
  .nav-actions .btn{
    width: 100%;
  }
}
@media (max-width: 520px){
  .card.pad{ padding: 16px; }
  main{ padding: 18px 0 40px; }
}
