/* ======================================
   THEME & RESETS
   ====================================== */

/* Timeline Styles */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  width: calc(50% - 40px);
}

.timeline-item.left {
  left: 0;
  margin-left: 0;
  padding-right: 2rem;
}

.timeline-item.right {
  margin-left: 50%;
  padding-left: 2rem;
}

.timeline-item::after {
  content: '';
  position: absolute;
  top: 20px;
  right: -28px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-1);
  box-shadow: 0 0 10px rgba(255,106,61,0.2);
}

.timeline-item.right::after {
  left: -28px;
  right: auto;
}

.timeline-date {
  color: var(--gold-1);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-content {
  background: var(--glass);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1);
}

.timeline-content h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.timeline-content p {
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.timeline-content ul {
  list-style: none;
  padding-left: 0;
}

.timeline-content li {
  color: var(--text);
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.timeline-content li:before {
  content: "•";
  color: var(--gold-2);
  position: absolute;
  left: 0;
}

.timeline-header {
  background: linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 3rem 0 2rem;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.skill-category {
  background: var(--glass);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1);
}

.skill-category h3 {
  color: var(--gold-1);
  margin-bottom: 1rem;
}

.skill-category ul {
  list-style: none;
  padding: 0;
}

.skill-category li {
  color: var(--text);
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.skill-category li:before {
  content: "→";
  color: var(--gold-2);
  position: absolute;
  left: 0;
}

/* Resume Button */
.resume-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(90deg,var(--gold-1),var(--gold-2));
  color: var(--bg-1);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resume-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}
@media (max-width:768px){
  .cta-buttons{ flex-direction:column; align-items:stretch }
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--gold-1);
  color: var(--gold-1);
}

#hyperspeed-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--bg-1);
}
:root{
  /* "Planckian Night" -- a stylized blackbody/color-temperature curve
     (deep ember-violet -> ember-orange -> white-hot), the same color
     science behind thermal-contour CFD plots. See script.js's
     drawStars()/planckianColor() for the animated version of this curve. */
  --bg-1:#060912;
  --bg-2:#10142c;
  --bg-3:#262a4d;
  --text:#ece7df;
  --text-dim:#b7bdd6;
  --ink:#333;
  --link-hover:#5bc0be;
  --brand:#0077ff;
  --gold-1:#ff6a3d;
  --gold-2:#ffe9a8;
  --glass:rgba(255,255,255,.10);
  --glass-strong:rgba(255,255,255,.18);
  --nav-glass:rgba(255,255,255,.85);
  --shadow-1:0 8px 20px rgba(0,0,0,.18);
  --shadow-2:0 12px 30px rgba(0,0,0,.28);
  --radius:14px;
  --radius-lg:22px;
  --pad:clamp(16px,2.2vw,28px);
  --font-mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Safari-specific */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Per-site accent: engineering keeps the default warm ember-orange;
   academic sits at a cooler point on the same Planckian curve -- one
   quiet variable difference, same everything else. */
body[data-site="academic"]{
  --gold-1:#b23a6e;
}

*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  font-family:'Poppins',sans-serif;
  line-height:1.6;
  color:var(--ink);
  background:linear-gradient(160deg,var(--bg-1),var(--bg-2),var(--bg-3));
  overflow-x:hidden; position:relative;
}

/* ======================================
   GLOBAL UTILS
   ====================================== */
.container{width:min(1100px,92%); margin-inline:auto}

/* Safari fixes for glass effects */
.glass-card,
[class*="glass"],
[style*="backdrop-filter"] {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transform: translateZ(0);
  will-change: transform;
}
h1,h2,h3,h4{color:#fff}
.gradient-text{
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip:text;
  background-clip: text;
  -webkit-text-fill-color:transparent;
  color: var(--gold-1); /* Fallback for Safari */
}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:.5rem; padding:.85rem 1.6rem; border-radius:999px;
  text-decoration:none; font-weight:600; color:#fff;
  border:1px solid rgba(255,255,255,.6);
  background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.06));
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  transition:transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.btn:hover,.btn:focus{
  transform:translateY(-2px);
  background:#fff; color:#000; box-shadow:var(--shadow-2);
}

