:root {
  --bg: #040817;
  --panel: #071125;
  --panel-2: #0a1730;
  --text: #f4f7ff;
  --muted: #9babca;
  --line: rgba(119, 163, 255, .16);
  --cyan: #00d8ff;
  --blue: #188cff;
  --purple: #7c3cff;
  --pink: #b13dff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 190, 255, .28), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(124, 60, 255, .34), transparent 26%),
    linear-gradient(135deg, #052b67 0%, #07142f 26%, #061024 62%, #2b0d62 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 42px auto;
  border: 1px solid rgba(115, 146, 240, .18);
  border-radius: 26px;
  background: rgba(3, 8, 24, .94);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.03);
  overflow: hidden;
  backdrop-filter: blur(18px);
  position: relative;
  isolation: isolate;
}

.page-shell > header,
.page-shell > main,
.page-shell > footer {
  position: relative;
  z-index: 4;
}

.background-icon-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.bg-icon {
  position: absolute;
  display: block;
  opacity: .76;
  mix-blend-mode: normal;
  filter: saturate(1.08) drop-shadow(0 14px 34px rgba(0, 0, 0, .30));
  animation: floatBgIcon 10s ease-in-out infinite;
}

.bg-icon img {
  display: block;
  width: 100%;
  height: auto;
}

.bg-icon-1 { width: 165px; left: -42px; top: 250px; transform: rotate(-18deg); animation-delay: 0s; }
.bg-icon-2 { width: 185px; right: -44px; top: 390px; transform: rotate(10deg); animation-delay: -2.4s; }
.bg-icon-3 { width: 170px; right: -38px; top: 980px; transform: rotate(15deg); animation-delay: -4.4s; }
.bg-icon-4 { width: 175px; left: -46px; top: 1510px; transform: rotate(-15deg); animation-delay: -1.6s; }
.bg-icon-5 { width: 190px; right: -52px; bottom: 150px; transform: rotate(13deg); animation-delay: -5.2s; }

@keyframes floatBgIcon {
  0%, 100% { transform: translateY(0) rotate(var(--bg-rot, 0deg)); }
  50% { transform: translateY(-14px) rotate(calc(var(--bg-rot, 0deg) + 1.5deg)); }
}

.bg-icon-1 { --bg-rot: -14deg; }
.bg-icon-2 { --bg-rot: 8deg; }
.bg-icon-3 { --bg-rot: 12deg; }
.bg-icon-4 { --bg-rot: -12deg; }
.bg-icon-5 { --bg-rot: 10deg; }

