/* ===================== THEME ===================== */
:root{
  /* Colors */
  --ink:#0f172a;                  /* near-black for text */
  --bg:#ffffff;                   /* white sections */
  --blue:#1e3a8a;                 /* royal blue */
  --blue-600:#2646b6;             /* hover */
  --soft:#737c88;                 /* secondary text */
  --mid-dark:#5d6877;             /* secondary text */
  --muted:#475569;                /* secondary text */

  /* Layout */
  --wrap: 1100px;                 /* max content width */
  --pad: clamp(2rem, 4vw, 4rem);
  --navh: 64px;                   /* fixed nav height */
  --nav-gap: 7rem;                /* spacing between nav items */
  --hero-left: 10vw;              /* slides hero text */

  /* Glass */
  --glass-bg: rgba(255,255,255,.14);
  --glass-brd: rgba(255,255,255,.28);
  --glass-txt: #eef2ff;
  --glass-shadow: 0 12px 32px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.25);

  /* Components */
  --edu-card-width: min(34rem, 92vw);
  --skills-height: 50vh;          /* adjust to taste */
}

/* ===================== BASE ===================== */
*{ box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
}
h1,h2,h3{ margin: .25em 0 .5em; }
h2{ font-size: clamp(1.6rem,2.5vw,2.2rem); }
p{ line-height: 1.6; color: var(--muted); }

/* Sections & container */
.section{ position: relative; padding: var(--pad) 1.25rem; scroll-margin-top: var(--navh); }
.wrap{ max-width: var(--wrap); margin: 0 auto; }

/* ===================== TOP NAV ===================== */
.topnav{
  position:fixed; inset:0 0 auto 0; height:var(--navh); z-index:50;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(255,255,255,.75), rgba(255,255,255,.45));
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding-left: 56px;
}
@media (prefers-color-scheme: dark){
  .topnav{
    background: linear-gradient(to bottom, rgba(17,24,39,.65), rgba(17,24,39,.45));
    border-bottom-color: rgba(255,255,255,.08);
  }
}
.nav-wrap {
  position: static;
  max-width: var(--wrap);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
.logo {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 60;
}
.logo img{
  height: 40px;
  width: auto;
  display: block;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.logo img:hover,
.logo img:active,
.logo img:focus{
  transform: none;
  box-shadow: none;
}
.center-nav { justify-content: center; }

.nav-links{
  display:flex; gap:var(--nav-gap); align-items:center;
  list-style:none; margin:0 auto; padding:0; max-width:var(--wrap);
}
.nav-links a{
  text-decoration:none;
  color: var(--soft);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .5px;
  transition: color .2s ease, background .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
  padding: .45rem .85rem;
  border-radius: 1rem;
}
.nav-links a:hover{ color: var(--ink); }

/* Active glassy pill */
.nav-links a.active{
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.40);
  color: var(--ink);
  backdrop-filter: blur(14px) saturate(110%);
  -webkit-backdrop-filter: blur(14px) saturate(110%);
  box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.35);
}
.nav-links a.active::before{
  content:""; position:absolute; inset:0; border-radius:inherit;
  background: linear-gradient(145deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,.05) 100%);
  pointer-events:none;
}
.nav-links a.active:hover{ border-color: rgba(255,255,255,.55); }

@media (prefers-color-scheme: dark){
  .nav-links a{ color:#e5e7eb; }
  .nav-links a:hover{ color:#93c5fd; }
}

/* ===================== HERO ===================== */
.hero{
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--navh) var(--pad) 0;
  color: #fff;
  background: url("images/sitebg1.jpg") center / cover no-repeat fixed;
}
.hero .overlay{
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.55));
}
.hero .wrap{
  position: relative;
  max-width: 40%;
  text-align: left;
  margin-left: var(--hero-left);
}
.hero h1{ font-size: clamp(2.2rem,6vw,4rem); margin-bottom:.3em; }
.tagline{ color:#e5e7eb; font-size: clamp(1.1rem,2.6vw,1.4rem); margin-left:.25rem; }

/* ===================== ABOUT ===================== */
#about{
  min-height: 80vh;
  display: flex;
  align-items: center;
}
#about .wrap{ max-width: var(--wrap); }
#about h2{ font-size: clamp(2rem,3vw,2.5rem); color:var(--ink); margin-bottom:1rem; }
#about p{
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  line-height: 1.9;
  color: var(--mid-dark);
  max-width: 70ch;
  margin: 0 auto;
}
.light{ background: var(--bg); }

