/* =========================================================
   HASSAM KHAN — MECHANICAL DESIGN ENGINEER PORTFOLIO
   Design system: charcoal / orange / electric blue
   ========================================================= */

:root{
  --bg:            #14161A;
  --bg-elevated:   #1B1E23;
  --bg-elevated-2: #20242B;
  --line:          #2B2F36;
  --line-soft:     #22262D;
  --text:          #ECEEF1;
  --text-muted:    #9BA1AC;
  --text-faint:    #5C6270;

  --orange:        #FF6A2C;
  --orange-soft:   rgba(255,106,44,0.14);
  --orange-glow:   rgba(255,106,44,0.35);
  --blue:          #33B1FF;
  --blue-soft:     rgba(51,177,255,0.14);
  --blue-glow:     rgba(51,177,255,0.35);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'IBM Plex Sans', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --container: 1200px;
  --chamfer: 18px;
  --ease: cubic-bezier(.22,.68,.32,1);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

h1,h2,h3,h4{
  font-family:var(--font-display);
  margin:0;
  font-weight:600;
  letter-spacing:-0.01em;
  color:var(--text);
}

p{ margin:0; }
a{ color:inherit; text-decoration:none; }
ul{ list-style:none; margin:0; padding:0; }
img,svg{ display:block; max-width:100%; }
button{ font-family:inherit; cursor:pointer; }

.container{
  max-width:var(--container);
  margin:0 auto;
  padding:0 32px;
}

/* chamfered "machined" panel corner — signature card shape */
.chamfer{
  clip-path: polygon(
    var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer)
  );
}

/* =========================================================
   AMBIENT BACKGROUND — drifting blurred glow shapes + grid
   ========================================================= */
.ambient{
  position:fixed;
  inset:0;
  z-index:0;
  overflow:hidden;
  pointer-events:none;
}
.ambient-grid{
  position:absolute;
  inset:-2px;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size:64px 64px;
  opacity:.35;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 30%, transparent 85%);
}
.blob{
  position:absolute;
  border-radius:50%;
  filter:blur(90px);
  opacity:.55;
  will-change:transform;
}
.blob-orange{
  width:520px; height:520px;
  background:var(--orange);
  top:-120px; left:-120px;
  animation: driftA 26s ease-in-out infinite alternate;
}
.blob-blue{
  width:600px; height:600px;
  background:var(--blue);
  top:20%; right:-200px;
  animation: driftB 32s ease-in-out infinite alternate;
}
.blob-orange-2{
  width:380px; height:380px;
  background:var(--orange);
  bottom:-80px; left:30%;
  opacity:.3;
  animation: driftC 22s ease-in-out infinite alternate;
}

@keyframes driftA{
  0%{ transform:translate(0,0) scale(1); }
  100%{ transform:translate(80px,60px) scale(1.15); }
}
@keyframes driftB{
  0%{ transform:translate(0,0) scale(1); }
  100%{ transform:translate(-60px,40px) scale(1.1); }
}
@keyframes driftC{
  0%{ transform:translate(0,0) scale(1); }
  100%{ transform:translate(40px,-50px) scale(1.2); }
}

/* =========================================================
   NAV
   ========================================================= */
.site-header{
  position:fixed;
  top:0; left:0; right:0;
  z-index:100;
  background:rgba(20,22,26,0.72);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line-soft);
}
.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 32px;
  max-width:var(--container);
  margin:0 auto;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-family:var(--font-display);
  font-weight:600;
  font-size:1.05rem;
  letter-spacing:.02em;
}
.brand-mark{
  width:34px; height:34px;
  border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--font-mono);
  font-size:.78rem;
  color:var(--orange);
  background:var(--bg-elevated);
  clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
}
.nav-links{
  display:flex;
  gap:36px;
}
.nav-links a{
  font-size:.92rem;
  color:var(--text-muted);
  position:relative;
  padding:4px 0;
  transition:color .25s var(--ease);
}
.nav-links a:hover, .nav-links a.active{ color:var(--text); }
.nav-links a::after{
  content:'';
  position:absolute;
  left:0; bottom:-2px;
  width:0; height:1px;
  background:var(--orange);
  transition:width .25s var(--ease);
}
.nav-links a:hover::after{ width:100%; }

