:root {
  --ink: #060818;
  --bg: #0a0e2a;
  --bg-warm: #190d2a;
  --blue: #4f43f0;
  --blue-bright: #6d62ff;
  --blue-deep: #271b96;
  --orange: #ff7a3d;
  --orange-bright: #ff9b66;
  --gold: #d4a945;
  --gold-bright: #ecca6e;
  --cream: #f2ede1;
  --text: #e9e7f2;
  --muted: #9794b2;
  --line: rgba(91, 76, 240, 0.4);
  --line-bright: rgba(120, 108, 255, 0.85);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--ink);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

/* atmospheric base: warm aubergine bloom up top, deep navy below, dark vignette edges */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 90% 55% at 75% 8%, rgba(91, 76, 240, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 20% 95%, rgba(255, 122, 61, 0.10), transparent 55%),
    radial-gradient(ellipse 120% 90% at 50% 40%, var(--bg-warm) 0%, var(--bg) 45%, var(--ink) 100%);
}

/* heavy vignette to deepen the corners like the reference */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(ellipse 80% 80% at 50% 45%, transparent 55%, rgba(3, 4, 14, 0.75) 100%);
  pointer-events: none;
}

/* ===== NAV ===== */
nav {
  position: fixed; top: 26px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; gap: 30px; padding: 13px 30px;
  background: rgba(8, 11, 32, 0.5); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 100px;
  box-shadow: 0 0 40px rgba(91,76,240,0.14), inset 0 0 20px rgba(91,76,240,0.05);
}
nav a {
  color: var(--text); text-decoration: none; font-family: 'Cinzel', serif;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  transition: color .3s; cursor: pointer; position: relative;
}
nav a::after { content:''; position:absolute; bottom:-5px; left:50%; width:0; height:1px; background:var(--gold-bright); transition:width .3s, left .3s; }
nav a:hover { color: var(--gold-bright); }
nav a:hover::after { width:100%; left:0; }

/* ===== shared display type ===== */
.painted {
  font-family: 'Caveat Brush', cursive;
  color: var(--blue-bright);
  text-shadow:
    -2px -2px 0 var(--orange),
    2px 2px 0 var(--blue-deep),
    0 0 25px rgba(91,76,240,0.5);
  line-height: 0.9;
}
.hand {
  font-family: 'Just Another Hand', cursive;
  color: var(--cream);
  letter-spacing: 1px;
  text-shadow: 0 0 18px rgba(91,76,240,0.4);
  line-height: 0.95;
}
.eyebrow {
  font-family: 'Cinzel', serif; font-weight: 500;
  color: var(--gold); letter-spacing: 6px; text-transform: uppercase;
  font-size: 13px;
}

/* ===== HERO / HEADER ===== */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 24px 80px; position: relative;
}
.hero-portfolio {
  font-size: clamp(88px, 19vw, 300px);
  letter-spacing: -3px; transform: rotate(-2.5deg);
}
.hero-rule { width: 70px; height: 1px; background: var(--gold); opacity: .6; margin: 34px auto 22px; }
.hero-name {
  font-family: 'Cinzel', serif; font-weight: 600;
  font-size: clamp(26px, 4.4vw, 50px); color: var(--gold-bright);
  letter-spacing: 12px; padding-left: 12px;
  text-shadow: 0 0 20px rgba(236, 202, 110, 0.25);
}
.hero-role { font-family:'Just Another Hand',cursive; font-size: clamp(24px,3vw,34px); color: var(--muted); letter-spacing: 2px; margin-top: 10px; }

