:root{
  --bg:#050608;
  --bg-soft:#0b0b0d;
  --yellow:#ffc400;
  --orange:#ff6a00;
  --white:#f5f5f5;
  --muted:#9a9a9a;
  --line:rgba(255,196,0,0.18);
  --glow:rgba(255,196,0,0.28);
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html, body{
  width:100%;
  min-height:100%;
}

body.portfolio-page{
  font-family: Arial, Helvetica, sans-serif;
  color:var(--white);
  overflow-x:hidden;
  overflow-y:auto;
  position:relative;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,196,0,0.10), transparent 20%),
    radial-gradient(circle at 86% 14%, rgba(255,106,0,0.08), transparent 18%),
    radial-gradient(circle at 22% 78%, rgba(255,196,0,0.05), transparent 24%),
    radial-gradient(circle at 78% 70%, rgba(255,106,0,0.06), transparent 24%),
    radial-gradient(circle at 50% 42%, rgba(18,24,34,0.55), transparent 42%),
    linear-gradient(180deg, #040506 0%, #07090d 38%, #090c12 100%);
}

body.portfolio-page::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,0.013) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.013) 1px, transparent 1px);
  background-size:72px 72px;
  opacity:0.18;
  mask-image:linear-gradient(180deg, rgba(0,0,0,0.95), rgba(0,0,0,0.72));
}

/* =========================
   PORTFOLIO PAGE
========================= */

.portfolio-page{
  position:relative;
  min-height:100vh;
  isolation:isolate;
}

.portfolio-hero,
.portfolio-gallery{
  position:relative;
  z-index:1;
  background:transparent;
}

.portfolio-hero::before,
.portfolio-hero::after,
.portfolio-gallery::before,
.portfolio-gallery::after{
  display:none !important;
  content:none !important;
}

.portfolio-hero{
  min-height:72vh;
  padding:120px 90px 72px;
  display:flex;
  align-items:flex-end;
}

.portfolio-hero-grid{
  display:none;
}

.portfolio-hero-inner{
  position:relative;
  z-index:2;
  max-width:860px;
}

.portfolio-kicker{
  font-size:12px;
  letter-spacing:0.26em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:18px;
  opacity:0;
  transform:translateY(24px);
  animation:textReveal 0.8s ease 0.1s forwards;
}

.portfolio-title{
  font-size:clamp(46px, 7vw, 112px);
  line-height:0.9;
  letter-spacing:-0.06em;
  font-weight:900;
  text-transform:uppercase;
  max-width:780px;
}

.portfolio-title span{
  display:block;
  opacity:0;
  transform:translateY(36px);
  animation:textReveal 0.85s cubic-bezier(.16,1,.3,1) forwards;
}

.portfolio-title span:first-child{
  animation-delay:0.18s;
}

.portfolio-title .accent{
  color:var(--yellow);
  position:relative;
  animation-delay:0.32s;
}

.portfolio-title .accent::after{
  content:"";
  position:absolute;
  left:0;
  bottom:12px;
  width:100%;
  height:16px;
  background:linear-gradient(90deg, rgba(255,106,0,0.22), rgba(255,196,0,0.08));
  transform:skewX(-18deg);
  border-radius:8px;
  z-index:-1;
}

.portfolio-sub{
  margin-top:24px;
  max-width:620px;
  color:#b8b8b8;
  font-size:clamp(15px, 1.15vw, 18px);
  line-height:1.8;
  opacity:0;
  transform:translateY(26px);
  animation:textReveal 0.85s ease 0.48s forwards;
}

.portfolio-meta{
  margin-top:26px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  opacity:0;
  transform:translateY(24px);
  animation:textReveal 0.85s ease 0.62s forwards;
}

.portfolio-meta span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,196,0,0.18);
  background:rgba(255,255,255,0.02);
  color:#d7b455;
  font-size:11px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  backdrop-filter:blur(6px);
}

.portfolio-gallery{
  padding:14px 90px 160px;
  overflow:visible;
}

.portfolio-head{
  position:relative;
  z-index:2;
  margin-bottom:34px;
}