.nav-cta{
  border:1px solid var(--orange);
  color:var(--orange);
  font-size:.85rem;
  padding:9px 18px;
  clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
  transition:background .25s var(--ease), color .25s var(--ease);
}
.nav-cta:hover{ background:var(--orange); color:#14161A; }

.nav-toggle{
  display:none;
  flex-direction:column;
  gap:5px;
  background:none;
  border:none;
  padding:6px;
}
.nav-toggle span{
  width:22px; height:2px; background:var(--text);
}

/* =========================================================
   HERO
   ========================================================= */
.hero{
  position:relative;
  z-index:1;
  min-height:100vh;
  display:flex;
  align-items:center;
  padding:140px 0 80px;
}
.hero-grid{
  display:grid;
  grid-template-columns:.85fr 1.15fr;
  gap:64px;
  align-items:center;
}

/* photo frame */
.hero-photo-wrap{
  position:relative;
  justify-self:center;
}
.frame{
  position:relative;
  width:340px;
  height:420px;
}
.frame-glow{
  position:absolute;
  inset:-30px;
  background:radial-gradient(circle at 35% 30%, var(--orange-glow), transparent 55%),
             radial-gradient(circle at 70% 75%, var(--blue-glow), transparent 55%);
  filter:blur(28px);
  opacity:.9;
  animation:pulseGlow 6s ease-in-out infinite;
}
@keyframes pulseGlow{
  0%,100%{ opacity:.65; transform:scale(1); }
  50%{ opacity:1; transform:scale(1.04); }
}
.frame-photo{
  position:relative;
  width:100%; height:100%;
  background:var(--bg-elevated-2);
  border:1px solid var(--line);
  overflow:hidden;
  clip-path: polygon(24px 0,100% 0,100% calc(100% - 24px),calc(100% - 24px) 100%,0 100%,0 24px);
}
.frame-photo svg{ width:100%; height:100%; }
.frame-photo .wipe{
  position:absolute; inset:0;
  background:var(--bg);
  transform-origin:left;
  animation: photoWipe 1.4s var(--ease) .3s forwards;
}
@keyframes photoWipe{
  0%{ transform:scaleX(1); }
  100%{ transform:scaleX(0); }
}
.frame-photo img, .frame-photo .portrait{
  opacity:0;
  animation: photoFade 1.2s ease .6s forwards;
}
@keyframes photoFade{ to{ opacity:1; } }

/* corner brackets — CAD viewport marks */
.corner{
  position:absolute;
  width:26px; height:26px;
  border-color:var(--orange);
  opacity:.9;
}
.corner.tl{ top:-10px; left:-10px; border-top:2px solid var(--orange); border-left:2px solid var(--orange); }
.corner.br{ bottom:-10px; right:-10px; border-bottom:2px solid var(--blue); border-right:2px solid var(--blue); }

.frame-tag{
  position:absolute;
  bottom:-42px; left:0;
  font-family:var(--font-mono);
  font-size:.72rem;
  color:var(--text-faint);
  letter-spacing:.03em;
}
.frame-tag span{ color:var(--orange); }

/* hero copy */
.hero-copy{ position:relative; }
.eyebrow{
  font-family:var(--font-mono);
  font-size:.82rem;
  color:var(--blue);
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:18px;
  opacity:0;
  animation:riseIn .7s var(--ease) .2s forwards;
}
.eyebrow::before{
  content:'';
  width:24px; height:1px;
  background:var(--blue);
}
.hero h1{
  font-size:clamp(2.6rem,5vw,4.2rem);
  line-height:1.05;
  opacity:0;
  animation:riseIn .8s var(--ease) .38s forwards;
}
.hero h1 .last{ color:var(--orange); }
.hero-role{
  margin-top:18px;
  font-size:1.15rem;
  color:var(--text-muted);
  font-weight:500;
  opacity:0;
  animation:riseIn .8s var(--ease) .55s forwards;
}
.hero-tagline{
  margin-top:22px;
  max-width:46ch;
  font-size:1.05rem;
  color:var(--text-muted);
  opacity:0;
  animation:riseIn .8s var(--ease) .7s forwards;
}
.hero-actions{
  margin-top:38px;
  display:flex;
  align-items:center;
  gap:22px;
  opacity:0;
  animation:riseIn .8s var(--ease) .85s forwards;
}
@keyframes riseIn{
  from{ opacity:0; transform:translateY(16px); }
  to{ opacity:1; transform:translateY(0); }
}

.btn-primary{
  display:inline-flex;
  align-items:center;
  gap:10px;
  background:var(--orange);
  color:#14161A;
  font-weight:600;
  font-size:.95rem;
  padding:15px 28px;
  border:none;
  clip-path: polygon(10px 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%,0 10px);
  transition:transform .25s var(--ease), box-shadow .25s var(--ease);
  box-shadow:0 0 0 rgba(255,106,44,0);
}
.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 30px -8px var(--orange-glow);
}
.btn-primary svg{ width:16px; height:16px; }

.btn-ghost{
  font-size:.92rem;
  color:var(--text-muted);
  border-bottom:1px solid var(--line);
  padding-bottom:3px;
  transition:color .25s var(--ease), border-color .25s var(--ease);
}
.btn-ghost:hover{ color:var(--text); border-color:var(--blue); }

/* =========================================================
   SCROLL-REVEAL SECTIONS
   ========================================================= */