.site-header {
  min-height: 84px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 38px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(4, 8, 23, .86);
  border-bottom: 1px solid rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; white-space: nowrap; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 13px 13px 17px 9px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  transform: rotate(-8deg);
  box-shadow: 0 0 28px rgba(0, 216, 255, .22);
}
.brand-mark::first-letter { transform: rotate(8deg); }
.brand-name { font-size: .98rem; letter-spacing: .1px; }
.main-nav { display: flex; justify-content: center; gap: 30px; }
.main-nav a { color: #d8e0f4; font-size: .9rem; position: relative; padding: 31px 0 26px; }
.main-nav a::after { content:""; position:absolute; left:0; right:0; bottom:21px; margin:auto; width:0; height:2px; border-radius:99px; background:var(--cyan); transition:.25s; }
.main-nav a:hover, .main-nav a.active { color: var(--cyan); }
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 14px 22px; font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(90deg, var(--cyan), var(--blue) 50%, var(--purple)); box-shadow: 0 10px 35px rgba(45, 92, 255, .28); }
.btn-outline { border: 1px solid rgba(81, 135, 255, .55); background: linear-gradient(90deg, rgba(0,216,255,.16), rgba(124,60,255,.2)); }
.btn-small { padding: 11px 18px; font-size: .82rem; }
.text-link { color: #c6d4ef; border-bottom: 1px solid rgba(198,212,239,.5); padding-bottom: 3px; }

.menu-toggle { display:none; background:none; border:0; padding:8px; }
.menu-toggle span { display:block; width:24px; height:2px; margin:5px 0; background:white; }

.section-pad { padding: 76px 44px; }
.section-line { border-top: 1px solid var(--line); }
.eyebrow { color: var(--cyan); font-size: .74rem; font-weight: 800; letter-spacing: 3px; margin: 0 0 12px; }
h1,h2,h3,h4,p { margin-top: 0; }
h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: .98; margin-bottom: 14px; letter-spacing: -2.6px; }
h1 span, h3 span { background: linear-gradient(90deg, var(--cyan), #2eb0ff 45%, var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: clamp(1.2rem, 2vw, 1.55rem); color: #f6f8ff; margin-bottom: 18px; }
h3 { font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.05; letter-spacing: -1.6px; margin-bottom: 16px; }
p { color: var(--muted); line-height: 1.75; }

.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; min-height: 610px; }
.lead { max-width: 650px; font-size: 1rem; }
.hero-actions { display:flex; align-items:center; gap:22px; margin-top: 28px; flex-wrap:wrap; }

.social-row { display:flex; gap:12px; margin-top:30px; }
.social-row a { width:38px; height:38px; display:grid; place-items:center; border:1px solid rgba(0,216,255,.48); border-radius:50%; font-size:.75rem; font-weight:800; color:#dffaff; background: rgba(0,216,255,.05); }
.album-tag-row { display:flex; align-items:center; gap:12px; margin-top:18px; flex-wrap:wrap; }
.album-tag-row .float-chip { position:relative; inset:auto; z-index:1; }

.hero-visual { min-height: 430px; display:grid; place-items:center; position:relative; isolation:isolate; }
.avatar-orbit { width:min(370px, 78vw); aspect-ratio:1; border-radius:50%; padding:8px; background: linear-gradient(145deg, var(--cyan), var(--purple), #e848ff); box-shadow:0 0 55px rgba(68,65,255,.55); position:relative; z-index:2; }
.avatar-orbit::before { content:""; position:absolute; inset:-32px; border-radius:50%; border:2px solid rgba(113, 70, 255, .7); border-left-color: transparent; border-bottom-color: rgba(0,216,255,.72); transform:rotate(-12deg); }
.dummy-avatar { width:100%; height:100%; border-radius:50%; overflow:hidden; display:flex; align-items:center; justify-content:flex-end; flex-direction:column; position:relative; background: radial-gradient(circle at 50% 34%, #27498d 0 19%, transparent 20%), radial-gradient(circle at 50% 60%, #13284f 0 34%, transparent 35%), linear-gradient(145deg, #0b1431, #071229 58%, #171744); border:5px solid #071020; }
.dummy-avatar span { position:absolute; inset:auto 0 26px; text-align:center; font-size:.68rem; font-weight:900; letter-spacing:2px; color:rgba(224,238,255,.6); }
.avatar-head { position:absolute; width:31%; height:31%; border-radius:48% 48% 44% 44%; top:22%; background:linear-gradient(180deg,#87a5ff,#334881); box-shadow:0 -16px 0 -4px #151e3b; }
.avatar-body { position:absolute; width:58%; height:42%; border-radius:48% 48% 16% 16%; bottom:10%; background:linear-gradient(180deg,#1b2f64,#0d1732); }
.halo { position:absolute; border-radius:50%; filter:blur(50px); opacity:.72; z-index:0; }
.halo-a { width:190px; height:190px; background:#00baff; left:6%; top:34%; }
.halo-b { width:210px; height:210px; background:#8b28ff; right:3%; top:19%; }
.float-chip { position:absolute; z-index:4; padding:9px 13px; border-radius:12px; background:rgba(5,13,33,.84); border:1px solid rgba(122,91,255,.45); color:#dbe8ff; font-size:.72rem; font-weight:800; letter-spacing:1px; box-shadow:0 8px 30px rgba(0,0,0,.35); }


.about { display:grid; grid-template-columns:.88fr 1.12fr; gap:70px; align-items:center; }
.about-visual { min-height: 420px; position:relative; display:grid; place-items:center; }
.blob { position:absolute; width:78%; height:78%; border-radius:35% 65% 56% 44% / 54% 38% 62% 46%; background:linear-gradient(150deg,#1c5eff,#7d2cff 65%,#ae38ff); box-shadow:0 0 55px rgba(82,50,255,.35); transform:rotate(8deg); }
.secondary { width:75%; aspect-ratio:1; border:none; background:linear-gradient(150deg,#081936,#0a1230); z-index:2; box-shadow:0 20px 60px rgba(0,0,0,.35); }
.about-photo-frame { width:75%; aspect-ratio:1; padding:8px; border-radius:50%; background: linear-gradient(145deg, rgba(45, 168, 255, .95), rgba(132, 71, 255, .9)); box-shadow: 0 0 48px rgba(82,50,255,.28), inset 0 1px 0 rgba(255,255,255,.28); z-index:2; }
.about-photo-stage { height:100%; border-radius:50%; display:flex; align-items:flex-end; justify-content:center; overflow:hidden; }
.about-copy > p:not(.eyebrow) { max-width: 660px; }
.stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:28px 0; }
.stat-card { padding:18px; border:1px solid rgba(84,132,255,.2); border-radius:14px; background:linear-gradient(145deg,rgba(16,31,67,.8),rgba(8,15,38,.8)); }
.stat-card strong { display:block; color:#eaf6ff; font-size:1.2rem; margin-bottom:5px; }
.stat-card span { color:var(--muted); font-size:.77rem; }

.section-heading { margin-bottom:34px; }
.section-heading > p:last-child { max-width:660px; margin-bottom:0; }
.skill-groups { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; align-items:start; }
.skill-panel { border:1px solid rgba(80,126,255,.22); border-radius:18px; padding:24px; background:linear-gradient(160deg,rgba(10,25,57,.95),rgba(5,11,28,.95)); box-shadow:inset 0 1px rgba(255,255,255,.025); }
.panel-title { display:flex; align-items:center; gap:14px; padding-bottom:19px; margin-bottom:18px; border-bottom:1px solid rgba(129,154,255,.12); }
.panel-icon { min-width:43px; height:43px; display:grid; place-items:center; border-radius:12px; font-size:.72rem; font-weight:900; background:linear-gradient(145deg,rgba(0,216,255,.22),rgba(124,60,255,.36)); color:#f4f7ff; border:1px solid rgba(68,165,255,.35); }
.panel-title h4 { margin:0 0 4px; font-size:1.05rem; }
.panel-title p { margin:0; font-size:.75rem; line-height:1.4; }
.skill-item + .skill-item { margin-top:17px; }
.skill-meta { display:flex; justify-content:space-between; gap:10px; font-size:.83rem; margin-bottom:8px; color:#dce7ff; }
.skill-meta strong { color:#f4f8ff; }
.bar { height:8px; border-radius:99px; background:#0d1b38; overflow:hidden; box-shadow:inset 0 1px 3px rgba(0,0,0,.45); }
.bar i { display:block; width:var(--level); height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--cyan),#168cff 48%,var(--purple)); box-shadow:0 0 14px rgba(33,122,255,.5); }

.portfolio-head { display:flex; justify-content:space-between; gap:28px; align-items:end; }
.filter-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.filter-btn { border:1px solid rgba(91,126,225,.24); color:#bfcae1; background:#08142b; padding:9px 14px; border-radius:999px; cursor:pointer; font-size:.78rem; }
.filter-btn:hover, .filter-btn.active { color:white; border-color:rgba(0,216,255,.55); background:linear-gradient(90deg,rgba(0,216,255,.18),rgba(124,60,255,.24)); }
.portfolio-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.work-card { overflow:hidden; border-radius:18px; border:1px solid rgba(79,118,238,.22); background:#071226; transition:.25s ease; }
.work-card:hover { transform:translateY(-5px); border-color:rgba(0,216,255,.38); box-shadow:0 20px 40px rgba(0,0,0,.25); }
.work-card.is-hidden { display:none; }
.work-thumb { aspect-ratio:1.45/1; display:grid; place-items:center; position:relative; overflow:hidden; isolation:isolate; }
.work-thumb::before, .work-thumb::after { content:""; position:absolute; border-radius:36px; filter:blur(2px); z-index:-1; }
.work-thumb::before { width:58%; height:76%; transform:rotate(25deg); background:rgba(255,255,255,.13); }
.work-thumb::after { width:80%; height:22%; transform:rotate(-13deg); border:1px solid rgba(255,255,255,.22); }
.work-thumb span { font-size:.72rem; font-weight:900; letter-spacing:3px; padding:10px 14px; border-radius:99px; background:rgba(1,7,22,.65); border:1px solid rgba(255,255,255,.15); }
.thumb-a{background:linear-gradient(135deg,#112a68,#105ccc 45%,#7c2ddc)}
.thumb-b{background:linear-gradient(135deg,#0e3f55,#0a7f95 40%,#2942a8)}
.thumb-c{background:linear-gradient(135deg,#522160,#af257d 42%,#44209f)}
.thumb-d{background:linear-gradient(135deg,#31216b,#5a24d8 46%,#048dca)}
.thumb-e{background:linear-gradient(135deg,#16274d,#194a82 50%,#6538b9)}
.thumb-f{background:linear-gradient(135deg,#421546,#7f1c78 43%,#175bad)}
.work-meta { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:18px; }
.work-meta small { display:block; color:#7ea7e8; margin-bottom:5px; }
.work-meta h4 { margin:0; font-size:.98rem; }
.work-meta button { width:38px; height:38px; border-radius:50%; border:1px solid rgba(59,135,255,.32); background:rgba(19,51,105,.4); color:white; cursor:pointer; }

.contact-card { display:grid; grid-template-columns:1.1fr .9fr; gap:40px; padding:34px; border-radius:22px; border:1px solid rgba(87,120,236,.24); background:radial-gradient(circle at 0 20%,rgba(0,216,255,.08),transparent 45%), radial-gradient(circle at 100% 80%,rgba(124,60,255,.14),transparent 44%), #071125; }
.contact-links { display:grid; gap:10px; }
.contact-links a { display:flex; justify-content:space-between; gap:20px; padding:16px 18px; border-radius:13px; border:1px solid rgba(81,123,224,.18); background:rgba(5,12,31,.7); }
.contact-links span { color:var(--muted); }
.contact-links strong { font-size:.88rem; }
.site-footer { min-height:80px; padding:0 44px; display:flex; justify-content:space-between; align-items:center; gap:20px; border-top:1px solid var(--line); color:#7687aa; font-size:.8rem; }

.reveal { opacity:0; transform:translateY(24px); transition:opacity .7s ease, transform .7s ease; }
.reveal.show { opacity:1; transform:none; }
.delay-1 { transition-delay:.08s; }
.delay-2 { transition-delay:.16s; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; padding: 0 24px; }
  .site-header > .btn { display:none; }
  .menu-toggle { display:block; grid-column:2; }
  .main-nav { position:absolute; top:72px; left:20px; right:20px; display:none; flex-direction:column; gap:0; padding:10px; background:#071126; border:1px solid rgba(102,135,235,.25); border-radius:15px; box-shadow:var(--shadow); }
  .main-nav.open { display:flex; }
  .main-nav a { padding:13px 14px; border-radius:10px; }
  .main-nav a::after { bottom: 5px; left: 14px; right: 14px; }
  .hero, .about, .contact-card { grid-template-columns:1fr; }
  .hero { min-height:auto; }
  .hero-visual { order:-1; min-height:400px; }
  .about-visual { max-width:560px; width:100%; margin:auto; }
  .skill-groups { grid-template-columns:1fr; }
  .portfolio-grid { grid-template-columns:repeat(2,1fr); }
  .portfolio-head { align-items:flex-start; flex-direction:column; }
  .filter-row { justify-content:flex-start; }
}

@media (max-width: 680px) {
  .page-shell { width: calc(100% - 18px); margin:10px auto; border-radius:18px; }
  .section-pad { padding:58px 22px; }
  .site-header { min-height:70px; padding:0 18px; }
  .brand-name { display:block; }
  .main-nav { top:62px; }
  h1 { letter-spacing:-1.7px; }
  .hero-visual { min-height:320px; }
  .avatar-orbit { width:min(290px, 80vw); }
  .stats-grid { grid-template-columns:1fr; }
  .portfolio-grid { grid-template-columns:1fr; }
  .contact-card { padding:24px; }
  .contact-links a { flex-direction:column; gap:4px; }
  .site-footer { padding:22px; flex-direction:column; align-items:flex-start; min-height:auto; }
}

/* =========================================================
   LIQUID GLASS UI — inspired by the provided reference
   ========================================================= */
:root {
  --liquid-bg: rgba(9, 29, 58, .42);
  --liquid-bg-strong: rgba(14, 43, 78, .56);
  --liquid-border: rgba(155, 225, 255, .34);
  --liquid-border-soft: rgba(174, 224, 255, .18);
  --liquid-highlight: rgba(255, 255, 255, .34);
  --liquid-shadow: 0 18px 45px rgba(0, 10, 32, .34),
                   inset 0 1px 0 rgba(255,255,255,.26),
                   inset 0 -1px 0 rgba(73,173,255,.10);
}

/* shared liquid surface */
.stat-card,
.skill-panel,
.work-card,
.contact-card,
.contact-links a,
.float-chip,
.filter-btn,
.social-row a,
.work-meta button,
.main-nav,
.panel-icon {
  background:
    linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.025) 40%, rgba(31,124,255,.06)),
    var(--liquid-bg);
  border: 1px solid var(--liquid-border-soft);
  box-shadow: var(--liquid-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}

.stat-card,
.skill-panel,
.work-card,
.contact-card,
.contact-links a,
.float-chip,
.panel-icon {
  position: relative;
  overflow: hidden;
}

/* glossy top reflection */
.stat-card::before,
.skill-panel::before,
.work-card::before,
.contact-card::before,
.contact-links a::before,
.float-chip::before,
.panel-icon::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  opacity: .72;
  pointer-events: none;
}

/* soft refracted glow */
.stat-card::after,
.skill-panel::after,
.contact-card::after,
.float-chip::after {
  content: "";
  position: absolute;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  right: -45px;
  top: -58px;
  background: radial-gradient(circle, rgba(104,215,255,.22), rgba(99,89,255,.08) 45%, transparent 72%);
  filter: blur(2px);
  pointer-events: none;
}

.stat-card { border-radius: 20px; }
.skill-panel { border-radius: 24px; }
.work-card { border-radius: 24px; }
.contact-card { border-radius: 28px; }
.contact-links a { border-radius: 18px; }
.float-chip { border-radius: 18px; }
.panel-icon { border-radius: 15px; }

/* liquid buttons */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(185, 232, 255, .38);
  background:
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.03) 46%),
    linear-gradient(100deg, rgba(0,216,255,.55), rgba(24,140,255,.48) 50%, rgba(124,60,255,.52));
  box-shadow:
    0 14px 34px rgba(0, 117, 255, .28),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -4px 12px rgba(0,61,141,.22),
    0 0 0 1px rgba(255,255,255,.05);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  backdrop-filter: blur(18px) saturate(155%);
}

.btn::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 4px;
  height: 42%;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,0));
  filter: blur(.2px);
  pointer-events: none;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: inherit;
  background: radial-gradient(circle at 24% 18%, rgba(255,255,255,.30), transparent 24%);
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow:
    0 18px 40px rgba(0, 146, 255, .34),
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -5px 14px rgba(24,67,188,.22);
}

.btn:active {
  transform: translateY(0) scale(.99);
  box-shadow:
    0 8px 20px rgba(0, 117, 255, .22),
    inset 0 3px 10px rgba(0,24,82,.28),
    inset 0 1px 0 rgba(255,255,255,.3);
}

.btn-outline {
  background:
    linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.025)),
    linear-gradient(90deg, rgba(0,216,255,.13), rgba(124,60,255,.18));
  border-color: rgba(168, 222, 255, .32);
}

/* liquid pills / icon buttons */
.filter-btn,
.social-row a,
.work-meta button {
  box-shadow:
    0 10px 26px rgba(0,12,40,.28),
    inset 0 1px 0 rgba(255,255,255,.30),
    inset 0 -1px 0 rgba(53,154,255,.08);
}

.filter-btn:hover,
.filter-btn.active,
.social-row a:hover,
.work-meta button:hover {
  border-color: rgba(150,225,255,.55);
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.03)),
    linear-gradient(100deg, rgba(0,216,255,.19), rgba(124,60,255,.24));
  box-shadow:
    0 14px 30px rgba(0,119,255,.26),
    inset 0 1px 0 rgba(255,255,255,.42);
}

/* make portfolio thumbnails feel like liquid glass windows */
.work-thumb {
  border-bottom: 1px solid rgba(183,228,255,.13);
}

/* slightly more translucent panels for the liquid effect */
.skill-panel,
.stat-card,
.work-card,
.contact-card {
  background:
    linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.018) 43%, rgba(0,151,255,.055)),
    rgba(4, 19, 43, .58);
}

@media (max-width: 680px) {
  .skill-panel,
  .stat-card,
  .work-card,
  .contact-card,
  .contact-links a {
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
  }
}

/* =========================================================
   FIXED / STICKY LIQUID NAVBAR
   Keeps the navigation visible while scrolling and gives the
   whole header a stronger liquid-glass / refractive appearance.
   ========================================================= */

/* overflow: clip keeps the rounded shell clipping without creating
   a scroll container that would prevent position: sticky from working. */
.page-shell {
  overflow: clip;
}

.site-header {
  position: sticky;
  top: 14px;
  z-index: 1000;
  min-height: 78px;
  margin: 14px 16px 0;
  padding: 0 26px;
  border: 1px solid rgba(184, 231, 255, .26);
  border-radius: 24px;
  background:
    radial-gradient(circle at 13% -35%, rgba(135, 229, 255, .28), transparent 42%),
    radial-gradient(circle at 90% 145%, rgba(119, 73, 255, .25), transparent 44%),
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.025) 42%, rgba(36,100,255,.08)),
    rgba(6, 18, 42, .58);
  box-shadow:
    0 18px 48px rgba(0, 8, 30, .42),
    0 7px 22px rgba(16, 121, 255, .11),
    inset 0 1px 0 rgba(255,255,255,.46),
    inset 0 -1px 0 rgba(89,184,255,.15),
    inset 12px 0 28px rgba(0,215,255,.035),
    inset -12px 0 28px rgba(128,70,255,.045);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
}

/* bright liquid reflection along the top edge */
.site-header::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 2px;
  height: 42%;
  border-radius: 22px 22px 50% 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0));
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
  pointer-events: none;
}

/* thin refracted highlight */
.site-header::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), rgba(128,225,255,.72), transparent);
  opacity: .8;
  pointer-events: none;
}

.site-header > * {
  position: relative;
  z-index: 2;
}

/* Inner navigation capsule */
.main-nav {
  width: fit-content;
  justify-self: center;
  padding: 0 24px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.018)),
    rgba(10, 30, 64, .38);
  border: 1px solid rgba(179, 225, 255, .18);
  box-shadow:
    0 10px 26px rgba(0, 6, 27, .24),
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(81,161,255,.08);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
}

.main-nav a {
  padding-top: 22px;
  padding-bottom: 21px;
}

.main-nav a::after {
  bottom: 13px;
  height: 3px;
  box-shadow: 0 0 12px rgba(0,216,255,.62);
}

/* Make the brand mark feel embedded in the same glass material */
.brand-mark {
  border: 1px solid rgba(211, 242, 255, .28);
  box-shadow:
    0 9px 26px rgba(29, 113, 255, .30),
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -4px 12px rgba(37,46,175,.2);
}

/* Prevent anchor targets from hiding behind the sticky header */
main section[id] {
  scroll-margin-top: 112px;
}

@media (max-width: 900px) {
  .site-header {
    top: 8px;
    margin: 8px 10px 0;
    min-height: 72px;
    padding: 0 20px;
    border-radius: 21px;
  }

  .main-nav {
    width: auto;
    justify-self: stretch;
    top: 78px;
    left: 0;
    right: 0;
    padding: 10px;
    border-radius: 20px;
    background:
      linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.025)),
      rgba(5, 17, 40, .90);
    box-shadow:
      0 20px 44px rgba(0, 4, 20, .48),
      inset 0 1px 0 rgba(255,255,255,.22);
  }

  .main-nav a {
    padding: 13px 14px;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 66px;
    margin: 7px 7px 0;
    padding: 0 15px;
    border-radius: 18px;
  }

  .main-nav {
    top: 72px;
  }
}

/* =========================================================
   MOBILE NAV BUG FIX
   Keeps the liquid header compact and lets the menu float
   below it without stretching the sticky header.
   ========================================================= */
@media (max-width: 980px) {
  .site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 72px;
    min-height: 72px;
    max-height: 72px;
    padding: 0 18px;
    overflow: visible;
    isolation: isolate;
  }

  .site-header::before,
  .site-header::after {
    z-index: 0;
  }

  .brand {
    flex: 0 1 auto;
    min-width: 0;
  }

  .menu-toggle {
    display: flex;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    margin-left: auto;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px solid rgba(211, 242, 255, .38);
    border-radius: 15px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.17), rgba(255,255,255,.035)),
      rgba(11, 31, 68, .58);
    box-shadow:
      0 10px 25px rgba(0, 7, 30, .32),
      inset 0 1px 0 rgba(255,255,255,.5),
      inset 0 -1px 0 rgba(89,184,255,.16);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    cursor: pointer;
  }

  .menu-toggle span {
    width: 24px;
    height: 2px;
    margin: 3px 0;
    border-radius: 999px;
    background: #fff;
    transition: transform .22s ease, opacity .22s ease;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .site-header > .btn {
    display: none;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - 105px);
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    border-radius: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(.985);
    transform-origin: top center;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    background:
      radial-gradient(circle at 15% 0%, rgba(83,211,255,.16), transparent 35%),
      radial-gradient(circle at 92% 100%, rgba(121,76,255,.20), transparent 40%),
      linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.035)),
      rgba(5, 17, 40, .92);
    border: 1px solid rgba(183, 230, 255, .28);
    box-shadow:
      0 24px 50px rgba(0, 4, 20, .52),
      inset 0 1px 0 rgba(255,255,255,.28),
      inset 0 -1px 0 rgba(92,171,255,.10);
    -webkit-backdrop-filter: blur(28px) saturate(175%);
    backdrop-filter: blur(28px) saturate(175%);
    z-index: 1001;
  }

  .main-nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .main-nav a {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border-radius: 13px;
  }

  .main-nav a:hover,
  .main-nav a.active {
    background: rgba(61, 155, 255, .10);
  }

  .main-nav a::after {
    display: block; bottom: 5px; left: 14px; right: 14px;
  }
}

@media (max-width: 680px) {
  .site-header {
    top: 7px;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    margin: 7px 7px 0;
    padding: 0 12px;
    border-radius: 18px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-name {
    display: block;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 13px;
  }

  .main-nav {
    top: calc(100% + 8px);
    border-radius: 18px;
    padding: 8px;
  }

  .main-nav a {
    padding: 13px 14px;
    font-size: 1rem;
  }

  main section[id] {
    scroll-margin-top: 90px;
  }
}

/* =========================================================
   PORTFOLIO ALBUM BROWSER + ORIGINAL-RATIO LIQUID PREVIEW
   ========================================================= */
.album-heading {
  align-items: end;
}

.album-hint {
  flex: 0 0 auto;
  padding: 11px 15px;
  border-radius: 999px;
  color: #cfe6ff;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .25px;
  border: 1px solid rgba(181, 230, 255, .20);
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.025)),
    rgba(8, 27, 60, .44);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    0 12px 30px rgba(0, 7, 30, .24);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
  backdrop-filter: blur(20px) saturate(155%);
}

.album-shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 34px 0 30px;
}

.album-card {
  position: relative;
  min-width: 0;
  height: 190px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  isolation: isolate;
  transition: transform .3s ease, filter .3s ease;
}

.album-card:hover,
.album-card.active {
  transform: translateY(-7px);
  filter: drop-shadow(0 18px 32px rgba(0, 113, 255, .16));
}

.album-stack,
.album-cover {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 1px solid rgba(183, 230, 255, .18);
}

.album-stack {
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.02)),
    rgba(9, 28, 59, .50);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  transition: transform .28s ease, opacity .28s ease;
}

.album-stack.stack-3 {
  transform: translate(11px, -11px) rotate(2deg) scale(.965);
  opacity: .46;
  z-index: 0;
}

.album-stack.stack-2 {
  transform: translate(6px, -6px) rotate(1deg) scale(.982);
  opacity: .72;
  z-index: 1;
}

.album-card:hover .stack-3,
.album-card.active .stack-3 { transform: translate(15px, -15px) rotate(3deg) scale(.965); }
.album-card:hover .stack-2,
.album-card.active .stack-2 { transform: translate(8px, -8px) rotate(1.6deg) scale(.982); }

.album-cover {
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 15px;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 0%, rgba(115,226,255,.22), transparent 36%),
    radial-gradient(circle at 100% 100%, rgba(119,72,255,.24), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.025) 46%, rgba(45,111,255,.07)),
    rgba(5, 19, 45, .63);
  box-shadow:
    0 20px 46px rgba(0, 6, 28, .34),
    inset 0 1px 0 rgba(255,255,255,.45),
    inset 0 -1px 0 rgba(88,182,255,.13);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
}

.album-cover::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 45% 55% 62% 38%;
  top: -85px;
  right: -55px;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.30), rgba(0,216,255,.13) 35%, rgba(124,60,255,.10) 62%, transparent 72%);
  filter: blur(.4px);
  transform: rotate(24deg);
  pointer-events: none;
}

