/* =========================================================
   LAYOUT & ALIGNMENT PASS — loads last
   One left edge for every section, nothing overlapping text,
   and consistent breakpoints: 1200 / 1024 / 820 / 560 / 340
   ========================================================= */

/* sections land below the floating menu */
section[id]{ scroll-margin-top:88px; }

/* ---------- Section headings: one left edge ---------- */
.shead{ display:block; }
.shead__num{
  display:inline-flex; align-items:center; gap:10px; margin-bottom:18px;
  font-family:var(--mono); font-size:13px; letter-spacing:.04em; color:var(--violet);
}
.shead__num::after{ content:""; width:36px; height:1px; background:currentColor; opacity:.6; }
.shead__title{ display:block; }
.shead__sub{ margin:16px 0 0; max-width:60ch; font-size:clamp(15px,1.2vw,17px); }

/* ---------- Hero: title left, card right, no overlap ---------- */
.hero__top{ align-items:center; }
.hero__top > :nth-child(2){ justify-self:center; }
.hero__top > :last-child{ justify-self:end; text-align:right; }
.hero__name{ text-align:left; }
.hero__title .ln1, .hero__title .ln2{ text-align:left; }

@media (min-width:821px){
  .hero__stage{
    display:grid; grid-template-columns:minmax(0,1fr) auto; place-items:initial;
    align-items:center; column-gap:clamp(28px,4vw,72px);
  }
  .hero__title{ font-size:clamp(3rem,6.6vw,8.4rem); text-align:left; }
  .hero__title .ln1{ white-space:nowrap; }
  .hero__portrait{
    position:relative; left:auto; top:auto; transform:none;
    width:clamp(220px,21vw,320px); justify-self:end;
  }
  .hero__base{ grid-template-columns:minmax(0,1fr) auto auto; column-gap:clamp(20px,4vw,56px); }
  .hero__base .mark{ max-width:46ch; }
}
@media (min-width:821px) and (max-width:1100px){
  .hero__title{ font-size:clamp(2.8rem,6.1vw,5rem); }
  .hero__portrait{ width:clamp(200px,24vw,250px); }
}

/* ---------- About ---------- */
.about__hey{ margin-bottom:clamp(32px,5vh,56px); }
.about__grid{ align-items:start; }
.about__col p:last-of-type{ margin-bottom:0; }
.about__cta{ margin-top:24px; }
.about__col--r p + p{ margin-top:0; }

/* ---------- Stats: equal cells, one left edge ---------- */
.stats__grid{ gap:0; }
.stat, .stat + .stat{ padding:28px 24px 8px; border-right:1px solid var(--line); border-top:0; }
.stat:nth-child(4n+1){ padding-left:0; }
.stat:nth-child(4n){ border-right:0; }

/* ---------- Experience ---------- */
.xp__item{ align-items:start; }
.xp__role{ margin-top:-4px; }

/* ---------- Services: symmetric gutters around the divider ---------- */
.svc{ padding:clamp(28px,4vw,48px) clamp(16px,3vw,48px) clamp(28px,4vw,48px) 0; }
.svc:nth-child(even){ padding-left:clamp(16px,3vw,48px); padding-right:0; }

/* ---------- Projects ---------- */
.work__filters{ margin:0 0 28px; }
.proj__head{ grid-template-columns:48px minmax(0,1fr) auto 40px; }
.proj__inner{ align-items:start; }
.proj__viz{ min-height:240px; }

/* ---------- Education ---------- */
.edu__grid{ align-items:stretch; }
.cert__list{ grid-template-rows:repeat(3,1fr); }

/* ---------- Contact ---------- */
.contact__grid{ align-items:start; }
.contact__info > p{ margin-top:0; }
.cform label{ min-width:0; }
.cform input, .cform textarea{ width:100%; }

/* keyboard-only hints are hidden on touch devices */
@media (hover:none){
  .foot__top > .foot__col:nth-child(3), .foot__mid{ display:none; }
}

/* =========================================================
   ≤1200
   ========================================================= */
@media (max-width:1200px){
  .about__grid{ grid-template-columns:1fr minmax(200px,280px) 1fr; }
}

/* =========================================================
   ≤1024 — tablets landscape / small laptops
   ========================================================= */
@media (max-width:1024px){
  .stats__grid{ grid-template-columns:1fr 1fr; }
  .stat, .stat + .stat{ padding:28px 24px 8px; border-right:1px solid var(--line); border-top:0; }
  .stat:nth-child(odd){ padding-left:0; }
  .stat:nth-child(even){ border-right:0; }
  .stat:nth-child(n+3){ border-top:1px solid var(--line); }

  /* About: card left, text right */
  .about__grid{ grid-template-columns:minmax(200px,280px) minmax(0,1fr); grid-template-rows:auto auto; column-gap:clamp(24px,4vw,48px); row-gap:20px; }
  .about__slot{ grid-column:1; grid-row:1 / span 2; order:0; width:100%; justify-self:stretch; align-self:start; }
  .about__col--l{ grid-column:2; grid-row:1; }
  .about__col--r{ grid-column:2; grid-row:2; }

  .skills__grid{ grid-template-columns:1fr 1fr; }
  .edu__grid{ grid-template-columns:1fr; }
  .cert__list{ grid-template-rows:none; grid-template-columns:repeat(3,1fr); }
  .cert{ flex-direction:column; align-items:flex-start; gap:14px; }
}

