/* ===========================
   THEME
   =========================== */
:root{
  /* Near-white lavender page background (purple-ish, not pure white) */
  --bg:#F4F1FF;

  /* Text & neutrals */
  --ink:#0f172a;
  --muted:#5b6072;
  --panel:#ffffff;
  --line:#e4e0ff;

  /* Accents (contrasty but harmonious with lavender) */
  --indigo:#3854FF;
  --purple:#7B61FF;
  --teal:#00A3A3;
  --magenta:#E11D48;

  /* Subtle surfaces */
  --lavender-1:#F6F3FF;
  --mint-1:#EEFFFD;
}

/* ===========================
   BASE
   =========================== */
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--ink)}

body{
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}

.wrap{max-width:1100px;margin-inline:auto;padding:28px 20px 80px}

/* Smooth load */
body .wrap{opacity:0; transform:translateY(6px); transition:opacity .45s ease, transform .45s ease;}
body.ready .wrap{opacity:1; transform:none;}
@media (prefers-reduced-motion: reduce){
  *{animation:none!important;transition:none!important;scroll-behavior:auto!important;}
  body .wrap{opacity:1; transform:none;}
}

/* ===========================
   HEADER
   =========================== */
.header{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:22px;
  align-items:stretch;
  margin-bottom: 2.4rem;
}
.header-box{ display:flex; align-items:center; padding:8px 0; }

/* Left side */
.brand-left{ display:flex; gap:12px; align-items:center; }
.avatar{
  width:84px; height:84px; border-radius:14px; object-fit:cover;
  border:1px solid var(--line); box-shadow:0 3px 14px rgba(123,97,255,.12);
}
.name{
  margin:0; line-height:1.02;
  font-family:"Poppins", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight:700; letter-spacing:.005em; color:#132157;
}
.name .fname, .name .lname{ display:inline-block; font-size:32px; }

