:root{--bg:#f3f2ee;--paper:#faf9f5;--ink:#171817;--muted:#696b67;--line:#d6d5ce;--blue:#234e70;--blue-soft:#dfe9ee;--amber:#a9682c;--amber-soft:#eee0d1;--dark:#181b1b;--white:#f3f2ee}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,Arial,sans-serif;font-size:15px;line-height:1.65}a{color:inherit;text-decoration:none}.nav{height:76px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 5vw;position:sticky;top:0;background:rgba(243,242,238,.92);backdrop-filter:blur(12px);z-index:10}.brand{font-size:14px;font-weight:700;letter-spacing:.12em}.brand span{color:var(--amber)}nav{display:flex;gap:30px;align-items:center;font-family:'DM Mono',monospace;font-size:11px;text-transform:uppercase;letter-spacing:.04em}nav a{opacity:.7;transition:.2s}nav a:hover{opacity:1}.nav-cv{border:1px solid var(--ink);padding:9px 13px;opacity:1}.section-grid{display:grid;grid-template-columns:150px minmax(0,1fr);gap:50px;padding-left:5vw;padding-right:5vw}.hero{min-height:calc(100vh - 76px);align-items:center;padding-top:8vh;padding-bottom:8vh}.eyebrow,.section-label,.path-top,.project-meta,.date,.type,.pub-year,.skill-columns span,.blueprint-label,.hero-code{font-family:'DM Mono',monospace;font-size:10px;letter-spacing:.08em}.eyebrow{display:flex;gap:16px;color:var(--muted);margin-bottom:30px}.eyebrow span,.section-label span:first-child{color:var(--amber)}h1{font-size:clamp(48px,7vw,92px);line-height:.98;letter-spacing:-.055em;margin:0 0 30px;font-weight:600}h1 em,.statement em,.about h2 em{font-family:'Source Serif 4',serif;font-weight:500}.hero-lead{font-size:17px;max-width:620px;color:#555752;line-height:1.8}.hero-actions{display:flex;gap:12px;margin-top:35px}.button{display:inline-flex;gap:30px;border:1px solid var(--line);padding:13px 17px;font-family:'DM Mono',monospace;font-size:11px}.button.primary{background:var(--ink);color:var(--white);border-color:var(--ink)}.hero-visual{height:510px;position:relative;border-left:1px solid var(--line);border-bottom:1px solid var(--line);background-image:linear-gradient(rgba(23,24,23,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(23,24,23,.05) 1px,transparent 1px);background-size:42px 42px;overflow:hidden}.blueprint-label{position:absolute;top:20px;right:20px;color:var(--blue)}.axis{position:absolute;background:var(--blue);opacity:.55}.axis.x{height:1px;width:330px;left:22%;top:58%;transform:rotate(-22deg)}.axis.y{height:1px;width:280px;left:36%;top:48%;transform:rotate(68deg)}.axis.z{height:1px;width:260px;left:40%;top:57%;transform:rotate(12deg)}.joint{position:absolute;width:18px;height:18px;border:2px solid var(--blue);border-radius:50%;background:var(--bg)}.j1{left:29%;top:54%}.j2{left:51%;top:39%}.j3{left:72%;top:54%}.arm{position:absolute;height:2px;background:var(--blue);transform-origin:left}.a1{width:180px;left:30%;top:55%;transform:rotate(-34deg)}.a2{width:180px;left:52%;top:40%;transform:rotate(34deg)}.a3{width:105px;left:72%;top:55%;transform:rotate(-62deg)}.dimension{position:absolute;border-top:1px solid var(--amber);height:40px;width:120px;color:var(--amber);font-family:'DM Mono',monospace;font-size:12px}.dimension:before,.dimension:after{content:'';position:absolute;top:-4px;width:7px;height:7px;border-top:1px solid var(--amber)}.dimension:before{left:0;transform:rotate(-45deg)}.dimension:after{right:0;transform:rotate(45deg)}.d1{left:30%;top:28%;transform:rotate(-34deg)}.d2{left:57%;top:66%;transform:rotate(34deg)}.coordinate{position:absolute;right:12%;bottom:13%;font-family:'DM Mono',monospace;font-size:11px;line-height:1.2;color:var(--blue)}.hero-code{position:absolute;left:25px;bottom:20px;line-height:1.8;color:var(--muted)}.identity{padding-top:130px;padding-bottom:80px}.section-label{display:flex;flex-direction:column;gap:8px;color:var(--muted)}.statement{font-size:clamp(30px,4vw,52px);line-height:1.15;letter-spacing:-.035em;margin:0 0 25px}.body-copy{max-width:720px;color:var(--muted);font-size:16px}.paths{display:grid;grid-template-columns:1fr 1fr;margin:0 5vw 140px}.path-card{min-height:390px;padding:24px;border:1px solid var(--line);display:flex;flex-direction:column;justify-content:space-between;transition:.3s}.path-card+ .path-card{border-left:0}.path-card.academic:hover{background:var(--blue-soft)}.path-card.industry:hover{background:var(--amber-soft)}.path-top,.path-bottom{display:flex;justify-content:space-between;color:var(--muted)}.path-content{display:flex;justify-content:space-between;align-items:center;gap:30px}.path-content h2{font-size:clamp(34px,4vw,56px);line-height:1;letter-spacing:-.05em;margin:0 0 22px}.path-content p{max-width:430px;color:var(--muted)}.path-symbol{font-family:'Source Serif 4',serif;font-size:34px;display:flex;flex-direction:column;align-items:center;gap:6px;opacity:.7}.academic-symbol{color:var(--blue)}.industrial-symbol{color:var(--amber)}.path-bottom{border-top:1px solid var(--line);padding-top:15px}.section{padding-top:110px;padding-bottom:130px}.section-heading-row{display:flex;align-items:end;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:20px;margin-bottom:40px}.section-heading-row h2{font-size:clamp(35px,4vw,56px);line-height:1;margin:0;letter-spacing:-.05em}.section-heading-row>span{font-family:'DM Mono',monospace;font-size:10px;color:var(--muted)}.work-grid{display:grid;grid-template-columns:1fr 1fr;gap:60px 30px}.project-image{height:330px;background:var(--paper);border:1px solid var(--line);position:relative;overflow:hidden}.project-image>span{position:absolute;top:17px;left:17px;font-family:'DM Mono',monospace;font-size:12px}.project-image small{position:absolute;top:18px;right:18px;font-family:'DM Mono',monospace;font-size:9px;color:var(--muted)}.surena{background-color:#e9eceb;background-image:linear-gradient(rgba(35,78,112,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(35,78,112,.08) 1px,transparent 1px);background-size:28px 28px}.robot-line{position:absolute;left:31%;top:25%;width:37%;height:50%;border:2px solid var(--blue);border-radius:48% 48% 30% 30%;transform:skew(-4deg)}.robot-line:after{content:'';position:absolute;left:50%;top:0;height:100%;border-left:1px dashed var(--blue)}.prosthesis{background:linear-gradient(150deg,#f0efea,#dfe9ee)}.wave{position:absolute;left:12%;right:12%;top:50%;height:50px;border-top:2px solid var(--blue);border-radius:50%;transform:rotate(-8deg);box-shadow:0 -13px 0 -12px var(--blue),0 13px 0 -12px var(--blue)}.microdrive{background:linear-gradient(135deg,#eee9e1,#f6f5f1)}.syringe{position:absolute;width:55%;height:28px;left:24%;top:49%;border:2px solid var(--ink);transform:rotate(-18deg)}.syringe:before{content:'';position:absolute;width:70px;height:8px;border:2px solid var(--ink);left:-74px;top:7px}.syringe:after{content:'';position:absolute;height:120px;border-left:2px solid var(--amber);right:-25px;top:-48px;transform:rotate(18deg)}.industry-project{background-color:#e9e5de;background-image:linear-gradient(rgba(169,104,44,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(169,104,44,.07) 1px,transparent 1px);background-size:35px 35px}.cad-box{position:absolute;width:45%;height:45%;left:28%;top:28%;border:2px solid var(--amber);transform:skewY(-12deg)}.cad-box:before,.cad-box:after{content:'';position:absolute;border:1px solid var(--amber)}.cad-box:before{width:70%;height:40%;left:15%;top:25%}.cad-box:after{width:1px;height:100%;left:50%;top:0}.project-meta{display:flex;justify-content:space-between;color:var(--muted);margin:15px 0 8px}.project h3{font-size:24px;letter-spacing:-.025em;margin:0 0 10px}.project p{color:var(--muted);max-width:620px}.tags{display:flex;gap:7px;flex-wrap:wrap;margin-top:16px}.tags span{border:1px solid var(--line);padding:4px 8px;font-family:'DM Mono',monospace;font-size:9px;color:var(--muted)}.dark-section{background:var(--dark);color:var(--white);padding-left:5vw;padding-right:5vw}.dark-section .section-label{color:#8f9490}.dark-section .section-heading-row{border-color:#363a38}.dark-section .section-heading-row>span{color:#8f9490}.timeline-item{display:grid;grid-template-columns:120px 1fr 100px;gap:20px;padding:25px 0;border-bottom:1px solid #343836;align-items:start}.timeline-item h3{margin:0;font-size:19px}.timeline-item p{margin:4px 0 0;color:#9a9e9b}.timeline-item .date,.timeline-item .type{color:#8f9490}.timeline-item .type{text-align:right}.publication-list article{display:grid;grid-template-columns:80px 1fr;gap:25px;padding:28px 0;border-bottom:1px solid var(--line)}.publication-list h3{font-size:21px;line-height:1.35;margin:0 0 7px}.publication-list p{color:var(--muted);margin:0}.pub-year{color:var(--amber)}.about{padding-top:100px;padding-bottom:150px}.about-content>h2{font-size:clamp(38px,5vw,65px);line-height:1.05;letter-spacing:-.045em;margin:0 0 35px}.about-content>p{font-size:17px;color:var(--muted);max-width:850px}.skill-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:30px;margin-top:60px}.skill-columns div{border-top:1px solid var(--line);padding-top:14px}.skill-columns span{color:var(--muted)}.skill-columns p{margin:10px 0 0}.section:target{scroll-margin-top:100px}footer{border-top:1px solid var(--line);padding:35px 5vw;display:grid;grid-template-columns:1fr auto auto;gap:40px;align-items:center;font-family:'DM Mono',monospace;font-size:10px;color:var(--muted)}footer strong{display:block;color:var(--ink);font-family:Inter,sans-serif;font-size:12px;letter-spacing:.1em;margin-bottom:4px}.footer-links{display:flex;gap:20px}.footer-links a:hover{color:var(--ink)}@media(max-width:900px){.section-grid{grid-template-columns:1fr;gap:25px}.section-label{flex-direction:row}.hero{padding-top:70px}.hero-visual{height:380px;margin-top:30px}.paths{grid-template-columns:1fr}.path-card+.path-card{border-left:1px solid var(--line);border-top:0}.work-grid{grid-template-columns:1fr}.skill-columns{grid-template-columns:1fr}.timeline-item{grid-template-columns:90px 1fr}.timeline-item .type{display:none}footer{grid-template-columns:1fr;gap:15px}.nav{padding:0 4vw}.nav nav a:not(.nav-cv){display:none}.section{padding-top:80px;padding-bottom:90px}.paths{margin-bottom:80px}}@media(max-width:560px){h1{font-size:48px}.hero-actions{flex-direction:column;align-items:stretch}.button{justify-content:space-between}.hero-visual{height:310px}.path-content{align-items:flex-start}.path-symbol{display:none}.project-image{height:260px}.publication-list article{grid-template-columns:55px 1fr}.publication-list h3{font-size:17px}}

/* --- v2 motion + responsive hero --- */
.hero-visual{display:flex;align-items:stretch;isolation:isolate}
.hero-diagram{position:absolute;inset:0;width:100%;height:100%;color:var(--blue);opacity:.72;z-index:0}
.diagram-geometry line,.diagram-geometry circle{fill:var(--bg);stroke:currentColor;stroke-width:2}
.diagram-geometry .dimension-line,.diagram-geometry .arc-line{fill:none;stroke:var(--amber);stroke-width:1.5}
.axis-lines line{stroke:var(--blue);stroke-width:1.5;opacity:.65}
.diagram-labels text{fill:var(--blue);font-family:'DM Mono',monospace;font-size:12px}
.hero-photo-wrap{position:absolute;z-index:2;right:9%;top:18%;width:min(240px,42%);aspect-ratio:3/4}
.photo-frame{position:relative;width:100%;height:100%;background:var(--paper);border:1px solid var(--line);overflow:hidden;box-shadow:14px 14px 0 rgba(35,78,112,.08)}
.photo-frame:before{content:'';position:absolute;inset:10px;border:1px solid rgba(35,78,112,.22);z-index:2;pointer-events:none}
.photo-frame img{width:100%;height:100%;object-fit:cover;display:block;filter:saturate(.78) contrast(1.02)}
.photo-placeholder{display:none;position:absolute;inset:0;align-items:center;justify-content:center;text-align:center;font-family:'DM Mono',monospace;font-size:12px;letter-spacing:.12em;color:var(--blue);line-height:1.8;background:linear-gradient(135deg,#e9eceb,#f5f3ed)}
.photo-placeholder.show{display:flex}
.photo-note{position:absolute;right:-34px;bottom:-25px;font-family:'DM Mono',monospace;font-size:9px;color:var(--muted);transform:rotate(-90deg);transform-origin:right top}
.hero-code{z-index:3}
.reveal{opacity:0;transform:translateY(28px);transition:opacity .8s ease,transform .9s cubic-bezier(.2,.7,.2,1)}
.reveal.is-visible{opacity:1;transform:none}
.reveal-group>*{opacity:0;transform:translateY(25px);transition:opacity .7s ease,transform .8s cubic-bezier(.2,.7,.2,1)}
.reveal-group.is-visible>*{opacity:1;transform:none}
.reveal-group.is-visible>*:nth-child(2){transition-delay:.12s}
.reveal-group.is-visible>*:nth-child(3){transition-delay:.24s}
.nav nav a.active{opacity:1}
.path-card,.project,.publication-list article,.timeline-item{transition:transform .35s ease,background .35s ease,border-color .35s ease}
.path-card:hover{transform:translateY(-5px)}
.project:hover{transform:translateY(-5px)}
.project-image{transition:transform .5s ease}
.project:hover .project-image{transform:scale(.985)}

@media(max-width:1100px){
  .hero-visual{min-height:460px}
  .hero-photo-wrap{right:7%;top:17%;width:205px}
}
@media(max-width:900px){
  .hero-visual{height:420px;min-height:0}
  .hero-photo-wrap{right:8%;top:15%;width:190px}
  .hero-diagram{opacity:.58}
}
@media(max-width:650px){
  .hero-visual{height:340px;margin-top:25px}
  .hero-photo-wrap{right:7%;top:12%;width:135px}
  .photo-note{display:none}
  .hero-diagram{left:-8%;width:116%;opacity:.42}
  .hero-code{left:16px;bottom:14px}
  .blueprint-label{font-size:8px;top:14px;right:14px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none!important;transition:none!important}
}


/* v3 hero refinement: portrait-led, no decorative engineering diagram */
.hero-portrait {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 10px 30px;
}
.hero-portrait::before {
  content: "";
  position: absolute;
  width: min(78%, 430px);
  aspect-ratio: 1 / 1.18;
  border: 1px solid var(--line, rgba(20,25,30,.16));
  border-radius: 2px;
  transform: translate(24px, 18px);
  pointer-events: none;
}
.hero-portrait::after {
  content: "";
  position: absolute;
  width: 72px; height: 72px;
  border-left: 1px solid var(--accent, #315b7d);
  border-top: 1px solid var(--accent, #315b7d);
  top: 48px; right: 24px;
  opacity: .7;
  pointer-events: none;
}
.hero-portrait-label {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 10px; letter-spacing: .14em;
  opacity: .62;
}
.hero-portrait .hero-photo-wrap {
  position: relative; z-index: 1;
  width: min(78%, 430px);
}
.hero-portrait .photo-frame {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #e9e8e4;
  border: 1px solid var(--line, rgba(20,25,30,.16));
  box-shadow: 18px 18px 0 rgba(20,25,30,.055);
}
.hero-portrait .photo-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hero-portrait .photo-placeholder {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center; text-align: center;
  font-size: 12px; letter-spacing: .18em; line-height: 1.7;
  color: rgba(20,25,30,.45);
}
.hero-portrait .photo-placeholder.show { display: flex; }
.hero-portrait .photo-note {
  position: absolute; right: -34px; bottom: 12px;
  font-size: 9px; letter-spacing: .15em; opacity: .55;
  transform: rotate(-90deg); transform-origin: right bottom;
}
.hero-portrait-meta {
  position: absolute; z-index: 2; left: 6px; bottom: 0;
  display: flex; flex-direction: column; gap: 7px;
  font-size: 9px; letter-spacing: .12em; opacity: .62;
}
@media (max-width: 820px) {
  .hero-portrait { min-height: 430px; margin-top: 12px; }
  .hero-portrait .hero-photo-wrap, .hero-portrait::before { width: min(76%, 340px); }
  .hero-portrait::after { right: 8px; top: 38px; width: 52px; height: 52px; }
}
@media (max-width: 560px) {
  .hero-portrait { min-height: 390px; padding-top: 34px; }
  .hero-portrait .hero-photo-wrap, .hero-portrait::before { width: min(78%, 300px); }
  .hero-portrait-meta { display: none; }
  .hero-portrait .photo-note { right: -27px; }
}

/* --- v3 multi-page portfolio --- */
.page-hero{min-height:58vh;align-items:end;padding-top:100px;padding-bottom:100px}.page-hero h1{margin-top:12px}.page-hero .hero-lead{max-width:760px}.academic-entry{padding:28px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.academic-entry h3{font-size:30px;margin:5px 0}.entry-kicker,.interest-grid,.compact-list>div>span,.course-grid,.project-list>article>span,.project-list>article>b,.capability-grid>div>span{font-family:'DM Mono',monospace;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.entry-title{font-size:17px;margin:0 0 10px}.muted{color:var(--muted)}.interest-grid{display:grid;grid-template-columns:repeat(3,1fr);margin-top:35px;border-top:1px solid var(--line);border-left:1px solid var(--line)}.interest-grid span{padding:16px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);color:var(--ink)}.research-entry{display:grid;grid-template-columns:150px 1fr;gap:35px;padding:32px 0;border-bottom:1px solid #343836}.research-entry h3{margin:0 0 4px;font-size:24px}.research-entry .entry-title{color:#aeb2ae}.research-entry ul{margin:16px 0 0;padding-left:20px;color:#bfc2bf}.research-entry li{margin:7px 0}.dark-section .date{color:#8f9490}.compact-list>div{display:grid;grid-template-columns:130px 1fr auto;gap:20px;align-items:baseline;padding:22px 0;border-bottom:1px solid var(--line)}.compact-list h3{margin:0;font-size:20px}.compact-list b{font-family:'DM Mono',monospace;font-size:10px;font-weight:400;color:var(--muted)}.course-grid{display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--line);border-left:1px solid var(--line)}.course-grid div{padding:20px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);font-family:Inter,sans-serif;font-size:15px;letter-spacing:0;text-transform:none;color:var(--ink)}.course-grid b{float:right;font-family:'DM Mono',monospace;font-size:10px;font-weight:400;color:var(--amber)}.project-list>article{display:grid;grid-template-columns:45px 1fr 110px;gap:20px;padding:30px 0;border-bottom:1px solid var(--line);align-items:start}.project-list h3{margin:0 0 7px;font-size:23px}.project-list p{color:var(--muted);margin:0;max-width:780px}.project-list>article>b{text-align:right;font-weight:400}.experience-accordion details{border-bottom:1px solid #343836}.experience-accordion summary{display:grid;grid-template-columns:120px 1fr 100px;gap:20px;padding:27px 0;align-items:start;cursor:pointer;list-style:none}.experience-accordion summary::-webkit-details-marker{display:none}.experience-accordion summary h3{margin:0;font-size:20px}.experience-accordion summary p{margin:4px 0 0;color:#9a9e9b}.experience-accordion summary .type{color:#8f9490;text-align:right}.experience-accordion details[open] summary .type{color:var(--amber)}.experience-detail{margin:-2px 100px 28px 140px;padding:22px 25px;border-left:1px solid var(--amber);background:#202423;color:#bfc2bf}.experience-detail p{margin:0 0 10px}.experience-detail p:last-of-type{margin-bottom:0}.experience-detail .tags{margin-top:17px}.capability-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:30px}.capability-grid>div{border-top:1px solid var(--line);padding-top:14px}.capability-grid p{color:var(--muted);margin:10px 0 0}.active{opacity:1!important}
@media(max-width:900px){.page-hero{min-height:auto;padding-top:80px;padding-bottom:70px}.interest-grid,.course-grid,.capability-grid{grid-template-columns:1fr}.research-entry{grid-template-columns:1fr;gap:10px}.compact-list>div{grid-template-columns:90px 1fr}.compact-list b{grid-column:2}.project-list>article{grid-template-columns:35px 1fr}.project-list>article>b{grid-column:2;text-align:left}.experience-accordion summary{grid-template-columns:90px 1fr}.experience-accordion summary .type{display:none}.experience-detail{margin:0 0 25px 110px}}
@media(max-width:560px){.page-hero h1{font-size:48px}.experience-accordion summary{grid-template-columns:1fr}.experience-detail{margin:0 0 22px 0}.compact-list>div{grid-template-columns:1fr}.compact-list b{grid-column:auto}.publication-list article{grid-template-columns:55px 1fr}}

/* === Mahdi Portfolio v5 visual refresh === */
:root{
 --bg:#eef2f5;
 --paper:#ffffff;
 --ink:#101827;
 --muted:#586273;
 --line:#d5dce5;
 --blue:#155e9b;
 --blue-soft:#dcecf8;
 --amber:#c47a2c;
 --amber-soft:#f6eadb;
 --dark:#0d1724;
 --white:#f5f7fa;
}
body{background:linear-gradient(180deg,#eef2f5 0%,#f8fafc 45%,#eef2f5 100%)}
.nav{background:rgba(238,242,245,.88);border-color:#d5dce5}
.hero-visual{background-color:#f8fafc;border-radius:18px;border:1px solid var(--line);box-shadow:0 20px 50px rgba(15,23,42,.08)}
.button{border-radius:8px;transition:.25s;background:#fff}
.button:hover{transform:translateY(-3px);box-shadow:0 10px 25px rgba(15,23,42,.12)}
.button.primary{background:linear-gradient(135deg,#102a43,#155e9b)}
.path-card{background:rgba(255,255,255,.65);border-radius:18px;box-shadow:0 12px 35px rgba(15,23,42,.04)}
.path-card:hover{transform:translateY(-6px)}
.project-image{border-radius:16px;box-shadow:0 12px 30px rgba(15,23,42,.06)}
.tags span{border-radius:20px;background:#fff}
.dark-section{background:linear-gradient(135deg,#0d1724,#162b40)}
.section-heading-row{border-color:#cbd5e1}
footer{background:#f8fafc}

.hero-portrait .photo-frame{border-radius:18px;overflow:hidden}
.hero-portrait img{width:100%;height:100%;object-fit:cover}
.photo-placeholder{background:linear-gradient(135deg,#dbeafe,#e2e8f0);color:#64748b}


/* === Academic Section Color Refresh v2 === */
/* === Mahdi Academic Portfolio - Section Color Refresh v2 === */

/* Soft section identity system */
#education{
  background: linear-gradient(180deg,#f8fafc 0%,#eef4f8 100%);
}

#research{
  background: linear-gradient(135deg,#0d1724 0%,#162b40 100%);
}

#publications{
  background: linear-gradient(180deg,#eef6ff 0%,#f8fbff 100%);
}

#teaching{
  background: linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);
}

#courses{
  background: linear-gradient(180deg,#fbf6ef 0%,#f8f3ec 100%);
}

#projects{
  background: linear-gradient(180deg,#f1f5f9 0%,#eaf1f7 100%);
}


/* Add depth without losing academic style */
#education .academic-entry,
#publications .publication-list article,
#teaching .compact-list > div,
#courses .course-grid div,
#projects .project-list > article{
  background:rgba(255,255,255,.72);
  border-radius:14px;
  transition:
    transform .3s ease,
    box-shadow .3s ease,
    background .3s ease;
}


/* Hover interaction */
#education .academic-entry:hover,
#publications .publication-list article:hover,
#teaching .compact-list > div:hover,
#courses .course-grid div:hover,
#projects .project-list > article:hover{
  transform:translateY(-5px);
  background:#ffffff;
  box-shadow:0 18px 40px rgba(15,23,42,.10);
}


/* Research cards */
#research .research-entry{
  border-radius:14px;
  transition:.3s ease;
}

#research .research-entry:hover{
  background:rgba(255,255,255,.06);
  transform:translateX(8px);
}


/* Academic interest chips */
#education .interest-grid span{
  background:rgba(255,255,255,.55);
  transition:.25s ease;
}

#education .interest-grid span:hover{
  background:#dcecf8;
  color:#155e9b;
}


/* Project emphasis */
#projects .project-list > article > span{
  color:#155e9b;
  font-weight:600;
}


/* Better separation between sections */
#education,
#publications,
#teaching,
#courses,
#projects{
  border-top:1px solid rgba(148,163,184,.25);
}


/* Keep mobile clean */
@media(max-width:900px){
  #education .academic-entry,
  #publications .publication-list article,
  #teaching .compact-list > div,
  #courses .course-grid div,
  #projects .project-list > article{
    border-radius:10px;
  }
}


/* === Academic Visual Balance v4 integrated === */

/* === Mahdi Academic Portfolio Visual Balance v4 === */
/* Professional alternating blue surfaces */

#education,
#courses {
  background: linear-gradient(180deg, #f7fbff 0%, #edf5fb 100%);
}

#research,
#projects {
  background: linear-gradient(180deg, #e6f1fa 0%, #d9e9f6 100%);
}

#publications,
#teaching {
  background: linear-gradient(180deg, #f2f8fd 0%, #e8f2fa 100%);
}

/* Smooth entrance */
.section {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity .8s ease,
    transform .8s ease;
}

.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Create visual rhythm between sections */
.section:nth-child(even) {
  box-shadow: inset 0 1px 0 rgba(21,94,155,.08);
}

.section:nth-child(odd) {
  box-shadow: inset 0 1px 0 rgba(21,94,155,.04);
}

/* Cards stay clean on colored backgrounds */
#education .academic-entry,
#publications .publication-list article,
#teaching .compact-list > div,
#courses .course-grid div,
#projects .project-list > article {
  background: rgba(255,255,255,.82);
  border-radius: 16px;
  transition:
    transform .35s ease,
    box-shadow .35s ease;
}

#education .academic-entry:hover,
#publications .publication-list article:hover,
#teaching .compact-list > div:hover,
#courses .course-grid div:hover,
#projects .project-list > article:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(21,94,155,.13);
}

/* Slight blue accent on interactive elements */
.interest-grid span:hover,
.tags span:hover {
  background: #e2f0fb;
  color: #155e9b;
}

/* === v6 Research Contrast + Viewport Fade Reveal === */

/* Research contrast on the light-blue alternating section */
#research {
  color: var(--ink);
}

#research .section-label,
#research .section-heading-row > span,
#research .date {
  color: #49677f;
}

#research .section-heading-row {
  border-color: rgba(21,94,155,.24);
}

#research .research-entry {
  border-bottom-color: rgba(21,94,155,.20);
}

#research .research-entry h3 {
  color: #13263a;
}

#research .research-entry .entry-title {
  color: #365b78;
}

#research .research-entry ul,
#research .research-entry li {
  color: #34495c;
}

#research .research-entry:hover {
  background: rgba(255,255,255,.55);
  transform: translateX(6px);
}