/* subtle focus ring */
:focus-visible{outline:2px solid var(--gold-1); outline-offset:3px; border-radius:6px}

/* ======================================
   NAVBAR
   ====================================== */
.navbar{
  position:sticky; top:0; z-index:1000;
  display:flex; justify-content:space-between; align-items:center;
  padding:1rem 5%; width:100%;
  background:var(--nav-glass); 
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  box-shadow:0 4px 20px rgba(0,0,0,.05);
  transition:background .3s ease, box-shadow .3s ease;
  transform: translateZ(0); /* Force GPU acceleration in Safari */
}
.logo{
  font-family:'Rajdhani',sans-serif; font-size:1.6rem; font-weight:700;
  color:var(--brand); letter-spacing:1px; user-select:none;
  transition:transform .2s ease;
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:12px;
}
.logo:hover{
  transform:translateY(-1px);
}
.logo-thumbnail{
  width:calc(1.6rem * 1.3);
  height:calc(1.6rem * 1.3);
  border-radius:50%;
  object-fit:cover;
  border:2px solid rgba(255,255,255,0.1);
  transition:border-color 0.2s ease, transform 0.2s ease;
  margin-right:-4px; /* slight adjustment for visual balance */
}
.logo:hover .logo-thumbnail{
  border-color:var(--gold-1);
  transform:scale(1.05);
}
.nav-links{list-style:none; display:flex; gap:2rem}
.nav-links a{
  text-decoration:none; font-family:'Inter',sans-serif; font-weight:500; color:#333;
  transition:color .25s, transform .2s;
}
.nav-links a:hover,.nav-links a:focus{color:var(--brand); transform:translateY(-2px)}
.nav-links a[aria-current="page"]{color:var(--brand); font-weight:600}
.nav-links a.site-switch{
  padding:.35rem .9rem; border-radius:999px;
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  color:var(--bg-1) !important; font-weight:600;
}
.nav-links a.site-switch:hover{transform:translateY(-2px); opacity:.9}

.hamburger{display:none; flex-direction:column; gap:5px; cursor:pointer}
.hamburger span{width:25px;height:3px;background:#333;border-radius:5px;display:block}

@media (max-width: 900px){
  /* Switches to the hamburger menu earlier than the general 768px mobile
     breakpoint used elsewhere, because the horizontal nav (5 links + the
     Engineering/Academic Site pill) starts wrapping mid-word around ~810px --
     this keeps it a single clean row until it collapses to the dropdown. */
  .nav-links{
    display:none; flex-direction:column; position:fixed; top:72px; right:5%;
    background:rgba(255,255,255,.97); padding:1rem 1.5rem; border-radius:12px;
    box-shadow:0 8px 25px rgba(0,0,0,.15); z-index:999; max-width:90%;
  }
  .nav-links.active{display:flex}
  .nav-links a{ padding:.6rem 0; display:block; }
  .hamburger{display:flex}
}

/* ======================================
   CANVAS / BACKGROUND
   ====================================== */
#background-animation{position:fixed; inset:0; z-index:-2;
  background:linear-gradient(160deg,var(--bg-1),var(--bg-2),var(--bg-3))}
#hyperspeed-bg{position:fixed; inset:0; z-index:-1}

/* ======================================
   HERO (index only)
   ====================================== */
