@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

.portfolio-page{
  font-family:Inter,system-ui,sans-serif;
  color:#10165c;
  background:#fff;
  overflow:hidden;
}
.portfolio-page *{box-sizing:border-box}

/* ============================================================
   HERO
   ============================================================ */
.portfolio-hero{
  background:
    radial-gradient(ellipse at 64% 60%,#d8eaff 0,transparent 45%),
    linear-gradient(110deg,#fff 0%,#f2f7ff 55%,#e7f3ff 100%);
  border-bottom:1px solid #e3edfb;
}
.portfolio-hero-inner{
  max-width:1440px;min-height:300px;margin:auto;
  padding:18px 40px 22px;position:relative;
  display:flex;align-items:center;
}
.portfolio-breadcrumb{
  position:absolute;top:20px;left:40px;
  display:flex;gap:9px;align-items:center;
  font-size:12px;color:#111a68;z-index:2;
}
.portfolio-breadcrumb a{color:inherit;text-decoration:none;transition:color .2s ease}
.portfolio-breadcrumb a:hover{color:#0873f9}

.portfolio-hero-copy{position:relative;z-index:1;width:51%;padding-top:30px}
.portfolio-hero-copy h1{
  font-size:clamp(34px,4.2vw,54px);
  line-height:1.04;letter-spacing:-2px;
  font-weight:900;margin:0 0 9px;color:#0b145b;
}
.portfolio-hero-copy h1 span{color:#0873f9}
.portfolio-hero-copy h1 em{
  font-style:normal;
  background:linear-gradient(90deg,#c31ce9,#791eff);
  color:transparent;background-clip:text;
}
.portfolio-hero-copy>p{font-size:14px;line-height:1.45;color:#10165c;margin:0;max-width:580px}

.portfolio-stats{display:flex;align-items:flex-start;margin-top:19px;max-width:540px}
.portfolio-stat{
  flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:3px;
  padding:0 14px;border-right:1px solid #dce8f9;
}
.portfolio-stat:first-child{padding-left:0}
.portfolio-stat:last-child{border:0}
.portfolio-stat svg{width:28px;height:28px;stroke-width:2.8;margin-bottom:2px;transition:transform .3s ease}
.portfolio-stat:hover svg{transform:scale(1.12)}
.portfolio-stat strong{font-size:18px;line-height:1.2;color:#11165f}
.portfolio-stat span{font-size:11px;white-space:nowrap}
.portfolio-stat.pink svg{color:#fa168e}
.portfolio-stat.blue svg{color:#0873f9}
.portfolio-stat.green svg{color:#00b977}
.portfolio-stat.orange svg{color:#f59a00}

.portfolio-hero-art{
  position:absolute;right:18px;top:17px;bottom:12px;
  width:52%;min-width:420px;perspective:900px;
}
.portfolio-device{
  position:absolute;border:5px solid #263956;
  background:#071735;box-shadow:0 15px 32px #123a6840;overflow:hidden;
}
.laptop-device{
  right:16%;top:10px;width:62%;height:75%;
  border-radius:12px 12px 4px 4px;transform:rotate(-4deg);padding:9px;
}
.laptop-device:after{
  content:"";position:absolute;left:-8%;right:-8%;bottom:-13px;
  height:13px;background:linear-gradient(#b9c5d5,#526a89);
  border-radius:2px 2px 10px 10px;
}
.device-top{height:12px;display:flex;gap:4px;align-items:center}
.device-top i{width:4px;height:4px;background:#8da4c3;border-radius:50%}
.device-dashboard{height:calc(100% - 12px);display:flex;background:linear-gradient(135deg,#0b2450,#07132c)}
.dash-sidebar{width:18%;background:#122b55;border-right:1px solid #29436a}
.dash-main{padding:12px;width:82%;display:flex;flex-direction:column;gap:9px}
.dash-main>b{height:7px;width:55%;background:#1c84ff;border-radius:5px}
.dash-main>b:nth-child(2){width:32%;background:#36567d}
.dash-chart{height:42%;display:flex;align-items:flex-end;gap:7px;padding:7px;background:#0f2b50;border:1px solid #23466d;border-radius:5px}
.dash-chart i{flex:1;background:linear-gradient(#1f9aff,#1261df);border-radius:3px 3px 0 0;height:35%}
.dash-chart i:nth-child(2){height:58%}
.dash-chart i:nth-child(3){height:46%}
.dash-chart i:nth-child(4){height:78%}
.dash-chart i:nth-child(5){height:64%}
.dash-chart i:nth-child(6){height:90%}
.dash-widgets{display:flex;gap:5px;flex:1}
.dash-widgets span{flex:1;background:linear-gradient(140deg,#153c6b,#0b1b38);border:1px solid #28476c;border-radius:4px}

.tablet-device{
  left:3%;bottom:8%;width:42%;height:46%;
  border-width:5px;border-radius:8px;transform:rotate(2deg);
  padding:7px;background:#0b1830;
}
.mini-dashboard{background:#f7faff;width:100%;height:100%;padding:10px;display:flex;flex-direction:column;gap:7px}
.mini-dashboard b{height:9px;background:#1475f8;border-radius:3px;width:50%}
.mini-dashboard span{height:14%;border-radius:3px;background:linear-gradient(90deg,#d8e9ff 30%,#fff 30%);border:1px solid #e0e9f8}

.phone-device{
  left:24%;bottom:2%;width:18%;height:50%;
  border:4px solid #18233d;border-radius:18px;transform:rotate(7deg);
  padding:7px;background:#fff;z-index:2;
}
.phone-speaker{width:34%;height:4px;border-radius:4px;background:#253453;margin:0 auto 8px}
.phone-ui{display:flex;flex-direction:column;gap:7px}
.phone-ui b{height:11px;background:#0873f9;border-radius:4px}
.phone-ui span{height:6px;background:#dce8f9;border-radius:4px}
.phone-ui div{height:26px;border-radius:6px;background:linear-gradient(135deg,#d8eaff,#eef5ff);border:1px solid #d7e4f5}

.portfolio-float{
  position:absolute;z-index:3;padding:11px 14px;border-radius:11px;
  color:#fff;font-size:12px;display:flex;align-items:center;gap:8px;
  box-shadow:0 10px 24px #1d4b8726;transform:rotate(-3deg);
}
.portfolio-float b{font-size:11px}
.float-web{left:13%;top:8%;background:#126bf2}
.float-mobile{left:22%;top:31%;background:#ed168d;transform:rotate(-5deg)}
.float-cloud{right:2%;top:14%;background:#00bc8b;transform:rotate(-4deg)}
.float-ai{right:0;top:43%;background:#861cf3;transform:rotate(-5deg)}
.float-enterprise{right:1%;bottom:13%;background:#ff4a5f;transform:rotate(-3deg)}

/* ============================================================
   WORK GRID (full width now)
   ============================================================ */
.portfolio-work{
  max-width:1440px;margin:0 auto;
  padding:20px 30px 14px;
}
.portfolio-main{min-width:0}

.portfolio-section-heading{
  display:flex;align-items:center;justify-content:space-between;
  gap:15px;margin-bottom:14px;
}
.portfolio-section-heading h2{font-size:21px;letter-spacing:-.6px;margin:0 0 3px;font-weight:800}
.portfolio-section-heading p{font-size:11px;margin:0;color:#18245f}

.portfolio-search{
  height:39px;width:205px;flex-shrink:0;
  display:flex;align-items:center;gap:8px;
  padding:0 11px;border:1px solid #cbdcf7;background:#fff;
  border-radius:11px;color:#0c4bc4;
  transition:border-color .25s ease, box-shadow .25s ease;
}
.portfolio-search:focus-within{border-color:#0873f9; box-shadow:0 0 0 4px rgba(8,115,249,.12)}
.portfolio-search input{min-width:0;width:100%;border:0;outline:0;font:inherit;font-size:11px;color:#11165c;background:transparent}
.portfolio-search button{
  border:0;background:none;padding:0;display:flex;color:#4d5b84;
  transition:transform .25s ease, color .25s ease;
}
.portfolio-search button:hover{transform:rotate(90deg); color:#0873f9}

.portfolio-filters{
  display:flex;gap:6px;flex-wrap:wrap;
  margin-bottom:17px;align-items:center;
}
.portfolio-filters>button,
.industry-filter>button{
  border:1px solid transparent;background:#f0f5fd;
  border-radius:8px;padding:9px 12px;font-size:10px;
  color:#11165c;cursor:pointer;white-space:nowrap;
  transition:background .2s ease, color .2s ease, transform .2s ease;
}
.portfolio-filters>button:hover,
.industry-filter>button:hover{background:#e3edfc; transform:translateY(-1px)}
.portfolio-filters>button.active{
  background:#0873f9;color:#fff;
  box-shadow:0 5px 12px #0873f933;
}
.industry-filter{position:relative}
.industry-filter>button{display:flex;align-items:center;gap:4px}
.industry-menu{
  position:absolute;z-index:9;right:0;top:40px;width:190px;max-height:240px;
  overflow:auto;background:#fff;border:1px solid #dce7f8;
  box-shadow:0 12px 30px #142b5720;border-radius:10px;padding:5px;
}
.industry-menu button{
  display:block;width:100%;border:0;background:#fff;text-align:left;
  padding:8px;border-radius:6px;font-size:11px;color:#11165c;cursor:pointer;
}
.industry-menu button:hover{background:#edf5ff}

.portfolio-project-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;
}
.portfolio-project-grid > .portfolio-reveal{display:block; min-width:0}
.portfolio-project-grid > .portfolio-reveal .portfolio-project-card{width:100%; height:100%}

.portfolio-project-card{
  padding:0;text-align:left;min-width:0;
  border:1px solid #dbe7f8;border-radius:12px;overflow:hidden;
  background:#fff;box-shadow:0 3px 12px #164b8a08;
  cursor:pointer;color:inherit;
  transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease;
}
.portfolio-project-card:hover{
  transform:translateY(-3px);
  border-color:#7bb5ff;
  box-shadow:0 12px 26px #1a67c526;
}
.project-image-wrap{height:92px;position:relative;background:#e6effd;overflow:hidden}
.project-image-wrap img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .35s ease}
.portfolio-project-card:hover .project-image-wrap img{transform:scale(1.06)}
.project-number{
  position:absolute;left:7px;top:7px;width:24px;height:24px;
  border-radius:8px;background:#ffffffed;color:#0873f9;
  font-size:11px;font-weight:800;display:grid;place-items:center;
  box-shadow:0 2px 6px #0a285122;
}
.project-open{
  position:absolute;right:7px;bottom:7px;width:25px;height:25px;
  border-radius:50%;display:grid;place-items:center;
  background:#0873f9;color:#fff;
  transition:transform .3s ease;
}
.portfolio-project-card:hover .project-open{transform:rotate(45deg) scale(1.1)}

.project-card-content{padding:8px 9px 9px}
.project-card-content h3{font-size:11px;line-height:1.3;margin:0 0 4px;font-weight:800;color:#10165c}
.project-card-content>p{font-size:9.5px;line-height:1.35;min-height:38px;margin:0 0 6px;color:#253366}
.project-tech-tags{display:flex;gap:4px;flex-wrap:wrap;min-height:20px}
.project-tech-tags span,
.detail-pills span{
  font-size:9px;padding:4px 6px;background:#edf4ff;
  border-radius:5px;color:#17235e;white-space:nowrap;
}
.project-card-bottom{
  display:flex;justify-content:space-between;align-items:center;
  gap:4px;margin-top:7px;font-size:9px;color:#18245f;
}
.project-card-bottom i{
  width:22px;height:22px;flex-shrink:0;display:grid;place-items:center;
  background:#0873f9;color:#fff;border-radius:50%;font-style:normal;
}

.portfolio-project-card:nth-child(4n+2) .project-number{color:#e91e9a}
.portfolio-project-card:nth-child(4n+2) .project-open{background:#e91e9a}
.portfolio-project-card:nth-child(4n+3) .project-number{color:#00ad76}
.portfolio-project-card:nth-child(4n+3) .project-open{background:#00b979}
.portfolio-project-card:nth-child(4n) .project-number{color:#f47a16}
.portfolio-project-card:nth-child(4n) .project-open{background:#ff8b00}

.portfolio-empty{
  grid-column:1/-1;
  display:grid;place-items:center;gap:8px;
  padding:35px 20px;border:1px dashed #cbd8f0;border-radius:12px;
  background:#f4f8ff;color:#3a4a72;text-align:center;
}
.portfolio-empty svg{color:#0873f9}
.portfolio-empty b{color:#10165c}
.portfolio-empty span{font-size:12px}

/* ============================================================
   MODAL
   ============================================================ */
.portfolio-modal-overlay{
  position:fixed;inset:0;z-index:200;
  display:grid;place-items:center;
  padding:24px;
  background:rgba(9,27,75,.55);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  animation:portfolioOverlayIn .25s ease forwards;
}
@keyframes portfolioOverlayIn{from{opacity:0}to{opacity:1}}

.portfolio-modal{
  position:relative;
  width:min(960px,100%);
  max-height:calc(100vh - 48px);
  overflow-y:auto;
  background:#fff;
  border-radius:22px;
  border:1px solid #e0e8f7;
  box-shadow:0 30px 70px rgba(10,30,80,.28);
  padding:26px 26px 22px;
  animation:portfolioModalIn .35s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes portfolioModalIn{
  from{opacity:0;transform:translateY(20px) scale(.97)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

.portfolio-modal-header{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:16px;padding-bottom:16px;
  border-bottom:1px solid #eef3fc;margin-bottom:20px;
}
.portfolio-modal-title-wrap{display:flex;align-items:flex-start;gap:14px}
.portfolio-modal-number{
  display:grid;place-items:center;
  width:40px;height:40px;border-radius:12px;
  font-size:14px;font-weight:800;
  color:#fff;background:#0873f9;
  box-shadow:0 8px 20px rgba(8,115,249,.3);
  flex-shrink:0;
}
.portfolio-modal-eyebrow{
  font-size:10px;letter-spacing:2px;font-weight:800;
  color:#6b7aa3;margin:0 0 4px;
}
.portfolio-modal-header h2{
  font-size:clamp(18px,2vw,22px);
  line-height:1.25;letter-spacing:-.5px;
  margin:0;color:#0b1b4a;
}
.portfolio-modal-close{
  flex-shrink:0;
  width:36px;height:36px;
  display:grid;place-items:center;
  border:0;border-radius:10px;
  background:#f3f7ff;color:#21355e;
  cursor:pointer;
  transition:transform .25s ease, background .25s ease, color .25s ease;
}
.portfolio-modal-close:hover{
  transform:rotate(90deg);
  background:#e6efff;color:#0873f9;
}

/* Tone-aware header number */
.portfolio-modal.tone-pink   .portfolio-modal-number{background:#e91e9a;box-shadow:0 8px 20px rgba(233,30,154,.3)}
.portfolio-modal.tone-green  .portfolio-modal-number{background:#00b979;box-shadow:0 8px 20px rgba(0,185,121,.3)}
.portfolio-modal.tone-orange .portfolio-modal-number{background:#ff8b00;box-shadow:0 8px 20px rgba(255,139,0,.3)}
.portfolio-modal.tone-purple .portfolio-modal-number{background:#861cf3;box-shadow:0 8px 20px rgba(134,28,243,.3)}
.portfolio-modal.tone-sky    .portfolio-modal-number{background:#0873f9;box-shadow:0 8px 20px rgba(8,115,249,.3)}

.portfolio-modal-body{
  display:grid;grid-template-columns:1.05fr 1fr;
  gap:22px;align-items:start;
}
.portfolio-modal-image{
  width:100%;height:200px;
  object-fit:cover;border-radius:12px;
  display:block;margin-bottom:16px;
}

/* Detail block reused */
.portfolio-detail-block{display:flex;gap:10px;margin:14px 0;color:#0873f9;align-items:flex-start}
.portfolio-detail-block>svg{width:22px;height:22px;flex-shrink:0;stroke-width:2.5}
.portfolio-detail-block>div{flex:1;min-width:0}
.portfolio-detail-block h4{font-size:12px;color:#10165c;margin:1px 0 6px;font-weight:800}
.portfolio-detail-block p{font-size:11.5px;line-height:1.55;color:#1c2a67;margin:0}
.portfolio-detail-block ul{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.portfolio-detail-block li{
  display:flex;gap:6px;align-items:flex-start;
  font-size:11.5px;line-height:1.45;color:#1c2a67;
  transition:color .2s ease, transform .2s ease;
}
.portfolio-detail-block li:hover{color:#0873f9; transform:translateX(3px)}
.portfolio-detail-block li svg{width:14px;height:14px;color:#00b979;flex-shrink:0;fill:#00b97912;margin-top:1px}
.detail-pills{display:flex;flex-wrap:wrap;gap:4px}

.portfolio-modal-note{
  display:flex;gap:10px;padding:12px;
  background:#f1f7ff;border-radius:10px;
  margin:15px 0;color:#0873f9;
}
.portfolio-modal-note svg{flex-shrink:0;width:18px;height:18px}
.portfolio-modal-note p{font-size:10.5px;line-height:1.5;color:#344574;margin:0}

.portfolio-modal-footer{
  margin-top:22px;padding-top:18px;
  border-top:1px solid #eef3fc;
  display:flex;justify-content:flex-end;
}
.portfolio-primary-cta{
  display:inline-flex;align-items:center;justify-content:center;
  gap:8px;padding:12px 22px;border-radius:9px;
  text-decoration:none;background:#0873f9;color:#fff;
  font-size:12px;font-weight:700;
  position:relative;overflow:hidden;
  transition:transform .25s ease,box-shadow .25s ease,background .25s ease;
}
.portfolio-primary-cta::after{
  content:"";position:absolute;inset:0;
  background:radial-gradient(circle at center,rgba(255,255,255,.35),transparent 60%);
  opacity:0;transform:scale(.6);
  transition:opacity .4s ease,transform .4s ease;
  pointer-events:none;
}
.portfolio-primary-cta:hover::after{opacity:1;transform:scale(1.4)}
.portfolio-primary-cta:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 26px rgba(8,115,249,.28);
  background:#075fd0;
}
.portfolio-primary-cta svg{transition:transform .3s ease}
.portfolio-primary-cta:hover svg{transform:translateX(4px)}

/* ============================================================
   BOTTOM STATS
   ============================================================ */
.portfolio-bottom-stats{
  max-width:1380px;margin:24px auto 18px;
  padding:13px 22px;
  display:grid;grid-template-columns:repeat(4,1fr);
  background:#f1f7ff;border-radius:12px;
}
.portfolio-bottom-stats>div{
  display:flex;align-items:center;justify-content:center;gap:12px;
  border-right:1px solid #d9e7fa;
}
.portfolio-bottom-stats>div:last-child{border:0}
.portfolio-bottom-stats svg{width:28px;height:28px;stroke-width:2.7}
.portfolio-bottom-stats svg.pink{color:#ff9b00}
.portfolio-bottom-stats svg.blue{color:#0873f9}
.portfolio-bottom-stats svg.green{color:#861cf3}
.portfolio-bottom-stats svg.orange{color:#00b979}
.portfolio-bottom-stats span{display:flex;flex-direction:column;gap:2px}
.portfolio-bottom-stats strong{font-size:15px}
.portfolio-bottom-stats small{font-size:10px}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.portfolio-reveal{
  opacity:0;transform:translateY(22px);
  transition:
    opacity .65s cubic-bezier(.22,1,.36,1),
    transform .65s cubic-bezier(.22,1,.36,1);
  will-change:opacity,transform;
}
.portfolio-reveal.is-visible{opacity:1;transform:translateY(0)}

/* Hero entrance */
.portfolio-hero-copy h1,
.portfolio-hero-copy>p,
.portfolio-hero-copy .portfolio-stats{
  opacity:0;transform:translateY(16px);
  animation:portfolioHeroFadeUp .9s cubic-bezier(.22,1,.36,1) forwards;
}
.portfolio-hero-copy h1{animation-delay:.05s}
.portfolio-hero-copy>p{animation-delay:.2s}
.portfolio-hero-copy .portfolio-stats{animation-delay:.35s}
@keyframes portfolioHeroFadeUp{to{opacity:1;transform:translateY(0)}}

.portfolio-hero-art{
  opacity:0;
  animation:portfolioVisualIn 1s cubic-bezier(.22,1,.36,1) .25s forwards;
}
@keyframes portfolioVisualIn{
  from{opacity:0;transform:translateX(28px) scale(.98)}
  to{opacity:1;transform:translateX(0) scale(1)}
}

/* Floating labels */
.portfolio-float{animation:portfolioFloat 5s ease-in-out infinite}
.float-web{animation-delay:0s}
.float-mobile{animation-delay:.6s}
.float-cloud{animation-delay:1.2s}
.float-ai{animation-delay:1.8s}
.float-enterprise{animation-delay:2.4s}
@keyframes portfolioFloat{
  0%,100%{transform:translateY(0) rotate(-3deg)}
  50%{transform:translateY(-8px) rotate(-3deg)}
}
.portfolio-float:hover{transform:translateY(-6px) scale(1.05) rotate(-3deg);transition:transform .25s ease}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media(min-width:1400px){
  .portfolio-hero-inner{min-height:340px}
  .portfolio-project-grid{gap:13px}
  .project-image-wrap{height:112px}
  .project-card-content h3{font-size:12px}
  .project-card-content>p{font-size:10px}
}
@media(max-width:1100px){
  .portfolio-work{padding:18px}
  .portfolio-project-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .portfolio-hero-inner{padding-left:28px}
  .portfolio-breadcrumb{left:28px}
  .portfolio-hero-copy{width:53%}
  .portfolio-hero-art{right:0;width:50%;min-width:350px}
  .portfolio-float{padding:8px 10px}
  .portfolio-float b{font-size:10px}
}
@media(max-width:760px){
  .portfolio-hero-inner{min-height:570px;display:block;padding:18px 20px 0}
  .portfolio-breadcrumb{left:20px;top:16px}
  .portfolio-hero-copy{padding-top:40px;width:100%}
  .portfolio-hero-copy h1{font-size:39px;letter-spacing:-1.5px}
  .portfolio-hero-copy>p{font-size:13px}
  .desktop-break{display:none}
  .portfolio-stats{max-width:100%;margin-top:18px}
  .portfolio-stat{padding:0 8px}
  .portfolio-stat strong{font-size:16px}
  .portfolio-stat span{font-size:9px;white-space:normal}
  .portfolio-stat svg{width:24px;height:24px}
  .portfolio-hero-art{top:auto;bottom:5px;left:8%;right:8%;width:84%;min-width:0;height:245px}
  .laptop-device{right:8%;width:70%;height:74%}
  .tablet-device{left:1%;width:42%;height:45%}
  .phone-device{left:25%;height:49%;width:19%}
  .portfolio-float{font-size:10px;padding:7px 8px;border-radius:7px}
  .portfolio-float b{font-size:9px}
  .float-web{left:4%;top:6%}
  .float-mobile{left:18%;top:30%}
  .float-cloud{right:0;top:10%}
  .float-ai{right:0;top:45%}
  .float-enterprise{right:0;bottom:7%}

  .portfolio-work{padding:22px 14px;gap:18px}
  .portfolio-section-heading{align-items:flex-start;flex-direction:column}
  .portfolio-section-heading h2{font-size:21px}
  .portfolio-section-heading p{line-height:1.5}
  .portfolio-search{width:100%}
  .portfolio-filters{flex-wrap:nowrap;overflow-x:auto;padding-bottom:5px}
  .portfolio-filters>button,.industry-filter>button{padding:9px 11px}
  .portfolio-project-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .project-image-wrap{height:100px}
  .project-card-content{padding:8px}
  .project-card-content h3{font-size:11px}
  .project-card-content>p{font-size:9px;min-height:50px}
  .project-tech-tags span{font-size:8px;padding:4px}
  .project-card-bottom{font-size:8px}

  .portfolio-bottom-stats{
    margin:0 14px 18px;padding:14px 7px;
    grid-template-columns:repeat(2,1fr);gap:14px;
  }
  .portfolio-bottom-stats>div{justify-content:flex-start;padding-left:12px;border-right:0}
  .portfolio-bottom-stats>div:nth-child(odd){border-right:1px solid #d9e7fa}
  .portfolio-bottom-stats svg{width:24px;height:24px}
  .portfolio-bottom-stats strong{font-size:14px}
  .portfolio-bottom-stats small{font-size:9px}

  /* Modal stacks */
  .portfolio-modal-overlay{padding:12px}
  .portfolio-modal{
    padding:20px 18px 18px;
    border-radius:18px;
    max-height:calc(100vh - 24px);
  }
  .portfolio-modal-body{grid-template-columns:1fr;gap:16px}
  .portfolio-modal-image{height:180px}
  .portfolio-modal-footer{justify-content:stretch}
  .portfolio-modal-footer .portfolio-primary-cta{width:100%}
}
@media(max-width:390px){
  .portfolio-hero-copy h1{font-size:33px}
  .portfolio-stat{padding:0 5px}
  .portfolio-stat strong{font-size:14px}
  .project-image-wrap{height:84px}
  .portfolio-project-grid{gap:7px}
  .portfolio-project-card{border-radius:9px}
  .project-card-content>p{min-height:60px}

  .portfolio-modal-header h2{font-size:16px}
  .portfolio-modal-number{width:36px;height:36px;font-size:13px}
  .portfolio-modal-image{height:150px}
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
  }
  .portfolio-reveal{opacity:1;transform:none}
  .portfolio-float,
  .portfolio-modal-overlay,
  .portfolio-modal{animation:none}
  .portfolio-project-card:hover,
  .portfolio-float:hover,
  .portfolio-primary-cta:hover{transform:none}
}

@media (max-width:760px){
  .portfolio-float{animation:none}
}

/* ============================================================
   LEGACY SAFETY (hides any stale side-panel selectors)
   ============================================================ */
.portfolio-detail-panel,
.portfolio-detail-heading,
.portfolio-detail-image { display:none !important; }