/* Normal scrolling — no snap, no forced section locking */
html {
  scroll-behavior: smooth;
  scroll-snap-type: none;
}

/* Section reveal:
   each section gently fades and lifts when it enters the viewport.
   Your existing IntersectionObserver adds .is-visible. */
.section.reveal,
.page-hero.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .85s ease,
    transform .85s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}

.section.reveal.is-visible,
.page-hero.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Very subtle "live" highlight as a section becomes visible */
.section.reveal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,.16) 45%,
    transparent 70%
  );
  transition: opacity .7s ease;
}

.section.reveal.is-visible::after {
  opacity: 1;
}

/* Keep the overlay behind actual section content */
.section.reveal > * {
  position: relative;
  z-index: 1;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .section.reveal,
  .page-hero.reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .section.reveal::after {
    display: none;
  }
}

/* === v14 Fixed Section Titles + Smooth Boundary Handoff === */

.academic-stage-page {
  overflow: hidden;
}

.academic-stage {
  position: relative;
  height: calc(100vh - 76px);
  overflow: hidden;
}

.academic-stage > main {
  display: contents;
}

.academic-stage .stage-panel,
.academic-stage .stage-footer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.998);
  z-index: 1;
}

.academic-stage .stage-panel.reveal {
  opacity: 0;
  transform: scale(.998);
}