.reveal{
  opacity:0;
  transform:translateY(36px);
  transition:opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.in-view{
  opacity:1;
  transform:translateY(0);
}

section{ position:relative; z-index:1; }

.section-head{
  max-width:640px;
  margin-bottom:56px;
}
.section-tag{
  font-family:var(--font-mono);
  font-size:.78rem;
  color:var(--orange);
  margin-bottom:14px;
  display:block;
}
.section-head h2{
  font-size:clamp(1.9rem,3.2vw,2.6rem);
  line-height:1.15;
}
.section-head p{
  margin-top:16px;
  color:var(--text-muted);
  font-size:1.02rem;
}

/* =========================================================
   STATS
   ========================================================= */
.stats{
  padding:100px 0;
  border-top:1px solid var(--line-soft);
  border-bottom:1px solid var(--line-soft);
}
.stats-row{
  display:grid;
  grid-template-columns:repeat(4,1fr);
}
.stat{
  position:relative;
  padding:0 28px;
  text-align:left;
}
.stat + .stat{ border-left:1px dashed var(--line); }
.stat-ticks{
  display:flex;
  gap:3px;
  margin-bottom:18px;
}
.stat-ticks span{
  width:1px; height:10px;
  background:var(--line);
}
.stat-num{
  font-family:var(--font-display);
  font-size:clamp(2.4rem,4vw,3.4rem);
  font-weight:700;
  display:flex;
  align-items:baseline;
  gap:4px;
  color:var(--text);
}
.stat-num .unit{
  font-family:var(--font-mono);
  font-size:1.2rem;
  color:var(--orange);
}
.stat-label{
  margin-top:10px;
  color:var(--text-muted);
  font-size:.92rem;
}

/* =========================================================
   SERVICES TEASER
   ========================================================= */
.services{ padding:120px 0; position:relative; overflow:hidden; }
.services > .container{ position:relative; z-index:2; }
.services-bg{
  position:absolute; inset:0;
  z-index:1;
  pointer-events:none;
}
.services-bg img{
  width:100%; height:100%;
  object-fit:cover;
  opacity:.16;
}
.services-bg::after{
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(180deg, var(--bg) 0%, rgba(14,16,20,0.9) 55%, var(--bg) 100%);
}
.services-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:24px;
}
.service-card{
  background:var(--bg-elevated);
  border:1px solid var(--line);
  padding:32px 26px;
  transition:transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.service-card:hover{
  transform:translateY(-6px);
  border-color:var(--blue);
  background:var(--bg-elevated-2);
}
.service-icon{
  width:44px; height:44px;
  margin-bottom:22px;
  color:var(--orange);
}
.service-card:nth-child(2n) .service-icon{ color:var(--blue); }
.service-card h3{
  font-size:1.08rem;
  margin-bottom:10px;
}
.service-card p{
  color:var(--text-muted);
  font-size:.92rem;
  line-height:1.55;
}

/* =========================================================
   FEATURED WORK
   ========================================================= */
.work{ padding:120px 0; }
.work-head-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  margin-bottom:56px;
  gap:24px;
}
.work-head-row .section-head{ margin-bottom:0; }
.work-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:26px;
}
.work-card{
  position:relative;
  overflow:hidden;
  border:1px solid var(--line);
  background:var(--bg-elevated);
  aspect-ratio:4/3.2;
}
.work-thumb{
  position:absolute; inset:0;
  overflow:hidden;
}
.work-thumb svg{
  width:100%; height:100%;
  transition:transform .6s var(--ease);
}
.work-card:hover .work-thumb svg{ transform:scale(1.12); }
.work-info{
  position:absolute;
  left:0; right:0; bottom:0;
  padding:20px 22px;
  background:linear-gradient(to top, rgba(20,22,26,0.95), transparent);
  transform:translateY(8px);
  opacity:.92;
  transition:transform .4s var(--ease);
}
.work-card:hover .work-info{ transform:translateY(0); }
.work-info .tag{
  font-family:var(--font-mono);
  font-size:.7rem;
  color:var(--orange);
  display:block;
  margin-bottom:6px;
}
.work-info h4{ font-size:1.02rem; }

.work-footer{
  margin-top:56px;
  text-align:center;
}

/* =========================================================
   TESTIMONIALS
   ========================================================= */
.testimonials{
  padding:120px 0;
  border-top:1px solid var(--line-soft);
}
.testi-wrap{
  position:relative;
  max-width:760px;
  margin:0 auto;
  min-height:260px;
}
.testi-card{
  position:absolute;
  inset:0;
  background:var(--bg-elevated);
  border:1px solid var(--line);
  padding:48px 52px;
  opacity:0;
  transform:translateX(16px);
  transition:opacity .35s var(--ease), transform .35s var(--ease);
  pointer-events:none;
  z-index:1;
}
.testi-card.active{
  opacity:1;
  transform:translateX(0);
  pointer-events:auto;
  z-index:2;
}
.testi-quote{
  font-family:var(--font-display);
  font-size:1.28rem;
  line-height:1.5;
  color:var(--text);
}
.testi-quote::before{ content:'“'; color:var(--orange); }
.testi-quote::after{ content:'”'; color:var(--orange); }
.testi-meta{
  margin-top:26px;
  display:flex;
  align-items:center;
  gap:14px;
}
.testi-avatar{
  width:42px;height:42px;
  border:1px solid var(--line);
  background:var(--bg-elevated-2);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--font-mono);
  font-size:.8rem;
  color:var(--blue);
  clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
}
.testi-name{ font-size:.92rem; font-weight:600; }
.testi-role{ font-size:.82rem; color:var(--text-muted); }

.testi-dots{
  display:flex;
  gap:10px;
  justify-content:center;
  margin-top:36px;
}
.testi-dots button{
  width:8px; height:8px;
  border-radius:50%;
  border:1px solid var(--line);
  background:transparent;
  padding:0;
  transition:background .25s, border-color .25s;
}
.testi-dots button.active{
  background:var(--orange);
  border-color:var(--orange);
}

/* =========================================================
   BRAND MARQUEE
   ========================================================= */