.blob { position: absolute; border-radius: 50%; filter: url(#paint-live); pointer-events: none; will-change: transform; }
.blob.b { background: radial-gradient(circle at 32% 30%, var(--blue-bright), var(--blue-deep) 72%); }
.blob.o { background: radial-gradient(circle at 32% 30%, var(--orange-bright), var(--orange) 72%); }
@keyframes drift1{0%,100%{transform:translate(0,0) rotate(0)}50%{transform:translate(24px,-46px) rotate(160deg)}}
@keyframes drift2{0%,100%{transform:translate(0,0)}50%{transform:translate(-34px,-54px)}}
@keyframes drift3{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(40px,34px) scale(1.18)}}

/* page-wide ambient floating dots */
.field { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fdot { position: absolute; border-radius: 50%; filter: url(#paint-soft); will-change: transform; }
@keyframes fa { 0%,100%{transform:translate(0,0)} 50%{transform:translate(18px,-42px)} }
@keyframes fb { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-28px,-30px)} }
@keyframes fc { 0%,100%{transform:translate(0,0)} 50%{transform:translate(24px,34px)} }
@keyframes fd { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-18px,30px) scale(1.3)} }

.scroll-cue {
  position: absolute; bottom: 38px; left: 50%; transform: translateX(-50%);
  font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 5px; color: var(--muted);
  text-transform: uppercase; animation: bob 2.6s ease-in-out infinite;
}
.scroll-cue::after { content:''; display:block; width:1px; height:30px; margin: 12px auto 0; background: linear-gradient(var(--gold), transparent); }
@keyframes bob { 0%,100%{transform:translateX(-50%) translateY(0); opacity:.55} 50%{transform:translateX(-50%) translateY(10px); opacity:1} }

/* ===== section scaffolding ===== */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.sec-head { text-align: center; margin-bottom: 64px; }
.sec-title { font-size: clamp(56px, 9vw, 120px); transform: rotate(-1.5deg); margin-top: 6px; }

/* ===== WORK ===== */
.work { padding: 70px 0 60px; }

/* featured project — RUST-style split */
.feature {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  margin-bottom: 90px; box-shadow: 0 0 50px rgba(91,76,240,0.1), inset 0 0 40px rgba(91,76,240,0.04);
  background: rgba(8,11,32,0.4);
}
.feature-img { position: relative; overflow: hidden; min-height: 460px; cursor: pointer; }
.feature-img svg { width: 100%; height: 100%; display: block; transition: transform .9s cubic-bezier(.16,1,.3,1); }
.feature-img:hover svg { transform: scale(1.06); }
.feature-img::after {
  content:''; position:absolute; inset:0; pointer-events:none;
  background: radial-gradient(circle at 30% 25%, rgba(255,122,61,0.16), transparent 60%);
  opacity:0; transition: opacity .6s;
}
.feature-img:hover::after { opacity:1; }
.feature-body { padding: 56px 50px; display: flex; flex-direction: column; justify-content: center; }
.feature-title { font-size: clamp(72px, 9vw, 130px); margin: 14px 0 8px; }
.feature-list { list-style: none; margin: 8px 0 30px; }
.feature-list li { font-family:'Just Another Hand',cursive; font-size: 30px; color: var(--text); letter-spacing: 1px; line-height: 1.25; }
.feature-list li span { color: var(--gold-bright); margin-right: 12px; }
.feature-desc { font-size: 14px; line-height: 1.85; color: var(--muted); font-weight: 300; margin-bottom: 28px; max-width: 420px; }

/* work grid (RISE / CRISIS / CRASH style) */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.tile { cursor: pointer; }
.tile-frame {
  aspect-ratio: 4/5; border-radius: 14px; overflow: hidden; position: relative;
  border: 1px solid var(--line); transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.16,1,.3,1), box-shadow .5s, border-color .5s; will-change: transform;
}
.tile-frame svg { width: 100%; height: 100%; display: block; }
.tile-frame::after {
  content: attr(data-label); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 5px; color: var(--cream);
  background: rgba(6, 8, 24, 0.6); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .45s; text-transform: uppercase;
}
.tile:hover .tile-frame { box-shadow: 0 24px 50px rgba(0,0,0,0.5); border-color: var(--line-bright); }
.tile:hover .tile-frame::after { opacity: 1; }
.tile-cap { text-align: center; margin-top: 16px; }
.tile-cap .t { font-family:'Just Another Hand',cursive; font-size: 38px; color: var(--cream); letter-spacing: 1px; }
.tile-cap .c { font-family:'Cinzel',serif; font-size: 10px; letter-spacing: 3px; color: var(--gold); text-transform: uppercase; margin-top: 2px; }