.academic-stage .stage-panel.is-active,
.academic-stage .stage-footer.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  z-index: 2;
}

.academic-stage .page-hero,
.academic-stage .section {
  min-height: 100%;
  height: 100%;
  padding-top: clamp(55px, 8vh, 100px);
  padding-bottom: clamp(45px, 7vh, 90px);
  align-items: center;
}

/* Final footer is also a fixed viewport panel */
.academic-stage .stage-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 40px;
  align-content: center;
  align-items: center;
  padding: 35px 5vw;
  border-top: 0;
  background: linear-gradient(180deg, #f2f8fd 0%, #e8f2fa 100%);
}

/* ---------- Fixed title + scrolling body ---------- */

.section-content-fixed {
  height: min(74vh, 720px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

/* Heading remains visually fixed while the body below it moves */
.section-content-fixed > .section-heading-row {
  position: relative;
  z-index: 3;
  margin-bottom: 22px;
  background: transparent;
}

/* No visible inner scrollbar. Content still responds to mouse wheel. */
.section-body-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scroll-behavior: smooth;

  scrollbar-width: none;
  -ms-overflow-style: none;

  /* Soft mask makes content disappear naturally beneath the fixed title/bottom */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 22px,
    #000 calc(100% - 22px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 22px,
    #000 calc(100% - 22px),
    transparent 100%
  );
}