.brands{
  padding:80px 0;
  border-top:1px solid var(--line-soft);
  border-bottom:1px solid var(--line-soft);
}
.brands .section-tag{
  text-align:center;
  display:block;
  margin-bottom:36px;
}
.marquee{
  overflow:hidden;
  -webkit-mask-image:linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image:linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-track{
  display:flex;
  width:max-content;
  gap:80px;
  animation:scrollMarquee 34s linear infinite;
}
.marquee:hover .marquee-track{ animation-play-state:paused; }
.marquee-item{
  font-family:var(--font-display);
  font-size:1.3rem;
  color:var(--text-faint);
  white-space:nowrap;
  letter-spacing:.02em;
  display:flex;
  align-items:center;
  gap:10px;
}
.marquee-item::before{
  content:'';
  width:6px;height:6px;
  background:var(--orange);
}
@keyframes scrollMarquee{
  from{ transform:translateX(0); }
  to{ transform:translateX(-50%); }
}

/* =========================================================
   CLOSING CTA
   ========================================================= */
.cta-close{
  padding:140px 0;
  text-align:center;
  position:relative;
}
.cta-close h2{
  font-size:clamp(2.2rem,4.5vw,3.4rem);
  max-width:760px;
  margin:0 auto;
  line-height:1.15;
}
.cta-close p{
  margin:22px auto 0;
  max-width:50ch;
  color:var(--text-muted);
}
.cta-close .hero-actions{
  justify-content:center;
  margin-top:40px;
  opacity:1;
  animation:none;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{
  border-top:1px solid var(--line-soft);
  padding:64px 0 32px;
  position:relative;
  z-index:1;
}
.footer-grid{
  display:grid;
  grid-template-columns:1.4fr 1fr 1fr 1fr;
  gap:40px;
  padding-bottom:48px;
}
.footer-brand p{
  margin-top:16px;
  color:var(--text-muted);
  font-size:.92rem;
  max-width:32ch;
}
.footer-col h5{
  font-family:var(--font-mono);
  font-size:.78rem;
  color:var(--text-faint);
  margin-bottom:18px;
  font-weight:400;
}
.footer-col ul li{ margin-bottom:12px; }
.footer-col ul a{
  font-size:.92rem;
  color:var(--text-muted);
  transition:color .25s;
}
.footer-col ul a:hover{ color:var(--orange); }
.social-row{
  display:flex;
  gap:12px;
  margin-top:18px;
}
.social-row a{
  width:38px;height:38px;
  border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  color:var(--text-muted);
  transition:border-color .25s, color .25s, transform .25s;
}
.social-row a:hover{
  border-color:var(--blue);
  color:var(--blue);
  transform:translateY(-3px);
}
.social-row svg{ width:16px;height:16px; }

.footer-bottom{
  border-top:1px solid var(--line-soft);
  padding-top:28px;
  display:flex;
  justify-content:space-between;
  color:var(--text-faint);
  font-size:.82rem;
  font-family:var(--font-mono);
}

/* =========================================================
   PORTFOLIO PAGE
   ========================================================= */
.portfolio-hero{
  padding:160px 0 60px;
  position:relative;
  z-index:1;
}
.portfolio-hero h1{
  margin-top:16px;
  font-size:clamp(2.2rem,4vw,3.2rem);
  line-height:1.15;
  max-width:14ch;
}
.portfolio-hero-sub{
  margin-top:20px;
  max-width:56ch;
  color:var(--text-muted);
  font-size:1.02rem;
}

.portfolio-browser{
  padding:20px 0 140px;
  position:relative;
  z-index:1;
}

/* --- filter tabs --- */
.filter-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:56px;
  padding-bottom:32px;
  border-bottom:1px solid var(--line-soft);
}
.filter-tab{
  background:var(--bg-elevated);
  border:1px solid var(--line);
  color:var(--text-muted);
  font-family:var(--font-body);
  font-size:.88rem;
  font-weight:500;
  padding:11px 20px;
  clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
  transition:background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.filter-tab:hover{
  border-color:var(--blue);
  color:var(--text);
}
.filter-tab.active{
  background:var(--orange);
  border-color:var(--orange);
  color:#14161A;
  font-weight:600;
  transform:translateY(-2px);
}

/* --- grid --- */
.portfolio-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:28px;
}
.project-card{
  background:var(--bg-elevated);
  border:1px solid var(--line);
  overflow:hidden;
  cursor:pointer;
  opacity:0;
  transform:translateY(28px);
  transition:opacity .6s var(--ease), transform .6s var(--ease),
             box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.project-card.card-in{
  opacity:1;
  transform:translateY(0);
}
.project-card.filtered-out{
  display:none;
}
.project-card:hover{
  border-color:var(--blue);
  box-shadow:0 20px 46px -20px rgba(51,177,255,0.28), 0 10px 24px -14px rgba(255,106,44,0.2);
}
.project-thumb{
  position:relative;
  aspect-ratio:4/3;
  overflow:hidden;
  border-bottom:1px solid var(--line);
}
.project-thumb svg{
  width:100%; height:100%;
  transition:transform .6s var(--ease);
}
.project-card:hover .project-thumb svg{
  transform:scale(1.08);
}
.project-body{
  padding:22px 24px 26px;
}
.project-category{
  font-family:var(--font-mono);
  font-size:.7rem;
  color:var(--orange);
  display:block;
  margin-bottom:10px;
}
.project-body h3{
  font-size:1.05rem;
  margin-bottom:8px;
  line-height:1.3;
}
.project-body p{
  font-size:.9rem;
  color:var(--text-muted);
  line-height:1.55;
}

/* --- lightbox --- */
.lightbox{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
  opacity:0;
  pointer-events:none;
  transition:opacity .35s var(--ease);
}
.lightbox.open{
  opacity:1;
  pointer-events:auto;
}
.lightbox-backdrop{
  position:absolute;
  inset:0;
  background:rgba(10,11,13,0.86);
  backdrop-filter:blur(6px);
}
.lightbox-panel{
  position:relative;
  z-index:1;
  width:100%;
  max-width:840px;
  max-height:88vh;
  overflow-y:auto;
  background:var(--bg-elevated);
  border:1px solid var(--line);
  clip-path: polygon(28px 0,100% 0,100% calc(100% - 28px),calc(100% - 28px) 100%,0 100%,0 28px);
  transform:translateY(24px) scale(.98);
  opacity:0;
  transition:transform .4s var(--ease), opacity .4s var(--ease);
}
.lightbox.open .lightbox-panel{
  transform:translateY(0) scale(1);
  opacity:1;
}
.lightbox-media{
  width:100%;
  aspect-ratio:16/9;
  border-bottom:1px solid var(--line);
  overflow:hidden;
}
.lightbox-media svg{ width:100%; height:100%; }
.lightbox-info{
  padding:32px 40px 40px;
}
.lightbox-info h3{
  font-size:1.5rem;
  margin:12px 0 14px;
}
.lightbox-info p{
  color:var(--text-muted);
  font-size:1rem;
  line-height:1.6;
  max-width:60ch;
}
.lightbox-close{
  position:absolute;
  top:18px; right:18px;
  z-index:2;
  width:40px; height:40px;
  border:1px solid var(--line);
  background:rgba(20,22,26,0.7);
  color:var(--text);
  display:flex;align-items:center;justify-content:center;
  transition:border-color .25s, color .25s, transform .25s;
}
.lightbox-close:hover{
  border-color:var(--orange);
  color:var(--orange);
  transform:rotate(90deg);
}
.lightbox-close svg{ width:18px; height:18px; }

.lightbox-media{ position:relative; }
.lightbox-arrow{
  position:absolute;
  top:50%; transform:translateY(-50%);
  z-index:2;
  width:40px; height:40px;
  border:1px solid var(--line);
  background:rgba(20,22,26,0.7);
  color:var(--text);
  display:flex;align-items:center;justify-content:center;
  transition:border-color .25s, color .25s;
}
.lightbox-arrow:hover{ border-color:var(--orange); color:var(--orange); }
.lightbox-arrow svg{ width:18px; height:18px; }
.lightbox-arrow.prev{ left:14px; }
.lightbox-arrow.next{ right:14px; }
.lightbox-gallery-dots{
  position:absolute;
  bottom:14px; left:0; right:0;
  z-index:2;
  display:flex;
  gap:8px;
  justify-content:center;
}
.lightbox-gallery-dots button{
  width:7px; height:7px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,0.6);
  background:rgba(20,22,26,0.5);
  padding:0;
  transition:background .25s, border-color .25s;
}
.lightbox-gallery-dots button.active{
  background:var(--orange);
  border-color:var(--orange);
}

/* =========================================================
   ABOUT PAGE
   ========================================================= */
.about-hero{
  padding:160px 0 120px;
  position:relative;
  z-index:1;
}
.about-grid{
  display:grid;
  grid-template-columns:1.5fr .85fr;
  gap:80px;
  align-items:start;
}
.about-copy h1{
  margin-top:16px;
  font-size:clamp(2rem,3.6vw,2.9rem);
  line-height:1.2;
  max-width:18ch;
}
.about-lead{
  margin-top:26px;
  font-size:1.15rem;
  color:var(--text);
  font-weight:500;
  max-width:56ch;
}
.about-copy p{
  margin-top:20px;
  color:var(--text-muted);
  font-size:1rem;
  line-height:1.7;
  max-width:62ch;
}
.about-mission{
  color:var(--text) !important;
  border-left:2px solid var(--orange);
  padding-left:20px;
  font-weight:500;
}
.focus-tags{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:36px;
}
.focus-tags span{
  font-family:var(--font-mono);
  font-size:.78rem;
  color:var(--text-muted);
  border:1px solid var(--line);
  padding:8px 14px;
  clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
}

.about-side{ position:sticky; top:120px; }
.about-frame{ position:relative; width:100%; max-width:280px; aspect-ratio:340/420; margin:0 auto; }
.frame-glow.small{
  position:absolute; inset:-22px;
  background:radial-gradient(circle at 35% 30%, var(--orange-glow), transparent 55%),
             radial-gradient(circle at 70% 75%, var(--blue-glow), transparent 55%);
  filter:blur(24px);
  opacity:.8;
  animation:pulseGlow 6s ease-in-out infinite;
}
.frame-photo.small{
  position:relative;
  width:100%; height:100%;
  background:var(--bg-elevated-2);
  border:1px solid var(--line);
  overflow:hidden;
  clip-path: polygon(20px 0,100% 0,100% calc(100% - 20px),calc(100% - 20px) 100%,0 100%,0 20px);
}
.frame-photo.small svg{ width:100%; height:100%; }
.about-side .frame-tag{
  position:static;
  margin-top:16px;
  text-align:center;
}

.quick-facts{
  margin-top:44px;
  display:flex;
  flex-direction:column;
  gap:22px;
  border-top:1px solid var(--line-soft);
  padding-top:28px;
}
.quick-fact{ display:flex; flex-direction:column; }
.qf-num{
  font-family:var(--font-display);
  font-size:2rem;
  font-weight:700;
}
.qf-num .unit{ font-family:var(--font-mono); font-size:1.1rem; color:var(--orange); }
.qf-label{ margin-top:4px; color:var(--text-muted); font-size:.85rem; }

/* --- timeline --- */
.timeline-section{
  padding:100px 0 130px;
  border-top:1px solid var(--line-soft);
  position:relative;
  z-index:1;
}
.timeline{ position:relative; padding-left:56px; }
.timeline-line{
  position:absolute;
  left:19px; top:6px; bottom:6px;
  width:2px;
  background:var(--line);
}
.timeline-line-fill{
  width:100%;
  height:0%;
  background:linear-gradient(to bottom, var(--orange), var(--blue));
  transition:height 1.4s var(--ease);
}
.timeline-item{
  position:relative;
  padding-bottom:56px;
  opacity:0;
  transform:translateY(24px);
  transition:opacity .7s var(--ease), transform .7s var(--ease);
}
.timeline-item:last-child{ padding-bottom:0; }
.timeline-item.in-view{
  opacity:1;
  transform:translateY(0);
}
.timeline-node{
  position:absolute;
  left:-56px;
  top:0;
  width:40px; height:40px;
  background:var(--bg-elevated);
  border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
  transition:border-color .4s var(--ease), background .4s var(--ease);
}
.timeline-item.in-view .timeline-node{
  border-color:var(--orange);
  background:var(--bg-elevated-2);
}
.timeline-node span{
  font-family:var(--font-mono);
  font-size:.75rem;
  color:var(--text-muted);
}
.timeline-item.in-view .timeline-node span{ color:var(--orange); }
.timeline-content{ max-width:640px; }
.timeline-content h3{
  margin-top:10px;
  font-size:1.2rem;
  line-height:1.35;
}
.timeline-content p{
  margin-top:10px;
  color:var(--text-muted);
  font-size:.94rem;
  line-height:1.6;
}

/* --- skills meters --- */
.skills-meter-section{
  padding:100px 0 140px;
  border-top:1px solid var(--line-soft);
  position:relative;
  z-index:1;
}
.skills-meters{
  display:flex;
  flex-direction:column;
  gap:32px;
  max-width:780px;
}
.skill-meter-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin-bottom:12px;
}
.skill-name{ font-size:.98rem; font-weight:500; }
.skill-percent{
  font-family:var(--font-mono);
  font-size:.88rem;
  color:var(--orange);
}
.skill-track{
  height:8px;
  background:var(--bg-elevated);
  border:1px solid var(--line);
}
.skill-fill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, var(--orange), var(--blue));
  transition:width 1.3s var(--ease);
}