.album-cover::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.78), rgba(110,226,255,.58), transparent);
  opacity: .8;
  pointer-events: none;
}

.album-cover-2d { --album-accent: #00d8ff; }
.album-cover-3d { --album-accent: #5c8cff; }
.album-cover-video { --album-accent: #c649ff; }

.album-orb {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  align-self: end;
  border-radius: 20px;
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .6px;
  color: #fff;
  border: 1px solid rgba(218,245,255,.34);
  background:
    linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.03)),
    color-mix(in srgb, var(--album-accent) 35%, rgba(24,36,88,.58));
  box-shadow:
    0 12px 28px color-mix(in srgb, var(--album-accent) 24%, transparent),
    inset 0 1px 0 rgba(255,255,255,.48);
}

.album-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.album-copy strong {
  font-size: 1.1rem;
  letter-spacing: -.25px;
}

.album-copy small {
  color: #9eb2d6;
  font-size: .78rem;
}

.album-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  align-self: end;
  border-radius: 50%;
  border: 1px solid rgba(190,231,255,.25);
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .25s ease, background .25s ease;
}

.album-card:hover .album-arrow,
.album-card.active .album-arrow {
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--album-accent, #00d8ff) 18%, rgba(255,255,255,.05));
}

.album-card.active .album-cover {
  border-color: rgba(153,226,255,.42);
  box-shadow:
    0 24px 54px rgba(0, 83, 255, .20),
    0 0 0 1px color-mix(in srgb, var(--album-accent, #00d8ff) 25%, transparent),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 0 rgba(88,182,255,.16);
}

.album-browser {
  padding: 24px;
  border: 1px solid rgba(175, 225, 255, .18);
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% -20%, rgba(80,212,255,.11), transparent 34%),
    radial-gradient(circle at 98% 120%, rgba(123,74,255,.14), transparent 36%),
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.018)),
    rgba(3, 15, 36, .62);
  box-shadow:
    0 22px 55px rgba(0, 5, 25, .34),
    inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 -1px 0 rgba(66,166,255,.08);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  backdrop-filter: blur(24px) saturate(155%);
}