.section-body-scroll::-webkit-scrollbar {
  display: none;
}

/* Give the moving content a little breathing room under the fixed heading */
.section-body-scroll > :first-child {
  margin-top: 8px;
}

.section-body-scroll > :last-child {
  margin-bottom: 24px;
}

/* Research contrast */
#research {
  color: var(--ink);
}

#research .section-label,
#research .section-heading-row > span,
#research .date {
  color: #49677f;
}

#research .section-heading-row {
  border-color: rgba(21,94,155,.24);
}

#research .research-entry {
  border-bottom-color: rgba(21,94,155,.20);
}

#research .research-entry h3 {
  color: #13263a;
}

#research .research-entry .entry-title {
  color: #365b78;
}

#research .research-entry ul,
#research .research-entry li {
  color: #34495c;
}

/* ---------- Global page progress scrollbar ---------- */

.stage-scrollbar {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: min(46vh, 360px);
  z-index: 30;
  display: flex;
  align-items: stretch;
  pointer-events: none;
}

.stage-scrollbar-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(21,94,155,.12);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(21,94,155,.07);
}

.stage-scrollbar-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  min-height: 28px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(21,94,155,.84),
    rgba(21,94,155,.58)
  );
  box-shadow: 0 4px 14px rgba(21,94,155,.16);
  transition:
    transform .42s cubic-bezier(.2,.7,.2,1),
    height .3s ease;
}