/* ===== ABOUT ===== */
.about { padding: 110px 0 70px; }
.about-grid { display: grid; grid-template-columns: 380px 1fr; gap: 60px; align-items: center; }
.portrait-wrap { perspective: 1200px; position: relative; }
.portrait {
  width: 100%; aspect-ratio: 4/5; border-radius: 14px; overflow: hidden;
  transform-style: preserve-3d; transition: transform .6s cubic-bezier(.16,1,.3,1); will-change: transform;
  border: 1px solid var(--line); box-shadow: 0 0 40px rgba(91,76,240,0.12);
}
.portrait svg, .portrait img { width: 100%; height: 100%; display: block; object-fit: cover; }
.about-body .eyebrow { display: block; margin-bottom: 6px; }
.about-title { font-family:'Caveat Brush',cursive; font-size: clamp(48px,6vw,84px); color: var(--blue-bright); filter: url(#paint-static); text-shadow: 2px 2px 0 var(--orange), 0 0 34px rgba(91,76,240,0.5); transform: rotate(-1deg); margin-bottom: 22px; line-height:.9; }
.about-body p { font-size: 15px; line-height: 1.9; color: var(--text); font-weight: 300; margin-bottom: 16px; max-width: 560px; }
.about-body p .hl { color: var(--orange-bright); }

/* ===== SKILLS ===== */
.skills { padding: 70px 0 80px; }
.skill-cloud { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 920px; margin: 0 auto; }
.chip {
  font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: 2px;
  padding: 14px 26px; border: 1px solid var(--line); border-radius: 100px;
  color: var(--text); background: rgba(91,76,240,0.06); cursor: pointer;
  transition: transform .4s cubic-bezier(.16,1,.3,1), background .4s, color .4s, border-color .4s;
}
.chip:hover { transform: translateY(-5px); background: var(--blue); color: var(--cream); border-color: var(--blue); }
.chip.gold:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.chip.orange:hover { background: var(--orange); color: var(--ink); border-color: var(--orange); }

/* ===== CTA ===== */
.cta { padding: 90px 0 130px; text-align: center; }
.cta-title { font-size: clamp(60px, 11vw, 150px); transform: rotate(-1.5deg); }
.cta-sub { font-family:'Just Another Hand',cursive; font-size: clamp(24px,3vw,32px); color: var(--muted); letter-spacing: 2px; margin: 26px auto 40px; max-width: 600px; }
.cta-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--gold-bright); text-decoration: none; padding: 17px 34px;
  border: 1px solid var(--line); border-radius: 100px; cursor: pointer;
  transition: background .4s, color .4s, border-color .4s; display: inline-block;
}
.btn:hover { background: var(--blue); border-color: var(--blue); color: var(--cream); }
.btn.solid { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn.solid:hover { background: var(--orange-bright); border-color: var(--orange-bright); }

footer {
  text-align: center; padding: 30px 24px 50px; font-family: 'Cinzel', serif;
  font-size: 10px; letter-spacing: 4px; color: var(--muted); opacity: .5; text-transform: uppercase;
}

/* reveals */
.reveal { opacity: 0; transform: translateY(44px); transition: opacity 1s cubic-bezier(.16,1,.3,1), transform 1s cubic-bezier(.16,1,.3,1); }
.reveal.show { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: .12s; } .d2 { transition-delay: .24s; } .d3 { transition-delay: .36s; }

/* responsive */
@media (max-width: 980px) {
  .feature { grid-template-columns: 1fr; }
  .feature-img { min-height: 340px; }
  .work-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .portrait-wrap { max-width: 340px; margin: 0 auto; }
  nav { gap: 16px; padding: 10px 18px; }
  nav a { font-size: 10px; letter-spacing: 2px; }
}
@media (max-width: 560px) {
  body { cursor: auto; }
  .cur-dot, .cur-glow { display: none; }
  .wrap { padding: 0 18px; }
  .hero-name { letter-spacing: 8px; }
  .work-grid { grid-template-columns: 1fr; gap: 32px; }
  .feature-body { padding: 36px 26px; }
  nav { gap: 11px; padding: 8px 14px; }
  nav a { font-size: 9px; letter-spacing: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .grain { animation: none; }
}

/* ===== WORK INNER PAGE STYLES ===== */
.work-nav-container {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}
.back-btn {
  position: fixed;
  top: 26px;
  left: 32px;
  z-index: 105;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(8, 11, 32, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--text);
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(91,76,240,0.1);
}
.back-btn:hover {
  color: var(--gold-bright);
  border-color: var(--line-bright);
  box-shadow: 0 0 40px rgba(91,76,240,0.25);
  transform: translateY(-2px);
}
.back-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform 0.3s;
}
.back-btn:hover svg {
  transform: translateX(-4px);
}

/* Category Nav Pill Bar */
.category-bar-wrap {
  width: 100%;
  max-width: 900px;
  margin: 32px auto 48px;
  overflow-x: auto;
  padding: 8px 16px;
  -scrollbar-width: none; /* Firefox */
}
.category-bar-wrap::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.category-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  min-width: max-content;
  margin: 0 auto;
}
.cat-pill {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--muted);
  background: rgba(8, 11, 32, 0.4);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cat-pill:hover {
  color: var(--text);
  border-color: var(--line-bright);
}
.cat-pill.active {
  color: var(--cream);
  background: var(--blue-deep);
  border-color: var(--blue-bright);
  box-shadow: 0 0 20px rgba(91, 76, 240, 0.4), inset 0 0 10px rgba(109, 98, 255, 0.2);
}

