/* =============================================================
   MATHSADIQ — pixel-matched to dev-shohan.netlify.app (measured)
   bg #E3F2FD · accent #C778DD · sharp buttons · FiraCode
   ============================================================= */

:root{
  --bg:#E3F2FD;              /* measured body background */
  --accent:#C778DD;          /* measured primary #C778DD */
  --accent-50:rgba(199,120,221,.5);
  --accent-70:rgba(199,120,221,.7);
  --line:rgba(171,178,191,.5);/* measured secondary border */
  --ink:#000;
  --ink-80:rgba(0,0,0,.8);
  --ink-60:rgba(0,0,0,.6);
  --ink-40:rgba(0,0,0,.4);
  --appbar-h:64px;
}

*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  font-family:"Fira Code",monospace;
  background:var(--bg);
  color:var(--ink);
  font-weight:400;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
a{text-decoration:none;color:inherit}
ul{list-style:none}
img{max-width:100%;display:block}
button,input,select,textarea{font:inherit;color:inherit}

/* ---------------- AppBar (measured h=64, no shadow) ---------------- */
.appbar{
  position:fixed;top:0;left:0;right:0;z-index:1100;
  background:var(--bg);
  color:#fff;
}
.appbar-inner{
  max-width:none;margin:0 0 0 64px;padding:0 24px;
  height:var(--appbar-h);
  display:flex;align-items:center;justify-content:space-between;gap:24px;
}
@media (max-width:900px){.appbar-inner{margin-left:0;padding:0 16px}}
.icon-btn{
  background:none;border:0;cursor:pointer;padding:8px;color:var(--ink);
  display:flex;border-radius:50%;
}
.icon-btn:hover{background:rgba(0,0,0,.08)}
.icon-btn svg{width:24px;height:24px;display:block}
.brand{display:none}

/* nav: "#" accent 600 + label 400 ink-80; active label black 600 */
.navlinks{display:flex;align-items:center;justify-content:center;flex:1;gap:2px}
.navlinks a{
  font-size:16px;padding:8px 4px;white-space:nowrap;
  display:inline-flex;align-items:baseline;
}
.navlinks .hash{color:var(--accent);font-weight:600;margin-right:1px}
.navlinks .lbl{color:var(--ink-80);font-weight:400}
.navlinks a:hover .lbl{color:var(--ink)}
.navlinks a.on .lbl{color:var(--ink);font-weight:600}
@media (max-width:1180px){.navlinks a{font-size:14px;padding:8px 2px}}
.burger{display:none;align-items:center}
@media (max-width:980px){
  .navlinks{
    position:fixed;top:var(--appbar-h);left:58px;right:0;   /* clears the rail */
    flex-direction:column;align-items:stretch;gap:0;
    background:var(--bg);padding:8px 20px 20px;display:none;margin-left:0;
    box-shadow:0 4px 10px rgba(0,0,0,.12);
  }
  .navlinks.open{display:flex}
  .navlinks a{font-size:15px;padding:11px 0;border-bottom:1px solid rgba(171,178,191,.25)}
  .burger{display:flex}
}

/* social icon row (measured 32px icons) */
.socialbar{border-bottom:1px solid rgba(171,178,191,.35);background:var(--bg)}
.socialbar-inner{
  max-width:none;margin:0 0 0 64px;padding:10px 24px;
  display:flex;align-items:center;justify-content:flex-end;gap:10px;
}
.socialbar a{width:32px;height:32px;display:flex;align-items:center;justify-content:center}
.socialbar a:hover{opacity:.7}
.socialbar svg{width:32px;height:32px}

/* ---------------- layout ---------------- */
.main{padding-top:var(--appbar-h)}
.container{max-width:none;margin:0 0 0 64px;padding:0 24px}
@media (max-width:900px){.container{margin-left:0;padding:0 16px}}
.page{padding:10px 0 20px}

/* section heading: 32px accent 500 with # prefix */
.sec-head{margin:34px 0 10px}
.sec-head h2{
  font-size:32px;font-weight:500;color:var(--accent);line-height:1.25;
  display:flex;align-items:baseline;gap:2px;
}
.sec-head h2 .hash{font-weight:500;color:var(--accent)}
.sec-head h2 .lbl{font-weight:500;color:var(--ink)}
@media (max-width:700px){.sec-head h2{font-size:24px}}