/* ---------- Mobile / touch fallback ---------- */

@media (max-width: 900px), (pointer: coarse) {
  .academic-stage-page {
    overflow: auto;
  }

  .academic-stage {
    height: auto;
    overflow: visible;
  }

  .academic-stage > main {
    display: block;
  }

  .academic-stage .stage-panel,
  .academic-stage .stage-footer {
    position: relative;
    inset: auto;
    height: auto;
    min-height: auto;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    overflow: visible;
  }

  .academic-stage .page-hero,
  .academic-stage .section {
    height: auto;
    min-height: auto;
  }

  .section-content-fixed {
    height: auto;
    display: block;
  }

  .section-body-scroll {
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
    padding-right: 0;
  }

  .academic-stage .stage-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    border-top: 1px solid var(--line);
  }

  .stage-scrollbar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-scrollbar {
    display: none;
  }
}

/* === v15 Ultra-smooth section title transition === */

/*
  Prevent older reveal/transition rules from making the section title
  appear a fraction later than the panel itself.
*/
.academic-stage .stage-panel .section-heading-row,
.academic-stage .stage-panel .eyebrow,
.academic-stage .stage-panel h1 {
  transition: none !important;
  will-change: opacity, transform;
}

/* Keep the fixed heading visually stable while content underneath scrolls. */
.section-content-fixed > .section-heading-row {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/*
  Slightly softer panel compositing makes the handoff feel continuous
  instead of like one layer disappears and another suddenly appears.
*/
.academic-stage .stage-panel,
.academic-stage .stage-footer {
  will-change: opacity, transform;
  backface-visibility: hidden;
  transform-origin: center center;
}

/* === v16 Faster Crossfade + Global Wheel Routing === */

/*
  The section transition is intentionally minimal:
  opacity only, very short duration, no scale, no delayed heading.
  Anime.js owns the actual opacity animation.
*/
.academic-stage .stage-panel,
.academic-stage .stage-footer {
  transform: none !important;
  transition: none !important;
  will-change: opacity;
}

.academic-stage .stage-panel.reveal,
.academic-stage .stage-panel.is-active,
.academic-stage .stage-footer.is-active {
  transform: none !important;
}

/* Titles stay fully composed with their section instead of animating separately. */
.academic-stage .stage-panel .section-heading-row,
.academic-stage .stage-panel .eyebrow,
.academic-stage .stage-panel h1 {
  opacity: 1;
  transform: none !important;
  transition: none !important;
  will-change: auto;
}

/*
  Internal content remains scrollbar-free visually, but it is scrollable
  from ANY mouse position because the window-level wheel handler routes
  the wheel delta to the active .section-body-scroll.
*/
.section-body-scroll {
  overscroll-behavior: contain;
}

/* === v17 Smooth Layered Section Transition === */

/*
  Keep section animation fluid without bringing back the old mechanical snap.
  Anime.js handles opacity/translate/blur; CSS only improves compositing.
*/
.academic-stage .stage-panel,
.academic-stage .stage-footer {
  transition: none !important;
  will-change: opacity, transform, filter;
  backface-visibility: hidden;
  transform-origin: center center;
}

/* Keep every heading locked to its section so it enters/exits as one layer. */
.academic-stage .stage-panel .section-heading-row,
.academic-stage .stage-panel .eyebrow,
.academic-stage .stage-panel h1 {
  transition: none !important;
  will-change: auto;
}

/* Avoid harsh edges during the crossfade. */
.academic-stage {
  isolation: isolate;
}

/*
  The scrolling content keeps its existing behavior:
  wheel anywhere on the page drives the active section body first,
  then hands off to the next section at the boundary.
*/
.section-body-scroll {
  overscroll-behavior: contain;
}

/* === v18 Teaching Card Spacing Refinement === */
#teaching .compact-list > div {
  grid-template-columns: 165px minmax(0, 1fr) 190px;
  column-gap: 34px;
  padding: 24px 30px;
  align-items: center;
}
#teaching .compact-list > div > span {
  white-space: nowrap;
  line-height: 1.45;
}
#teaching .compact-list h3 {
  padding-left: 4px;
}
#teaching .compact-list b {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  padding-right: 4px;
}
#teaching .compact-list > div + div {
  margin-top: 2px;
}
@media (max-width: 1200px) {
  #teaching .compact-list > div {
    grid-template-columns: 150px minmax(0, 1fr) 170px;
    column-gap: 26px;
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 900px) {
  #teaching .compact-list > div {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px 22px;
    padding: 21px 20px;
  }
  #teaching .compact-list b {
    grid-column: 2;
    justify-self: start;
    text-align: left;
    padding-right: 0;
  }
  #teaching .compact-list > div > span {
    white-space: normal;
  }
  #teaching .compact-list h3 {
    padding-left: 0;
  }
}