/* =========================================================
   SERVICES PAGE
   ========================================================= */
.services-hero{
  padding:160px 0 70px;
  position:relative;
  z-index:1;
}
.services-hero h1{
  margin-top:16px;
  font-size:clamp(2.1rem,3.8vw,3.1rem);
  line-height:1.18;
  max-width:20ch;
}
.services-hero-sub{
  margin-top:22px;
  max-width:58ch;
  color:var(--text-muted);
  font-size:1.02rem;
}

.services-full{
  padding:20px 0 140px;
  position:relative;
  z-index:1;
}
.services-full-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:26px;
}

.service-full-card{
  position:relative;
  background:var(--bg-elevated);
  border:1px solid var(--line);
  padding:34px 30px 28px;
  clip-path: polygon(20px 0,100% 0,100% calc(100% - 20px),calc(100% - 20px) 100%,0 100%,0 20px);
  opacity:0;
  transform:translateY(30px);
  transition:opacity .7s var(--ease), transform .7s var(--ease),
             box-shadow .35s var(--ease), border-color .35s var(--ease);
  display:flex;
  flex-direction:column;
}
.sfc-bg{
  position:absolute;
  inset:0;
  z-index:0;
  overflow:hidden;
  pointer-events:none;
}
.sfc-bg img{
  width:100%; height:100%;
  object-fit:cover;
  opacity:.22;
}
.sfc-bg::after{
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(27,30,35,0.55) 0%, var(--bg-elevated) 92%);
}
.sfc-content{
  z-index:1;
  display:flex;
  flex-direction:column;
  flex-grow:1;
}
.service-full-card.card-in{
  opacity:1;
  transform:translateY(0);
}
.service-full-card:hover{
  transform:translateY(-6px);
  border-color:var(--blue);
  box-shadow:0 24px 50px -22px rgba(51,177,255,0.3), 0 12px 26px -16px rgba(255,106,44,0.22);
}
.service-full-card.card-in:hover{ transform:translateY(-6px); }