/* Subcategory Tabs */
.tabs-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.tab-btn {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tab-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}
.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-bright), #a03cff);
  border-color: transparent;
  box-shadow: 0 0 35px rgba(160, 60, 255, 0.5), 0 0 15px rgba(109, 98, 255, 0.3);
}

/* Masonry Gallery Grid */
.gallery-grid {
  column-count: 3;
  column-gap: 24px;
  width: 100%;
  margin-bottom: 80px;
  transition: opacity 0.4s ease;
}
.gallery-grid.fade-out {
  opacity: 0;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 24px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 11, 32, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s, box-shadow 0.5s;
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 15px;
}
.gallery-item:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: var(--line-bright);
  box-shadow: 0 20px 50px rgba(91, 76, 240, 0.22);
}
.gallery-item:hover img {
  transform: scale(1.04);
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(3, 4, 14, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-content {
  position: relative;
  max-width: 85%;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.92);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.active .lightbox-content {
  transform: scale(1);
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 50px rgba(91, 76, 240, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  color: var(--muted);
  font-size: 36px;
  text-decoration: none;
  font-weight: 300;
  transition: color 0.3s, transform 0.3s;
  cursor: pointer;
}
.lightbox-close:hover {
  color: var(--gold-bright);
  transform: rotate(90deg);
}
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-arrow:hover {
  color: var(--cream);
  background: rgba(91, 76, 240, 0.3);
  border-color: var(--blue-bright);
  box-shadow: 0 0 25px rgba(91, 76, 240, 0.4);
}
.lightbox-arrow.prev {
  left: -80px;
}
.lightbox-arrow.next {
  right: -80px;
}
.lightbox-arrow svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.lightbox-caption {
  position: absolute;
  bottom: -45px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
}

/* responsive adjustments for work page */
@media (max-width: 980px) {
  .gallery-grid {
    column-count: 2;
  }
  .lightbox-arrow.prev { left: -60px; }
  .lightbox-arrow.next { right: -60px; }
}
@media (max-width: 768px) {
  .back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
  }
  .category-bar-wrap {
    margin-top: 80px;
  }
}
@media (max-width: 560px) {
  .gallery-grid {
    column-count: 1;
  }
  .lightbox-arrow {
    display: none;
  }
  .lightbox-content {
    max-width: 95%;
  }
  .lightbox-close {
    top: -40px;
    right: 10px;
  }
}