/* === v19 Teaching Layout Balance === */

/*
  Rebalance the Teaching cards:
  - semester stays compact but readable
  - course title shifts left and becomes the visual focus
  - TA role becomes a subtle badge so the right side feels intentional
*/
#teaching .compact-list > div {
  grid-template-columns: 170px minmax(0, 1fr) max-content;
  column-gap: 22px;
  padding: 23px 30px;
  align-items: center;
}

/* Bring the term visually closer to the course title */
#teaching .compact-list > div > span {
  white-space: nowrap;
  text-align: right;
  padding-right: 10px;
  border-right: 1px solid rgba(21,94,155,.14);
}

/* Course title becomes the main anchor instead of floating in the middle */
#teaching .compact-list h3 {
  padding-left: 0;
  margin: 0;
  max-width: 760px;
  line-height: 1.25;
}

/* Turn the role into a quiet badge to give the right side visual purpose */
#teaching .compact-list b {
  justify-self: end;
  text-align: center;
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(21,94,155,.07);
  border: 1px solid rgba(21,94,155,.12);
  color: #4d6478;
}

/* Slightly tighten the card width visually without changing the section grid */
#teaching .compact-list {
  padding-right: 8px;
}

/* Hover remains restrained and professional */
#teaching .compact-list > div:hover b {
  background: rgba(21,94,155,.11);
  border-color: rgba(21,94,155,.18);
}

