/* Homepage sections: compact content, stable anchors, and no image cropping. */
html{scroll-padding-top:var(--header-height)}
:root{--header-compact-height:var(--header-height)}
body[data-page=home] .site-header.scrolled{height:var(--header-height)}
body[data-page=home] :is(.work-section,.resume-section,.about-section){padding-block:24px}
.compact-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:20px}
.compact-heading h2,html[lang=fa] .compact-heading h2{font-size:clamp(24px,2.3vw,34px);line-height:1.25;letter-spacing:-.025em}
html[lang=fa] .compact-heading h2{letter-spacing:0;line-height:1.5}
.home-projects{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 24px}
.home-project{min-width:0}
.home-project:nth-child(n+7){display:none}
.home-project>a{display:block}
.home-project-image{display:flex;align-items:flex-start;justify-content:center;overflow:visible}
.home-project-image img{display:block;width:auto;max-width:100%;height:auto;max-height:clamp(140px,calc((100svh - var(--header-height) - 340px)/2),260px);object-fit:contain;transition:filter .3s}
.home-project a:hover img{filter:brightness(1.035)}
.home-project-caption{display:flex;align-items:start;justify-content:space-between;gap:10px;margin-top:10px}
.home-project-caption h3{font-size:clamp(15px,1.25vw,19px);line-height:1.4;font-weight:500;letter-spacing:-.015em}
.home-project-caption .ui-icon{width:16px;height:16px;margin-top:4px}
.home-project> a>p{font-size:11px;line-height:1.5;color:var(--muted);margin-top:4px}
.home-archive-link{display:flex;justify-content:flex-end;margin-top:18px;border-top:1px solid var(--line);padding-top:5px}
.home-archive-link .text-link{font-size:13px;border:0;min-height:40px}
body[data-page=home] .about-grid{grid-template-columns:minmax(200px,.72fr) minmax(0,1.3fr);gap:6%;align-items:center}
body[data-page=home] .portrait-frame{max-width:350px}
body[data-page=home] .portrait-frame img{max-height:calc(100svh - var(--header-height) - 92px);object-fit:contain}
body[data-page=home] .portrait-caption{font-size:9px;letter-spacing:.07em;padding-top:8px}
body[data-page=home] .about-copy h2,html[lang=fa] body[data-page=home] .about-copy h2{font-size:clamp(25px,2.8vw,40px);line-height:1.35;margin:0 0 18px}
body[data-page=home] .about-copy h2 br{display:none}
body[data-page=home] .about-copy>p{font-size:15px;line-height:1.85}
body[data-page=home] .about-copy .about-lead{font-size:18px;line-height:1.7;margin-bottom:14px}
body[data-page=home] .practice-list{margin-top:20px}
body[data-page=home] .practice-list>div{padding-block:10px;gap:16px}
body[data-page=home] .practice-list h3{font-size:14px}
body[data-page=home] .resume-layout{grid-template-columns:minmax(0,1.7fr) minmax(240px,1fr);gap:5%;align-items:start}
body[data-page=home] .timeline-row{display:block;padding:0;border-top:1px solid var(--line)}
.timeline-row summary{display:grid;grid-template-columns:104px minmax(0,1fr) 20px;gap:16px;align-items:center;list-style:none;cursor:pointer;padding:13px 0}
.timeline-row summary::-webkit-details-marker,.resume-disclosure summary::-webkit-details-marker{display:none}
.timeline-row summary:focus-visible,.resume-disclosure summary:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
.timeline-role{min-width:0}
.timeline-role strong{display:block;font-size:16px;font-weight:500;line-height:1.45}
body[data-page=home] .timeline-date{font-size:11px;padding:0}
body[data-page=home] .timeline-place{display:block;font-size:12px;line-height:1.5;margin:3px 0 0}
.disclosure-mark{display:block;font:22px/1 Manrope,sans-serif;transition:transform .2s;justify-self:end}
details[open]>summary>.disclosure-mark{transform:rotate(45deg)}
.timeline-detail{padding:0 26px 16px 120px}
html[dir=rtl] .timeline-detail{padding:0 120px 16px 26px}
body[data-page=home] .timeline-description{font-size:14px;line-height:1.8}
body[data-page=home] .timeline-context{margin-top:12px}
.resume-disclosure{border-top:1px solid var(--line)}
.resume-disclosure summary{display:flex;align-items:center;justify-content:space-between;gap:16px;list-style:none;padding:13px 0;cursor:pointer;font-size:16px}
.resume-disclosure .education-item{margin:0 0 15px}
.resume-disclosure .education-item strong{font-size:14px;line-height:1.5}
.resume-disclosure .education-item p{font-size:12px;line-height:1.6;margin-top:4px}
.resume-disclosure .tool-tags{padding:0 0 16px;gap:6px}
.resume-disclosure .tool-tags span{font-size:11px;padding:5px 8px}
body[data-page=home] .contact-section{padding-top:24px}
body[data-page=home] .contact-layout{padding:0 0 24px;gap:7%;align-items:start}
body[data-page=home] .contact-main{padding:4px 0 0;gap:16px}
body[data-page=home] .contact-main h2,html[lang=fa] body[data-page=home] .contact-main h2{font-size:clamp(28px,3.2vw,46px);line-height:1.3}
body[data-page=home] .contact-main>p{font-size:15px;line-height:1.8;margin-top:16px}
body[data-page=home] .contact-form{padding:22px 24px}
body[data-page=home] .form-field{margin-bottom:16px}
body[data-page=home] .form-field label{margin-bottom:4px}
body[data-page=home] .form-field input{min-height:44px;padding-block:6px 9px}
body[data-page=home] .form-field textarea{min-height:80px;padding-block:6px 9px}
body[data-page=home] #contact-challenge{margin-block:8px;min-height:65px}
body[data-page=home] .form-submit{min-height:44px;padding-block:9px}
body[data-page=home] .contact-section footer{padding-block:10px;min-height:64px}
@media(min-width:761px) and (max-height:800px){
 .home-project:nth-child(n+4){display:none}
 .home-project-image img{max-height:clamp(170px,calc(100svh - var(--header-height) - 240px),400px)}
}
@media(max-width:1000px){
 body[data-page=home] .resume-layout{grid-template-columns:1fr;gap:12px}
 .resume-supplement{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:start}
}
@media(max-width:760px){
 body[data-page=home] :is(.work-section,.resume-section,.about-section){padding-block:18px}
 .compact-heading{gap:14px;margin-bottom:16px}
 .compact-heading h2,html[lang=fa] .compact-heading h2{font-size:25px}
 .home-projects{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}
 .home-project:nth-child(n+5){display:none}
 .home-project-image img{max-height:clamp(120px,calc((100svh - var(--header-height) - 310px)/2),180px)}
 .home-project-caption{margin-top:9px;gap:6px}
 .home-project-caption h3{font-size:14px;line-height:1.45}
 .home-project-caption .ui-icon{width:14px;height:14px}
 .home-project> a>p{font-size:10px}
 .home-archive-link{margin-top:14px}
 body[data-page=home] .about-grid{display:grid;grid-template-columns:100px minmax(0,1fr);gap:16px;align-items:start}
 body[data-page=home] .portrait-frame{max-width:100px;grid-column:1;grid-row:1;margin:0}
 body[data-page=home] .portrait-frame img{max-height:none}
 body[data-page=home] .portrait-caption{display:none}
 body[data-page=home] .about-copy{display:contents}
 body[data-page=home] .about-copy h2,html[lang=fa] body[data-page=home] .about-copy h2{grid-column:2;grid-row:1;align-self:center;font-size:26px;margin:0}
 body[data-page=home] .about-copy>p,body[data-page=home] .practice-list{grid-column:1/-1}
 body[data-page=home] .about-copy .about-lead{font-size:16px;line-height:1.75;margin:0}
 body[data-page=home] .about-copy>p{font-size:14px;line-height:1.8}
 body[data-page=home] .practice-list{margin-top:0;display:flex;flex-wrap:wrap;gap:8px 16px;border-top:1px solid #ffffff29;padding-top:10px}
 body[data-page=home] .practice-list>div{padding:0;border:0}
 body[data-page=home] .practice-list span{display:none}
 body[data-page=home] .practice-list h3{font-size:12px}
 .resume-section .compact-heading{align-items:flex-start}
 .resume-section .compact-heading h2,html[lang=fa] .resume-section .compact-heading h2{font-size:22px}
 .resume-section .compact-heading .text-link{font-size:11px;white-space:nowrap;gap:8px;padding-block:4px}
 .resume-section .file-label{display:none}
 .timeline-row summary{grid-template-columns:79px minmax(0,1fr) 16px;gap:10px;padding:10px 0}
 .timeline-role strong{font-size:13px;line-height:1.5}
 body[data-page=home] .timeline-date{font-size:10px}
 body[data-page=home] .timeline-place{font-size:11px}
 .timeline-detail,html[dir=rtl] .timeline-detail{padding:0 0 14px}
 .resume-supplement{gap:16px}
 .resume-disclosure summary{font-size:13px;padding:10px 0}
 .resume-disclosure .education-item strong{font-size:13px}
 body[data-page=home] .contact-section{padding-top:18px}
 body[data-page=home] .contact-layout{grid-template-columns:1fr;gap:16px;padding-bottom:16px}
 body[data-page=home] .contact-main{padding:0;gap:0}
 body[data-page=home] .contact-main h2,html[lang=fa] body[data-page=home] .contact-main h2{font-size:27px}
 body[data-page=home] .contact-main>p{font-size:13px;line-height:1.7;margin-top:8px}
 body[data-page=home] .contact-form{padding:16px}
 body[data-page=home] .form-pair{grid-template-columns:1fr 1fr;gap:14px}
 body[data-page=home] .form-field{margin-bottom:12px}
 body[data-page=home] .form-field label{font-size:10px;letter-spacing:0}
 body[data-page=home] .form-field input::placeholder,body[data-page=home] .form-field textarea::placeholder{font-size:12px}
 body[data-page=home] .form-field textarea{min-height:72px}
 body[data-page=home] .form-bottom{flex-direction:row;align-items:center;gap:12px}
 body[data-page=home] .form-submit{width:auto;font-size:12px;padding-inline:12px;gap:12px}
 body[data-page=home] .form-bottom>span{font-size:10px}
 body[data-page=home] .contact-section footer{gap:6px 14px;padding-block:8px}
 body[data-page=home] .footer-actions{gap:12px}
}
@media(max-width:760px) and (max-height:739px){
 .home-project:nth-child(n+3){display:none}
 .home-project-image img{max-height:clamp(140px,34svh,225px)}
}
@media(prefers-reduced-motion:reduce){.home-project-image img,.disclosure-mark{transition:none}}


/* Contact height follows its content; the footer has no artificial spacer. */
body[data-page=home] .contact-section{min-height:0;display:block}
body[data-page=home] .contact-section>.section-shell{width:100%}
body[data-page=home] .contact-section footer{margin-top:0}
.timeline-detail-title{display:none}
@media(max-width:760px){
 body[data-page=home] .contact-form{padding:12px 16px}
 body[data-page=home] .contact-layout{gap:12px;padding-bottom:12px}
 body[data-page=home] .form-field{margin-bottom:8px}
 body[data-page=home] .form-field textarea{height:64px;min-height:64px}
 body[data-page=home] .contact-section footer{min-height:60px}
}
@media(max-width:480px){
 .timeline-row summary{grid-template-columns:73px minmax(0,1fr) 16px;gap:10px;min-height:56px;padding:9px 0}
 .timeline-role strong{display:none}
 body[data-page=home] .timeline-place{font-size:13px;line-height:1.5;color:var(--ink);margin:0}
 .timeline-detail-title{display:block;font-size:14px;font-weight:500;line-height:1.65;margin-bottom:8px}
}
@media(max-width:370px){
 body[data-page=home] .about-grid{grid-template-columns:72px minmax(0,1fr);gap:11px}
 body[data-page=home] .portrait-frame{max-width:72px}
 body[data-page=home] .about-copy h2,html[lang=fa] body[data-page=home] .about-copy h2{font-size:23px}
 body[data-page=home] .about-copy>p{line-height:1.7}
 body[data-page=home] .about-copy .about-lead{font-size:15px;line-height:1.65}
 body[data-page=home] .about-section{padding-block:14px}
 body[data-page=home] .form-submit{font-size:11px;padding-inline:8px;gap:6px}
 body[data-page=home] .contact-main h2,html[lang=fa] body[data-page=home] .contact-main h2{font-size:25px}
}

@media(max-width:370px){
 body[data-page=home] .resume-section{padding-block:14px}
 body[data-page=home] .contact-section{padding-top:14px}
 body[data-page=home] .contact-section footer{font-size:10px;flex-wrap:nowrap;gap:10px}
 body[data-page=home] .footer-actions{gap:8px}
 body[data-page=home] .footer-actions>a:last-child{white-space:nowrap}
 body[data-page=home] .form-field{margin-bottom:6px}
}

.form-notes{font-size:11px;line-height:1.6;color:#68746b;max-width:180px}
@media(max-width:760px){.form-notes{font-size:10px}}

/* A wide writing surface, with delivery controls alongside the message. */
body[data-page=home] .contact-layout{display:block;padding:0 0 18px}
body[data-page=home] .contact-main{padding:0 0 20px}
body[data-page=home] .contact-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) minmax(300px,.95fr);gap:22px 28px;padding:24px 28px}
body[data-page=home] .contact-form .form-pair{display:contents}
body[data-page=home] .contact-form .form-field{margin:0}
body[data-page=home] .contact-form .form-field-subject{grid-column:3}
body[data-page=home] .contact-form .form-field-message{grid-column:1/span 2;display:flex;flex-direction:column}
body[data-page=home] .contact-form .form-field-message textarea{flex:1;height:126px;min-height:126px;max-height:350px}
body[data-page=home] .contact-actions{grid-column:3;display:flex;flex-direction:column;justify-content:space-between;gap:18px;min-width:0}
body[data-page=home] .contact-actions #contact-challenge{margin:0;min-height:65px}
body[data-page=home] .contact-actions .form-bottom{gap:16px;flex-wrap:wrap;align-items:center}
body[data-page=home] .contact-actions .form-notes{flex:1 1 100px;max-width:none}
body[data-page=home] .contact-actions .form-submit{margin-inline-start:auto;flex-shrink:0}
body[data-page=home] .contact-form .form-status{grid-column:1/-1;margin:0}
body[data-page=home] .contact-layout>.contact-privacy{margin:12px 0 0;max-width:120ch;color:#bac7be;font-size:12px;line-height:1.8}
@media(min-width:761px) and (max-width:1000px){
 body[data-page=home] .contact-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px;padding:22px}
 body[data-page=home] .contact-form .form-field-subject{grid-column:1/-1}
 body[data-page=home] .contact-form .form-field-message{grid-column:1}
 body[data-page=home] .contact-actions{grid-column:2}
}
@media(max-width:760px){
 body[data-page=home] .contact-main{padding-bottom:14px}
 body[data-page=home] .contact-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:16px}
 body[data-page=home] .contact-form .form-field-subject,
 body[data-page=home] .contact-form .form-field-message,
 body[data-page=home] .contact-actions{grid-column:1/-1}
 body[data-page=home] .contact-form .form-field-message textarea{height:88px;min-height:88px}
 body[data-page=home] .contact-actions{gap:12px}
 body[data-page=home] .contact-layout>.contact-privacy{font-size:11px;line-height:1.8;margin-top:12px}
}

/* Keep the complete professional subtitle readable beside mobile navigation. */
@media(max-width:760px){
 :root{--header-height:68px;--header-compact-height:68px}
 .site-header,.site-header.scrolled{padding:2px 16px 20px;gap:8px}
 .site-header .identity{gap:8px}
 .site-header .identity img{width:30px;height:30px}
 .site-header .identity small{
  position:absolute;
  inset-inline-start:54px;
  inset-inline-end:16px;
  bottom:6px;
  font-size:10px;
  line-height:1.45;
  letter-spacing:0;
  white-space:normal;
 }
}
@media(max-width:380px){
 .site-header,.site-header.scrolled{padding-inline:14px;gap:6px}
 .site-header .identity{gap:8px}
 .site-header .identity img{width:30px;height:30px}
 .site-header .identity small{inset-inline-start:52px;inset-inline-end:14px}
}
