:root, [data-theme="light"] {
  --bg: #F6F4EF;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-2: rgba(250, 248, 244, 0.96);
  --text: #161719;
  --muted: #686B70;
  --accent: #9A6B42;
  --accent-soft: rgba(154, 107, 66, 0.10);
  --line: rgba(22, 23, 25, 0.09);
  --line-hover: rgba(154, 107, 66, 0.45);
  --shadow: 0 8px 28px rgba(22, 23, 25, 0.045);

  --stage-bg: #17191C;
  --stage-text: #F4F2ED;
  --stage-muted: #9A9E9C;
  --stage-border: rgba(255, 255, 255, 0.10);

  --nav-bg: rgba(246, 244, 239, 0.82);
  --grid-line: rgba(120, 95, 70, 0.16);
  --orb-grad: radial-gradient(circle, rgba(217, 138, 60, 0.28) 0%, rgba(120, 145, 220, 0.14) 42%, transparent 70%);

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #0D0F10;
  --surface: rgba(20, 23, 25, 0.86);
  --surface-2: rgba(26, 30, 33, 0.94);
  --text: #E8E6E1;
  --muted: #8E928E;
  --accent: #C7B299;
  --accent-soft: rgba(199, 178, 153, 0.10);
  --line: rgba(232, 230, 225, 0.10);
  --line-hover: rgba(199, 178, 153, 0.45);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.25);

  --stage-bg: #181C20;
  --stage-text: #E8E6E1;
  --stage-muted: #8E928E;
  --stage-border: rgba(232, 230, 225, 0.10);

  --nav-bg: rgba(13, 15, 16, 0.82);
  --grid-line: rgba(255, 255, 255, 0.08);
  --orb-grad: radial-gradient(circle, rgba(212, 255, 63, 0.16) 0%, rgba(99, 102, 241, 0.11) 42%, transparent 70%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Cursor Spotlight Grid & Ambient Glow Orb (from Case 02) */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle 420px at var(--mx, 50%) var(--my, 35%), #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle 420px at var(--mx, 50%) var(--my, 35%), #000 10%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}
.glow-orb {
  position: fixed;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  background: var(--orb-grad);
  filter: blur(40px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  left: var(--mx, 50%);
  top: var(--my, 35%);
  z-index: 0;
  will-change: left, top;
  transition: left 0.15s ease-out, top 0.15s ease-out;
}

/* Floating Sticky Navbar (revealed after scrolling past splash) */
.floating-nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 90;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px 8px 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.floating-nav.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}
.floating-nav .nav-brand {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.floating-nav .nav-links {
  display: flex;
  gap: 16px;
}
.floating-nav .nav-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.floating-nav .nav-links a:hover { color: var(--text); }

/* Theme Toggle Button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--line-hover);
  transform: translateY(-1px);
}

/* ================= 06: ZEN INTERACTIVE CANVAS SPLASH ================= */
.hero-wrap {
  position: relative;
  height: 100vh;
  min-height: 620px;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 48px;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
#zenCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-layer {
  position: relative;
  z-index: 2;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.hero-center {
  max-width: 880px;
}
.hero-center h1 {
  font-family: var(--serif);
  font-size: clamp(52px, 8.5vw, 114px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.02em;
}
.hero-center h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-center p {
  margin-top: 24px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 520px;
}
.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-solid, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-solid {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}
.btn-solid:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--line-hover); }

.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.enter-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition: color 0.2s;
}
.enter-link:hover { color: var(--accent); }

/* ================= SHARED CONTAINER ================= */
.section-wrap {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 72px 28px 0;
  display: grid;
  gap: 16px;
}

/* ================= 03: SPATIAL BENTO SHOWCASE ================= */
.topbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.id-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}
.led {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 12px;
  flex-wrap: wrap;
}
.tab-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hero-bento {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
}
.bento-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.intro-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 300px;
}
.kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(154, 107, 66, 0.22);
  padding: 6px 12px;
  border-radius: 999px;
  width: fit-content;
}
.intro-card h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.08;
  margin: 20px 0 14px;
}
.intro-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  max-width: 460px;
}

/* Spotlight Stage Card */
.stage-card {
  background: var(--stage-bg);
  color: var(--stage-text);
  border: 1px solid var(--stage-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 300px;
}
.stage-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--stage-muted);
}
.stage-body { padding: 18px 0; }
.stage-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: rgba(199, 178, 153, 0.16);
  color: #E2CEB5;
}
.stage-body h3 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 10px;
  color: var(--stage-text);
}
.stage-body p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--stage-muted);
}
.stage-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.ctrl-group { display: flex; gap: 8px; }
.ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--stage-text);
  padding: 8px 14px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.ctrl-btn:hover { background: rgba(255, 255, 255, 0.16); }
.ctrl-btn.primary {
  background: #E2CEB5;
  color: #141619;
  border-color: #E2CEB5;
  font-weight: 600;
}

/* 3-Column Bento Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s, background 0.25s;
}
.proj-card:hover, .proj-card.active-card {
  transform: translateY(-4px);
  border-color: var(--line-hover);
  background: var(--surface-2);
}
.proj-thumb {
  height: 136px;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.proj-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.proj-card h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.proj-card p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 14px;
}
.proj-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}
.proj-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.proj-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}
.proj-detail-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.proj-detail-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ================= ABOUT & CAPABILITIES BENTO ================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}
.about-story h3 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.18;
  margin: 16px 0 14px;
}
.about-story p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--muted);
}
.cap-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.cap-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.cap-item h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.timeline-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.tl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13.5px;
}
.tl-period {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* ================= CONTACT BENTO ================= */
.contact-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.contact-card h3 {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  margin-top: 8px;
}
.contact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================= PROJECT DETAIL MODAL ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 15, 16, 0.55);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-panel {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 24px;
  max-width: 680px;
  width: 100%;
  padding: 32px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 22px; right: 22px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.modal-highlights {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 18px 0 22px;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 13.5px;
}
.modal-highlights li::before {
  content: "✦ ";
  color: var(--accent);
}

/* Footer */
footer {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 48px auto 0;
  padding: 28px 28px 48px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

@media (max-width: 920px) {
  .hero-wrap { padding: 24px; }
  .hint-desktop { display: none; }
  .hero-bento, .about-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .floating-nav { display: none; }
}