@media (max-width: 1200px) {
  #teaching .compact-list > div {
    grid-template-columns: 155px minmax(0, 1fr) max-content;
    column-gap: 18px;
    padding-left: 24px;
    padding-right: 24px;
  }

  #teaching .compact-list h3 {
    max-width: 620px;
  }
}

@media (max-width: 900px) {
  #teaching .compact-list > div {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px;
  }

  #teaching .compact-list > div > span {
    text-align: left;
    padding-right: 0;
    border-right: 0;
    white-space: normal;
  }

  #teaching .compact-list b {
    justify-self: start;
  }
}

/* === v20 Teaching Horizontal Balance === */

/*
  Desktop refinement:
  Keep the semester, course title and role as one tighter visual group.
  The role badge no longer floats at the far-right edge of a very wide card.
*/
#teaching .compact-list > div {
  grid-template-columns: 175px minmax(360px, 760px) max-content;
  justify-content: start;
  column-gap: 28px;
  padding: 23px 34px;
}

/* Semester stays compact and visually separated */
#teaching .compact-list > div > span {
  text-align: right;
  padding-right: 12px;
  border-right: 1px solid rgba(21,94,155,.14);
}

/* Course title gets a wider, cleaner working area */
#teaching .compact-list h3 {
  width: 100%;
  max-width: 760px;
}

/* Bring the role badge closer to the title instead of pushing it to the card edge */
#teaching .compact-list b {
  justify-self: start;
  margin-left: 4px;
}

/* On very wide screens, keep the group balanced inside the card */
@media (min-width: 1450px) {
  #teaching .compact-list > div {
    grid-template-columns: 185px minmax(420px, 820px) max-content;
    column-gap: 30px;
    padding-left: 40px;
    padding-right: 40px;
  }

  #teaching .compact-list h3 {
    max-width: 820px;
  }
}

@media (max-width: 1200px) {
  #teaching .compact-list > div {
    grid-template-columns: 155px minmax(320px, 1fr) max-content;
    column-gap: 20px;
    padding-left: 24px;
    padding-right: 24px;
  }

  #teaching .compact-list h3 {
    max-width: none;
  }
}