/* ===================== EDUCATION ===================== */
#education{
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
}
#education .wrap{ position:relative; z-index:1; }
.edu{
  color:#fff;
  background: url("images/sitebg2.jpg") center / cover no-repeat fixed;
}
@media (max-width: 768px){
  .hero{ background-attachment: scroll; }
  .edu { background-attachment: scroll; }
}
.edu .overlay{
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.55));
}
.edu, .edu h2 { color:#fff; }

/* Card list (stacked, centered) */
.edu .cards{
  list-style:none; margin:0; padding:0;
  display:flex; flex-direction:column; gap:1.1rem; align-items:center;
}

/* Base card dims (width + base blur) */
.card{
  width: var(--edu-card-width);
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
}

/* Glassy card skin */
.edu .card{
  position: relative;
  color: var(--glass-txt);
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  border-radius: 1.75rem;
  overflow: hidden;
  padding: 1.1rem 1.25rem;
  backdrop-filter: blur(14px) saturate(110%);
  -webkit-backdrop-filter: blur(14px) saturate(110%);
  box-shadow: var(--glass-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.edu .card::before{
  content:""; position:absolute; inset:0; border-radius:inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,.08) 40%, rgba(255,255,255,0) 100%);
  pointer-events:none; mix-blend-mode: soft-light;
}
.edu .card:hover,
.edu .card:focus-within{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.45);
  box-shadow: 0 16px 40px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35);
}
.edu .card h3{ margin:.1rem 0 .25rem; }
.edu .card p{ color: rgba(255,255,255,.85); margin:.35rem 0 0; }
.edu .card small{
  display:block;
  color: rgba(255,255,255,.85);
  margin-top:.25rem;      /* tight gap under <p> only */
}

/* Make the whole card clickable without style change */
.card-link{ text-decoration:none; color:inherit; display:block; width:100%; }
.card-link .card{ transition: transform .25s ease, box-shadow .25s ease; }
.card-link:hover .card{
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.5);
  box-shadow: 0 18px 45px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35);
}

/* ===================== PROJECTS ===================== */
#projects.projects{
  min-height: 80vh;
  display: flex;
  align-items: center;
}
.proj-grid{
  list-style:none; margin:0; padding:0;
  display:grid; gap:1.25rem;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width:980px){ .proj-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width:640px){ .proj-grid{ grid-template-columns: 1fr; } }

.proj-link{ display:block; text-decoration:none; color:inherit; }
.proj-card{
  display:flex; flex-direction:column; height:260px;
  border-radius:1.5rem; overflow:hidden; background:#fff;
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
  transition: transform .25s ease, box-shadow .25s ease;
}
@media (max-width: 640px){
  .proj-card{ height: 280px; }              /* slightly taller on phones */
  .proj-card .thumb{ background-position: top center; }
}
.proj-card .thumb{
  flex: 0 0 60%;
  background-size: cover;
  background-position: center;
}
.proj-card .proj-body{
  flex:1; padding:1rem 1.1rem 1.25rem;
  display:flex; flex-direction:column; justify-content:center;
}
.proj-card h3{
  margin:.25rem 0 .4rem; font-size:1.05rem; font-weight:700; color:var(--ink);
}
.proj-card p{
  margin:0; color:var(--mid-dark); line-height:1.6; font-size:.95rem;
}
.proj-link:hover .proj-card,
.proj-link:focus-visible .proj-card{
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(0,0,0,.12);
}
.proj-link:active .proj-card,
.card-link:active .card,
.chips li:active{
  transform: translateY(-1px) scale(0.995);
}