#hero{
  position:relative; height:100vh; display:flex; align-items:center; justify-content:center;
  overflow:hidden; animation:fadeInUp .8s ease-out forwards;
}
@supports (height: 100dvh){
  /* dvh accounts for mobile browser toolbars showing/hiding (Safari/Chrome on
     phones and tablets), so the hero doesn't jump or clip as the address bar
     collapses -- 100vh above still applies as the fallback everywhere else */
  #hero{ height:100dvh; }
}
.hero-overlay{position:relative; z-index:2; text-align:center; color:#fff; padding:0 2rem}
.hero-text h1{
  font-family:'Rajdhani',sans-serif; font-size:clamp(2.2rem,5.2vw,3.8rem); font-weight:700; margin-bottom:1rem;
}
.hero-text h1 span{
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip:text;
  background-clip: text;
  -webkit-text-fill-color:transparent;
}
.hero-text p{font-family:'Inter',sans-serif; font-weight:500; font-size:clamp(1.05rem,2.2vw,1.4rem); margin-bottom:.75rem; text-shadow:0 1px 2px rgba(0,0,0,.5)}
.hero-buttons{display:flex; gap:1rem; justify-content:center}
@media (max-width:768px){.hero-buttons{flex-direction:column; gap:.8rem}}

/* Golden resume box in hero */
.resume-gold-box {
  position: fixed;
  bottom: 120px; /* Adjust this value to position above footer */
  left: 0;
  right: 0;
  width: 100%;
  padding: 2rem 0;
  background: linear-gradient(
    to right,
    rgba(255, 106, 61, 0.1),
    rgba(255, 233, 168, 0.15)
  );
  border-top: 1px solid rgba(255, 106, 61, 0.3);
  border-bottom: 1px solid rgba(255, 106, 61, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
}

.gold-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resume-content {
  flex: 1;
}

.resume-buttons {
  display: flex;
  gap: 1rem;
}

@media (max-width: 768px) {
  .gold-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  /* Below the desktop breakpoint, take the box out of fixed/viewport-anchored
     positioning entirely so it can never collide with .hero-buttons or the
     .display-controls gear widget -- it just flows in after the hero content. */
  #hero{
    height:auto;
    align-items:flex-start;
    padding-top:calc(72px + 1rem);
    padding-bottom:2rem;
  }
  .resume-gold-box {
    position: static;
    width: auto;
    margin-top: 1.5rem; /* extra clearance from the fixed gear widget is added at runtime, see script.js */
    padding: 1.25rem 0;
  }
}
.resume-gold-box h3{
  margin:0; font-size:1.05rem; font-weight:700;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-1); /* fallback for older browsers */
  text-shadow: 0 2px 8px rgba(255,106,61,0.08);
}

/* Golden button styles for resume box */
.resume-gold-box .btn-primary{
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  color: var(--bg-1);
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  font-weight:700;
  box-shadow: 0 8px 24px rgba(255,106,61,0.08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.resume-gold-box .btn-primary:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(255,106,61,0.14);
}

.resume-gold-box .btn-secondary{
  background: transparent;
  color: var(--gold-1);
  border: 2px solid rgba(255,106,61,0.23);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight:600;
  transition: background .18s ease, transform .18s ease;
}
.resume-gold-box .btn-secondary:hover{
  background: rgba(255,106,61,0.06);
  transform: translateY(-2px);
}

/* ensure paragraph text inside the gold box is readable on the warm gradient */
.resume-gold-box p{
  color: var(--text);
  opacity: 0.95;
  margin: 0.25rem 0 0;
}

/* ======================================
   ABOUT — intro banner
   ====================================== */
.intro-about{padding:clamp(48px,7vw,72px) 5% 0; text-align:center; animation:fadeInUp .8s ease-out forwards}
.intro-content{
  width:min(980px,92%); margin-inline:auto; display:flex; gap:clamp(16px,3vw,28px);
  align-items:center; justify-content:center; background:var(--glass); padding:var(--pad);
  border-radius:var(--radius); box-shadow:var(--shadow-1); border:1px solid rgba(255,255,255,.14);
}
.intro-image{
  width:clamp(120px,22vw,190px); height:clamp(120px,22vw,190px); object-fit:cover;
  border-radius:28%; box-shadow:0 10px 24px rgba(0,0,0,.35); transform:translateZ(0);
  transition:transform .35s ease, box-shadow .35s ease, filter .35s ease;
}
.intro-image:hover{transform:scale(1.03) rotate(-1deg); filter:saturate(1.06); box-shadow:var(--shadow-2)}
.intro-text h1{font-family:'Rajdhani',sans-serif; font-size:clamp(1.8rem,4.2vw,2.6rem); margin-bottom:.35rem}
.intro-text h1{
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip:text;
  background-clip: text;
  -webkit-text-fill-color:transparent;
}
.intro-text p{font-family:'Inter',sans-serif; color:var(--text); font-size:1.05rem; text-shadow:0 1px 2px rgba(0,0,0,.5)}

@media (max-width:820px){
  .intro-content{flex-direction:column; text-align:center}
}

/* ======================================
   ABOUT — main story text
   ====================================== */
section{scroll-margin-top:84px}
#about{
  padding:clamp(28px,5vw,42px) 5%;
  display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:3rem;
  animation:fadeInUp .8s ease-out .2s both;
}
.about-text{flex:1; min-width:300px; width:min(900px,92%); margin-inline:auto}
.about-text h2{
  font-family:'Rajdhani',sans-serif; font-size:clamp(1.8rem,3.8vw,2.5rem); margin-bottom:.8rem;
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip:text;
  background-clip: text;
  -webkit-text-fill-color:transparent;
}
.about-text p{
  font-family:'Inter',sans-serif; color:var(--text); font-size:1.05rem; line-height:1.75;
  margin-bottom:1rem; text-shadow:0 1px 2px rgba(0,0,0,.45);
}
.about-text .btn{margin-top:.4rem}