@media (max-width: 900px) {
  #teaching .compact-list > div {
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 8px;
    padding: 20px;
  }

  #teaching .compact-list > div > span {
    text-align: left;
    padding-right: 0;
    border-right: 0;
  }

  #teaching .compact-list b {
    justify-self: start;
    margin-left: 0;
  }
}

/* === v21 Publications Layout Refinement === */

/*
  Publications:
  - stronger visual hierarchy
  - cleaner year column
  - more deliberate spacing
  - title width controlled for readability
  - cards feel balanced instead of stretched
*/
#publications .publication-list {
  display: grid;
  gap: 14px;
}

#publications .publication-list article {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  column-gap: 28px;
  align-items: start;
  padding: 28px 32px;
  border: 1px solid rgba(21,94,155,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
}

/* Make the year feel intentional, not like a loose number at the edge */
#publications .pub-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(196,122,44,.08);
  border: 1px solid rgba(196,122,44,.14);
  color: var(--amber);
  font-weight: 500;
}

/* Keep titles readable and visually anchored */
#publications .publication-list h3 {
  margin: 0 0 10px;
  max-width: 1040px;
  font-size: clamp(20px, 1.55vw, 28px);
  line-height: 1.3;
  letter-spacing: -.02em;
}

/* Authors/conference line: softer but still easy to read */
#publications .publication-list p {
  margin: 0;
  max-width: 980px;
  color: #667085;
  font-size: 15px;
  line-height: 1.65;
}

/* Small accent to keep the card from looking too empty */
#publications .publication-list article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 999px;
  background: rgba(21,94,155,.22);
  opacity: 0;
  transition: opacity .25s ease;
}

#publications .publication-list article {
  position: relative;
}

#publications .publication-list article:hover::before {
  opacity: 1;
}

/* Slightly stronger hover, still academic/professional */
#publications .publication-list article:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(21,94,155,.10);
  border-color: rgba(21,94,155,.18);
}

@media (max-width: 1100px) {
  #publications .publication-list article {
    grid-template-columns: 78px minmax(0, 1fr);
    column-gap: 22px;
    padding: 24px 26px;
  }

  #publications .publication-list h3 {
    font-size: 21px;
  }
}

@media (max-width: 700px) {
  #publications .publication-list article {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px 20px;
  }

  #publications .pub-year {
    justify-content: flex-start;
    width: max-content;
  }

  #publications .publication-list h3 {
    font-size: 19px;
  }
}

/* === v22 Publications Year Vertical Alignment === */

/* Center the publication year vertically relative to the full card content */
#publications .publication-list article {
  align-items: center;
}

/* Keep text content aligned naturally while the year stays centered */
#publications .publication-list article > div {
  align-self: center;
}

/* Year badge remains horizontally centered in its own column */
#publications .pub-year {
  align-self: center;
}

/* === v23 Publication Conference Badge === */

/* Stack publication year + conference together in the left badge */
#publications .pub-year {
  flex-direction: column;
  gap: 2px;
  width: 82px;
  min-height: 54px;
  padding: 8px 10px;
  line-height: 1.15;
}

#publications .pub-year strong {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--amber);
}

#publications .pub-year small {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .05em;
  color: #667085;
  white-space: nowrap;
}

@media (max-width: 700px) {
  #publications .pub-year {
    width: max-content;
    align-items: flex-start;
  }
}

/* === v24 Publication Conference Label === */

/* Single-line conference/year label in the left column */
#publications .pub-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 104px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(196,122,44,.08);
  border: 1px solid rgba(196,122,44,.14);
  color: var(--amber);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .03em;
  white-space: nowrap;
  line-height: 1;
  align-self: center;
}

/* Remove old stacked badge typography rules */
#publications .pub-year strong,
#publications .pub-year small {
  all: unset;
}

@media (max-width: 700px) {
  #publications .pub-year {
    justify-content: flex-start;
  }
}

/* === v25 Publications Spacing Balance === */

/*
  Tighten the Publications layout without making it crowded:
  - reduce excessive empty space inside cards
  - keep a clear gap between badge and text
  - control title width
  - reduce the large vertical gaps between cards
*/
#publications .publication-list {
  gap: 10px;
}

#publications .publication-list article {
  grid-template-columns: 108px minmax(0, 1fr);
  column-gap: 22px;
  padding: 22px 26px;
  min-height: 0;
  align-items: center;
}

/* Keep the conference badge compact and vertically centered */
#publications .pub-year {
  min-width: 104px;
  padding: 7px 11px;
  justify-self: center;
}

/* Bring text a little closer to the badge while preserving breathing room */
#publications .publication-list h3 {
  max-width: 980px;
  margin-bottom: 8px;
  line-height: 1.26;
}

/* Author line slightly tighter */
#publications .publication-list p {
  max-width: 940px;
  line-height: 1.5;
}

/* Make the cards feel connected to the section instead of floating too far apart */
#publications .publication-list article + article {
  margin-top: 0;
}

@media (min-width: 1450px) {
  #publications .publication-list article {
    grid-template-columns: 116px minmax(0, 1fr);
    column-gap: 24px;
    padding-left: 28px;
    padding-right: 28px;
  }

  #publications .publication-list h3 {
    max-width: 1080px;
  }

  #publications .publication-list p {
    max-width: 1000px;
  }
}

@media (max-width: 1100px) {
  #publications .publication-list article {
    grid-template-columns: 100px minmax(0, 1fr);
    column-gap: 18px;
    padding: 20px 22px;
  }

  #publications .publication-list h3 {
    max-width: none;
  }

  #publications .publication-list p {
    max-width: none;
  }
}

@media (max-width: 700px) {
  #publications .publication-list {
    gap: 12px;
  }

  #publications .publication-list article {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
  }

  #publications .pub-year {
    justify-self: start;
  }
}