.portfolio-label{
  font-size:12px;
  letter-spacing:0.22em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:12px;
}

.portfolio-section-title{
  font-size:clamp(30px, 4vw, 58px);
  line-height:1;
  font-weight:900;
  letter-spacing:-0.04em;
  text-transform:uppercase;
  color:var(--white);
}

.portfolio-grid{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:24px;
  align-items:stretch;
}

.portfolio-card{
  position:relative;
  z-index:2;
  min-height:430px;
  display:block;
  overflow:hidden;
  text-decoration:none;
  isolation:isolate;
  border-radius:26px;
  background:rgba(10,14,20,0.32);
  border:1px solid rgba(255,255,255,0.06);
  backdrop-filter:blur(4px);
  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    filter 0.35s ease;
}

.portfolio-card:hover{
  transform:translateY(-10px);
  border-color:rgba(255,196,0,0.22);
  box-shadow:
    0 16px 32px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,196,0,0.08);
}

.portfolio-card::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.03), transparent 26%),
    linear-gradient(315deg, rgba(255,196,0,0.04), transparent 32%);
  opacity:0.7;
}

.portfolio-card::after{
  content:"";
  position:absolute;
  inset:1px;
  z-index:1;
  pointer-events:none;
  border-radius:25px;
  border:1px solid rgba(255,255,255,0.035);
}

.portfolio-card-image,
.portfolio-card-image img,
.portfolio-card-overlay{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

.portfolio-card-image{
  z-index:0;
}

.portfolio-card-image img{
  display:block;
  object-fit:cover;
  object-position:center;
  transform:scale(1);
  transition:
    transform 0.45s ease,
    filter 0.45s ease,
    opacity 0.45s ease;
}

.portfolio-card:hover .portfolio-card-image img{
  transform:scale(1.06);
  filter:brightness(1.05) contrast(1.04);
}

.portfolio-card-overlay{
  z-index:1;
  background:
    linear-gradient(
      180deg,
      rgba(7,8,12,0.03) 0%,
      rgba(7,8,12,0.10) 40%,
      rgba(7,8,12,0.68) 100%
    );
}

.portfolio-card-content{
  position:absolute;
  left:24px;
  right:24px;
  bottom:24px;
  z-index:2;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.portfolio-card-index{
  font-size:11px;
  letter-spacing:0.22em;
  text-transform:uppercase;
  color:#d1a946;
  opacity:0.85;
  transition:opacity 0.28s ease;
}

.portfolio-card:hover .portfolio-card-index{
  opacity:1;
}

.portfolio-card-name{
  font-size:clamp(26px, 2.2vw, 40px);
  line-height:0.95;
  font-weight:900;
  letter-spacing:-0.03em;
  text-transform:uppercase;
  color:#fff;
  text-shadow:0 4px 18px rgba(0,0,0,0.34);
  transition:transform 0.28s ease;
}

.portfolio-card:hover .portfolio-card-name{
  transform:translateY(-2px);
}

.portfolio-card-desc{
  max-width:270px;
  font-size:11px;
  letter-spacing:0.12em;
  line-height:1.7;
  text-transform:uppercase;
  color:rgba(255,255,255,0.62);
  opacity:0.78;
  transform:translateY(6px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    color 0.28s ease;
}

.portfolio-card:hover .portfolio-card-desc{
  opacity:1;
  transform:translateY(0);
  color:#d9b760;
}

/* =========================
   VIEWER PAGE
========================= */

.viewer-page{
  min-height:100vh;
  background:
    radial-gradient(circle at 50% 10%, rgba(255,196,0,0.06), transparent 22%),
    radial-gradient(circle at 14% 80%, rgba(255,106,0,0.05), transparent 24%),
    linear-gradient(180deg, #05070a 0%, #040506 100%);
  overflow-x: hidden;
  overflow-y: auto;  
}

.viewer-page::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  background:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size:72px 72px;
  opacity:0.16;
}

.viewer-page::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,196,0,0.05), transparent 24%);
  opacity:0.7;
}

.viewer-shell{
  position:relative;
  z-index:1;
  min-height:100vh;
  padding:28px;
}