/* ======================================
   EDUCATION — ROAD TIMELINE
   ====================================== */
.education-timeline-wrap{
  padding:10px 5% 48px;
  position:relative;
  z-index:1;
}
.education-timeline{
  position:relative; 
  width:min(980px,92%); 
  margin:0 auto; 
  padding:clamp(10px,2vw,16px) 0;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.education-timeline::before{
  /* the road */
  content:''; 
  position:absolute; 
  left:50%; 
  top:0; 
  transform:translateX(-50%);
  width:6px; 
  height:100%;
  background:linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
  border-radius:6px; 
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);
  z-index:-1;
}
.timeline-item{
  position:relative; 
  width:50%; 
  padding:16px clamp(16px,3.2vw,24px);
  background:var(--glass); 
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius); 
  box-shadow:var(--shadow-1);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  transition:transform .25s ease, box-shadow .25s ease, background .25s ease;
  margin:clamp(18px,2.4vw,26px) 0;
}
.timeline-item:hover{
  transform:translateY(-3px); 
  box-shadow:var(--shadow-2); 
  background:var(--glass-strong)
}
.timeline-item h4{
  font-family:'Rajdhani',sans-serif; 
  color:#fff; 
  font-size:1.2rem; 
  margin-bottom:.25rem
}
.timeline-item span{
  display:block;
  color:#c0c0c0;
  font-size:.95rem;
  margin-bottom:.35rem;
  font-family:var(--font-mono);
  letter-spacing:.02em;
}
.timeline-item p{
  font-family:'Inter',sans-serif; 
  color:var(--text-dim); 
  font-size:.97rem; 
  line-height:1.55
}

.timeline-item::after{
  /* milestone dot */
  content:''; 
  position:absolute; 
  top:20px; 
  width:16px; 
  height:16px; 
  border-radius:50%;
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  box-shadow:0 0 0 4px rgba(255,106,61,.18), 0 6px 14px rgba(0,0,0,.35);
  z-index:2;
}

/* left / right alternating */
.timeline-item.left{
  align-self:flex-start;
  padding-right:calc(clamp(16px,3vw,24px)+10px);
  margin-right:auto;
}
.timeline-item.left::after{right:-8px}
.timeline-item.right{
  align-self:flex-end;
  padding-left:calc(clamp(16px,3vw,24px)+10px);
  margin-left:auto;
}
.timeline-item.right::after{left:-8px}

@media (max-width:900px){
  .education-timeline::before{
    left:20px; 
    transform:none;
  }
  .timeline-item{
    width:calc(100% - 40px);
    margin:1rem 0 1rem 40px !important;
  }
  .timeline-item.left,
  .timeline-item.right{
    align-self:flex-start;
    padding:16px;
  }
  .timeline-item::after{
    left:-28px;
    right:auto;
  }
  .timeline-item.left::after,
  .timeline-item.right::after{
    left:-28px;
  }
}

/* ======================================
   SKILLS
   ====================================== */
.skills-section{padding:24px 5% 56px; text-align:center; animation:fadeInUp .8s ease-out .35s both}
.skills-section h2{
  font-family:'Rajdhani',sans-serif; font-size:2rem; margin-bottom:1rem;
}
.skills-section h2{background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip:text;
  background-clip: text;
  -webkit-text-fill-color:transparent}

