:root {
  --fg: #f4f4f6;
  --muted: rgba(244, 244, 246, 0.52);
  --pad-x: clamp(20px, 6.5vw, 110px);
  --font: 'Poppins', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #08080a; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  min-height: 100vh; background: #08080a; color: var(--fg);
  font-family: var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: #fff; color: #000; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Page transition curtain */
.curtain {
  position: fixed; inset: 0; z-index: 999;
  background: #000; pointer-events: none;
  opacity: 0; transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  animation: curtainIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.leaving .curtain { opacity: 1; pointer-events: all; animation: none; }
@keyframes curtainIn { from { opacity: 1; } to { opacity: 0; } }

/* Full-viewport WebGL refractive coast + liquid caustics canvas */
#optics-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0; pointer-events: none;
}

/* Fallback coast background if WebGL is unavailable */
.bg-fallback {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: #08080a url('hero-bg-coast.jpg') center center / cover no-repeat;
  filter: saturate(0.9) contrast(1.06) brightness(0.86);
}

/* =====================================================================
   TOP BAR — CLEAN, RESTRAINED, UNOBSTRUCTED AVATAR
   ===================================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad-x);
  background: rgba(8, 8, 10, 0.38);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.logo {
  display: flex; align-items: center; gap: 12px;
  color: #fff; font-size: 15px; letter-spacing: -0.01em;
}
.logo-avatar {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  padding: 1.5px;
  background: conic-gradient(from 0deg, #7cf0ff, #b69cff, #ff8fb1, #ffd29a, #7cf0ff);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}
.logo-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1.5px solid #000;
}
.logo b { font-weight: 700; color: #fff; }
.logo span { font-weight: 400; color: rgba(255, 255, 255, 0.82); }

.nav-links {
  display: flex; gap: clamp(20px, 3.6vw, 48px); list-style: none; align-items: center;
}
.nav-links a {
  color: rgba(255, 255, 255, 0.85); font-size: 14px; font-weight: 500; position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: #fff; transform: scaleX(0); transform-origin: right; transition: transform .35s ease;
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* =====================================================================
   MAIN SHELL & SECTION HEADERS
   ===================================================================== */
.shell {
  position: relative; z-index: 2;
  max-width: 1360px; margin: 0 auto;
  padding: 40px var(--pad-x) 100px;
}
.sec { margin-top: clamp(56px, 7vw, 96px); }
.sec:first-child { margin-top: 4px; }

.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.sec-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}
.sec-head p {
  color: rgba(255, 255, 255, 0.65); font-size: 13px; font-weight: 400;
}

/* =====================================================================
   ARCHITECTURAL MONOLITHIC GLASS SHEET (TIGHTLY FUSED, CLEAN, NO CLUTTER)
   Each cell is a crisp optical glass pane fused edge-to-edge (-1px seam).
   Light dispersion is uneven & localized along joints and corners, never
   a gaudy full-border rainbow ring.
   ===================================================================== */
.sheet {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 11, 14, 0.16);
  backdrop-filter: blur(4px) saturate(1.25);
  -webkit-backdrop-filter: blur(4px) saturate(1.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 24px 64px rgba(0, 0, 0, 0.45);
}