.sfc-tag{
  position:absolute;
  top:28px; right:30px;
  font-family:var(--font-mono);
  font-size:.78rem;
  color:var(--text-faint);
}
.sfc-icon{
  width:52px; height:52px;
  color:var(--orange);
  margin-bottom:22px;
}
.service-full-card:nth-child(2n) .sfc-icon{ color:var(--blue); }
.service-full-card h3{
  font-size:1.16rem;
  margin-bottom:12px;
  max-width:22ch;
}
.service-full-card p{
  color:var(--text-muted);
  font-size:.92rem;
  line-height:1.6;
  flex-grow:1;
}
.sfc-footer{
  margin-top:28px;
  padding-top:22px;
  border-top:1px solid var(--line-soft);
  display:flex;
  align-items:center;
  justify-content:flex-end;
}
.sfc-cta{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:.85rem;
  color:var(--orange);
  font-weight:500;
  transition:gap .25s var(--ease);
}
.sfc-cta svg{ width:14px; height:14px; }
.sfc-cta:hover{ gap:10px; }

/* =========================================================
   CERTIFICATIONS PAGE
   ========================================================= */
.certs-hero{
  padding:160px 0 70px;
  position:relative;
  z-index:1;
}
.certs-hero h1{
  margin-top:16px;
  font-size:clamp(2.1rem,3.8vw,3.1rem);
  line-height:1.18;
  max-width:22ch;
}
.certs-hero-sub{
  margin-top:22px;
  max-width:58ch;
  color:var(--text-muted);
  font-size:1.02rem;
}

.certs-section{
  padding:20px 0 140px;
  position:relative;
  z-index:1;
}

.certs-timeline{
  position:relative;
  padding-left:64px;
  max-width:820px;
}
.certs-line{
  position:absolute;
  left:23px; top:6px; bottom:6px;
  width:2px;
  background:var(--line);
}
.certs-line-fill{
  width:100%;
  height:0%;
  background:linear-gradient(to bottom, var(--orange), var(--blue));
  transition:height 1.4s var(--ease);
}
.certs-group{
  padding:20px 0 100px;
  position:relative;
  z-index:1;
}
.certs-group:first-of-type{ padding-top:20px; }
.cert-row{
  position:relative;
  padding-bottom:28px;
  opacity:0;
  transform:translateY(26px);
  transition:opacity .7s var(--ease), transform .7s var(--ease);
}
.cert-row.in-view{
  opacity:1;
  transform:translateY(0);
}
.cert-row:last-child{ padding-bottom:0; }