.skills-list{
  list-style:none; display:flex; flex-wrap:wrap; justify-content:center; gap:.8rem; margin-bottom:1.2rem;
}
.skill-tag{
  background:var(--glass); color:var(--text); border:1px solid rgba(255,255,255,.14);
  padding:.5rem 1rem; border-radius:999px; font-size:.92rem; font-family:'Inter',sans-serif;
  transition:background .25s ease, transform .2s ease, box-shadow .25s ease;
}
.skill-tag:hover{background:var(--glass-strong); transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,.25)}

.skills-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1rem; margin-top:.5rem;
}
.skills-grid > div{
  background:var(--glass); border:1px solid rgba(255,255,255,.14); border-radius:var(--radius);
  padding:16px; text-align:left; color:var(--text); box-shadow:var(--shadow-1);
  transition:transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.skills-grid > div:hover{transform:translateY(-3px); box-shadow:var(--shadow-2); background:var(--glass-strong)}
.skills-grid h4{font-family:'Rajdhani',sans-serif; color:var(--gold-1); margin-bottom:.4rem}
.skills-grid ul{list-style:none}
.skills-grid li{font-family:'Inter',sans-serif; color:var(--text); font-size:.98rem; line-height:1.45}

/* Detailed experience blocks (collapsible) */
.detailed-experience details.experience-block{
  background:var(--glass-strong);
  border:1px solid rgba(255,255,255,0.18);
  border-radius:12px;
  padding:12px 16px;
  margin:0.75rem 0;
  box-shadow:var(--shadow-1);
}
.detailed-experience details.experience-block summary{
  list-style:none; cursor:pointer; display:flex; flex-direction:column; gap:6px; outline:none;
}
.detailed-experience .muted{color:var(--text-dim); font-size:.95rem}
.detailed-experience .exp-body{margin-top:0.6rem}
.detailed-experience summary .muted{ font-family:var(--font-mono); letter-spacing:.02em; }
.detailed-experience details.experience-block[open]{background:var(--glass-strong)}

/* make summary content more visible */
.detailed-experience summary strong{font-size:1.02rem; color:var(--text)}
.detailed-experience summary{position:relative}

/* arrow indicator */
.detailed-experience summary::after{
  content: '\25B6'; /* right-pointing triangle */
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%) rotate(0deg);
  color:var(--gold-2);
  transition:transform .25s ease, color .2s ease;
}
.detailed-experience details[open] > summary::after{
  transform:translateY(-50%) rotate(90deg);
  color:var(--gold-1);
}

/* gold-gradient title inside summary */
.detailed-experience summary strong{
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip:text;
  background-clip: text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  color:var(--gold-1);
}

.detailed-experience .muted{color:var(--text-dim); font-size:.95rem}
.detailed-experience .exp-body ul li{color:var(--text); margin:0.45rem 0}

.detailed-experience .exp-body ul li{color:var(--text)}


/* ======================================
   PROJECTS (shared)
   ====================================== */
