@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=JetBrains+Mono:wght@300;400&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --display: "EB Garamond", serif;
  --mono: "JetBrains Mono", monospace;
  --bg: #030303;
  --t1: #e8e4df;
  --t2: #888580;
  --t3: #444240;
  --t4: #2a2826;
  --accent: #8b7fe8;
  --accent2: #e87fa0;
}
html {
  scroll-behavior: auto;
}
body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--display);
  overflow-x: hidden;
}

#spacer {
  height: 800vh;
  position: relative;
  z-index: 0;
}
canvas#c {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 100;
  width: 0%;
}

.sec {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.97);
  transition:
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.sec.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

#nav {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  cursor: pointer;
  transition: all 0.4s;
  pointer-events: auto;
}
.dot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(139, 127, 232, 0.5);
}
.dot:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

/* ═══ ENTRANCE ═══ */
.entrance {
  text-align: center;
  gap: 14px;
}
.entrance h1 {
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--t1);
  line-height: 1.05;
  text-shadow: 0 0 60px rgba(139, 127, 232, 0.15);
}
.entrance .tagline {
  font-family: var(--display);
  font-size: clamp(15px, 1.8vw, 20px);
  font-weight: 400;
  font-style: italic;
  color: var(--t2);
  letter-spacing: 0.02em;
}
.entrance .scroll-cue {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.entrance .scroll-cue span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--t3);
}
.scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--t3), transparent);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.2;
    transform: scaleY(0.5);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ═══ WORK ═══ */
.work {
  padding: 0 clamp(24px, 5vw, 72px);
  max-width: 860px;
  gap: 16px;
  align-items: stretch;
}
.work .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--t3);
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 6px;
}
.pgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}
.pcard {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px 22px;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.pcard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    300px circle at var(--mx, 50%) var(--my, 50%),
    rgba(139, 127, 232, 0.08),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 1;
}
.pcard:hover::before {
  opacity: 1;
}
.pcard:hover {
  transform: translateY(-2px);
}
.pcard .num {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--t3);
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}
.pcard h3 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  color: var(--t1);
  margin-bottom: 5px;
}
.pcard .desc {
  font-family: var(--display);
  font-size: 13.5px;
  color: var(--t2);
  line-height: 1.55;
  margin-bottom: 12px;
}
.pcard .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pcard .tag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}
.cv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s;
}
.cv-row:hover {
  border-color: rgba(139, 127, 232, 0.2);
  background: rgba(139, 127, 232, 0.03);
}
.cv-row span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--t2);
}
.cv-row .arr {
  color: var(--t3);
  transition: transform 0.3s;
  font-size: 14px;
}
.cv-row:hover .arr {
  transform: translateX(4px);
  color: var(--accent);
}

/* ═══ PERSON ═══ */
.person {
  padding: 0 clamp(24px, 5vw, 72px);
  max-width: 720px;
  gap: 20px;
  align-items: flex-start;
}
.person .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--t3);
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 6px;
}
.person-header {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}
.person-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    rgba(139, 127, 232, 0.15),
    rgba(232, 127, 160, 0.15)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
  overflow: hidden;
}
.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.person-info .name {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  color: var(--t1);
}
.person-info .sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t2);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.person .bio {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.75;
  color: var(--t2);
  background: rgba(0, 0, 0, 0.7);
  padding: 16px 20px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.person .bio em {
  color: var(--t1);
  font-style: normal;
}
.person .history {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
  letter-spacing: 0.04em;
  line-height: 1.8;
  background: rgba(0, 0, 0, 0.7);
  padding: 16px 20px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.person .history a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.person .history a:hover {
  color: var(--accent);
}

/* ═══ SIGNAL ═══ */
.signal {
  text-align: center;
  gap: 20px;
}
.signal-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.signal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
body.unfolded .signal-card {
}
.signal .email {
  font-family: var(--display);
  font-size: clamp(18px, 2.5vw, 24px);
  font-style: italic;
  color: var(--t2);
  text-decoration: none;
  transition: color 0.3s;
  text-shadow:
    0 0 20px rgba(0, 0, 0, 1),
    0 0 40px rgba(0, 0, 0, 0.8);
}
.signal .email:hover {
  color: var(--accent);
}
.signal .links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.signal .links a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--t2);
  text-decoration: none;
  transition: all 0.3s;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
}
.signal .links a:hover {
  color: var(--t1);
  border-color: rgba(139, 127, 232, 0.3);
  background: rgba(139, 127, 232, 0.06);
}
.signal .closing {
  font-family: var(--display);
  font-size: 14px;
  font-style: italic;
  color: var(--t4);
  margin-top: 20px;
  text-shadow:
    0 0 20px rgba(0, 0, 0, 1),
    0 0 40px rgba(0, 0, 0, 0.8);
}