.viewer-topbar{
  position:relative;
  z-index:3;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:24px;
  padding:0 0 20px;
}

.viewer-kicker{
  font-size:11px;
  letter-spacing:0.24em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:10px;
}

.viewer-title{
  font-size:clamp(28px, 3vw, 54px);
  line-height:1;
  letter-spacing:-0.04em;
  font-weight:900;
  text-transform:uppercase;
  color:var(--white);
}

.viewer-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.viewer-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:150px;
  padding:14px 18px;
  text-decoration:none;
  text-transform:uppercase;
  letter-spacing:0.16em;
  font-size:11px;
  color:var(--yellow);
  border:1px solid rgba(255,196,0,0.26);
  background:rgba(255,255,255,0.02);
  border-radius:999px;
  overflow:hidden;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.viewer-btn::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.12) 45%, transparent 70%);
  transform:translateX(-120%);
  transition:transform 0.45s ease;
}

.viewer-btn:hover{
  transform:translateY(-3px);
  background:rgba(255,196,0,0.08);
  border-color:rgba(255,196,0,0.45);
  box-shadow:0 10px 24px rgba(255,196,0,0.08);
}

.viewer-btn:hover::before{
  transform:translateX(120%);
}

.viewer-stage{
  position:relative;
  height: auto;
  border-radius:28px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(circle at 50% 20%, rgba(255,196,0,0.05), transparent 24%),
    linear-gradient(180deg, #0b0e13 0%, #05070a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 18px 50px rgba(0,0,0,0.28);
}

.viewer-stage::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:1;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.03), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(255,255,255,0.02), transparent 40%);
}

#modelCanvas{
  position:relative;
  z-index:0;
  display:block;
  width:100%;
  height:100%;
}

.viewer-hud{
  position:absolute;
  left:20px;
  bottom:20px;
  z-index:2;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.viewer-hud span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,196,0,0.14);
  background:rgba(255,255,255,0.03);
  color:#d8b559;
  font-size:10px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  backdrop-filter:blur(6px);
}

/* =========================
   FOOTER
========================= */

.site-footer{
  position:relative;
  padding:100px 90px 30px;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(255,106,0,0.12), transparent 40%),
    radial-gradient(circle at 10% 80%, rgba(255,196,0,0.06), transparent 30%),
    linear-gradient(180deg, #06070a 0%, #020304 100%);
}

.site-footer::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:80px;
  pointer-events:none;
  background:
    linear-gradient(
      to bottom,
      rgba(255,196,0,0.18),
      rgba(255,196,0,0.06),
      transparent
    );
  filter:blur(12px);
  opacity:0.8;
}

.site-footer::after{
  display:none;
}

.footer-top,
.footer-bottom{
  position:relative;
  z-index:2;
}

.footer-top{
  display:grid;
  grid-template-columns:minmax(0, 1.1fr) minmax(0, 1fr);
  gap:70px;
  align-items:start;
  padding-bottom:44px;
}

.footer-brand{
  max-width:560px;
}

.footer-kicker{
  font-size:12px;
  letter-spacing:0.24em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:16px;
}

.footer-title{
  font-size:clamp(34px, 4.2vw, 68px);
  line-height:0.95;
  font-weight:900;
  letter-spacing:-0.05em;
  text-transform:uppercase;
  color:var(--white);
  margin-bottom:18px;
}

.footer-text{
  max-width:460px;
  color:#b3b3b3;
  font-size:15px;
  line-height:1.8;
}

.footer-links-wrap{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:28px;
}

.footer-col{
  min-width:0;
}

.footer-heading{
  font-size:11px;
  letter-spacing:0.2em;
  text-transform:uppercase;
  color:#d8b45a;
  margin-bottom:18px;
}