/* Right side — original stacked layout */
.header-box.right{ text-align:right; flex-direction:column; align-items:flex-end; }
.hero-title{
  margin:0 0 8px; line-height:1; white-space:nowrap;
  font-family:"Poppins", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  letter-spacing:-.01em;
}
.hero-j{ color:var(--indigo); font-weight:700; font-size:25px; }
.amp{ color:var(--purple); font-weight:700; font-size:25px; margin:0 .25ch; }
.hero-d{ color:#10172F; font-weight:700; font-size:25px; }

/* Original-style lines under title */
.skill-line{
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  font-weight:600; font-size:13px; color:#2a2570;
  background:var(--lavender-1); border:1px dashed #d8d4ff;
  border-radius:12px; padding:8px 12px; margin:6px 0 0 8px;
  box-shadow:0 3px 10px rgba(123,97,255,.08);
  font-family:"Poppins", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
.skill-line.alt{
  background:var(--mint-1); border-color:#c9efed; color:#124e4d;
}
.skill-line .dot{ color:#9aa0b6; }

/* ===========================
   LINKS
   =========================== */
a{ transition:color .15s ease, border-color .15s ease; }
a.ext{ color:inherit; text-decoration:none; border-bottom:2px dotted currentColor; text-underline-offset:2px; }
a.ext::after{ content:" ↗"; }
a.ext:hover{ color:var(--magenta); }
/* Ensures bold anchors actually render bold across stacks */
a.ext.bolder, a.ext b{ font-weight:700; }

/* ===========================
   ABOUT
   =========================== */
.about{ margin:14px 0 28px; max-width:820px; }

/* ===========================
   PANELS
   =========================== */
.panels{ display:grid; grid-template-columns:2fr 1fr; gap:20px; margin-top:8px; }
.panel{
  background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:18px 16px; position:relative;
  box-shadow: 0 10px 30px rgba(56,84,255,.08);
}
.section-title{
  font:600 16px/1.2 "Poppins", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin:0 0 12px; color:#0f172a; position:relative; letter-spacing:.2px;
}
.section-title::after{
  content:""; display:block; height:3px; width:68px; border-radius:2px; margin-top:7px; background:#cbbcff;
}
.section-title.indigo::after{ background:var(--indigo); }
.section-title.purple::after{ background:var(--purple); }
.section-title.teal::after{ background:var(--teal); }

.with-divider::after{
  content:""; position:absolute; top:16px; right:-11px; bottom:16px; width:0;
  border-right:2px dotted #cbc5ff;
}

/* Logos */
.logo-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.logo-grid.slim{ grid-template-columns:1fr; }
.logo-cell{
  height:72px; background:#fff; border:1px solid var(--line); border-radius:12px;
  display:flex; align-items:center; justify-content:center; padding:10px; overflow:hidden;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.logo-cell img{ max-height:100%; max-width:90%; object-fit:contain; display:block; }
.logo-cell:hover{
  transform:translateY(-2px); box-shadow:0 12px 22px rgba(56,84,255,.16); border-color:#d8d4ff;
}

/* ===========================
   SELECTED WORK
   =========================== */
.selected{ margin-top:28px; }

.card-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
@media (max-width:980px){ .card-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .card-grid{ grid-template-columns:1fr; } }

.card{
  background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden;
  transition:transform .25s, box-shadow .25s, border-color .2s;
  box-shadow:0 10px 28px rgba(16,23,47,.08);
}
.card:hover{
  transform:translateY(-3px);
  box-shadow:0 16px 32px rgba(56,84,255,.18);
  border-color:#d7d2ff;
}
.card-link{ display:block; color:inherit; text-decoration:none; }

/* Media area keeps consistent crop; images fill nicely */
.media{ position:relative; aspect-ratio:16/10; background:#f0edff; overflow:hidden; }
.media img{ width:100%; height:100%; object-fit:cover; display:block; }

/* Meta row: logo only (no text label) */
.card-meta{
  display:flex; align-items:center; gap:8px; padding:10px 12px 0;
  min-height:36px;
}
.brand{ height:18px; width:auto; display:block; filter: drop-shadow(0 1px 0 rgba(0,0,0,.04)); }

/* Title */
.card-title{
  font-size:15px; line-height:1.35; margin:8px 12px 14px;
  border-top:1px dashed var(--line); padding-top:10px;
}
.card-title:hover{ color:var(--magenta); }

/* ===========================
   EDUCATION & AWARDS
   =========================== */
.section-block{
  background:#ffffff; border:1px solid var(--line); border-radius:16px; padding:18px 16px; margin-top:24px;
  box-shadow:0 8px 26px rgba(16,23,47,.06);
}
.edu-list,.award-list{ list-style:none; padding:0; margin:8px 0 0; }
.edu-list li + li,.award-list li + li{ margin-top:8px; }
.edu-list a.ext{ border-bottom-color:var(--teal); }
.edu-list a.ext:hover{ color:var(--magenta); }
.meta{ display:block; color:#6b7280; font-size:14px; margin-top:2px; }

/* ===========================
   FOOTER
   =========================== */
.footer{ margin-top:48px; color:#6b7280; font-size:14px; }
.footer .footer-inner{ display:inline-flex; align-items:center; gap:16px; flex-wrap:wrap; }
.footer .sep{ opacity:.35; }
#backToTop{
  border:1px solid var(--line); background:#fff; color:#3854FF;
  font-weight:700; border-radius:999px; padding:.4rem .8rem; cursor:pointer;
  transition:transform .12s ease, background .12s ease, box-shadow .2s ease;
  font-family:"Poppins", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
#backToTop:hover{ background:#ffffff; transform:translateY(-1px); box-shadow:0 8px 18px rgba(0,0,0,.08); }
#backToTop:focus-visible{ outline:3px solid rgba(123,97,255,.3); outline-offset:3px; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width:1100px){
  .hero-j, .amp, .hero-d{ font-size:34px; }
}
@media (max-width:980px){
  .hero-j, .amp, .hero-d{ font-size:32px; }
}
@media (max-width:780px){
  .header{ grid-template-columns:1fr; gap:12px; }
  .header-box.right{ text-align:left; align-items:flex-start; }
  .avatar{ width:76px; height:76px; }
  .name .fname, .name .lname{ font-size:30px; }
  .hero-j, .amp, .hero-d{ font-size:30px; white-space:normal; }
  .panels{ grid-template-columns:1fr; gap:14px; }
  .with-divider::after{ display:none; }
  .logo-grid{ grid-template-columns:repeat(2,1fr); }
  .logo-cell{ height:66px; }
}
@media (max-width:480px){
  .name .fname, .name .lname{ font-size:28px; }
  .hero-j, .amp, .hero-d{ font-size:26px; }
}
/* --- Mobile: center the entire header stack --- */
@media (max-width:780px){
  .header{
    grid-template-columns: 1fr; /* already there, keeps single column */
    justify-items: center;      /* centers grid items */
  }

  .header-box{
    justify-content: center;    /* centers flex contents */
    align-items: center;
  }

  .header-box.left,
  .header-box.right{
    text-align: center;         /* center text in both columns */
  }

  .brand-left{
    justify-content: center;    /* centers avatar + name row */
  }

  .name{ text-align:center; }

  .hero-title{
    white-space: normal;        /* allow wrapping on small screens */
    margin-left: 0;
    margin-right: 0;
  }

  /* center the two skill lines and remove the left nudge */
  .skill-line,
  .skill-line.alt{
    margin: 6px 0 0 0;
    justify-content: center;
  }
}
/* --- Phone: hard-center the skill lines + their text --- */
@media (max-width:780px){
  .skill-line,
  .skill-line.alt{
    /* center the whole pill */
    margin: 6px auto 0 auto;   /* overrides the old left nudge */
    justify-content: center;   /* centers the items inside */
    text-align: center;        /* centers inline text fallback */
  }

  /* make the bullets occupy equal space so the line feels balanced */
  .skill-line .dot,
  .skill-line.alt .dot{
    display: inline-block;
    width: 1ch;                /* symmetrical around the dot */
    text-align: center;
  }
}