/* ═══ PROJECT DETAIL OVERLAY ═══ */
#project-detail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: none;
  overflow-y: auto;
  overflow-x: hidden;
}
#project-detail.lifting {
  opacity: 1;
  pointer-events: none;
  background: transparent;
}
#project-detail.open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(3, 3, 3, 0.12);
}
#project-detail .pd-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px clamp(24px, 5vw, 60px) 80px;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1s 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
  background: rgba(3, 3, 3, 0.35);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
#project-detail.open .pd-inner {
  opacity: 1;
  transform: translateY(0);
}
body.unfolded #project-detail .pd-inner {
  transition:
    opacity 0.4s 0.2s ease-out,
    transform 0.5s 0.2s ease-out;
}
body.unfolded #project-detail.open {
  background: rgba(3, 3, 3, 0.08);
}

.pd-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
}
.pd-back {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--t3);
  cursor: pointer;
  transition: color 0.3s;
  background: none;
  border: none;
  padding: 8px 0;
}
.pd-back:hover {
  color: var(--t1);
}
.pd-esc {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--t4);
}

.pd-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}
.pd-title {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  color: var(--t1);
  margin-bottom: 8px;
  line-height: 1.15;
}
.pd-subtitle {
  font-family: var(--display);
  font-size: clamp(15px, 2vw, 18px);
  font-style: italic;
  color: var(--t2);
  margin-bottom: 28px;
}
.pd-divider {
  width: 120px;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 28px;
}

.pd-hero {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  margin-bottom: 32px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t4);
  overflow: hidden;
}
.pd-hero img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.pd-hero:has(img) {
  aspect-ratio: auto;
  background: none;
  border: none;
  flex-direction: column;
  align-items: stretch;
}

.pd-body {
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.8;
  color: var(--t2);
  margin-bottom: 36px;
}
.pd-body em {
  color: var(--t1);
  font-style: normal;
}
.pd-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pd-body a:hover {
  color: var(--accent2);
}

.pd-section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 14px;
}
.pd-tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 36px;
}
.pd-tech-card {
  padding: 18px 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.pd-tech-card .tc-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 8px;
}
.pd-tech-card .tc-line {
  font-family: var(--display);
  font-size: 13.5px;
  color: var(--t2);
  line-height: 1.6;
}

.pd-quote {
  font-family: var(--display);
  font-size: 16px;
  font-style: italic;
  color: var(--t3);
  line-height: 1.7;
  margin-bottom: 36px;
  padding-left: 20px;
  border-left: 1px solid rgba(139, 127, 232, 0.2);
}
.pd-quote a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-style: normal;
}
.pd-quote a:hover {
  color: var(--accent2);
}

.pd-caption {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t4);
  line-height: 1.5;
  margin-top: 8px;
  letter-spacing: 0.02em;
}
.pd-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 36px;
}
.pd-gallery-fig {
  margin: 0;
}
.pd-gallery-img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 0.3s;
}
.pd-gallery-img:hover {
  transform: scale(1.02);
}

.pd-code-block {
  margin-bottom: 36px;
}
.pd-code-toggle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--t3);
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s;
  list-style: none;
}
.pd-code-toggle::-webkit-details-marker {
  display: none;
}
.pd-code-toggle::before {
  content: "▸ ";
  transition: transform 0.2s;
}
details[open] .pd-code-toggle::before {
  content: "▾ ";
}
.pd-code-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--t2);
}
.pd-code {
  margin-top: 12px;
  padding: 20px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--t2);
  tab-size: 4;
}
.pd-code code {
  white-space: pre;
}
.hl-kw {
  color: #c678dd;
}
.hl-str {
  color: #98c379;
}
.hl-cmt {
  color: #5c6370;
  font-style: italic;
}
.hl-num {
  color: #d19a66;
}
.hl-fn {
  color: #61afef;
}
.hl-blt {
  color: #56b6c2;
}
.hl-dec {
  color: #c678dd;
}
.hl-op {
  color: #abb2bf;
}

.pd-links {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
}
.pd-link {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}
.pd-link.primary {
  background: rgba(139, 127, 232, 0.1);
  border: 1px solid rgba(139, 127, 232, 0.25);
  color: var(--accent);
}
.pd-link.primary:hover {
  background: rgba(139, 127, 232, 0.18);
  border-color: rgba(139, 127, 232, 0.4);
}
.pd-link.secondary {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--t2);
}
.pd-link.secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--t1);
}