#projects{padding:2rem 10%; color:#fff}
.projects-intro{
  font-family:'Rajdhani',sans-serif; font-size:clamp(2rem,5vw,3rem); text-align:center; margin-bottom:.5rem;
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip:text;
  background-clip: text;
  -webkit-text-fill-color:transparent;
  animation:fadeInUp .8s ease-out forwards;
}
.projects-subtitle{
  font-family:'Inter',sans-serif; font-size:1.05rem; text-align:center; color:var(--text);
  margin-bottom:1.8rem; text-shadow:0 1px 2px rgba(0,0,0,.5);
  animation:fadeInUp .8s ease-out .15s both;
}
.project-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:1.2rem;
  animation:fadeInUp .8s ease-out .3s both;
}
.project-card{
  background:var(--glass); padding:var(--pad); border-radius:var(--radius);
  text-align:center; transition:transform .25s, box-shadow .25s, background .25s;
  border:1px solid rgba(255,255,255,.14);
}
.project-card:hover,.project-card:focus-within{transform:translateY(-5px); box-shadow:0 10px 26px rgba(255,106,61,.28)}
.project-card img{width:100%; height:160px; object-fit:cover; border-radius:10px; margin-bottom:.9rem}
.project-card h3{font-family:'Rajdhani',sans-serif; font-size:1.35rem; margin-bottom:.4rem; color:#fff}
.project-card p{font-family:'Inter',sans-serif; font-size:.95rem; color:var(--text)}

/* ======================================
   FOOTER
   ====================================== */
footer{
  padding:2rem 5%; background:rgba(0,0,0,.7); color:white;
  display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:2rem; text-align:left;
}
.footer-section h3{
  font-family:'Rajdhani',sans-serif; font-size:1.25rem; margin-bottom:.9rem;
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  -webkit-background-clip:text;
  background-clip: text;
  -webkit-text-fill-color:transparent;
}
.footer-section p,.footer-section a{
  font-family:'Inter',sans-serif; font-size:.92rem; color:var(--text); text-decoration:none; margin-bottom:.45rem; display:block;
}
.footer-section a:hover,.footer-section a:focus{color:var(--gold-1); text-decoration:underline}
.footer-bottom{
  grid-column:1/-1; text-align:center; padding-top:1rem; border-top:1px solid rgba(255,255,255,.1); font-size:.85rem;
}
@media (max-width:768px){footer{grid-template-columns:1fr; text-align:center}}

/* ======================================
   ANIMATIONS
   ====================================== */
@keyframes fadeInUp{
  0%{opacity:0; transform:translateY(40px)}
  100%{opacity:1}
}

/* Fix for bullet overflow inside detailed experience boxes */
.detailed-experience .exp-body ul{
  list-style-position: inside; /* keep bullets inside the box */
  padding-left: 1rem;
  margin: 0.4rem 0;
}
.detailed-experience .exp-body ul li{
  color:var(--text);
  margin:0.45rem 0;
  word-break:break-word; /* prevent long words from overflowing */
  overflow-wrap:anywhere;
}

/* Display controls (bottom-right) */
.display-controls{
  position:fixed; right:24px; bottom:24px; z-index:1100; font-family:Inter, sans-serif;
  filter:drop-shadow(0 4px 12px rgba(0,0,0,.15));
}
.display-controls .dc-toggle{
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  color:var(--bg-1);
  border:none;
  min-width:200px;
  max-width:70vw;
  height:46px;
  padding:0 18px;
  border-radius:14px;
  display:inline-flex; align-items:center; justify-content:flex-start;
  gap:10px;
  cursor:pointer;
  font-size:0.95rem;
  white-space:nowrap;
  overflow:visible;
  transition:transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  transform-origin:center;
}
.display-controls .dc-toggle:hover{
  transform:scale(1.1) rotate(180deg);
}
.dc-always-visible{
  font-size:0.92rem;
  color:var(--bg-1);
  opacity:0.95;
  font-weight:600;
  margin-left:8px;
  display:inline-block;
  line-height:1;
}
.display-controls .dc-panel{
  position:absolute;
  right:0;
  bottom:calc(100% + 12px);
  background:linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 100%);
  color:var(--text);
  border-radius:16px;
  padding:16px;
  width:240px;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border:1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.3), 0 4px 8px -4px rgba(0,0,0,0.1), inset 0 -1px 1px rgba(255,255,255,0.1);
  transform-origin:bottom right;
  animation:panelSlideIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width:420px){
  .display-controls .dc-toggle{
    min-width:120px; /* keep a compact size on very small screens */
    padding:0 10px;
    font-size:0.85rem;
  }
}

.display-controls .dc-row{
  display:flex;
  align-items:center;
  gap:16px;
  justify-content:space-between;
  margin-bottom:16px;
  padding:8px;
  border-radius:12px;
  transition:all 0.2s ease;
}

.display-controls .dc-row:hover{
  background:rgba(255,255,255,0.03);
  transform:translateX(2px);
}