.pane {
  --mx: 50%; --my: 50%;
  --has-ptr: 0;
  position: relative; isolation: isolate;
  margin: -0.5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    /* Subtle localized cursor caustics when hovered */
    radial-gradient(320px circle at var(--mx) var(--my),
      rgba(255, 255, 255, calc(0.11 * var(--has-ptr))) 0%,
      rgba(140, 215, 255, calc(0.05 * var(--has-ptr))) 38%,
      transparent 70%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.012) 55%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 1px 0 0 rgba(150, 215, 255, 0.14),
    inset -1px 0 0 rgba(255, 165, 210, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

/* Uneven, localized prismatic edge segments (only partial segments of the seam catch chromatic light) */
.pane::before {
  content: ""; position: absolute; inset: 0; padding: 1px;
  pointer-events: none; z-index: 2;
  background: var(--seam-light,
    linear-gradient(125deg,
      rgba(135, 215, 255, 0.72) 0%,
      rgba(255, 255, 255, 0.65) 14%,
      transparent 34%,
      transparent 72%,
      rgba(255, 165, 210, 0.58) 88%,
      rgba(255, 225, 155, 0.45) 100%));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.72;
  transition: opacity 0.3s ease;
}
.pane:hover {
  background:
    radial-gradient(340px circle at var(--mx) var(--my),
      rgba(255, 255, 255, 0.13) 0%,
      rgba(140, 215, 255, 0.06) 40%,
      transparent 72%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.025) 55%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 1px 0 0 rgba(150, 220, 255, 0.28),
    inset -1px 0 0 rgba(255, 165, 210, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32);
}
.pane:hover::before { opacity: 1; }

/* Different uneven light distribution per pane so light hits at varied angles */
.p-a {
  --seam-light: linear-gradient(135deg,
    rgba(255,255,255,0.85) 0%, rgba(130,215,255,0.75) 18%,
    transparent 42%, transparent 78%,
    rgba(255,160,210,0.55) 94%, transparent 100%);
}
.p-b {
  --seam-light: linear-gradient(215deg,
    rgba(135,215,255,0.78) 0%, rgba(255,255,255,0.7) 15%,
    transparent 36%, transparent 68%,
    rgba(255,220,155,0.6) 85%, rgba(255,160,205,0.55) 96%, transparent 100%);
}
.p-c {
  --seam-light: linear-gradient(75deg,
    transparent 0%, rgba(255,160,210,0.62) 12%, rgba(255,255,255,0.75) 24%,
    transparent 46%, transparent 76%,
    rgba(130,215,255,0.72) 92%, transparent 100%);
}
.p-d {
  --seam-light: linear-gradient(305deg,
    rgba(255,220,155,0.65) 0%, rgba(255,255,255,0.75) 14%,
    transparent 35%, transparent 74%,
    rgba(135,215,255,0.75) 90%, rgba(175,155,255,0.55) 100%);
}

/* =====================================================================
   WORK PANES — VARIED PROPORTIONS (SPAN 7, 5, 4, 8, Tall, Wide) TIGHTLY FUSED
   ===================================================================== */
.w-pane {
  padding: clamp(24px, 2.6vw, 36px);
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 16px;
}

/* Varied architectural grid spans — rich geometry, strictly aligned */
.span-7 { grid-column: span 7; min-height: 250px; }
.span-5 { grid-column: span 5; min-height: 250px; }
.span-4 { grid-column: span 4; min-height: 230px; }
.span-8 { grid-column: span 8; min-height: 210px; }
.span-6 { grid-column: span 6; min-height: 210px; }
.span-12 { grid-column: span 12; }

.w-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.w-tag {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.w-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.w-badge--live {
  color: #ecfdf5;
  background: rgba(16, 185, 129, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 0 0 1px rgba(110, 231, 183, 0.65),
    0 2px 10px rgba(16, 185, 129, 0.18);
}
.w-badge--award {
  color: #fff7ed;
  background: rgba(249, 115, 22, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 0 0 1px rgba(253, 186, 116, 0.7),
    0 2px 10px rgba(249, 115, 22, 0.22);
}
.w-badge--soon {
  color: #fffbeb;
  background: rgba(245, 158, 11, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 0 1px rgba(252, 211, 77, 0.6),
    0 2px 10px rgba(245, 158, 11, 0.16);
}

.w-pane h3 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.2;
  color: #fff;
  margin-top: 2px;
}
.w-pane p {
  color: rgba(244, 244, 246, 0.76);
  font-size: 14px; font-weight: 300; line-height: 1.72;
  max-width: 54ch;
}
.w-foot {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--muted);
}
.w-foot a {
  color: #fff; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 1px;
  transition: border-color 0.2s, gap 0.2s;
}
.w-foot a:hover { border-color: #fff; gap: 10px; }

/* =====================================================================
   DEV TOOLS — TIGHTLY FUSED 6-COLUMN GLASS STRIP
   ===================================================================== */
.tool-pane {
  grid-column: span 2;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  min-height: 78px;
}
.tool-pane img {
  width: 32px; height: 32px; object-fit: contain; flex-shrink: 0;
  filter: grayscale(1) brightness(1.35) contrast(1.1);
  transition: filter 0.25s, transform 0.25s;
}
.tool-pane:hover img {
  filter: grayscale(0) brightness(1.05);
  transform: scale(1.06);
}
.tool-meta { display: flex; flex-direction: column; line-height: 1.25; }
.tool-name { font-size: 14px; font-weight: 600; color: #fff; }
.tool-role { font-size: 11.5px; color: var(--muted); font-weight: 300; margin-top: 2px; }

/* =====================================================================
   ABOUT & CONTACT — FUSED ARCHITECTURAL FOOTER BLOCK
   ===================================================================== */
.about-pane {
  grid-column: span 6;
  padding: clamp(24px, 2.6vw, 36px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
}
.about-pane h3 {
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em; color: #fff;
}
.about-pane p, .about-pane li {
  color: rgba(244, 244, 246, 0.76); font-size: 14px; font-weight: 300; line-height: 1.7;
}
.about-pane ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.about-pane ul li::before { content: "— "; color: var(--muted); }
.about-note { font-size: 12.5px !important; color: var(--muted) !important; margin-top: 6px; }

.contact-pane {
  grid-column: span 3;
  padding: 26px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.88);
  transition: color 0.25s, background 0.25s;
}
.contact-pane svg { width: 24px; height: 24px; transition: transform 0.25s; }
.contact-pane:hover { color: #fff; }
.contact-pane:hover svg { transform: translateY(-2px); }

/* Footer */
.footer {
  margin-top: 56px; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 13px; font-weight: 300;
}
.footer a:hover { color: #fff; }

/* Modals */
body.modal-open { overflow: hidden; }
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}
.modal-panel {
  width: min(400px, 100%); padding: 26px;
  background: rgba(12, 13, 17, 0.86);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.26);
  z-index: 1;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h2 { font-size: 1.15rem; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 18px; line-height: 1;
}
.modal-close:hover { background: #fff; color: #000; }
.modal-meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.modal-panel img { width: 100%; height: auto; border: 1px solid rgba(255,255,255,0.15); }
.modal-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }
.gmail-addr {
  font-family: var(--mono);
  font-size: 1.05rem; padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-align: center; word-break: break-all; margin-bottom: 16px;
}
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.m-btn {
  padding: 9px 20px; font-size: 13px; font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.65); transition: 0.2s;
}
.m-btn:hover { background: #fff; color: #000; }

/* Responsive */
@media (max-width: 960px) {
  .span-7, .span-5, .span-8 { grid-column: span 12; }
  .span-4, .span-6 { grid-column: span 6; }
  .tool-pane { grid-column: span 4; }
  .about-pane { grid-column: span 12; }
  .contact-pane { grid-column: span 6; }
}
@media (max-width: 600px) {
  .span-4, .span-6 { grid-column: span 12; }
  .tool-pane { grid-column: span 6; }
  .contact-pane { grid-column: span 6; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 13px; }
}