.footer-links{
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.footer-links li,
.footer-links a,
.footer-links span{
  font-size:14px;
  line-height:1.6;
  color:#c9c9c9;
  text-decoration:none;
  transition:
    color 0.25s ease,
    transform 0.25s ease,
    opacity 0.25s ease;
}

.footer-links a:hover{
  color:var(--yellow);
  transform:translateX(4px);
}

.footer-contact span{
  color:#9f9f9f;
}

.footer-bottom{
  border-top:1px solid rgba(255,255,255,0.08);
  padding-top:20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
}

.footer-bottom p{
  font-size:12px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:rgba(255,255,255,0.42);
}

.footer-back{
  text-decoration:none;
  color:var(--yellow);
  font-size:12px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  border:1px solid rgba(255,196,0,0.24);
  padding:10px 14px;
  background:rgba(255,255,255,0.02);
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.footer-back:hover{
  transform:translateY(-3px);
  background:rgba(255,196,0,0.08);
  border-color:rgba(255,196,0,0.45);
  box-shadow:0 10px 24px rgba(255,196,0,0.08);
}

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.6),
    rgba(0,0,0,0.75)
  );
  pointer-events:none;
}
.hero p{
  opacity: 0.85;
}
.hero p{
  color: rgba(255,255,255,0.85);
}
.hero-buttons a{
  border: 1px solid rgba(255,196,0,0.5);
  background: rgba(255,196,0,0.08);
}

.hero-buttons a:hover{
  background: rgba(255,196,0,0.2);
}
/* =========================
   ANIMATION
========================= */

@keyframes textReveal{
  from{
    opacity:0;
    transform:translateY(28px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}


.portfolio-tabs{
  position:relative;
  z-index:2;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:30px;
}

.portfolio-tab{
  appearance:none;
  border:none;
  cursor:pointer;
  padding:12px 18px;
  border-radius:999px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  color:#cfcfcf;
  font-size:11px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.portfolio-tab:hover{
  transform:translateY(-2px);
  color:#fff;
  border-color:rgba(255,196,0,0.22);
  background:rgba(255,196,0,0.06);
}

.portfolio-tab.is-active{
  color:#111;
  background:linear-gradient(135deg, #ffc400, #ff9d00);
  border-color:rgba(255,196,0,0.5);
  box-shadow:0 10px 24px rgba(255,196,0,0.18);
}

.portfolio-card{
  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    filter 0.35s ease,
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.portfolio-card.is-hidden{
  display:none;
}
/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px){
  .portfolio-hero,
  .portfolio-gallery{
    padding-left:56px;
    padding-right:56px;
  }

  .portfolio-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .site-footer{
    padding:80px 56px 26px;
  }

  .footer-top{
    gap:48px;
  }
}

@media (max-width: 980px){
  .portfolio-hero{
    min-height:auto;
    padding:110px 26px 58px;
  }

  .portfolio-gallery{
    padding:18px 26px 120px;
  }

  .portfolio-grid{
    grid-template-columns:1fr;
  }

  .viewer-shell{
    padding:18px;
  }

  .viewer-topbar{
    flex-direction:column;
    align-items:flex-start;
  }

  .viewer-stage{
    height:calc(100vh - 170px);
  }

  .site-footer{
    padding:72px 26px 24px;
  }

  .footer-top{
    grid-template-columns:1fr;
    gap:38px;
  }

  .footer-links-wrap{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:24px;
  }
}

@media (max-width: 640px){
  .portfolio-card{
    min-height:340px;
    border-radius:22px;
  }

  .portfolio-card::after{
    border-radius:21px;
  }

  .portfolio-card-content{
    left:18px;
    right:18px;
    bottom:18px;
  }

  .portfolio-card-name{
    font-size:32px;
  }

  .viewer-stage{
    height:calc(100vh - 190px);
    border-radius:20px;
  }

  .viewer-hud{
    left:14px;
    right:14px;
    bottom:14px;
  }

  .footer-links-wrap{
    grid-template-columns:1fr;
  }

  .footer-title{
    font-size:clamp(32px, 12vw, 52px);
  }

  .footer-text{
    font-size:14px;
  }

  .footer-bottom{
    flex-direction:column;
    align-items:flex-start;
  }

  .footer-back{
    padding:10px 12px;
  }
}
.footer-logo img{
  width: 180px;
  transition: 0.3s;
}

.footer-logo img:hover{
  filter: brightness(1.4) drop-shadow(0 0 10px rgba(255,180,60,0.4));
}

body.portfolio-page{
  padding-top: 72px;
}