.display-controls .dc-reset{
  appearance:none;
  -webkit-appearance:none;
  background:transparent;
  border:1px solid rgba(255,255,255,0.06);
  color:var(--gold-2);
  padding:0.35rem 0.6rem;
  border-radius:0.45rem;
  font-size:0.9rem;
  cursor:pointer;
  transition:background 140ms ease, transform 120ms ease;
}
.display-controls .dc-reset:hover{
  background:rgba(255,255,255,0.03);
  transform:translateY(-1px);
}
.display-controls .dc-reset:active{
  transform:translateY(0);
}

.display-controls .dc-control{
  flex:1;
}

.display-controls label{
  font-size:0.92rem;
  color:var(--text);
  font-weight:500;
  text-shadow:0 1px 2px rgba(0,0,0,0.1);
  display:block;
}

.display-controls .dc-tooltip{
  display:block;
  font-size:0.75rem;
  color:var(--text-dim);
  margin-top:2px;
  opacity:0;
  transform:translateY(-4px);
  transition:all 0.2s ease;
}

.display-controls .dc-row:hover .dc-tooltip{
  opacity:1;
  transform:translateY(0);
}

.display-controls input[type=range]{
  flex:1.2;
  height:4px;
  appearance:none;
  -webkit-appearance:none;
  background:linear-gradient(to right, 
    rgba(255,106,61,0.5) 0%,
    rgba(255,106,61,0.2) 100%);
  border-radius:2px;
  outline:none;
  position:relative;
}

.display-controls input[type=range]::before{
  content:'';
  position:absolute;
  left:0; right:0; top:-4px; bottom:-4px;
  background:rgba(255,255,255,0.05);
  border-radius:6px;
  opacity:0;
  transition:opacity 0.2s ease;
}

.display-controls input[type=range]:hover::before{
  opacity:1;
}

.display-controls input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:18px;
  height:18px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--gold-1), var(--gold-2));
  cursor:pointer;
  border:2px solid rgba(255,255,255,0.9);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.2),
    0 0 0 2px rgba(255,106,61,0.1);
  transition:all 0.2s ease;
}

.display-controls input[type=range]::-moz-range-thumb{
  width:18px;
  height:18px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--gold-1), var(--gold-2));
  cursor:pointer;
  border:2px solid rgba(255,255,255,0.9);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.2),
    0 0 0 2px rgba(255,106,61,0.1);
  transition:all 0.2s ease;
}

.display-controls input[type=range]::-moz-range-track{
  background:transparent;
}

.display-controls .dc-theme{
  background:linear-gradient(to bottom,
    rgba(255,255,255,0.12),
    rgba(255,255,255,0.06));
  border:1px solid rgba(255,255,255,0.15);
  color:var(--text);
  padding:8px 16px;
  border-radius:10px;
  font-size:0.92rem;
  font-weight:500;
  cursor:pointer;
  transition:all 0.2s ease;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.1),
    inset 0 1px rgba(255,255,255,0.1);
}

.display-controls .dc-theme:hover{
  background:rgba(255,255,255,0.15);
  transform:translateY(-1px);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.15),
    inset 0 1px rgba(255,255,255,0.15);
}

.display-controls .dc-note{
  font-size:0.85rem;
  line-height:1.5;
  color:var(--text-dim);
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,0.08);
  text-shadow:0 1px 2px rgba(0,0,0,0.1);
}

@keyframes panelSlideIn{
  from{
    opacity:0;
    transform:translate(10px, 10px) scale(0.95);
  }
  to{
    opacity:1;
    transform:translate(0, 0) scale(1);
  }
}

@keyframes spin{
  from{ transform:rotate(0deg); }
  to{ transform:rotate(360deg); }
}

/* Fix for Safari compatibility */
.display-controls input[type=range]{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
}

/* Light theme overrides (used by JS toggle) */
body.light-theme{
  /* Creamy vanilla / warm light theme */
  --bg-1:#fff9f0; /* warm cream */
  --bg-2:#fff4e6;
  --bg-3:#fff0dc;
  --text:#111111; --text-dim:#4a4a4a; --nav-glass:rgba(255,255,255,0.92);
  --glass:rgba(0,0,0,0.06); --glass-strong:rgba(0,0,0,0.08);
}

/* make headings readable in light mode (override default white) */
body.light-theme h1, body.light-theme h2, body.light-theme h3, body.light-theme h4{
  color:var(--text) !important;
}