.album-browser-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.browser-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--cyan);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: 2.4px;
}

.album-browser-head h4 {
  margin: 0;
  font-size: 1.42rem;
}

.browser-count {
  padding: 9px 12px;
  border-radius: 999px;
  color: #bfd1ee;
  font-size: .75rem;
  border: 1px solid rgba(172,222,255,.17);
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.portfolio-item {
  position: relative;
  min-width: 0;
  padding: 9px 9px 13px;
  overflow: hidden;
  border: 1px solid rgba(177, 226, 255, .17);
  border-radius: 23px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.015)),
    rgba(6, 23, 50, .52);
  box-shadow:
    0 14px 34px rgba(0, 6, 28, .24),
    inset 0 1px 0 rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.portfolio-item::before {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  top: 1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.62), transparent);
  opacity: .7;
  pointer-events: none;
}

.portfolio-item:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(145, 223, 255, .38);
  box-shadow:
    0 20px 42px rgba(0, 69, 255, .16),
    inset 0 1px 0 rgba(255,255,255,.33);
}

.portfolio-item.is-album-hidden { display: none; }

.square-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 17px;
  isolation: isolate;
  background: var(--art-bg);
  border: 1px solid rgba(225,246,255,.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.20),
    inset 0 -18px 50px rgba(0,0,0,.14);
}

.square-art::before,
.preview-media::before {
  content: "";
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 30% 70% 58% 42%;
  background: linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,.015));
  transform: rotate(28deg) translate(-4%, -2%);
  box-shadow: 0 0 65px var(--art-glow);
  z-index: -1;
}