/* =========================================================
   ≤820 — tablets portrait
   ========================================================= */
@media (max-width:820px){
  :root{ --sec:clamp(72px,11vh,120px); }
  section[id]{ scroll-margin-top:80px; }

  .hero{ min-height:auto; padding-bottom:0; }
  .hero__top{ grid-template-columns:minmax(0,1fr) auto; column-gap:16px; }
  .hero__top > :first-child{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .hero__top > :last-child{ display:none; }
  .hero__top > :nth-child(2){ justify-self:end; white-space:nowrap; }
  .hero__stage{ align-items:flex-start; padding-block:clamp(28px,5vh,48px); }
  .hero__title{ width:100%; }
  .hero__portrait{ align-self:center; }

  .xp__item{ grid-template-columns:1fr; gap:14px; }
  .xp__meta{ flex-direction:row; align-items:center; flex-wrap:wrap; gap:12px; }

  .svc__list{ grid-template-columns:1fr; }
  .svc, .svc:nth-child(even){ padding:28px 0; border-right:0; }

  .proj__head{ grid-template-columns:36px minmax(0,1fr) 36px; gap:12px; }
  .proj__meta{ grid-template-columns:repeat(3,1fr); }
  .proj__meta div + div{ padding-left:14px; border-left:1px solid var(--line); border-top:0; }

  .contact__grid{ grid-template-columns:1fr; }
  .contact__mail{ max-width:none; }

  .foot__top{ grid-template-columns:1fr 1fr; row-gap:28px; }
  .foot__up{ position:static; grid-column:2; grid-row:1; justify-self:end; }
  .foot__top > .foot__col:nth-child(3){ grid-column:1 / -1; }
}

/* =========================================================
   ≤560 — phones
   ========================================================= */
@media (max-width:560px){
  body{ font-size:15.5px; }
  .label{ font-size:11px; }

  .hero__top{ grid-template-columns:1fr; row-gap:8px; }
  .hero__top > :nth-child(2){ justify-self:start; display:inline-flex; }
  .hero__base{ grid-template-columns:1fr; row-gap:14px; }
  .hero__scroll{ justify-self:start; }

  .about__hey{ font-size:clamp(2.4rem,11vw,3.2rem); }
  .about__grid{ grid-template-columns:1fr; grid-template-rows:none; }
  .about__slot{ grid-column:1; grid-row:auto; order:-1; width:min(260px,72vw); justify-self:center; margin-bottom:8px; }
  .about__col--l, .about__col--r{ grid-column:1; grid-row:auto; }
  .about__cta .btn{ flex:1 1 auto; justify-content:center; }

  .stats__grid{ grid-template-columns:1fr 1fr; }
  .stat__num{ font-size:clamp(2.4rem,12vw,3.4rem); }
  .stat__label{ font-size:13.5px; }
  .stat, .stat + .stat{ padding:22px 14px 6px; }
  .stat:nth-child(odd){ padding-left:0; }

  .manifesto{ height:200vh; }
  .manifesto__text{ font-size:clamp(1.6rem,7.4vw,2.2rem); }

  .shead__title{ font-size:clamp(2rem,10vw,2.8rem); }

  .skills__grid{ grid-template-columns:1fr; }
  .skill{ padding:22px; }

  .svc__t{ font-size:clamp(1.4rem,6.6vw,1.9rem); }

  .proj__t{ font-size:clamp(1.15rem,5.4vw,1.45rem); }
  .proj__meta{ grid-template-columns:1fr; }
  .proj__meta div + div{ padding-left:0; border-left:0; border-top:1px solid var(--line); }
  .proj__viz{ min-height:170px; padding:16px; font-size:12px; }

  .term__title{ font-size:11px; text-align:left; }
  .term__body{ height:min(420px,60svh); font-size:12px; }
  .term__chips{ padding:10px 12px 12px; gap:6px; }

  .cert__list{ grid-template-columns:1fr; }
  .cert{ flex-direction:row; align-items:center; }

  .contact__title{ font-size:clamp(2.6rem,13vw,3.6rem); }
  .cform .btn{ width:100%; justify-content:center; }

  .foot__top{ grid-template-columns:1fr auto; }
  .foot__top > .foot__col:nth-child(2), .foot__top > .foot__col:nth-child(3){ grid-column:1 / -1; }
  .foot__in{ flex-direction:column; gap:6px; }
}

/* =========================================================
   ≤340 — very small phones
   ========================================================= */
@media (max-width:340px){
  .stats__grid{ grid-template-columns:1fr; }
  .stat, .stat + .stat{ padding-left:0; border-right:0; }
  .stat + .stat{ border-top:1px solid var(--line); }
  .menu__bar{ padding-left:16px; }
}