.cert-card{
  position:relative;
  background:var(--bg-elevated);
  border:1px solid var(--line);
  padding:28px 30px;
  clip-path: polygon(18px 0,100% 0,100% calc(100% - 18px),calc(100% - 18px) 100%,0 100%,0 18px);
  transition:border-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
  display:flex;
  align-items:center;
  gap:24px;
  justify-content:space-between;
}
.cert-body{ flex:1; min-width:0; }
.cert-logo-frame{
  flex-shrink:0;
  width:64px; height:64px;
  border-radius:50%;
  overflow:hidden;
  border:1px solid var(--line);
  background:var(--bg-elevated-2);
  display:flex; align-items:center; justify-content:center;
}
.cert-logo-frame img{
  width:100%; height:100%;
  object-fit:cover;
}
@media (max-width: 640px){
  .cert-card{ flex-direction:column; align-items:flex-start; }
  .cert-logo-frame{ width:52px; height:52px; order:-1; }
}
.cert-card:hover{
  transform:translateY(-4px);
  border-color:var(--blue);
  box-shadow:0 20px 44px -22px rgba(51,177,255,0.28), 0 10px 22px -14px rgba(255,106,44,0.18);
}

.cert-node{
  position:absolute;
  left:-64px; top:24px;
  width:46px; height:46px;
  background:var(--bg-elevated-2);
  border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
  color:var(--text-faint);
  z-index:2;
  transition:border-color .4s var(--ease), color .4s var(--ease), background .4s var(--ease);
}
.cert-node svg{ width:22px; height:22px; }
.cert-row.in-view .cert-node{
  border-color:var(--orange);
  color:var(--orange);
  background:var(--bg-elevated);
}
.cert-row:nth-child(2n).in-view .cert-node{
  border-color:var(--blue);
  color:var(--blue);
}

.cert-head{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
.cert-year{
  font-family:var(--font-mono);
  font-size:.75rem;
  color:var(--orange);
  border:1px solid var(--line);
  padding:4px 10px;
}
.cert-card:nth-child(2n) .cert-year{ color:var(--blue); }
.cert-type{
  font-family:var(--font-mono);
  font-size:.72rem;
  color:var(--text-faint);
}
.cert-card h3{
  font-size:1.1rem;
  line-height:1.35;
  max-width:52ch;
}
.cert-issuer{
  margin-top:8px;
  font-size:.88rem;
  color:var(--text-muted);
  font-weight:500;
}
.cert-issuer span{ color:var(--text-faint); font-weight:400; }
.cert-desc{
  margin-top:12px;
  color:var(--text-muted);
  font-size:.92rem;
  line-height:1.6;
  max-width:58ch;
}

/* =========================================================
   CONTACT PAGE
   ========================================================= */
.contact-hero{
  padding:160px 0 70px;
  position:relative;
  z-index:1;
}
.contact-hero h1{
  margin-top:16px;
  font-size:clamp(2.1rem,3.8vw,3.1rem);
  line-height:1.18;
  max-width:18ch;
}
.contact-hero-sub{
  margin-top:22px;
  max-width:62ch;
  color:var(--text-muted);
  font-size:1.02rem;
}

.contact-section{
  padding:20px 0 140px;
  position:relative;
  z-index:1;
}
.contact-grid{
  display:grid;
  grid-template-columns:1.5fr .85fr;
  gap:60px;
  align-items:start;
}

/* --- form --- */
.contact-form{
  background:var(--bg-elevated);
  border:1px solid var(--line);
  padding:44px 44px 40px;
  clip-path: polygon(28px 0,100% 0,100% calc(100% - 28px),calc(100% - 28px) 100%,0 100%,0 28px);
  position:relative;
}
.form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:24px;
}
.field{
  margin-bottom:24px;
  display:flex;
  flex-direction:column;
}
.field label{
  font-family:var(--font-mono);
  font-size:.76rem;
  color:var(--text-muted);
  margin-bottom:10px;
  letter-spacing:.02em;
}
.field input,
.field select,
.field textarea{
  background:var(--bg-elevated-2);
  border:1px solid var(--line);
  color:var(--text);
  font-family:var(--font-body);
  font-size:.95rem;
  padding:14px 16px;
  transition:border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  width:100%;
}
.field textarea{ resize:vertical; min-height:140px; line-height:1.6; }
.field input::placeholder,
.field textarea::placeholder{ color:var(--text-faint); }
.field select{
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239BA1AC' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:16px;
  padding-right:40px;
  cursor:pointer;
}
.field select option{ background:var(--bg-elevated-2); color:var(--text); }

.field input:focus,
.field select:focus,
.field textarea:focus{
  outline:none;
  border-color:var(--blue);
  background:var(--bg-elevated);
  box-shadow:0 0 0 3px var(--blue-soft), 0 0 24px -6px var(--blue-glow);
}

.field input.field-invalid,
.field select.field-invalid,
.field textarea.field-invalid{
  border-color:var(--orange);
  box-shadow:0 0 0 3px var(--orange-soft);
}

.form-submit{
  border:none;
  cursor:pointer;
  margin-top:6px;
}
.form-note{
  margin-top:16px;
  font-family:var(--font-mono);
  font-size:.76rem;
  color:var(--text-faint);
  line-height:1.6;
}

.form-success{
  display:none;
  align-items:flex-start;
  gap:16px;
  margin-top:26px;
  padding:22px 24px;
  background:var(--orange-soft);
  border:1px solid var(--orange);
  clip-path: polygon(14px 0,100% 0,100% calc(100% - 14px),calc(100% - 14px) 100%,0 100%,0 14px);
}
.form-success.visible{ display:flex; }
.form-success svg{
  width:22px; height:22px;
  color:var(--orange);
  flex-shrink:0;
  margin-top:2px;
}
.form-success h4{ font-size:1rem; margin-bottom:6px; }
.form-success p{ color:var(--text-muted); font-size:.9rem; line-height:1.55; }