/* ===================== SKILLS ===================== */
.skills{
  color:#fff;
  overflow:hidden;
  min-height: var(--skills-height);
  display:grid;
  place-items:center;
  text-align:center;
  position:relative;
}
.skills .bg-blur {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("images/sitebg3.jpg") center / cover no-repeat fixed;
  filter: brightness(0.65) saturate(0.9);
}
.skills .overlay.dark{
  position:absolute; inset:0; background:rgba(0,0,0,.25); z-index:-1;
}
.chips{
  list-style:none;
  display:flex; flex-wrap:wrap; gap:.8rem;
  justify-content:center; padding:0; margin:1.5rem 0 0;
}
.chips li{
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  color: rgba(255,255,255,.85);
  padding:.6rem 1.1rem;
  border-radius:999px;
  backdrop-filter: blur(14px) saturate(110%);
  -webkit-backdrop-filter: blur(14px) saturate(110%);
  box-shadow: var(--glass-shadow);
  font-weight:500; letter-spacing:.4px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .3s ease, color .3s ease;
}
.chips li:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.95);
  box-shadow: 0 14px 32px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35);
}

/* ===================== CONTACT ===================== */
.contact-section{
  min-height: 80vh;
  display:flex; align-items:center;
}
.contact-form{
  max-width:640px; margin:0 auto;
  display:grid; gap:1rem;
}
.contact-form .row label{
  display:grid; gap:.45rem; font-weight:600; color:var(--ink);
}
.contact-form input,
.contact-form textarea{
  width:100%; padding:.75rem .9rem;
  border-radius:.75rem; border:1px solid #e5e7eb;
  background:#fff; color:var(--ink); font:inherit;
}
.contact-form input:focus,
.contact-form textarea:focus{
  outline:none; border-color:var(--blue-600);
  box-shadow:0 0 0 3px rgba(38,70,182,.15);
}
.btn-primary{
  align-self:start; padding:.7rem 1.1rem; border-radius:.75rem;
  border:1px solid transparent; background:var(--blue); color:#fff;
  font-weight:600; cursor:pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn-primary:hover{ background:var(--blue-600); transform: translateY(-1px); }
.contact-form .alt{ margin:.25rem 0 0; color:var(--muted); font-size:.95rem; }

/* ===================== FOOTER ===================== */
.footer{ background:#0b1020; color:#cbd5e1; padding:1rem; }
.footer .wrap{
  display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap;
}
.footer .contact{
  list-style:none; display:flex; gap:1rem; padding:0; margin:0;
}
.footer a{ color:#cbd5e1; text-decoration:none; }
.footer a:hover{ color:#fff; text-decoration:underline; }

/* ===================== SMALL SCREENS ===================== */
@media (max-width: 640px){
  .nav-links{
    gap: 0.9rem;
    flex-wrap: wrap;
  }
  .nav-links a{
    font-size: .9rem;
    padding: .4rem .7rem;
  }

  /* Hide the active pill and prevent color shift */
  .nav-links a.active {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: inherit !important;            /* keeps same color as normal */
    transition: none !important;          /* removes fade/hover effect */
  }
  .nav-links a.active::before {
    content: none !important;             /* removes the sheen overlay */
  }
}
@media (max-width: 640px){
  .hero .wrap{ max-width: 100%; margin-left: 4vw; }
  :root{ --hero-left: 4vw; }
}
@media (max-width: 640px){
  .hero{ height: 100svh; }
  #education{ min-height: 80svh; }
  .contact-section{ min-height: 80svh; }
}
@media (max-width:560px){
  .hero{ min-height:70vh; }
}
@media (max-width: 640px){
  .hero{
    min-height: 100svh;
    align-items: flex-start;
    padding: calc(var(--navh) + 1.25rem) 1.25rem 2.5rem;
    background-size: cover;
    background-attachment: scroll;
    background-position: calc(100% + 49vw) center;
  }
  .hero .wrap{
    max-width: 92vw;
    margin: 0 auto;
    text-align: center;
  }

  /* Comfortable mobile type */
  .hero h1{
    font-size: clamp(2.1rem, 8.2vw, 3rem);
  }
  .tagline{
    font-size: clamp(1.05rem, 4.2vw, 1.3rem);
    margin-left: 0;
  }
}

/* ===================== MOTION REDUCTION ===================== */
@media (prefers-reduced-motion: reduce){
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
@media (max-width: 640px) {
  .topnav .nav-links a { color: var(--soft) !important; }
  .topnav .nav-links a.active {
    color: var(--soft) !important;   /* same as the others */
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}