/* Results table for TTT-Binary */
.pd-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}
.pd-table th,
.pd-table td {
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.pd-table th {
  color: var(--t3);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 9px;
}
.pd-table td {
  color: var(--t2);
}
.pd-table td.highlight {
  color: var(--accent);
  font-weight: 400;
}

/* ═══ UNFOLD TOGGLE ═══ */
#fold-toggle {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 150;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--t3);
  background: rgba(3, 3, 3, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.4s;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#fold-toggle:hover {
  color: var(--accent);
  border-color: rgba(139, 127, 232, 0.3);
}

/* ═══ HEADER CARD (unfolded layout — carolynzou-inspired) ═══ */
.header-card {
  width: 100%;
  padding: 28px 32px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 16px;
}
.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-top .person-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    rgba(139, 127, 232, 0.15),
    rgba(232, 127, 160, 0.15)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--t3);
  overflow: hidden;
}
.header-top .person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.header-info h1 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
  color: var(--t1);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.header-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t2);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.header-links {
  display: flex;
  gap: 16px;
}
.header-links a {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s;
  letter-spacing: 0.02em;
}
.header-links a:hover {
  color: var(--t1);
}

.bio-card {
  width: 100%;
  padding: 28px 32px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}
.bio-card p {
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.7;
  color: var(--t2);
  margin-bottom: 12px;
}
.bio-card p:last-child {
  margin-bottom: 0;
}
.bio-card .bio-coursework {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: var(--t3);
  margin-top: 16px;
}
.bio-coursework a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bio-coursework a:hover {
  color: var(--accent);
}
.bio-card em {
  color: var(--t1);
  font-style: normal;
}

.interests-card {
  width: 100%;
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-top: 24px;
}
.interests-row {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t2);
  line-height: 1.8;
  letter-spacing: 0.02em;
}
.interests-label {
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 12px;
  font-size: 9px;
}
.interests-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.interests-card a:hover {
  color: var(--accent2);
}
body:not(.unfolded) .interests-card {
  display: none;
}

.dog-flash {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  pointer-events: none;
  z-index: 50;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ═══ UNFOLDED STATE (default — clean scrollable portfolio) ═══ */
body.unfolded #spacer {
  display: none;
}
body.unfolded canvas#c {
  pointer-events: none;
  opacity: 0.25;
}
body.unfolded #progress {
  display: none;
}
body.unfolded #nav {
  display: none;
}
body.unfolded #overlay {
  position: relative;
  width: 100%;
  height: auto;
  max-width: 720px;
  margin: 0 auto;
  overflow: visible;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.35s ease-out;
  padding: 0 clamp(20px, 4vw, 40px);
}
body.unfolded .sec {
  position: relative;
  width: 100%;
  height: auto;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: none;
  animation: unfoldIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Header — compact, not full-screen */
body.unfolded .sec.entrance {
  min-height: auto;
  padding: 80px 0 0;
  text-align: left;
  align-items: stretch;
  gap: 0;
}
body.unfolded .entrance h1 {
  font-size: 24px;
  text-shadow: none;
}
body.unfolded .entrance .tagline {
  display: none;
}
body.unfolded .entrance .scroll-cue {
  display: none;
}

/* Projects */
body.unfolded .sec.work {
  padding: 48px 0 48px;
  min-height: auto;
  align-items: stretch;
}
body.unfolded .work .label {
  background: none;
  padding: 0;
}
body.unfolded .pgrid {
  grid-template-columns: 1fr 1fr;
  max-width: none;
  gap: 14px;
  margin: 0;
}

/* Hide the separate about & signal sections — info is in the header now */
body.unfolded .sec.person {
  display: none;
}
body.unfolded .sec.signal {
  display: none;
}

body.unfolded .pcard {
  background: rgba(255, 255, 255, 0.025);
}

body.unfolded .sec:nth-child(1) {
  animation-delay: 0s;
}
body.unfolded .sec:nth-child(2) {
  animation-delay: 0.12s;
}
body.unfolded .sec:nth-child(3) {
  animation-delay: 0.24s;
}
body.unfolded .sec:nth-child(4) {
  animation-delay: 0.32s;
}

@keyframes unfoldIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* In Möbius (folded) mode, show big title + tagline, hide header cards */
body:not(.unfolded) .header-card {
  display: none;
}
body:not(.unfolded) .bio-card {
  display: none;
}
.mobius-title {
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--t1);
  line-height: 1.05;
  text-shadow: 0 0 60px rgba(139, 127, 232, 0.15);
}
/* In unfolded mode, hide the big Möbius title & tagline */
body.unfolded .mobius-title {
  display: none;
}
body.unfolded .entrance .tagline {
  display: none;
}

/* Responsive */
@media (max-width: 640px) {
  body.unfolded .pgrid {
    grid-template-columns: 1fr;
  }
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-card,
  .bio-card {
    padding: 22px 24px;
  }
}

@media (max-width: 640px) {
  .pgrid {
    grid-template-columns: 1fr;
  }
  .pd-tech-grid {
    grid-template-columns: 1fr;
  }
  #nav {
    right: 14px;
    gap: 10px;
  }
  .dot {
    width: 5px;
    height: 5px;
  }
  .person-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  #fold-toggle {
    right: 14px;
    top: 14px;
  }
}