.form-error{
  display:none;
  align-items:flex-start;
  gap:16px;
  margin-top:26px;
  padding:22px 24px;
  background:rgba(229,72,77,.10);
  border:1px solid #e5484d;
  clip-path: polygon(14px 0,100% 0,100% calc(100% - 14px),calc(100% - 14px) 100%,0 100%,0 14px);
}
.form-error.visible{ display:flex; }
.form-error svg{
  width:22px; height:22px;
  color:#e5484d;
  flex-shrink:0;
  margin-top:2px;
}
.form-error h4{ font-size:1rem; margin-bottom:6px; }
.form-error p{ color:var(--text-muted); font-size:.9rem; line-height:1.55; }
.form-submit[disabled]{ opacity:.65; cursor:progress; }

/* --- contact info side --- */
.contact-side{
  display:flex;
  flex-direction:column;
  gap:18px;
  position:sticky;
  top:120px;
}
.contact-info-card{
  background:var(--bg-elevated);
  border:1px solid var(--line);
  padding:22px 24px;
  clip-path: polygon(14px 0,100% 0,100% calc(100% - 14px),calc(100% - 14px) 100%,0 100%,0 14px);
}
.cic-label{
  display:block;
  font-family:var(--font-mono);
  font-size:.74rem;
  color:var(--orange);
  margin-bottom:8px;
}
.cic-value{
  color:var(--text);
  font-size:.96rem;
  font-weight:500;
}

.social-block{
  background:var(--bg-elevated);
  border:1px solid var(--line);
  padding:22px 24px;
  clip-path: polygon(14px 0,100% 0,100% calc(100% - 14px),calc(100% - 14px) 100%,0 100%,0 14px);
}
.social-row-lg a{
  width:44px; height:44px;
}
.social-row-lg{ margin-top:14px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width:1180px) and (min-width:681px){
  .nav-links{ gap:22px; }
  .nav-links a{ font-size:.86rem; }
  .nav-cta{ padding:9px 14px; font-size:.8rem; }
  .brand{ font-size:.98rem; }
}

@media (max-width:980px){
  .hero-grid{ grid-template-columns:1fr; text-align:center; }
  .hero-copy{ order:2; }
  .hero-photo-wrap{ order:1; }
  .eyebrow{ justify-content:center; }
  .hero-actions{ justify-content:center; }
  .hero-tagline{ margin-left:auto; margin-right:auto; }
  .stats-row{ grid-template-columns:repeat(2,1fr); row-gap:40px; }
  .stat:nth-child(2n){ border-left:1px dashed var(--line); }
  .stat:nth-child(1),.stat:nth-child(2){ border-bottom:1px dashed var(--line); padding-bottom:30px; }
  .services-grid{ grid-template-columns:repeat(2,1fr); }
  .work-grid{ grid-template-columns:repeat(2,1fr); }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  .portfolio-grid{ grid-template-columns:repeat(2,1fr); }
  .about-grid{ grid-template-columns:1fr; }
  .about-side{ position:static; order:-1; margin-bottom:20px; }
  .about-frame{ margin:0 auto; }
  .skills-meters{ max-width:100%; }
  .services-full-grid{ grid-template-columns:repeat(2,1fr); }
  .contact-grid{ grid-template-columns:1fr; }
  .contact-side{ position:static; order:-1; margin-bottom:12px; }
}

@media (max-width:680px){
  .nav-links, .nav-cta{ display:none; }
  .nav-toggle{ display:flex; }
  .site-header.open .nav-links{
    display:flex;
    flex-direction:column;
    position:absolute;
    top:100%; left:0; right:0;
    background:var(--bg-elevated);
    padding:24px 32px;
    gap:20px;
    border-top:1px solid var(--line-soft);
  }
  .site-header.open .nav-cta{
    display:inline-flex;
    margin:0 32px 24px;
  }
  .stats-row{ grid-template-columns:1fr; }
  .stat{ border-left:none !important; border-bottom:1px dashed var(--line); padding-bottom:28px; }
  .services-grid{ grid-template-columns:1fr; }
  .work-grid{ grid-template-columns:1fr; }
  .work-head-row{ flex-direction:column; align-items:flex-start; }
  .footer-grid{ grid-template-columns:1fr; }
  .footer-bottom{ flex-direction:column; gap:10px; }
  .testi-card{ padding:32px 26px; }
  .portfolio-grid{ grid-template-columns:1fr; }
  .filter-tabs{ gap:10px; }
  .filter-tab{ font-size:.82rem; padding:9px 16px; }
  .lightbox-info{ padding:26px 24px 30px; }
  .timeline{ padding-left:52px; }
  .timeline-node{ left:-52px; width:34px; height:34px; }
  .services-full-grid{ grid-template-columns:1fr; }
  .cert-card{ padding:22px 22px; }
  .certs-timeline{ padding-left:52px; }
  .certs-line{ left:19px; }
  .cert-node{ left:-52px; width:38px; height:38px; }
  .cert-node svg{ width:18px; height:18px; }
  .contact-grid{ grid-template-columns:1fr; }
  .contact-side{ position:static; }
  .contact-form{ padding:30px 24px; }
  .form-row{ grid-template-columns:1fr; gap:0; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
  .blob{ animation:none; }
}

/* focus visibility */
a:focus-visible, button:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:3px;
}

/* =========================================================
   IMAGE PROTECTION (profile photo + project images)
   Drag/select/long-press-save are blocked here; the right-click
   block is added by js/protect.js.
   ========================================================= */
.img-protected img{
  -webkit-user-drag:none;
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}

/* Narrow phones (about 390px): the fixed 340px profile frame plus page padding
   was 14px wider than the screen and caused a sideways scroll on the Home page. */
@media (max-width:420px){
  .frame{
    width:min(340px, calc(100vw - 80px));
    height:auto;
    aspect-ratio:340/420;
  }
}

/* ---------- Smooth load: hide the page until saved content has loaded ---------- */
html.cms-wait body { opacity: 0; }
html.cms-wait.cms-ready body { opacity: 1; transition: opacity .35s ease; }
