/* ===== Theme ===== */
:root{
    --bg:#f6f7fb;
    --panel:#ffffff;
    --stroke:#e7e9f2;
    --shadow:0 10px 30px rgba(23,28,45,.08);
    --text:#0f172a;
    --muted:#6b7280;
    --blue:#3b82f6;
    --blue2:#8fb3ff;
  }
  *{box-sizing:border-box} html,body{margin:0;padding:0}
  body{font-family:Inter,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text)}
  .wrap{max-width:1120px;margin:0 auto;padding:0 20px}
  .section{padding:96px 0;position:relative}
  .section.alt{background:linear-gradient(180deg,#fafbff 0%, #eef2ff 100%)}
  .section__title{font-size:2.2rem;text-align:center;margin:0 0 12px}
  
  /* ===== Header ===== */
  .header{position:sticky;top:0;z-index:50;background:#eef2ffbd;border-bottom:1px solid #eaefff;backdrop-filter:saturate(180%) blur(10px)}
  .header__row{display:flex;align-items:center;justify-content:space-between;padding:14px 0}
  .brand{font-weight:800;color:#6b8bff;text-decoration:none}
  .nav__link{color:#111827;text-decoration:none;margin-left:18px;padding:8px 14px;border-radius:999px}
  .nav__link:hover{background:#e8ecff}
  .nav__link.active{background:#dfe6ff}
  .toggle{margin-left:12px;border:1px solid var(--stroke);background:#fff;border-radius:999px;width:40px;height:40px;box-shadow:var(--shadow)}
  
  /* ===== Hero ===== */
  .hero{isolation:isolate}
  .hero__grid{display:grid;grid-template-columns:1.15fr .85fr;gap:32px;align-items:center}
  .eyebrow{color:#6b7280;margin:0}
  .hero h1{font-size:3.2rem;margin:.2rem 0 .4rem}
  .grad{background:linear-gradient(90deg,#6b8bff,#9bb0ff);-webkit-background-clip:text;background-clip:text;color:transparent}
  .subtitle{font-size:1.35rem;color:#374151;margin:.2rem 0 1rem}
  .lead{color:var(--muted);max-width:560px}
  .actions{margin:18px 0 12px}
  .btn{display:inline-block;padding:12px 18px;border-radius:12px;border:1px solid #d5e3ff;background:#fff;color:#0f172a;text-decoration:none;font-weight:600;margin-right:12px;box-shadow:var(--shadow)}
  .btn--primary{background:linear-gradient(135deg,#3b82f6,#7aa2ff);border:0;color:#fff}
  .socials{display:flex;gap:10px;margin-top:12px}
  .chip{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:10px;background:#fff;border:1px solid var(--stroke);box-shadow:var(--shadow);color:#6b7280;text-decoration:none;font-weight:700}
  
  /* Photo card */
  .card{background:var(--panel);border:1px solid var(--stroke);border-radius:18px;box-shadow:var(--shadow)}
  .photo-card{padding:12px}
  .photo-card img{display:block;border-radius:14px;width:100%;height:auto}
  
  /* Background decorations */
  .hero__bg{position:absolute;inset:-120px 0 auto 0;z-index:-1;height:560px;
    background:
      radial-gradient(60% 80% at 20% 20%, rgba(123,164,255,.35), transparent 60%),
      radial-gradient(50% 70% at 70% 10%, rgba(131,179,255,.35), transparent 60%);
  }
  .hero__bg svg{position:absolute;inset:0;width:100%;height:100%;mix-blend-mode:overlay}
  
  /* Rotating subtitle caret */
  .subtitle #rotating{border-right:2px solid currentColor;padding-right:4px}
  .subtitle #rotating.typing{animation:caret .8s steps(1) infinite}
  @keyframes caret{50%{border-color:transparent}}
  
  /* ===== Shared grids ===== */
  .grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:22px}
  .grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:22px}
  .grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:22px}
  .h3.center{text-align:center;margin:24px 0 8px}
  
  /* ===== About ===== */
  .about-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:26px}
  .about-cards{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
  .mini{padding:16px}
  
  /* ===== Projects ===== */
  .project__img{width:100%;height:190px;object-fit:cover;border-radius:18px 18px 0 0;display:block}
  .project__body{padding:16px}
  .project__body p{color:#6b7280;margin:.4rem 0 .8rem}
  .tags{display:flex;flex-wrap:wrap;gap:8px;margin:.3rem 0 .6rem}
  .tags span{background:#f3f6ff;border:1px solid #e1e8ff;color:#4b74ff;padding:6px 10px;border-radius:999px;font-size:.85rem}
  .link{color:#4b74ff;text-decoration:none;font-weight:600}
  
  /* ===== Skills ===== */
  .skills .card{padding:16px;display:grid;grid-template-rows:auto auto auto;gap:8px}
  .skill__icon{font-size:28px}
  .bar{height:8px;border-radius:999px;background:#eef1ff;overflow:hidden;border:1px solid #e2e6ff}
  .bar span{display:block;height:100%;width:var(--p,70%);background:linear-gradient(90deg,#7aa2ff,#a0b8ff)}
  .tools{display:flex;gap:18px;flex-wrap:wrap;justify-content:center;margin-top:12px}
  .tool{padding:16px;display:flex;flex-direction:column;align-items:center;gap:8px}
  .tool img{width:56px;height:56px}
  
  /* ===== Research ===== */
  .paper{padding:18px}
  .paper .muted{color:#6b7280}
  
  /* ===== Contact ===== */
  .contact-grid{align-items:start}
  .contact-left .field{display:flex;gap:12px;align-items:center;padding:14px;margin-bottom:12px}
  .field__icon{font-size:22px}
  .field__title{font-weight:700}
  .code{padding:0;overflow:auto}
  .code pre{margin:0;padding:16px;background:#111;color:#eaeef5;border-radius:18px}
  
  /* ===== Footer ===== */
  .footer{border-top:1px solid var(--stroke);padding:28px 0;text-align:center;color:var(--muted)}
  
  /* ===== Responsive ===== */
  @media (max-width: 980px){
    .about-grid,.grid2{grid-template-columns:1fr}
    .grid3{grid-template-columns:1fr 1fr}
    .grid4{grid-template-columns:1fr 1fr}
    .hero h1{font-size:2.6rem}
  }
  @media (max-width: 620px){
    .grid3,.grid4{grid-template-columns:1fr}
  }
  img, svg{max-width:100%;height:auto}

  /* --- About left column styling --- */
.about-left .intro{
    font-size:1.05rem;
    line-height:1.8;
    color:#111827;
    margin:0 0 14px 0;
  }
  
  .about-points{
    list-style:none;
    margin:0;
    padding:0;
    display:grid;
    gap:12px;
  }
  
  .about-points li{
    background:#fff;
    border:1px solid var(--stroke);
    border-radius:14px;
    padding:12px 14px;
    box-shadow:var(--shadow);
    line-height:1.65;
    color:#111827;
    position:relative;
  }
  
  /* subtle check icon */
  .about-points li::before{
    content:"✓";
    position:absolute;
    left:12px; top:12px;
    font-size:.95rem;
    color:#4b74ff;
    opacity:.9;
  }
  .field a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
  }
  
  /* Contact layout */
.contact-grid{
    display:grid;
    grid-template-columns: 1.1fr .9fr; /* left column wider */
    gap:28px;
    align-items:start;
  }
  
  .contact-left{
    display:grid;
    gap:14px;            /* uniform spacing between cards */
  }
  
  .field a{ color: var(--text); text-decoration: none; }
  .field a:hover{ text-decoration: underline; }
  
  /* If using a button for the resume link */
  .field .btn{ margin-top:6px; }
  
  /* Code panel */
  .code{ padding:0; overflow:auto; }
  .code pre{ margin:0; padding:16px; background:#111; color:#eaeef5; border-radius:18px; }
  
  /* Stack on mobile */
  @media (max-width: 980px){
    .contact-grid{ grid-template-columns: 1fr; }
  }
  
  
  /* pill label */
  .about-points .k{
    display:inline-block;
    font-weight:700;
    color:#1f2937;
    background:#eef2ff;
    border:1px solid #dde4ff;
    padding:3px 10px;
    border-radius:999px;
    margin-right:8px;
  }
  
/*mobile*/
/* 1) Fluid grids by default */
.grid2 { display:grid; gap:28px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { display:grid; gap:28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { display:grid; gap:18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Make project/skills grids adapt automatically at intermediate widths */
@media (max-width: 1200px){
  .grid3 { grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }
  .grid4 { grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); }
}

/* 2) Hero: swap to single column on tablets/phones */
.hero__grid { display:grid; grid-template-columns: 1.2fr .8fr; align-items:center; gap:32px; }
@media (max-width: 980px){
  .hero__grid{ grid-template-columns: 1fr; text-align:center; }
  .hero__copy{ order:1; }
  .hero__photo{ order:2; margin:8px auto 0; max-width: 320px; }
  .actions{ display:flex; justify-content:center; gap:12px; flex-wrap:wrap; }
}

/* 3) Contact section: stack columns */
.contact-grid{ display:grid; grid-template-columns: 1.1fr .9fr; gap:28px; align-items:start; }
@media (max-width: 980px){
  .contact-grid{ grid-template-columns: 1fr; }
}

/* 4) Skills bars: keep readable on narrow screens */
.skill .bar{ height:8px; border-radius:999px; background:var(--muted-2,#e7edf7); overflow:hidden; }
.skill .bar span{ display:block; height:100%; width:var(--p,70%); background:var(--accent,#4ea3ff); }

/* 5) Header/nav tweaks for small screens (simple, no JS) */
.header{ position: sticky; top:0; z-index:50; }
.nav{ display:flex; gap:16px; }
@media (max-width: 680px){
  .brand{ font-size:16px; }
  .nav{ overflow-x:auto; white-space:nowrap; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .nav::-webkit-scrollbar{ display:none; }
}

/* 6) Typography & spacings on mobile */
@media (max-width: 680px){
  h1{ font-size: clamp(28px, 6vw, 36px); line-height:1.15; }
  .subtitle{ font-size: 18px; }
  .lead{ font-size: 16px; }
  .section{ padding: 48px 0; }
  .wrap{ padding-left: 16px; padding-right: 16px; }
  .card{ border-radius: 16px; }
  .btn{ padding:10px 16px; font-size:15px; }
}

/* 7) Images/buttons are fluid and tappable */
img{ max-width:100%; height:auto; display:block; }
.btn{ min-height:44px; }            /* finger-friendly */
.chip, .nav__link{ padding:8px 10px; }
  