/* Other white-on-dark elements that need readable colors in light mode */
body.light-theme .hero-overlay,
body.light-theme #projects,
body.light-theme .project-card h3,
body.light-theme .btn,
body.light-theme .intro-text h1,
body.light-theme h1 span{
  color:var(--text) !important;
}

/* larger gear icon relative to the toggle font size */
.display-controls .dc-toggle > span{
  font-size: calc(0.95rem * 1.6);
  line-height:1;
  display:inline-block;
}
.display-controls .dc-toggle > span svg{ width:1.35em; height:1.35em; display:block; fill:currentColor; }
.dc-icon{ width:14px; height:14px; vertical-align:-2px; margin-right:4px; fill:currentColor; }

/* small responsive tweak */
@media (max-width:520px){
  .display-controls .dc-panel{width:190px}
  .display-controls input[type=range]{width:90px}
}

/* Image lightbox/modal */
.img-modal{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,0.6); z-index:1200; padding:24px;
}
.img-modal[hidden]{display:none}
.img-modal-content{
  position:relative; max-width:min(95%,1200px); width:auto; background:transparent; border-radius:10px;
  box-shadow:0 20px 60px rgba(0,0,0,0.6); overflow:hidden;
  max-height:90vh; overflow-y:auto;
}
.img-modal-content img{display:block; width:100%; height:auto; border-radius:8px; max-height:80vh; object-fit:contain}
/* On short/landscape-phone viewports, keep the modal clear of the sticky navbar */
@media (max-height:500px){
  .img-modal{ align-items:flex-start; padding-top:84px; overflow-y:auto; }
  .img-modal-content{ max-height:calc(100vh - 108px); }
}
.img-modal-close{
  position:absolute; top:8px; right:8px; z-index:2; background:rgba(0,0,0,0.6); color:#fff; border:0;
  width:40px; height:40px; border-radius:999px; display:inline-flex; align-items:center; justify-content:center;
  font-size:20px; cursor:pointer; transition:transform .12s ease, background .12s ease;
}
.img-modal-close:hover{transform:scale(1.06); background:rgba(0,0,0,0.8)}
.img-modal-caption{color:var(--text-dim); font-size:0.9rem; margin-top:8px; text-align:center}

/* Resume / CV picker modal */
.doc-picker-content{
  background:linear-gradient(160deg,var(--bg-2),var(--bg-1));
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius-lg);
  padding:clamp(24px,4vw,40px);
  max-width:min(560px,92vw);
  width:auto;
  box-shadow:var(--shadow-2);
}
.doc-picker-title{
  font-family:'Rajdhani',sans-serif;
  font-size:clamp(1.3rem,3vw,1.7rem);
  text-align:center;
  margin-bottom:1.5rem;
}
.doc-picker-options{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:1rem;
}
.doc-picker-card{
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:.4rem;
  padding:1.4rem 1rem;
  background:var(--glass);
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius);
  text-decoration:none;
  color:var(--text);
  transition:transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
}
.doc-picker-card:hover,.doc-picker-card:focus{
  transform:translateY(-4px);
  background:var(--glass-strong);
  box-shadow:var(--shadow-2);
  border-color:var(--gold-1);
}
.doc-picker-icon{font-size:2rem}
.doc-picker-icon svg{width:2rem; height:2rem; display:block; margin:0 auto; fill:currentColor;}
.doc-picker-name{
  font-family:'Rajdhani',sans-serif; font-weight:700; font-size:1.1rem; color:#fff;
}
.doc-picker-desc{font-family:'Inter',sans-serif; font-size:.85rem; color:var(--text-dim); line-height:1.4}
.doc-picker-card.recommended{
  border-color:var(--gold-1);
  box-shadow:0 0 0 1px var(--gold-1), var(--shadow-1);
}
.doc-picker-card.recommended::after{
  content:'Recommended';
  font-size:.7rem; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  color:var(--bg-1);
  background:linear-gradient(90deg,var(--gold-1),var(--gold-2));
  padding:.2rem .6rem; border-radius:999px; margin-top:.3rem;
}
@media (max-width:520px){
  .doc-picker-options{grid-template-columns:1fr}
}