/* grids — measured REF grid spans ~1344 of 1384 container */
.grid{display:flex;flex-wrap:wrap;gap:16px;margin:12px -16px}
.g-12{width:calc(100% + 32px)}
.g-8{width:calc(66.666% - 11px)}
.g-6{width:calc(50% - 8px)}
.g-4{width:calc(33.333% - 11px)}
.g-3{width:calc(25% - 12px)}
@media (max-width:1200px){.g-3{width:calc(33.333% - 11px)}}
@media (max-width:900px){.g-8,.g-6,.g-4,.g-3{width:100%}}

/* ---------------- hero (banner 464x397 measured) ---------------- */
.hero{display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start}
.hero-left{flex:1 1 420px;min-width:300px}
.hero-right{flex:0 1 clamp(420px,42%,620px);min-width:280px}
.hero-img{
  position:relative;
  width:100%;max-width:100%;
  display:flex;align-items:flex-end;justify-content:flex-start;
}
/* accent square sitting behind the photo */
.hero-img::before{
  content:"";position:absolute;
  left:-16px;top:-16px;width:64%;height:64%;
  border:2px solid var(--accent);opacity:.55;
  z-index:0;
}
/* corner bracket, bottom-right */
.hero-img::after{
  content:"";position:absolute;
  right:-16px;bottom:-16px;width:52%;height:52%;
  border:2px solid var(--accent);opacity:.55;
  border-top:none;border-left:none;
  z-index:0;
}
.hero-img img{
  position:relative;z-index:1;
  width:auto;height:auto;max-width:100%;max-height:min(calc(100vh - 212px),720px);object-fit:contain;
}
.hero-name{font-size:30px;font-weight:600;line-height:1.28;color:var(--ink)}
.hero-name .nb{color:var(--accent);font-weight:500}
.hero-role{display:none}
.hero-text{font-size:32px;font-weight:600;line-height:1.35;margin:6px 0 18px}
.hero-text .nb{color:var(--accent);font-weight:500}
.hero-sub{font-size:14px;color:var(--ink-80);line-height:1.7;margin:12px 0}
.hero-meta{font-size:14px;color:var(--ink-80);line-height:1.8}
.hero-meta b{color:var(--accent);font-weight:600}
@media (max-width:700px){
  .hero-name,.hero-role,.hero-text{font-size:22px}
}

/* ---------------- blockquote (measured 920w, Abril 48px accent) ---------------- */
.banner_blockquoteWrapper{display:flex;margin-top:26px}
.banner_blockquote{
  margin:0 auto;max-width:920px;width:100%;
  font-family:"Barlow Condensed",sans-serif;
}
.banner_blockquote h1{
  border:2px solid var(--accent);border-radius:20px;
  font-family:"Abril Fatface",cursive;
  font-size:48px;font-weight:400;line-height:1.2;margin:0;padding:25px;
  color:var(--accent);
}
.banner_blockquote h4{
  font-family:"Barlow Condensed",sans-serif;
  font-size:20.8px;font-weight:400;color:var(--ink);
  margin:0 0 0 150px;padding:15px 0 0 12px;
}
@media (max-width:700px){
  .banner_blockquote h1{font-size:26px;padding:18px}
  .banner_blockquote h4{font-size:17px;margin-left:24px}
}

/* ---------------- buttons (measured: 16px/600, pad 5px 15px, radius 0) -------- */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  height:40px;padding:5px 15px;border-radius:0;
  border:1px solid var(--accent-50);background:transparent;
  font-size:16px;font-weight:600;color:var(--ink);cursor:pointer;
  text-transform:uppercase;letter-spacing:.02em;
  transition:background .2s ease,border-color .2s ease;
}
.btn:hover{background:rgba(199,120,221,.12);border-color:var(--accent)}
.btn.sec{border-color:var(--line)}
.btn.sec:hover{background:rgba(171,178,191,.18);border-color:rgba(171,178,191,.8)}
.btn svg{width:24px;height:24px;flex-shrink:0}
.btn.sm{height:34px;font-size:14px;padding:4px 12px}