.square-art::after,
.preview-media::after {
  content: "";
  position: absolute;
  width: 82%;
  height: 28%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.20);
  transform: rotate(-14deg);
  z-index: -1;
}

.art-mark,
.preview-watermark {
  position: relative;
  z-index: 2;
  padding: 9px 12px;
  border: 1px solid rgba(222,245,255,.22);
  border-radius: 999px;
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: rgba(2, 11, 31, .55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 22px rgba(0,0,0,.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.play-mark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.30);
  background: rgba(4,13,36,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 20px rgba(0,0,0,.2);
}

.item-copy {
  display: grid;
  gap: 3px;
  padding: 11px 5px 1px;
  min-width: 0;
}

.item-copy small {
  color: #7fa9e6;
  font-size: .7rem;
}

.item-copy strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .86rem;
}

.art-01 { --art-bg: linear-gradient(135deg, #123a8c, #126bd9 48%, #7638e7); --art-glow: rgba(73,116,255,.42); }
.art-02 { --art-bg: linear-gradient(135deg, #006d7f, #10a7a5 45%, #2944ca); --art-glow: rgba(0,228,211,.34); }
.art-03 { --art-bg: linear-gradient(135deg, #6c184e, #d62b77 46%, #6b37e9); --art-glow: rgba(247,55,164,.35); }
.art-04 { --art-bg: linear-gradient(135deg, #382177, #6942da 42%, #079fbe); --art-glow: rgba(111,72,255,.35); }
.art-05 { --art-bg: linear-gradient(135deg, #11304b, #0d7d91 43%, #4157d3); --art-glow: rgba(43,202,255,.30); }
.art-06 { --art-bg: linear-gradient(135deg, #4f2b13, #b96e1c 46%, #8a35d0); --art-glow: rgba(255,169,64,.34); }
.art-07 { --art-bg: linear-gradient(135deg, #0f2d3f, #255985 46%, #5e32b6); --art-glow: rgba(62,135,255,.34); }
.art-08 { --art-bg: linear-gradient(135deg, #541b5f, #b22589 44%, #5630c8); --art-glow: rgba(225,52,221,.35); }
.art-09 { --art-bg: linear-gradient(135deg, #112a69, #175ec5 44%, #bb2f8f); --art-glow: rgba(66,109,255,.35); }
.art-10 { --art-bg: linear-gradient(160deg, #381759, #7c2fd3 48%, #08a9c8); --art-glow: rgba(111,57,255,.35); }

/* fullscreen liquid project preview */
body.preview-open { overflow: hidden; }

.project-preview {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 26px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .24s ease, visibility .24s ease;
}

.project-preview.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(0,157,255,.18), transparent 32%),
    radial-gradient(circle at 86% 90%, rgba(126,56,255,.24), transparent 34%),
    rgba(1, 5, 17, .76);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  backdrop-filter: blur(20px) saturate(135%);
  cursor: zoom-out;
}

.preview-dialog {
  position: relative;
  z-index: 2;
  width: min(1060px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(192,235,255,.25);
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% -20%, rgba(95,220,255,.16), transparent 34%),
    radial-gradient(circle at 100% 110%, rgba(123,75,255,.18), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.018)),
    rgba(5, 17, 40, .78);
  box-shadow:
    0 35px 90px rgba(0,0,0,.48),
    inset 0 1px 0 rgba(255,255,255,.32),
    inset 0 -1px 0 rgba(70,167,255,.10);
  -webkit-backdrop-filter: blur(30px) saturate(175%);
  backdrop-filter: blur(30px) saturate(175%);
  transform: translateY(18px) scale(.975);
  transition: transform .28s ease;
}

.project-preview.open .preview-dialog { transform: translateY(0) scale(1); }

.preview-close {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(220,244,255,.32);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255,255,255,.17), rgba(255,255,255,.03)),
    rgba(5,20,48,.64);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 10px 28px rgba(0,0,0,.28);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.preview-media {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  flex: 0 0 auto;
  border-radius: 22px;
  background: var(--art-bg);
  border: 1px solid rgba(220,244,255,.18);
  box-shadow:
    0 22px 56px rgba(0,0,0,.34),
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -22px 70px rgba(0,0,0,.15);
}

.preview-media.ratio-4-5 { width: min(52vh, 480px); aspect-ratio: 4 / 5; }
.preview-media.ratio-3-4 { width: min(54vh, 520px); aspect-ratio: 3 / 4; }
.preview-media.ratio-1-1 { width: min(62vh, 610px); aspect-ratio: 1 / 1; }
.preview-media.ratio-16-9 { width: min(82vw, 920px); aspect-ratio: 16 / 9; }
.preview-media.ratio-21-9 { width: min(84vw, 960px); aspect-ratio: 21 / 9; }
.preview-media.ratio-9-16 { width: min(36vh, 340px); aspect-ratio: 9 / 16; }

.preview-watermark {
  padding: 13px 18px;
  font-size: .82rem;
}

.preview-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 3;
  padding: 8px 10px;
  border-radius: 999px;
  color: #dff6ff;
  font-size: .68rem;
  font-weight: 800;
  border: 1px solid rgba(215,244,255,.25);
  background: rgba(3,16,38,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.preview-info {
  width: min(920px, 100%);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px 2px;
}

.preview-info small { color: #7fa9e6; }
.preview-info h4 { margin: 4px 0 0; font-size: 1.12rem; }
.preview-note { color: #8fa5ca; font-size: .72rem; white-space: nowrap; }

@media (max-width: 980px) {
  .album-shelf { gap: 16px; }
  .album-card { height: 165px; }
  .album-cover { padding: 18px; gap: 11px; }
  .album-orb { width: 48px; height: 48px; border-radius: 17px; }
  .album-copy strong { font-size: .98rem; }
  .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .album-heading { gap: 14px; }
  .album-hint { font-size: .7rem; padding: 9px 12px; }

  .album-shelf {
    display: flex;
    gap: 14px;
    margin: 28px -22px 24px;
    padding: 8px 22px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .album-shelf::-webkit-scrollbar { display: none; }
  .album-card {
    flex: 0 0 min(78vw, 300px);
    height: 154px;
    scroll-snap-align: start;
  }
  .album-stack, .album-cover { border-radius: 23px; }
  .album-cover { padding: 16px; }

  .album-browser { padding: 15px; border-radius: 24px; }
  .album-browser-head { margin-bottom: 14px; }
  .album-browser-head h4 { font-size: 1.18rem; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .portfolio-item { padding: 7px 7px 10px; border-radius: 18px; }
  .square-art { border-radius: 13px; }
  .item-copy { padding: 9px 3px 0; }
  .item-copy strong { font-size: .78rem; }
  .item-copy small { font-size: .64rem; }

  .project-preview { padding: 10px; }
  .preview-dialog { width: 98vw; padding: 14px; border-radius: 24px; gap: 14px; }
  .preview-close { width: 40px; height: 40px; top: 10px; right: 10px; }
  .preview-media { border-radius: 17px; }
  .preview-media.ratio-16-9,
  .preview-media.ratio-21-9 { width: 92vw; }
  .preview-media.ratio-4-5 { width: min(62vw, 360px); }
  .preview-media.ratio-3-4 { width: min(66vw, 390px); }
  .preview-media.ratio-1-1 { width: min(78vw, 430px); }
  .preview-media.ratio-9-16 { width: min(48vw, 280px); }
  .preview-info { align-items: flex-start; flex-direction: column; gap: 6px; }
  .preview-note { white-space: normal; }
}

@keyframes albumItemIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.portfolio-item:not(.is-album-hidden) { animation: albumItemIn .32s ease both; }

/* =========================================================
   ALBUM PAGE VIEW + TRUE CENTER DESKTOP NAV
   ========================================================= */
@media (min-width: 981px) {
  .site-header {
    position: sticky;
  }

  .main-nav {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    margin: 0;
    z-index: 4;
  }
}

.portfolio-album-page,
.album-detail-page {
  min-height: 0;
}

.is-page-hidden {
  display: none !important;
}

.album-shelf {
  margin-bottom: 8px;
}

.album-card.active {
  transform: none;
  filter: none;
}

.album-card.active .stack-3 {
  transform: translate(11px, -11px) rotate(2deg) scale(.965);
}

.album-card.active .stack-2 {
  transform: translate(6px, -6px) rotate(1deg) scale(.982);
}

.album-card.active .album-cover {
  border-color: rgba(183, 230, 255, .18);
  box-shadow:
    0 20px 46px rgba(0, 6, 28, .34),
    inset 0 1px 0 rgba(255,255,255,.45),
    inset 0 -1px 0 rgba(88,182,255,.13);
}

.album-detail-page {
  animation: albumPageEnter .42s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes albumPageEnter {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.album-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 32px;
}

.album-back-btn,
.album-detail-count {
  border: 1px solid rgba(191, 231, 255, .26);
  background:
    linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.035)),
    rgba(7, 26, 59, .56);
  box-shadow:
    0 14px 34px rgba(0, 6, 28, .28),
    inset 0 1px 0 rgba(255,255,255,.42),
    inset 0 -1px 0 rgba(81,169,255,.12);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
}

.album-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  color: #eef7ff;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.album-back-btn span {
  font-size: 1.18rem;
  color: var(--cyan);
}

.album-back-btn:hover {
  transform: translateX(-3px);
  border-color: rgba(128, 224, 255, .54);
  box-shadow:
    0 18px 38px rgba(0, 97, 255, .22),
    inset 0 1px 0 rgba(255,255,255,.48);
}

.album-detail-count {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: #cfe1ff;
  font-size: .78rem;
  font-weight: 750;
}

.album-detail-heading {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 30px;
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(179, 228, 255, .22);
  background:
    radial-gradient(circle at 8% -20%, rgba(63, 210, 255, .19), transparent 42%),
    radial-gradient(circle at 95% 120%, rgba(123, 71, 255, .25), transparent 40%),
    linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.025)),
    rgba(5, 18, 43, .68);
  box-shadow:
    0 24px 60px rgba(0, 5, 27, .34),
    inset 0 1px 0 rgba(255,255,255,.36),
    inset 0 -1px 0 rgba(71, 164, 255, .10);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
}

.album-detail-heading::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 12%, rgba(255,255,255,.11) 28%, transparent 44%);
  transform: translateX(-45%);
}

.album-detail-heading h3 {
  margin-bottom: 10px;
}

.album-detail-heading p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.album-detail-orb {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  border: 1px solid rgba(217, 244, 255, .42);
  background:
    linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,.035)),
    linear-gradient(135deg, rgba(0,216,255,.46), rgba(105,73,255,.52));
  box-shadow:
    0 18px 42px rgba(32, 109, 255, .25),
    inset 0 1px 0 rgba(255,255,255,.55);
}

.album-page-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.album-page-grid .portfolio-item {
  animation: albumItemIn .38s ease both;
}

/* The project tile stays square. Original ratio is only restored in the preview overlay. */
.album-page-grid .square-art {
  aspect-ratio: 1 / 1;
}

/* Extra liquid depth for the original-ratio preview. */
.preview-dialog {
  background:
    radial-gradient(circle at 10% 0%, rgba(86, 219, 255, .16), transparent 36%),
    radial-gradient(circle at 95% 100%, rgba(132, 75, 255, .20), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.135), rgba(255,255,255,.032)),
    rgba(3, 13, 33, .82);
  border-color: rgba(194, 235, 255, .32);
  box-shadow:
    0 38px 110px rgba(0, 3, 22, .68),
    inset 0 1px 0 rgba(255,255,255,.46),
    inset 0 -1px 0 rgba(78, 172, 255, .12);
  -webkit-backdrop-filter: blur(34px) saturate(185%);
  backdrop-filter: blur(34px) saturate(185%);
}

.preview-media {
  box-shadow:
    0 24px 70px rgba(0, 8, 34, .45),
    0 0 0 1px rgba(190, 234, 255, .14),
    inset 0 1px 0 rgba(255,255,255,.28);
}

@media (max-width: 1100px) {
  .album-page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .album-detail-toolbar { margin-bottom: 20px; }
  .album-detail-heading { padding: 22px; border-radius: 24px; }
  .album-detail-orb { width: 60px; height: 60px; border-radius: 20px; }
  .album-page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 480px) {
  .album-detail-heading { align-items: flex-start; }
  .album-detail-orb { width: 54px; height: 54px; border-radius: 18px; }
  .album-back-btn { min-height: 42px; padding: 0 14px; font-size: .82rem; }
  .album-detail-count { min-height: 38px; padding: 0 12px; font-size: .7rem; }
}

/* =========================================================
   DESKTOP HEADER LAYOUT FIX
   Keep the center nav truly centered without allowing the
   Hire Me button to stretch into the middle grid column.
   ========================================================= */
@media (min-width: 981px) {
  .site-header {
    position: sticky;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .site-header .brand {
    grid-column: 1;
    justify-self: start;
    min-width: 0;
    z-index: 5;
  }

  .site-header .main-nav {
    grid-column: 2;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    justify-self: center;
    width: max-content;
    margin: 0;
    z-index: 5;
  }

  .site-header > .btn {
    grid-column: 3;
    justify-self: end;
    width: auto;
    min-width: max-content;
    max-width: max-content;
    z-index: 5;
  }
}


/* =========================================================
   HOME / ABOUT PROFILE PHOTO — fill the circular frame
   ========================================================= */
.home-photo-orbit {
  padding: 7px;
  overflow: visible;
}

.home-photo-stage {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(59, 124, 255, .24), transparent 34%),
    radial-gradient(circle at 50% 80%, rgba(116, 47, 255, .20), transparent 44%),
    linear-gradient(145deg, rgba(5, 18, 45, .96), rgba(6, 10, 30, .98));
  border: 5px solid #071020;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -24px 55px rgba(26, 53, 120, .18);
}

/* Fill the inner circular stage at every breakpoint. The stage keeps
   overflow:hidden and border-radius:50%, while object-fit preserves proportions. */
.home-photo-stage > .home-profile-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  transform: none;
  filter: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ===== CMS dynamic content support ===== */
.plain-title { background:none !important; -webkit-background-clip:initial !important; background-clip:initial !important; color:#f7f9ff !important; }
.square-art.has-media { background:#071226; }
.square-art.has-media::before,
.square-art.has-media::after { opacity:.12; }
.square-art img,
.square-art video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; }
.square-art .art-mark,
.square-art .play-mark { z-index:3; }
.preview-media.has-media::before,
.preview-media.has-media::after { opacity:0; }
#previewAsset { position:absolute; inset:0; z-index:1; display:grid; place-items:center; overflow:hidden; }
#previewAsset img,
#previewAsset video { width:100%; height:100%; object-fit:contain; display:block; }
.preview-media .preview-badge,
.preview-media .preview-watermark { z-index:3; }
.preview-media.has-media .preview-watermark { display:none; }
.album-cover { overflow:hidden; }
/* Full-card project photo under a frosted veil; text stays sharp. */
.album-cover { isolation: isolate; }
.album-cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  filter: blur(9px) saturate(1.15);
  transform: scale(1.12);
  opacity: .82;
  z-index: 0;
  pointer-events: none;
}
.album-card[data-cover] .album-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: inherit;
  transform: none;
  filter: none;
  background:
    linear-gradient(180deg, rgba(5,16,37,.20), rgba(3,12,30,.76)),
    linear-gradient(135deg, rgba(218,242,255,.17), rgba(77,115,194,.08));
  opacity: 1;
  z-index: 1;
  pointer-events: none;
}
.album-cover::after { z-index: 3; }
.album-orb, .album-copy, .album-arrow { position: relative; z-index: 2; }
.album-card[data-cover] .album-copy strong {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
}
.album-card[data-cover] .album-copy small { color: #d8e5fb; }
@media (max-width: 680px) {
  .album-cover-photo { filter: blur(7px) saturate(1.15); }
}
.cms-loading { opacity:.65; pointer-events:none; }



/* Multi-media project gallery */
.preview-nav {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid rgba(220,244,255,.32);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  background: linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.04)),rgba(5,20,48,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.30),0 10px 26px rgba(0,0,0,.26);
  backdrop-filter: blur(16px) saturate(150%);
}
.preview-prev { left: 14px; }
.preview-next { right: 14px; }
.preview-nav.is-hidden { display: none; }
.preview-counter {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #e8f7ff;
  font-size: .68rem;
  font-weight: 800;
  border: 1px solid rgba(215,244,255,.24);
  background: rgba(3,16,38,.50);
  backdrop-filter: blur(12px);
}
.preview-thumbs {
  width: min(920px,100%);
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}
.preview-thumbs[hidden] { display: none; }
.preview-thumb {
  flex: 0 0 72px;
  width: 72px;
  aspect-ratio: 1;
  padding: 3px;
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  border: 1px solid rgba(176,225,255,.20);
  background: rgba(7,22,50,.72);
  cursor: pointer;
  opacity: .68;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.preview-thumb.active { opacity: 1; border-color: rgba(0,216,255,.75); box-shadow: 0 0 0 2px rgba(0,216,255,.12), inset 0 1px 0 rgba(255,255,255,.18); }
.preview-thumb img,.preview-thumb video { width:100%;height:100%;object-fit:cover;border-radius:11px;display:block; }

@media(max-width:680px){
  .preview-nav{width:40px;height:40px;font-size:1.65rem}.preview-prev{left:8px}.preview-next{right:8px}
  .preview-thumb{flex-basis:58px;width:58px;border-radius:12px}
}


/* =========================================================
   PRODUCT-LIKE PROJECT GALLERY
   Project click -> one large selected media + thumbnail rail
   ========================================================= */
.product-gallery-dialog {
  width: min(1160px, 96vw);
  max-height: 94vh;
  gap: 14px;
  padding: 22px 24px 20px;
}

.preview-product-head {
  width: min(980px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 54px 2px 2px;
}

.preview-product-copy {
  min-width: 0;
}

.preview-product-copy small {
  display: block;
  margin-bottom: 4px;
  color: #79a8e8;
  font-size: .73rem;
}

.preview-product-copy h4 {
  margin: 0;
  color: #f7fbff;
  font-size: clamp(1rem, 1.8vw, 1.28rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-product-count {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 8px 12px;
  border-radius: 999px;
  text-align: center;
  color: #eaf8ff;
  font-size: .72rem;
  font-weight: 800;
  border: 1px solid rgba(205,239,255,.25);
  background: linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,.035)),rgba(6,23,52,.54);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24);
  backdrop-filter: blur(12px);
}

.product-gallery-dialog .preview-media {
  margin-inline: auto;
  max-height: 62vh;
}

.product-gallery-dialog #previewAsset {
  background: radial-gradient(circle at 50% 30%, rgba(64,128,255,.08), transparent 48%), rgba(1,7,19,.18);
}

.product-gallery-dialog #previewAsset img,
.product-gallery-dialog #previewAsset video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-thumb-section {
  width: min(980px, 100%);
  padding: 10px 12px 12px;
  border-radius: 20px;
  border: 1px solid rgba(184,228,255,.15);
  background: linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.015)),rgba(5,18,42,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13);
  backdrop-filter: blur(18px) saturate(150%);
}

.preview-thumb-label {
  margin: 0 0 8px 3px;
  color: #9db2d6;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.preview-thumbs {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 5px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.preview-thumb {
  flex: 0 0 82px;
  width: 82px;
  padding: 4px 4px 6px;
  display: grid;
  gap: 5px;
  border-radius: 16px;
  scroll-snap-align: center;
  opacity: .62;
  transition: transform .18s ease, opacity .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.preview-thumb:hover {
  opacity: .9;
  transform: translateY(-2px);
}

.preview-thumb.active {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(0,216,255,.8);
  box-shadow: 0 0 0 2px rgba(0,216,255,.12), 0 10px 26px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.22);
}

.preview-thumb-visual {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 11px;
  background: #020712;
}

.preview-thumb-visual img,
.preview-thumb-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-thumb b {
  color: #aebfdd;
  font-size: .63rem;
  line-height: 1;
  font-weight: 800;
}

.preview-thumb.active b {
  color: #dffaff;
}

.preview-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-style: normal;
  font-size: 1rem;
  text-shadow: 0 3px 12px #000;
  background: rgba(0,0,0,.10);
}

.product-gallery-info {
  width: min(980px, 100%);
  min-height: auto;
  align-items: center;
  padding: 0 4px;
}

.preview-help {
  color: #748bad;
  font-size: .7rem;
}

@media (max-width: 680px) {
  .product-gallery-dialog {
    width: 98vw;
    padding: 15px 12px 14px;
    gap: 11px;
  }

  .preview-product-head {
    padding: 0 48px 0 2px;
    gap: 10px;
  }

  .preview-product-copy h4 {
    font-size: .98rem;
  }

  .preview-product-count {
    padding: 7px 9px;
    font-size: .66rem;
  }

  .product-gallery-dialog .preview-media {
    max-height: 55vh;
  }

  .preview-thumb-section {
    padding: 8px 8px 10px;
    border-radius: 17px;
  }

  .preview-thumb {
    flex-basis: 64px;
    width: 64px;
    border-radius: 13px;
  }

  .preview-thumb-visual {
    border-radius: 9px;
  }

  .product-gallery-info {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}


/* =========================================================
   PROJECT GALLERY MODAL — CLIPPING FIX
   The modal is mounted outside .page-shell. These rules keep the
   product-style preview centered in the viewport at every scroll position.
   ========================================================= */
.project-preview {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  overflow: hidden;
}

.project-preview .preview-dialog {
  max-width: min(1160px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  overscroll-behavior: contain;
}

.product-gallery-dialog .preview-media {
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .project-preview {
    padding: 8px;
  }
  .project-preview .preview-dialog {
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

/* =========================================================
   PREVIEW ASPECT-RATIO FIX
   Prevent max-height from independently clamping the preview box,
   which can make wide media such as 16:9 look flattened.
   Width is constrained by both viewport width and viewport height,
   while aspect-ratio remains authoritative.
   ========================================================= */
.product-gallery-dialog .preview-media {
  max-height: none !important;
  height: auto !important;
}

/* All media ratios, including arbitrary dimensions from admin uploads. */
.product-gallery-dialog .preview-media {
  width: min(100%, 1100px, calc(58dvh * var(--preview-ratio-number, 1)));
  aspect-ratio: var(--preview-ratio, 1 / 1);
  max-width: 100%;
}
@media (max-width: 680px) {
  .product-gallery-dialog .preview-media {
    width: min(100%, calc(54dvh * var(--preview-ratio-number, 1)));
  }
}

@media (max-width: 980px) {
  .bg-icon { opacity: .68; }
  .bg-icon-1 { width: 150px; left: -34px; top: 120px; }
  .bg-icon-2 { width: 180px; right: -28px; top: 140px; }
  .bg-icon-3 { width: 155px; right: -20px; top: 700px; }
  .bg-icon-4 { width: 160px; left: -28px; top: 1240px; }
  .bg-icon-5 { width: 175px; right: -24px; bottom: 90px; }
}

@media (max-width: 680px) {
  .background-icon-layer { opacity: 1; }
  .bg-icon { opacity: .72; }
  .bg-icon-1 { width: 92px; left: -34px; top: 250px; }
  .bg-icon-2 { width: 104px; right: -40px; top: 560px; }
  .bg-icon-3 { width: 96px; right: -34px; top: 1260px; }
  .bg-icon-4 { width: 100px; left: -38px; top: 1900px; }
  .bg-icon-5 { width: 108px; right: -44px; bottom: 170px; }
}


/* MOBILE: show all portfolio albums instead of hiding them in a horizontal strip */
@media (max-width: 680px) {
  .portfolio .album-shelf {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin: 26px 0 18px !important;
    padding: 8px 0 14px !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  .portfolio .album-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
    height: 154px !important;
    scroll-snap-align: none !important;
  }

  .portfolio .album-cover {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .portfolio .album-copy strong {
    white-space: normal;
  }
}

/* =========================================================
   MOBILE NAV BUG FIX + READABLE LIQUID DESCRIPTION PANELS
   ========================================================= */

/* Keep long descriptive copy readable above the decorative background. */
#homeDescription,
#aboutDescription,
#skillsDescription,
#portfolioDescription,
#activeAlbumDescription,
#contactDescription {
  width: fit-content;
  max-width: 680px;
  margin-top: 10px;
  margin-bottom: 18px;
  padding: 14px 17px;
  border-radius: 18px;
  color: #c8d7f1;
  background:
    radial-gradient(circle at 10% 0%, rgba(67, 207, 255, .10), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.028)),
    rgba(5, 17, 41, .72);
  border: 1px solid rgba(174, 225, 255, .20);
  box-shadow:
    0 16px 38px rgba(0, 5, 24, .22),
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -1px 0 rgba(63, 161, 255, .08);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

/* Small descriptions inside skill cards also get a compact glass layer. */
.panel-title p {
  width: fit-content;
  max-width: 100%;
  margin-top: 7px !important;
  padding: 7px 10px;
  border-radius: 11px;
  color: #aebfdd;
  background: rgba(7, 23, 52, .58);
  border: 1px solid rgba(160, 218, 255, .13);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

@media (max-width: 980px) {
  .site-header {
    z-index: 5000 !important;
    overflow: visible !important;
  }

  /* More opaque liquid menu prevents the hero/photo from bleeding through. */
  .site-header .main-nav {
    background:
      radial-gradient(circle at 12% 0%, rgba(58, 202, 255, .17), transparent 34%),
      radial-gradient(circle at 90% 100%, rgba(122, 77, 255, .19), transparent 38%),
      linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.028)),
      rgba(4, 14, 34, .965) !important;
    border: 1px solid rgba(184, 232, 255, .30) !important;
    box-shadow:
      0 24px 56px rgba(0, 3, 18, .62),
      inset 0 1px 0 rgba(255,255,255,.24),
      inset 0 -1px 0 rgba(76, 166, 255, .08) !important;
    -webkit-backdrop-filter: blur(32px) saturate(175%) !important;
    backdrop-filter: blur(32px) saturate(175%) !important;
  }
}

@media (max-width: 680px) {
  body:has(.main-nav.open) {
    overflow: hidden;
  }

  /* Compact 2-column dropdown so it no longer covers most of the hero portrait. */
  .site-header .main-nav {
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: none !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
    padding: 10px !important;
    border-radius: 18px !important;
    overflow: visible !important;
  }

  .site-header .main-nav a {
    min-width: 0;
    padding: 12px 12px !important;
    border-radius: 12px !important;
    text-align: center;
    background: rgba(22, 49, 85, .30);
    border: 1px solid rgba(155, 218, 255, .08);
  }

  .site-header .main-nav a:last-child {
    grid-column: 1 / -1;
  }

  .site-header .main-nav a:hover,
  .site-header .main-nav a.active {
    background:
      linear-gradient(145deg, rgba(82, 203, 255, .16), rgba(92, 67, 255, .12)),
      rgba(24, 56, 96, .46) !important;
    border-color: rgba(129, 219, 255, .20);
  }

  #homeDescription,
  #aboutDescription,
  #skillsDescription,
  #portfolioDescription,
  #activeAlbumDescription,
  #contactDescription {
    width: 100%;
    max-width: 100%;
    padding: 13px 14px;
    border-radius: 16px;
    font-size: .95rem;
    line-height: 1.7;
  }
}


/* =========================================================
   FIXED HEADER ON TOP
   Keep header pinned to the viewport while scrolling.
   ========================================================= */
:root {
  --fixed-header-top: 14px;
  --fixed-header-width: min(1148px, calc(100% - 32px));
  --page-shell-header-space: 104px;
}

.page-shell {
  padding-top: var(--page-shell-header-space);
}

.site-header {
  position: fixed !important;
  top: var(--fixed-header-top) !important;
  left: 50%;
  transform: translateX(-50%);
  width: var(--fixed-header-width);
  margin: 0 !important;
}

@media (max-width: 980px) {
  :root {
    --fixed-header-top: 8px;
    --fixed-header-width: calc(100% - 14px);
    --page-shell-header-space: 88px;
  }

  .page-shell {
    padding-top: var(--page-shell-header-space);
  }

  .site-header {
    left: 50%;
    transform: translateX(-50%);
    width: var(--fixed-header-width);
  }
}

@media (max-width: 680px) {
  :root {
    --fixed-header-top: 7px;
    --fixed-header-width: calc(100% - 14px);
    --page-shell-header-space: 84px;
  }
}


/* =========================================================
   TRUE VIEWPORT-FIXED HEADER
   Header is mounted directly under <body>, outside .page-shell,
   so backdrop-filter / overflow on the shell can no longer make
   position: fixed behave like a scrolling child.
   ========================================================= */
:root {
  --header-fixed-top: 14px;
  --header-fixed-width: min(1148px, calc(100% - 32px));
}

.site-header {
  position: fixed !important;
  top: var(--header-fixed-top) !important;
  left: 50% !important;
  right: auto !important;
  width: var(--header-fixed-width) !important;
  margin: 0 !important;
  transform: translateX(-50%) !important;
  z-index: 10000 !important;
}

/* Reserve vertical room because the fixed header no longer participates
   in document flow. */
.page-shell {
  margin: 116px auto 42px !important;
  padding-top: 0 !important;
}

/* Anchor sections land below the fixed navbar. */
section[id] {
  scroll-margin-top: 110px;
}

@media (max-width: 980px) {
  :root {
    --header-fixed-top: 8px;
    --header-fixed-width: calc(100% - 18px);
  }

  .site-header {
    width: var(--header-fixed-width) !important;
  }

  .page-shell {
    margin: 92px auto 18px !important;
  }

  section[id] {
    scroll-margin-top: 96px;
  }
}

@media (max-width: 680px) {
  :root {
    --header-fixed-top: 7px;
    --header-fixed-width: calc(100% - 14px);
  }

  .page-shell {
    margin: 88px auto 10px !important;
  }

  section[id] {
    scroll-margin-top: 92px;
  }
}


/* =========================================================
   HIDE FIXED HEADER WHILE PROJECT PREVIEW IS OPEN
   The preview already adds body.preview-open in script.js.
   ========================================================= */
body.preview-open .site-header {
  transition: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.site-header {
  transition:
    opacity .18s ease,
    visibility .18s ease,
    transform .18s ease;
}

/* Keep glass copy and dynamic CMS content within the available width. */
.contact-links a, .panel-title > div, .album-copy { min-width: 0; }
.contact-links strong, .item-copy small, .item-copy strong,
#homeDescription, #aboutDescription, #skillsDescription,
#portfolioDescription, #activeAlbumDescription, #contactDescription {
  overflow-wrap: anywhere;
}
.item-copy strong { white-space: normal; }
.preview-thumb-section, .preview-product-head { flex-shrink: 0; }
.preview-dialog > * { min-width: 0; }
.preview-description { width: 100%; margin: 0; color: #c8d7f1; overflow-wrap: anywhere; }
.preview-description:empty { display: none; }
@media (max-width: 980px) {
  .site-header .main-nav { max-height: calc(100dvh - 105px) !important; overflow-y: auto !important; }
}

/* Compact transition from album/project grid to the Contact card. */
#portfolio { padding-bottom: 32px; }
#contact { padding-top: 32px; }

/* Keep the active marker centered inside its own mobile menu item. */
@media (max-width: 980px) {
  .site-header .main-nav a::after {
    display: block;
    left: 50%;
    right: auto;
    bottom: 5px;
    margin: 0;
    width: 32px;
    max-width: calc(100% - 24px);
    height: 3px;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .site-header .main-nav a.active::after {
    width: 32px;
    opacity: 1;
  }
}

@media (max-width: 680px) {
  .site-header .brand { flex: 1 1 auto; gap: 10px; min-width: 0; }
  .site-header .brand-mark { flex: 0 0 38px; width: 38px; height: 38px; }
  .site-header .brand-name {
    display: block;
    min-width: 0;
    font-size: clamp(.8rem, 3.5vw, .95rem);
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #portfolio { padding-bottom: 24px; }
  #contact { padding-top: 24px; }
}

/* Only All Albums floats below the header; the count stays in document flow. */
.album-back-placeholder { display: block; flex: 0 1 auto; }
.album-back-btn.album-floating-back {
  position: fixed;
  z-index: 9000;
  margin: 0;
  max-width: calc(100% - 32px);
}
.album-floating-back[hidden] { display: none !important; }
.album-floating-back span:last-child { overflow-wrap: anywhere; }
body.preview-open .album-floating-back {
  visibility: hidden !important;
  pointer-events: none !important;
}
@media (max-width:980px) {
  body:has(.site-header .main-nav.open) .album-floating-back {
    visibility: hidden;
    pointer-events: none;
  }
}

/* Capsule header and a tighter Skills-to-Portfolio transition. */
.site-header {
  border-radius: 999px !important;
  padding-inline: clamp(18px, 2.4vw, 30px);
}
.site-header::before { border-radius: 999px; }
#skills { padding-bottom: 32px; }
#portfolio { padding-top: 32px; }
@media (max-width: 680px) {
  #skills { padding-bottom: 24px; }
  #portfolio { padding-top: 24px; }
}