/* ---------------- chips (measured border rgba(199,120,221,.7)) ------------- */
.chip{
  display:inline-flex;align-items:center;height:26px;padding:0 12px;
  border-radius:13px;font-size:13px;border:1px solid var(--accent-70);color:var(--ink);
}
.chips{display:flex;flex-wrap:wrap;gap:8px}

/* ---------------- project card (measured image 330x199) ---------------- */
.pcard{
  border:1px solid var(--line);border-radius:0;background:rgba(255,255,255,.28);
  display:flex;flex-direction:column;overflow:hidden;
}
.pcard-img{
  width:100%;aspect-ratio:330/199;background:rgba(255,255,255,.4);
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.pcard-img img{width:100%;height:100%;object-fit:cover}
.pcard-img img.fg,.pcard-img img.bg{display:block;width:100%;height:100%}
.pcard-body{padding:12px 14px 14px;display:flex;flex-direction:column;gap:8px;flex:1}
.pcard-cat{font-size:15px;font-weight:600;color:var(--ink)}
.pcard-body p{font-size:14px;color:var(--ink-80);line-height:1.7}
.pcard-acts{display:flex;flex-wrap:wrap;gap:10px;margin-top:auto}

/* ---------------- panels / timeline ---------------- */
.panel{border:1px solid var(--line);border-radius:2px;padding:16px;background:rgba(255,255,255,.28)}
.panel h3{font-size:16px;font-weight:600;margin-bottom:6px}
.panel p{font-size:14px;color:var(--ink-80);line-height:1.8}
.panel-label{font-size:14px;color:var(--accent);font-weight:600;margin-bottom:4px}
.panel-row{display:flex;flex-wrap:wrap;gap:16px}
.panel-row>div{flex:1 1 240px;border:1px solid var(--line);border-radius:2px;padding:16px}

.tl{border:1px solid var(--line);border-radius:2px;padding:4px 18px;margin-bottom:16px;background:rgba(255,255,255,.24)}
.tl-item{padding:16px 0;border-bottom:1px solid rgba(171,178,191,.3)}
.tl-item:last-child{border-bottom:0}
.tl-item h3{font-size:16px;font-weight:600}
.tl-role{font-size:15px;font-weight:600;color:var(--accent)}
.tl-date{font-size:14px;color:var(--ink-80);margin:4px 0 8px}
.tl-item ul li{font-size:14px;color:var(--ink-80);line-height:1.8;padding-left:16px;position:relative}
.tl-item ul li::before{content:"-";position:absolute;left:0;color:var(--accent)}
.muted{font-size:13px;color:var(--ink-60)}

/* ---------------- long project rows ---------------- */
.proj{
  display:flex;flex-wrap:wrap;border:1px solid var(--line);border-radius:2px;
  overflow:hidden;margin-bottom:16px;background:rgba(255,255,255,.26);
}
.proj-img{
  width:330px;min-height:199px;flex-shrink:0;border-right:1px solid var(--line);
  background:rgba(255,255,255,.4);
  display:flex;align-items:center;justify-content:center;
}
.proj-body{flex:1;min-width:260px;padding:18px}
.proj-top{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.proj-body h3{font-size:16px;font-weight:600}
.proj-body p{font-size:14px;color:var(--ink-80);line-height:1.8;margin:10px 0 12px}
.proj-link{font-size:16px;font-weight:600;color:var(--ink);border-bottom:1px solid var(--accent);padding-bottom:2px}
.proj-link:hover{color:var(--accent)}
@media (max-width:700px){
  .proj-img{width:100%;min-height:160px;border-right:0;border-bottom:1px solid var(--line)}
}

/* ---------------- contact ---------------- */
.contact-intro{font-size:14px;color:var(--ink-80);line-height:1.9}
.form{display:flex;flex-direction:column;gap:16px;margin-top:18px}
.form-row{display:flex;gap:16px;flex-wrap:wrap}
.form-row .field{flex:1 1 240px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:14px;font-weight:600;color:var(--ink)}
.field input,.field select,.field textarea{
  width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:0;
  background:rgba(255,255,255,.5);font-size:14px;outline:none;
  transition:border-color .2s ease,box-shadow .2s ease;appearance:none;
}
.field select{
  background-image:linear-gradient(45deg,transparent 50%,var(--ink-80) 50%),
    linear-gradient(135deg,var(--ink-80) 50%,transparent 50%);
  background-position:calc(100% - 18px) 50%,calc(100% - 13px) 50%;
  background-size:5px 5px;background-repeat:no-repeat;padding-right:32px;
}
.field textarea{resize:vertical;min-height:130px}
.field input:focus,.field select:focus,.field textarea:focus{
  border-color:var(--accent);box-shadow:0 0 0 1px var(--accent);
}
.hidden{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.status{padding:12px 14px;border:1px solid var(--line);font-size:14px;margin-top:16px}
.status.ok{border-color:#2e7d32;color:#1b5e20}
.status.err{border-color:#c62828;color:#b71c1c}

.connect{border:1px solid var(--line);border-radius:2px;padding:6px 14px 14px;background:rgba(255,255,255,.24)}
.connect .cc-title{font-size:16px;font-weight:600;padding:12px 0 6px}
.connect li a{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid rgba(171,178,191,.28)}
.connect li:last-child a{border-bottom:0}
.connect li a:hover .c-name{color:var(--accent)}
.connect li svg{width:32px;height:32px;flex-shrink:0}
.connect .c-text{display:flex;flex-direction:column;min-width:0;flex:1}
.connect .c-name{font-size:16px;color:var(--ink-80);font-weight:600}
.connect .c-handle{font-size:14px;color:var(--ink-80);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* contact icon strip (measured 32px, horizontal) */
.iconstrip{display:flex;flex-wrap:wrap;gap:26px;padding:18px 0}
.iconstrip a{display:flex;align-items:center;gap:10px;font-size:16px;color:var(--ink-80)}
.iconstrip a:hover{color:var(--accent)}
.iconstrip svg{width:32px;height:32px}

/* ---------------- footer ---------------- */
.footer{border-top:1px solid rgba(171,178,191,.4);padding:20px 0 14px;margin-top:30px}
.footer-row{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.footer-socials{display:flex;flex-wrap:wrap;gap:20px;padding:14px 0}
.footer-socials a{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--ink-80)}
.footer-socials a:hover{color:var(--accent)}
.footer-socials svg{width:24px;height:24px}
.footer-copy{font-size:12px;color:var(--ink)}
.footer-note{font-size:12px;color:var(--ink-80);text-align:center;margin-top:10px}
@media (max-width:700px){.footer-row{flex-direction:column;align-items:flex-start}}
/* =============================================================
   FIXED SOCIAL DOCK (left, vertically centred)
   ============================================================= */
.dock{
  position:fixed;top:38%;left:20px;transform:translateY(-50%);
  display:flex;flex-direction:column;align-items:center;gap:20px;
  padding-left:16px;
  z-index:9999;
}

.dock a{
  position:relative;z-index:1;
  width:38px;height:38px;
  color:var(--ink-80);
  background:var(--bg);
  border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  transition:color .2s ease,border-color .2s ease,transform .2s ease;
}
.dock a:hover{color:var(--accent);border-color:var(--accent);transform:scale(1.12)}
.dock a svg{width:19px;height:19px;fill:currentColor}
@media (max-width:1400px){.dock{left:10px}}
@media (max-width:1100px){.dock{display:none} /* mobile: reference hides it */}

/* =============================================================
   SETTINGS / CUSTOMIZER PANEL (top-right)
   ============================================================= */
.set-btn{cursor:pointer}
.set-panel{
  position:fixed;top:var(--appbar-h);right:0;bottom:0;z-index:1200;
  width:max(300px,25vw);              /* quarter of the screen */
  background:var(--bg);
  border-left:2px solid var(--accent);
  padding:20px 22px;display:none;
  overflow-y:auto;
  box-shadow:-6px 0 18px rgba(0,0,0,.18);
}
.set-panel.open{display:block}
.set-panel h4{
  font-size:16px;font-weight:600;color:var(--accent);
  margin:0 0 4px;padding-bottom:8px;border-bottom:1px solid var(--line);
}
.set-panel .set-sub{font-size:12px;color:var(--ink-60);margin:-6px 0 16px}
.set-item{border:1px solid var(--line);padding:10px 12px;margin-bottom:10px;background:rgba(255,255,255,.3)}
.set-item .set-top{display:flex;align-items:center;gap:10px}
.set-item .set-name{font-size:14px;font-weight:600;flex:1;color:var(--ink)}
.set-item input[type=color]{
  width:46px;height:30px;padding:0;border:1px solid var(--line);
  background:none;cursor:pointer;flex-shrink:0;
}
.set-item .set-what{font-size:12px;color:var(--ink-60);line-height:1.6;margin-top:6px}
.set-item .set-val{
  font-size:11px;color:var(--ink-60);margin-top:4px;font-family:monospace;
}
.set-panel .btn{width:100%;justify-content:center;margin-top:6px}

/* radio group */
.set-radios{display:flex;gap:6px;margin-bottom:12px}
.set-radios label{
  flex:1;border:1px solid var(--line);padding:6px 4px;font-size:12px;
  text-align:center;cursor:pointer;user-select:none;
}
.set-radios input{display:none}
.set-radios input:checked + span{color:var(--accent);font-weight:600}
.set-radios label:has(input:checked){border-color:var(--accent);background:rgba(199,120,221,.12)}

/* =============================================================
   SKILLS GRID
   ============================================================= */
.skills{display:flex;flex-wrap:wrap;gap:16px}
.sk-box{
  flex:1 1 300px;border:1px solid var(--line);border-radius:2px;
  padding:14px 16px;background:rgba(255,255,255,.28);
}
.sk-box h4{font-size:15px;font-weight:600;color:var(--accent);margin-bottom:6px}
.sk-box p{font-size:14px;color:var(--ink-80);line-height:1.9}

/* =============================================================
   ABOUT with avatar
   ============================================================= */
.about-wrap{display:flex;flex-wrap:wrap;gap:28px;align-items:flex-start}
.about-txt{flex:1 1 460px}
.about-img{
  position:relative;
  flex:0 0 400px;width:400px;
  display:flex;align-items:flex-end;justify-content:flex-start;
}
.about-img::before{
  content:"";position:absolute;
  left:-14px;top:-14px;width:60%;height:60%;
  border:2px solid var(--accent);opacity:.55;z-index:0;
}
.about-img::after{
  content:"";position:absolute;
  right:-14px;bottom:-14px;width:50%;height:50%;
  border:2px solid var(--accent);opacity:.55;
  border-top:none;border-left:none;z-index:0;
}
.about-img img{position:relative;z-index:1;width:auto;height:auto;max-width:100%;max-height:min(56vh,520px);object-fit:contain}
@media (max-width:900px){
  .about-img{flex:1 1 100%;width:100%;max-width:340px;margin:24px 0 24px}
  .hero-img{max-width:100%;margin:16px 0}
  .hero-img::before{left:-10px;top:-10px}
  .hero-img::after{right:-10px;bottom:-10px}
}

/* hero company line */
.hero-company{margin-top:18px;font-size:16px;color:var(--ink-80)}
.hero-company b{color:var(--ink);font-size:20px;font-weight:600;display:block}

/* ============ EXPERIENCE CARDS (ref: 672x426) ============ */
.exps{display:flex;flex-wrap:wrap;gap:16px}
.exp-card{
  flex:1 1 460px;border:1px solid var(--line);border-radius:2px;
  padding:18px 20px;background:rgba(255,255,255,.28);
}
.exp-tech{font-size:15px;font-weight:600;color:var(--accent);margin-bottom:6px}
.exp-date{font-size:14px;color:var(--ink-80);margin-bottom:8px}
.exp-co{font-size:18px;font-weight:600;color:var(--ink);line-height:1.3}
.exp-place{font-size:14px;color:var(--ink-80);margin-top:2px;margin-bottom:10px}
.exp-card ul li{
  font-size:14px;color:var(--ink-80);line-height:1.8;
  padding-left:16px;position:relative;
}
.exp-card ul li::before{content:"-";position:absolute;left:0;color:var(--accent)}

/* ============ SPEC ADDITIONS ============ */
/* tag pills */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  display:inline-block;padding:4px 12px;border-radius:999px;
  background:rgba(171,178,191,.16);border:1px solid rgba(171,178,191,.42);
  color:var(--ink-80);font-size:12px;line-height:1.5;white-space:nowrap;
}

/* hero CTAs stacked vertically */
.hero-cta{margin-top:20px;display:flex;flex-direction:column;align-items:flex-start;gap:14px}
.hero-cta .btn{width:auto;min-width:200px}

/* About Me actions */
.about-cta{display:flex;flex-wrap:wrap;gap:14px;margin-top:20px}
.about-cta .btn{width:auto;min-width:190px}

/* hero art: portrait + dot grid + offset role box */
.hero-art{position:relative;padding:6px 0 0 0}
.hero-img{position:relative;z-index:2}
.hero-img::before,.hero-img::after{z-index:1}

/* 5x5 dot matrix behind the lower-right of the portrait */
.hero-dotgrid{
  position:absolute;right:-10px;bottom:-6px;z-index:0;
  display:grid;grid-template-columns:repeat(5,1fr);gap:11px;
  padding:10px;
}
.hero-dotgrid i{
  width:7px;height:7px;border-radius:50%;
  background:var(--accent);opacity:.5;
}

/* offset outlined card with current role */
.hero-company{
  position:relative;z-index:3;
  margin:10px 0 0 -14px;
  padding:8px 13px;
  border:1px solid var(--accent);
  background:var(--bg);
  font-size:13px;line-height:1.45;color:var(--ink-80);
  max-width:340px;
}
.hero-company b{display:block;color:var(--accent);font-weight:600;margin-top:2px}
.hero-company-k{
  display:block;font-size:10px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--ink-60);margin-bottom:2px;
}

/* project card action buttons */
.pcard-acts{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.pcard-acts .btn{min-width:0;padding:5px 15px;font-size:14px;height:38px}

/* thin short margin line under the icon stack */
.dock-line{
  position:static;width:1px;height:40px;margin-top:4px;
  background:var(--accent);opacity:.9;border-radius:0;
}

/* ---- desktop gets the big picture, mobile gets it lifted into view ---- */
@media (min-width:901px){
  .hero-img img{width:auto;height:auto;max-width:100%;max-height:min(calc(100vh - 212px),720px)}
  .about-img img{width:auto;height:auto;max-width:100%;max-height:min(calc(100vh - 340px),560px)}
}

@media (max-width:900px){
  /* normal order: introduction first, then the portrait */
  .hero{flex-direction:column;gap:8px}
  /* in a column, flex-basis becomes a forced HEIGHT -> hug the content instead */
  .hero-left{flex:0 0 auto;width:100%}
  .hero-right{flex:0 0 auto;width:100%}
  .hero-img{max-width:100%;margin:0}

  /* tighten the text column so the portrait + role box clear the fold */
  .hero-name{font-size:21px;line-height:1.25}
  .hero-sub{font-size:12px;line-height:1.5;margin:8px 0}
  .hero-cta{margin-top:10px;gap:10px}
  .hero-cta .btn{min-width:170px}
  .hero-art{padding:12px 0 0 0}
  .hero-company{
    margin:8px 0 0 -10px;padding:7px 12px;font-size:12px;line-height:1.4;max-width:100%;
  }
  /* picture keeps its size; role box stays inside the first screen */
  .hero-img img{width:auto;height:auto;max-width:100%;max-height:min(52vh,470px)}
  /* dial the decoration back on mobile */
  .hero-dotgrid{display:none}
  .hero-img::before{left:-8px;top:-8px;width:46%;height:46%;border-width:2px;opacity:.4}
  .hero-img::after{right:-8px;bottom:-8px;width:38%;height:38%;border-width:2px;opacity:.4}
  .about-img img{width:auto;height:auto;max-width:100%;max-height:min(44vh,400px)}
  .about-img::before,.about-img::after{display:none}
}

/* ---- desktop: portrait sits flush RIGHT; mobile keeps it left ---- */
@media (min-width:901px){
  .hero-img{justify-content:flex-end}
  .about-img{justify-content:flex-end}
  .hero-company{margin:10px -14px 0 0}
  .hero-dotgrid{right:auto;left:-10px}
  .hero-img::before{left:auto;right:-16px}
  .hero-img::after{right:auto;left:-16px}
}

/* ---- nothing may overlap the transparent cutout ---- */
.hero-img::before,.hero-img::after,
.about-img::before,.about-img::after{display:none}

/* single clean accent rule + dot matrix, both clear of the portrait */
.hero-art::before{
  content:"";position:absolute;left:-14px;top:6px;bottom:6px;width:2px;
  background:var(--accent);opacity:.45;z-index:0;
}
.hero-dotgrid{right:auto;left:-6px;bottom:-4px;z-index:0}
.hero-img{z-index:2}

/* FIX 2: role box flush to the same right edge as the portrait */
@media (min-width:901px){
  .hero-company{
    margin:10px 0 0 auto;max-width:340px;
  }
}

/* FIX 3: mobile portrait nudged right of flush-left */
@media (max-width:900px){
  .hero-img{justify-content:center}
  .hero-art::before{left:-8px}
}

/* ============================================================
   LEFT MARGIN RAIL  (notebook rule + social column)
   starts level with the menu button, stops before screen centre
   ============================================================ */
.rail{
  position:fixed;
  top:84px;                      /* menu button centre */
  left:var(--rail-x);
  width:40px;
  height:calc(48vh - 92px);
  display:flex;flex-direction:column;align-items:center;
  z-index:9999;
  pointer-events:none;
}
/* the long margin rule */
.rail-rule{
  width:1px;flex:1 1 auto;min-height:56px;
  background:var(--accent);opacity:.38;
}
/* the app icons, each their own row */
.rail-acts{
  display:flex;flex-direction:column;align-items:center;gap:12px;
  padding:12px 0;pointer-events:auto;flex:0 0 auto;
}
.rail-acts a{
  width:38px;height:38px;flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;
  color:var(--ink-80);background:none;border:0;
  transition:color .2s ease,transform .2s ease;
}
.rail-acts a:hover{color:var(--accent);transform:scale(1.18)}
.rail-acts a svg{
  width:24px;height:24px;fill:currentColor;
  stroke:currentColor;stroke-width:1.1;stroke-linejoin:round;stroke-linecap:round;
  paint-order:stroke fill;
}
/* short closing line */
.rail-tail{width:1px;height:22px;flex:0 0 auto;background:var(--accent);opacity:.38}

@media (min-width:901px){ :root{--rail-x:74px} }
@media (max-width:900px){
  :root{--rail-x:10px}
  .rail-acts{gap:10px;padding:10px 0}
  .rail-acts a{width:32px;height:32px}
  .rail-acts a svg{
    width:21px;height:21px;
    stroke-width:1;paint-order:stroke fill;
  }
  .rail-tail{height:18px}
  .rail{height:calc(48vh - 88px)}
}

/* the old dock is gone */
.dock{display:none}

/* ============================================================
   MARGIN GUTTER: content starts after the rule, never across it
   ============================================================ */
@media (min-width:901px){
  .page{padding-left:60px}          /* rail occupies 88..128 */
  .footer{padding-left:60px}
}
@media (max-width:900px){
  .page{padding-left:58px}          /* rail occupies 16..52  */
  .footer{padding-left:58px}
  /* cancel the full-bleed grid so cards cannot slide back under the rail */
  .grid{margin-left:0;margin-right:0}
  .g-12{width:100%}
}

/* ---------- icon-only social buttons (no visible text) ---------- */
.sicon{
  display:inline-flex;align-items:center;justify-content:center;
  width:44px;height:44px;border-radius:2px;
  color:var(--ink-80);background:none;border:1px solid var(--line);
  transition:color .2s ease,border-color .2s ease,transform .2s ease;
}
.sicon svg{
  width:22px;height:22px;fill:currentColor;
  stroke:currentColor;stroke-width:.9;stroke-linejoin:round;stroke-linecap:round;
  paint-order:stroke fill;
}
.sicon:hover{color:var(--accent);border-color:var(--accent);transform:translateY(-2px)}
.sicon:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sicon.big{width:52px;height:52px}
.sicon.big svg{width:26px;height:26px;stroke-width:1}

/* lists of icon-only links */
.footer-socials{display:flex;flex-wrap:wrap;gap:14px;padding:16px 0}
.iconstrip{display:flex;flex-wrap:wrap;gap:14px;padding:18px 0}
.connect ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:14px}
.connect li{margin:0}

/* disabled state for links whose file is not installed yet */
.is-off{opacity:.45;pointer-events:none;cursor:not-allowed}

/* ---------- project cards: horizontal (image beside the text) ---------- */
.pcard.hcard{flex-direction:row;align-items:stretch}
.pcard.hcard .pcard-img{
  width:40%;flex:0 0 40%;
  border-bottom:0;border-right:1px solid var(--line);
  position:relative;overflow:hidden;background:var(--bg);
  display:flex;align-items:center;justify-content:center;
}
.pcard.hcard .pcard-body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}
.pcard.hcard .pcard-acts{margin-top:auto;padding-top:12px}
/* alternate the image side for rhythm */
.pcard.hcard:nth-child(even) .pcard-img{
  order:2;border-right:0;border-left:1px solid var(--line);
}
/* Portrait phone screenshots fill the frame and crop from the bottom, keeping
   the app header, nav and first screen visible. */
.pcard-img .shot{display:flex;width:100%;height:100%;align-items:center;justify-content:center}
.pcard-img .shot.tall{aspect-ratio:3/4;height:auto;max-height:420px}
.pcard-img picture{display:contents}
.pcard-img .shot.tall img{width:100%;height:100%;object-fit:cover;object-position:center top}
/* Landscape images (e.g. the transcription shot) are shown WHOLE: no crop, no zoom. */
.pcard-img .shot.wide{aspect-ratio:16/9;height:auto}
.pcard-img .shot.wide img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
/* Screenshots fill the frame and crop from the bottom, so the app header,
   nav and first content stay visible. No letterboxing = no slim image. */
.pcard.hcard .pcard-img img.fg{object-position:center top}


/* ---------- project cards stack on narrow screens ---------- */
@media (max-width:900px){
  .pcard.hcard{flex-direction:column}
  .pcard.hcard .pcard-img,
  .pcard.hcard:nth-child(even) .pcard-img{
    order:0;width:100%;flex:none;
    border-right:0;border-left:0;border-bottom:1px solid var(--line);
  }
  .pcard.hcard .pcard-body{width:100%}
  .pcard-img .shot.tall{max-height:340px;margin:0 auto}
  .pcard-img .shot.wide{max-height:none;max-width:100%}
}


/* ---------- masonry: cards flow past each other, no dead space ---------- */
.mgrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-rows:8px;          /* JS measures and sets row spans */
  column-gap:16px;
}
.mgrid .mcard{min-width:0;align-self:start}
.mgrid .sec-head.mfull{grid-column:1/-1;margin:22px 0 2px}
.mgrid .sec-head.mfull:first-child{margin-top:0}
@media (max-width:900px){
  .mgrid{grid-template-columns:minmax(0,1fr)}
}

/* ---------- wordmark: display face for the name only ---------- */

/* ---------- homepage project cards: image above text, 3 across ---------- */
.pcard.vcard{flex-direction:column}
.pcard.vcard .pcard-img{
  width:100%;flex:none;
  border-bottom:1px solid var(--line);border-right:0;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;background:var(--bg);
}
.pcard.vcard .pcard-body{padding:14px}
.pcard.vcard .pcard-img .shot{max-height:none;width:100%;height:auto}
.pcard.vcard .pcard-img .shot.tall{aspect-ratio:3/4}
.pcard.vcard .pcard-img .shot.wide{aspect-ratio:16/9}

.proj-see{margin:20px 0 0}
.proj-see .proj-link{display:inline-flex;align-items:center;gap:8px}

/* ---------- Starixo: wordmark face (Keristyper, personal-use licence) ----------
   Charset is A-Z a-z 0-9 space ONLY - no punctuation - so Abril Fatface and
   Fira Code stay in the chain to cover anything Starixo cannot draw.        */
@font-face{
  font-family:"Starixo";
  src:local("Starixo"),
      url("assets/Starixo.woff") format("woff");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
.wordmark{
  font-family:"Starixo","Abril Fatface",cursive;
  font-weight:400;
  font-size:2.1em;        /* Starixo cap height is short; scaled to match Abril's presence */
  line-height:1.05;
  letter-spacing:.05em;
}

/* Starixo is a wide face; on narrow screens it must shrink to fit the column
   or it pushes the page into horizontal scroll. */
@media (max-width:520px){
  .wordmark{ font-size:1.5em; letter-spacing:.03em; }
}
