:root {
  --v11-klein: #002FA7;
  --v11-accent: #2855e8;
  --v11-accent-soft: rgba(40, 85, 232, .16);
  --v11-panel: rgba(12, 14, 18, .72);
  --v11-line: rgba(255, 255, 255, .13);
}

html { scroll-padding-top: 88px; }
body { background: #07080a; }

/* Clean, Codex-inspired interaction field: quiet until the pointer moves. */
.hero-title,
.hero-title * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.noise-overlay, #starfield { display: none !important; }
.vignette { opacity: .42; }
#bg-canvas {
  display: block !important;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .92;
  pointer-events: none;
}

#nav {
  top: 16px;
  left: 50%;
  width: min(calc(100% - 32px), 1440px);
  transform: translateX(-50%);
  border: 1px solid var(--v11-line);
  border-radius: 999px;
  background: rgba(7, 8, 10, .66);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .25);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}
.nav-brand {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--v11-accent);
  letter-spacing: -.04em;
}
.nav-item { border-radius: 999px; transition: color .25s ease, background .25s ease; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.08); }

.hero { min-height: 100svh; padding-top: 124px; }
.hero-left { max-width: 1300px; }
.hero-title { letter-spacing: -.075em; line-height: .82; }
.hero-title-line { filter: none; }
.hero-subtitle { max-width: 620px; color: rgba(255,255,255,.68); font-size: clamp(1rem, 1.45vw, 1.35rem); }
.hero-topline { color: var(--v11-accent); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 52px);
}
.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--v11-line);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.045);
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.hero-action.primary { color: #fff; border-color: var(--v11-accent); background: var(--v11-accent); }
.hero-action:hover { transform: translateY(-3px); background: rgba(255,255,255,.12); }
.hero-action.primary:hover { background: #3767ff; }

.section, .section-dark {
  position: relative;
  border-top: 1px solid rgba(255,255,255,.065);
  background: transparent !important;
}
.section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.012), transparent 170px);
}
.section-header { align-items: start; }
.section-header-main { text-wrap: balance; letter-spacing: -.055em; }
.section-header-desc { max-width: 42ch; color: rgba(255,255,255,.58); }
.section-num { color: var(--v11-accent); }

.download-grid { gap: 14px; }
.download-card {
  border: 1px solid var(--v11-line);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
}
.download-card:hover { border-color: rgba(40,85,232,.55); }
.download-arrow { color: var(--v11-accent); }

.page-figure, .page-cell {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
}
.page-figure img, .page-cell img {
  image-rendering: auto;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  transform: none;
  filter: none;
  transition: transform .7s cubic-bezier(.2,.75,.2,1), filter .4s ease;
}
.page-figure:hover img, .page-cell:hover img { transform: scale(1.012); }

.experience-accordion, .links-grid, .lab-gallery { position: relative; z-index: 2; }

.portfolio-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.portfolio-path {
  position: relative;
  display: flex;
  min-height: 330px;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(26px, 4vw, 54px);
  overflow: hidden;
  border: 1px solid var(--v11-line);
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.018));
  transition: transform .45s cubic-bezier(.2,.75,.2,1), border-color .3s ease;
}
.portfolio-path::before {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  right: -100px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(40,85,232,.22), transparent 68%);
  transition: transform .6s ease;
}
.portfolio-path:hover { transform: translateY(-7px); border-color: rgba(40,85,232,.5); }
.portfolio-path:hover::before { transform: scale(1.45); }
.portfolio-path h3 { max-width: 12ch; margin: 18px 0 10px; font-size: clamp(2rem, 4vw, 4rem); line-height: .95; letter-spacing: -.055em; }
.portfolio-path p { max-width: 42ch; color: rgba(255,255,255,.58); }
.path-index { color: var(--v11-accent); font: 600 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.path-arrow { margin-top: 32px; color: rgba(255,255,255,.85); }
.path-wide { grid-column: 1 / -1; min-height: 420px; }
.path-experiment { background: linear-gradient(145deg, rgba(76,115,255,.11), rgba(255,255,255,.018)); }
.path-platform { background: linear-gradient(145deg, rgba(0,47,167,.2), rgba(255,255,255,.018)); }

.ai-chat-toggle {
  border-color: rgba(40,85,232,.55) !important;
  background: rgba(8,10,18,.92) !important;
  box-shadow: 0 16px 50px rgba(0,0,0,.35), 0 0 0 1px rgba(40,85,232,.12);
}
.ai-chat-toggle-icon, .ai-chat-avatar {
  display: grid !important;
  place-items: center;
  color: #fff !important;
  background: var(--v11-accent) !important;
  font-weight: 800;
}
.ai-chat-toggle-icon {
  position: relative;
  width: 27px !important;
  height: 27px !important;
  overflow: hidden;
  border: 1px solid rgba(125,153,255,.82);
  border-radius: 7px;
  animation: corePulse 2.8s ease-in-out infinite !important;
  box-shadow: inset 0 0 8px rgba(255,255,255,.34), 0 0 12px rgba(40,85,232,.35);
}
.ai-chat-toggle-icon::before {
  content: '';
  position: absolute;
  inset: -14px;
  z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 38%, #dce5ff 47%, #4b72ff 53%, transparent 62% 100%);
  animation: currentFlow 4.6s linear infinite;
}
.ai-chat-toggle-icon::after {
  content: '';
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: 4px;
  background: #2855e8;
}
.ai-chat-avatar { border-radius: 11px !important; box-shadow: 0 0 18px rgba(40,85,232,.3); }
@keyframes currentFlow { to { transform: rotate(360deg); } }
@keyframes corePulse {
  0%, 100% { filter: brightness(.86); box-shadow: inset 0 0 6px rgba(255,255,255,.2), 0 0 8px rgba(40,85,232,.24); }
  50% { filter: brightness(1.15); box-shadow: inset 0 0 11px rgba(255,255,255,.48), 0 0 19px rgba(40,85,232,.58); }
}
.ai-chat-panel { border-color: rgba(40,85,232,.32) !important; }
.ai-chat-input button, .ai-suggestion:hover { color: #fff !important; background: var(--v11-accent) !important; }

.platform-grid { grid-template-columns: 1fr; max-width: 1280px; }
.platform-card {
  min-height: min(58vh, 680px);
  justify-content: flex-end;
  padding: clamp(32px, 6vw, 84px);
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 16%, rgba(40,85,232,.2), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.018));
}
.platform-card h3 { max-width: 10ch; font-size: clamp(3rem, 8vw, 7rem); line-height: .88; letter-spacing: -.07em; }
.platform-card .link-desc { max-width: 46ch; font-size: clamp(1rem, 1.6vw, 1.3rem); }
.platform-card .link-url { color: var(--v11-accent); }

.lab-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.lab-item {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--v11-line);
  border-radius: 18px;
  background: #111318;
}
.lab-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.75,.2,1); }
.lab-item:hover img { transform: scale(1.045); }
.lab-item-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 64px 20px 20px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.84));
}
.lab-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.lab-filter {
  padding: 10px 16px;
  border: 1px solid var(--v11-line);
  border-radius: 999px;
  color: rgba(255,255,255,.7);
  background: transparent;
  cursor: pointer;
}
.lab-filter.active, .lab-filter:hover { color: #fff; border-color: var(--v11-accent); background: var(--v11-accent); }

.reveal-v11 { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.75,.2,1); }
.reveal-v11.is-visible { opacity: 1; transform: none; }

:focus-visible { outline: 2px solid var(--v11-accent); outline-offset: 4px; }

@media (max-width: 900px) {
  #nav { top: 10px; width: calc(100% - 20px); border-radius: 22px; }
  .hero { padding-top: 104px; }
  .hero-title { letter-spacing: -.055em; }
  .hero-bottomline, .hero-corner { display: none; }
  .lab-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-item { min-height: 260px; }
}

@media (max-width: 600px) {
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-action { width: 100%; }
  .lab-gallery { grid-template-columns: 1fr; }
  .lab-item { min-height: 420px; }
  .ai-chat-panel { width: calc(100vw - 24px); right: 12px; bottom: 86px; }
  .portfolio-paths { grid-template-columns: 1fr; }
  .path-wide { grid-column: auto; min-height: 360px; }
  .portfolio-path { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #bg-canvas, #starfield, .cursor-dot, .cursor-glow { display: none !important; }
  .reveal-v11 { opacity: 1; transform: none; }
}

/* ===== Portfolio system pass: type, space, color, motion ===== */
:root {
  --zz-blue-900: #00154f;
  --zz-blue-700: #002fa7;
  --zz-blue-500: #2855e8;
  --zz-blue-300: #7894ff;
  --zz-ink-950: #050712;
  --zz-ink-900: #090c16;
  --zz-ink-800: #101522;
  --zz-white: #f5f7ff;
  --zz-muted: rgba(226, 231, 247, .62);
  --zz-hairline: rgba(205, 215, 255, .12);
  --zz-focus: #8aa2ff;
  --zz-font-display: "Bahnschrift SemiCondensed", "Arial Narrow", "Microsoft YaHei", sans-serif;
  --zz-font-body: "Microsoft YaHei UI", "PingFang SC", "Source Han Sans SC", system-ui, sans-serif;
  --zz-font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --zz-type-caption: .75rem;
  --zz-type-small: .875rem;
  --zz-type-body: clamp(1rem, .96rem + .16vw, 1.125rem);
  --zz-type-h3: clamp(1.5rem, 1.15rem + 1.25vw, 2.25rem);
  --zz-type-h2: clamp(2.5rem, 1.7rem + 3vw, 5.5rem);
  --zz-type-display: clamp(4.75rem, 1.4rem + 12vw, 13rem);
  --zz-space-1: .25rem;
  --zz-space-2: .5rem;
  --zz-space-3: .75rem;
  --zz-space-4: 1rem;
  --zz-space-6: 1.5rem;
  --zz-space-8: 2rem;
  --zz-space-12: 3rem;
  --zz-space-16: 4rem;
  --zz-section: clamp(5rem, 2.4rem + 7vw, 10rem);
  --zz-container: 1440px;
  --zz-radius-sm: 10px;
  --zz-radius-md: 16px;
  --zz-radius-lg: 24px;
  --zz-fast: 140ms;
  --zz-normal: 260ms;
  --zz-cinematic: 620ms;
  --zz-ease-out: cubic-bezier(.16, 1, .3, 1);
  --zz-ease-move: cubic-bezier(.65, 0, .35, 1);
}

html { background: var(--zz-ink-950); }
body {
  color: var(--zz-white);
  background: var(--zz-ink-950);
  font-family: var(--zz-font-body);
  font-size: var(--zz-type-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { color: #fff; background: var(--zz-blue-700); }
a, button, input { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--zz-focus) !important;
  outline-offset: 4px;
}

#scroll-progress {
  height: 2px;
  background: linear-gradient(90deg, var(--zz-blue-700), var(--zz-blue-300));
  box-shadow: 0 0 18px rgba(40, 85, 232, .55);
}

#nav {
  height: 64px;
  padding-inline: clamp(12px, 2.5vw, 34px);
  border-color: var(--zz-hairline);
  background: rgba(5, 7, 18, .76);
  transition: opacity var(--zz-normal) ease, transform var(--zz-normal) var(--zz-ease-out), border-color var(--zz-normal) ease;
}
.nav-brand { width: 38px; height: 38px; color: #fff; font: 700 14px/1 var(--zz-font-display); background: var(--zz-blue-700); }
.nav-item { min-height: 38px; display: inline-flex; align-items: center; padding-inline: 14px; font: 500 12px/1 var(--zz-font-body); letter-spacing: .02em; }
.nav-item:hover { background: rgba(40, 85, 232, .1); }
.nav-item.active { color: #fff; background: rgba(40, 85, 232, .18); box-shadow: inset 0 0 0 1px rgba(120,148,255,.2); }

.hero { padding-inline: clamp(24px, 5vw, 80px); }
.hero-left { width: min(100%, var(--zz-container)); }
.hero-topline, .hero-bottomline, .hero-corner, .section-title, .section-num, .grid-label-text, .download-label, .download-num {
  font-family: var(--zz-font-mono);
  letter-spacing: .08em;
}
.hero-topline { font-size: var(--zz-type-caption); color: var(--zz-blue-300); }
.hero-title { font-family: var(--zz-font-display); font-size: var(--zz-type-display); font-weight: 650; line-height: .79; letter-spacing: -.07em; }
.hero-subtitle { margin-top: var(--zz-space-8); font-size: var(--zz-type-body); line-height: 1.6; letter-spacing: .01em; }
.hero-actions { gap: var(--zz-space-3); margin-top: var(--zz-space-12); }
.hero-action { min-height: 48px; padding-inline: 22px; font-size: var(--zz-type-small); transition-duration: var(--zz-fast); }
.hero-action:hover { transform: translateY(-2px); }
.hero-action:active { transform: translateY(0) scale(.985); }
.hero-action.primary { background: var(--zz-blue-700); }
.hero-action.primary:hover { background: var(--zz-blue-500); box-shadow: 0 10px 34px rgba(0,47,167,.25); }
.hero-bottomline, .hero-corner { color: rgba(226,231,247,.46); font-size: var(--zz-type-caption); }
.scroll-label { font: 500 10px/1 var(--zz-font-mono); letter-spacing: .16em; }
.scroll-dot { background: var(--zz-blue-300); }

.section, .section-dark { padding: var(--zz-section) clamp(24px, 5vw, 80px); }
.section-header, .page-stack, .masonry-grid, .download-grid, .experience-accordion, .experience-accordion-hint {
  width: min(100%, var(--zz-container));
  margin-inline: auto;
}
.section-header { gap: var(--zz-space-16); margin-bottom: clamp(3rem, 2rem + 3vw, 6rem); }
.section-header-left { min-width: clamp(180px, 22vw, 320px); }
.section-num { color: var(--zz-blue-300); font-size: var(--zz-type-caption); }
.section-title { font-size: var(--zz-type-caption); color: rgba(226,231,247,.62); }
.section-header-main { font-family: var(--zz-font-display); font-size: var(--zz-type-h2); font-weight: 550; line-height: .92; letter-spacing: -.045em; }
.section-header-desc { max-width: 52ch; margin-top: var(--zz-space-6); color: var(--zz-muted); font-size: var(--zz-type-body); line-height: 1.75; }

.page-figure, .page-cell {
  border-radius: var(--zz-radius-md);
  border-color: var(--zz-hairline);
  background: var(--zz-ink-900);
  box-shadow: 0 24px 90px rgba(0,0,0,.2);
  transition: transform var(--zz-normal) var(--zz-ease-out), border-color var(--zz-normal) ease, box-shadow var(--zz-normal) ease;
}
.page-figure.revealed:hover, .page-cell.revealed:hover { transform: translateY(-3px); border-color: rgba(120,148,255,.3); box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.page-figure.revealed:hover img, .page-cell.revealed:hover img { transform: scale(1.012); }
.page-figure img, .page-cell img { transition-duration: var(--zz-cinematic); transition-timing-function: var(--zz-ease-out); }

.download-grid { gap: var(--zz-space-4); }
.download-card { min-height: 190px; padding: clamp(24px, 3vw, 40px); border-radius: var(--zz-radius-lg); background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(0,47,167,.045)); }
.download-card:hover { transform: translateY(-4px); border-color: rgba(120,148,255,.35); box-shadow: 0 26px 70px rgba(0,0,0,.24); }
.download-title { font-family: var(--zz-font-display); font-size: var(--zz-type-h3); font-weight: 550; letter-spacing: -.025em; }
.download-meta { color: var(--zz-muted); font-size: var(--zz-type-small); }
.download-arrow { color: var(--zz-blue-300); }

.experience-accordion-hint { margin-top: var(--zz-space-12); color: var(--zz-muted); font-size: var(--zz-type-small); }
.accordion-item { border-color: var(--zz-hairline); }
.accordion-header { min-height: 72px; }
.accordion-title { font-family: var(--zz-font-display); letter-spacing: -.015em; }

.ai-chat-toggle { min-height: 48px; border-radius: 999px !important; }
.ai-chat-panel { border-radius: var(--zz-radius-lg) !important; background: rgba(8,11,22,.94) !important; box-shadow: 0 30px 100px rgba(0,0,0,.48) !important; backdrop-filter: blur(24px); }
.ai-message-bubble { line-height: 1.65; }
.ai-suggestion { min-height: 40px; border-radius: 999px !important; }
.ai-chat-input input { min-height: 46px; font-size: 16px; }
.ai-chat-input button { width: 46px; height: 46px; }

.reveal-v11 { transform: translateY(18px); transition: opacity var(--zz-cinematic) ease, transform var(--zz-cinematic) var(--zz-ease-out); }
.footer { border-color: var(--zz-hairline); color: rgba(226,231,247,.55); font-size: var(--zz-type-small); }

@media (max-width: 900px) {
  #nav { top: 10px; width: calc(100% - 20px); }
  .nav-items { gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .nav-items::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; padding-inline: 11px; }
  .hero { padding-top: 108px; }
  .hero-title { line-height: .83; }
  .hero-bottomline, .hero-corner { display: none; }
  .section-header { display: grid; gap: var(--zz-space-8); }
  .section-header-left { min-width: 0; }
  .section-header-main { font-size: clamp(2.5rem, 11vw, 4.5rem); }
}

@media (max-width: 560px) {
  .nav-brand { display: none; }
  #nav { justify-content: center; padding-inline: 8px; }
  .hero-title { font-size: clamp(4.2rem, 23vw, 7rem); }
  .hero-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .hero-action { width: 100%; }
  .section, .section-dark { padding-inline: 20px; }
  .download-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== Monochrome direction: preserve system, remove chromatic accent ===== */
:root {
  --v11-klein: #ffffff;
  --v11-accent: #f2f2f2;
  --v11-accent-soft: rgba(255,255,255,.12);
  --zz-blue-900: #171717;
  --zz-blue-700: #f2f2f2;
  --zz-blue-500: #ffffff;
  --zz-blue-300: #c9c9c9;
  --zz-ink-950: #050505;
  --zz-ink-900: #090909;
  --zz-ink-800: #111111;
  --zz-focus: #ffffff;
  --zz-white: #f4f4f4;
  --zz-muted: rgba(244,244,244,.58);
  --zz-hairline: rgba(255,255,255,.12);
}

#bg-canvas { filter: none; opacity: .58; }
body { background: #050505 !important; }
.section, .section-dark { background-color: transparent !important; }
#scroll-progress { background: linear-gradient(90deg, rgba(255,255,255,.32), #fff); box-shadow: 0 0 14px rgba(255,255,255,.22); }
.hero-topline, .section-num, .download-arrow, .platform-card .link-url { color: rgba(255,255,255,.72); }
.scroll-dot { background: #fff; }
.hero-action.primary { color: #07080a; border-color: #f2f2f2; background: #f2f2f2; }
.hero-action.primary:hover { color: #000; background: #fff; box-shadow: 0 10px 34px rgba(255,255,255,.08); }
.nav-brand { color: #07080a; background: #f2f2f2; }
.nav-item:hover { background: rgba(255,255,255,.07); }
.nav-item.active { background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.page-figure.revealed:hover, .page-cell.revealed:hover, .download-card:hover { border-color: rgba(255,255,255,.28); }
.download-card { background: linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.018)); }
.portfolio-path::before { background: radial-gradient(circle, rgba(255,255,255,.1), transparent 68%); }
.portfolio-path:hover { border-color: rgba(255,255,255,.3); }
.path-platform, .path-experiment { background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)); }
.ai-chat-toggle { border-color: rgba(255,255,255,.28) !important; background: rgba(9,9,11,.92) !important; box-shadow: 0 16px 50px rgba(0,0,0,.38), 0 0 0 1px rgba(255,255,255,.05); }
.ai-chat-toggle-icon, .ai-chat-avatar { color: #07080a !important; background: #f2f2f2 !important; }
.ai-chat-toggle-icon { border-color: rgba(255,255,255,.8); box-shadow: inset 0 0 8px rgba(255,255,255,.5), 0 0 12px rgba(255,255,255,.12); }
.ai-chat-toggle-icon::before { background: conic-gradient(from 0deg, transparent 0 38%, #fff 47%, #777 53%, transparent 62% 100%); }
.ai-chat-toggle-icon::after { background: #f2f2f2; }
.ai-chat-avatar { box-shadow: 0 0 18px rgba(255,255,255,.1); }
@keyframes corePulse {
  0%, 100% { filter: brightness(.88); box-shadow: inset 0 0 6px rgba(255,255,255,.24), 0 0 8px rgba(255,255,255,.09); }
  50% { filter: brightness(1.08); box-shadow: inset 0 0 11px rgba(255,255,255,.56), 0 0 18px rgba(255,255,255,.2); }
}
.ai-chat-panel { border-color: rgba(255,255,255,.16) !important; }
.ai-chat-input button, .ai-suggestion:hover { color: #07080a !important; background: #f2f2f2 !important; }
.lab-filter.active, .lab-filter:hover { color: #07080a; border-color: #f2f2f2; background: #f2f2f2; }
:where(a, button, input, [tabindex]):focus-visible { outline-color: #fff !important; }

/* Klein blue appears only as a momentary title interaction. */
.hero-char {
  transition: color 140ms ease, text-shadow 180ms ease, transform 250ms var(--ease-spring), filter 250ms ease;
}
.hero-char:hover,
.hero-char.is-code-active {
  color: #1947d1;
  text-shadow: 0 0 14px rgba(30, 73, 220, .32), 0 0 34px rgba(0, 47, 167, .16);
}
#hero-code-canvas {
  position: fixed;
  inset: 0;
  z-index: 24;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce), (hover: none) {
  #hero-code-canvas { display: none; }
  .hero-char:hover, .hero-char.is-code-active { text-shadow: none; }
}

/* ===== Editorial refinement: hierarchy, entry cover, mobile & rendering ===== */
.password-gate {
  padding: 24px;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #050505;
  background-size: 72px 72px;
}
.password-gate::before,
.password-gate::after {
  content: "";
  position: absolute;
  width: 56px;
  height: 56px;
  border-color: rgba(255,255,255,.28);
  pointer-events: none;
}
.password-gate::before { top: 24px; left: 24px; border-top: 1px solid; border-left: 1px solid; }
.password-gate::after { right: 24px; bottom: 24px; border-right: 1px solid; border-bottom: 1px solid; }
.password-gate-content { width: min(620px, 100%); text-align: left; }
.password-gate-mark { margin: 0 0 42px; }
.password-gate-kicker {
  margin: 0 0 18px;
  color: rgba(255,255,255,.48);
  font: 500 11px/1 var(--zz-font-mono);
  letter-spacing: .16em;
}
.password-gate-title {
  margin-bottom: 28px;
  font-size: clamp(4rem, 11vw, 8.5rem);
  font-weight: 650;
  line-height: .78;
  letter-spacing: -.075em;
}
.password-gate-subtitle { margin-bottom: 28px; color: rgba(255,255,255,.58); letter-spacing: .03em; }
.password-form { width: min(480px, 100%); }
.password-input { min-width: 0; min-height: 52px; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.025); font-size: 16px; }
.password-submit { min-height: 52px; padding-inline: 28px; }

.ai-chat-toggle-icon,
.ai-chat-avatar {
  font-family: var(--zz-font-display) !important;
  font-weight: 800 !important;
  font-style: italic;
  letter-spacing: -.08em;
}
.ai-chat-toggle-icon::after { z-index: -1; }

.section:not(#resume) { content-visibility: visible; contain: none; }
.page-cell { content-visibility: visible; contain: none; }
.page-cell img { background: #0b0b0b; }
.section-header-main { max-width: 10ch; text-wrap: balance; }
.section-header-desc { text-wrap: pretty; }
.masonry-grid { row-gap: clamp(16px, 2vw, 28px); }

@media (max-width: 900px) {
  #nav { overflow: hidden; }
  .nav-items { overscroll-behavior-inline: contain; scroll-snap-type: x proximity; }
  .nav-item { scroll-snap-align: start; }
  .page-figure, .page-cell { border-radius: 10px; }
}

@media (max-width: 560px) {
  .hero { min-height: 100svh; padding: 104px 20px 72px; }
  .hero-title { font-size: clamp(3.85rem, 21vw, 6.2rem); line-height: .82; }
  .hero-subtitle { max-width: 19em; margin-top: 24px; line-height: 1.75; }
  .hero-actions { margin-top: 34px; }
  .section, .section-dark { padding-block: clamp(76px, 22vw, 110px); }
  .section-header { margin-bottom: 42px; }
  .section-header-main { font-size: clamp(2.7rem, 13vw, 4rem); line-height: .9; }
  .section-header-desc { margin-top: 18px; font-size: .95rem; }
  .download-card { min-height: 154px; border-radius: 16px; }
  .ai-chat-widget { z-index: 120; }
  .ai-chat-panel { max-height: min(620px, calc(100svh - 108px)); }
  .password-gate { padding: 20px; background-size: 48px 48px; }
  .password-gate::before { top: 16px; left: 16px; }
  .password-gate::after { right: 16px; bottom: 16px; }
  .password-gate-mark { margin-bottom: 32px; }
  .password-gate-title { font-size: clamp(3.9rem, 22vw, 6rem); }
}

@media (max-width: 380px) {
  .hero-title { font-size: 3.65rem; }
  .hero-topline { gap: 8px; }
  .nav-item { padding-inline: 9px; font-size: 11px; }
}

@media (prefers-reduced-data: reduce) {
  #bg-canvas, #hero-code-canvas, .noise-overlay, .vignette { display: none !important; }
  .page-cell img { transition: none !important; }
}

/* ===== Refine C: restore the signature page lift, simplify identity ===== */
#nav {
  width: auto;
  max-width: calc(100% - 32px);
  height: 58px;
  padding-inline: 6px;
  border: 0;
  border-radius: 0;
  background: rgba(5,5,5,.34);
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-items { gap: clamp(2px, 1.2vw, 18px); }
.nav-item {
  position: relative;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
.nav-item::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 5px;
  left: 14px;
  height: 1px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 240ms var(--zz-ease-out);
}
.nav-item:hover::after,
.nav-item.active::after { transform: scaleX(1); transform-origin: left; }

.ai-chat-toggle-icon,
.ai-chat-avatar {
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-style: normal;
  line-height: 1 !important;
  text-align: center;
  text-indent: 0;
  letter-spacing: 0;
}
.ai-chat-toggle-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
}
.ai-chat-toggle-icon::after { border-radius: 50%; }
.ai-chat-avatar { width: 38px; height: 38px; }

.hero-char:hover,
.hero-char.is-code-active {
  color: #fff;
  text-shadow: 0 0 14px rgba(255,255,255,.26), 0 0 34px rgba(255,255,255,.1);
}

.page-stack,
.masonry-grid { overflow: visible; }
.page-figure,
.page-cell { position: relative; isolation: isolate; }
.page-figure.revealed:hover,
.page-cell.revealed:hover {
  z-index: 30;
  overflow: visible;
  transform: translateY(-8px);
  border-color: rgba(255,255,255,.34);
  box-shadow: 0 46px 120px rgba(0,0,0,.72), 0 0 0 1px rgba(255,255,255,.12);
}
.page-figure.revealed:hover img,
.page-cell.revealed:hover img {
  position: relative;
  z-index: 2;
  transform: scale(1.08);
  border-radius: 8px;
  box-shadow: 0 36px 100px rgba(0,0,0,.66);
}

@media (max-width: 900px) {
  #nav { width: auto; max-width: calc(100% - 20px); overflow: hidden; }
  .nav-items { padding-inline: 2px; }
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .page-figure.revealed:hover,
  .page-cell.revealed:hover { transform: none; overflow: hidden; box-shadow: 0 24px 90px rgba(0,0,0,.2); }
  .page-figure.revealed:hover img,
  .page-cell.revealed:hover img { transform: none; box-shadow: none; }
}

/* ===== Breakout D: the hovered sheet leaves its frame physically ===== */
.page-cell {
  content-visibility: visible !important;
  contain: none !important;
  clip-path: none !important;
}
.page-figure,
.page-cell,
.page-figure picture,
.page-cell picture {
  overflow: visible !important;
}
.page-figure picture,
.page-cell picture {
  position: relative;
  z-index: 1;
  display: block;
  transform: none;
  transform-origin: 50% 50%;
  transition: transform 560ms cubic-bezier(.16,1,.3,1), filter 360ms ease;
}
.page-figure.revealed:hover,
.page-cell.revealed:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.page-figure.revealed:hover picture,
.page-cell.revealed:hover picture {
  z-index: 50;
  transform: translate3d(0,-10px,0) scale(1.11);
  filter: drop-shadow(0 42px 46px rgba(0,0,0,.72));
}
.page-figure.revealed:hover img,
.page-cell.revealed:hover img {
  transform: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.16);
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .page-figure.revealed:hover picture,
  .page-cell.revealed:hover picture { transform: none; filter: none; }
}

/* ===== Nav grid E: identity left, navigation right ===== */
#nav {
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  max-width: none;
  height: 76px;
  padding-inline: clamp(24px, 5vw, 80px);
  transform: none;
  background: linear-gradient(180deg, rgba(5,5,5,.76), rgba(5,5,5,.18));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-brand {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  color: #080808;
  background: #f4f4f4;
  font: 800 16px/1 var(--zz-font-display);
  letter-spacing: 0;
  transition: color 180ms ease, background 180ms ease, transform 240ms var(--zz-ease-out);
}
.nav-brand:hover { color: #fff; background: #090909; transform: rotate(-8deg); }
.nav-items { margin-left: auto; justify-content: flex-end; }

@media (max-width: 900px) {
  #nav {
    width: 100%;
    max-width: none;
    height: 68px;
    padding-inline: 20px;
    overflow: visible;
  }
  .nav-brand { display: grid; width: 36px; height: 36px; }
  .nav-items {
    top: 68px;
    padding: 28px 24px;
    overflow-y: auto;
    background: rgba(5,5,5,.97);
  }
  .nav-item { padding: 16px 0; }
}

/* ===== Nav fix F: persistent identity + truly centered access cover ===== */
#nav {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}
.nav-brand {
  opacity: 1 !important;
  visibility: visible !important;
}
.password-gate { min-height: 100svh; }
.password-gate-content {
  width: min(620px, calc(100vw - 40px));
  max-width: 620px;
  padding: 40px 20px;
  margin: auto;
  text-align: center;
}
.password-gate-mark { margin: 0 auto 42px; }
.password-gate-kicker,
.password-gate-title,
.password-gate-subtitle { text-align: center; }
.password-gate-subtitle { max-width: 34em; margin-right: auto; margin-left: auto; }
.password-form { width: min(480px, 100%); margin-right: auto; margin-left: auto; }
.password-error { text-align: center; }

@media (max-width: 560px) {
  .password-gate-content { width: min(100%, 440px); padding-inline: 8px; }
  .password-gate-mark { margin-right: auto; margin-left: auto; }
}

/* ===== Performance pass: keep the visual language, reduce compositor cost ===== */
.page-cell img,
.page-figure img {
  background: #090909;
  image-rendering: auto;
}

.page-cell:not(.image-ready) img {
  opacity: .001;
}

.page-cell.image-ready img {
  opacity: 1;
  transition: opacity 180ms ease;
}

@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  #nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(5,5,5,.96);
  }

  .page-figure picture,
  .page-cell picture,
  .page-figure img,
  .page-cell img {
    filter: none !important;
    transition-duration: 160ms !important;
  }
}

/* ===== Interaction 2026-07-17: portfolio breakout + movable AI workspace ===== */
/* The portfolio hover is independent from scroll/reveal state. This keeps the
   signature lift reliable in Edge and on hybrid pointer devices. */
#graduate .masonry-grid .page-cell,
#undergrad .masonry-grid .page-cell {
  aspect-ratio: 3368 / 1191;
}

#graduate .masonry-grid .page-cell picture,
#undergrad .masonry-grid .page-cell picture,
#graduate .masonry-grid .page-cell img,
#undergrad .masonry-grid .page-cell img {
  width: 100%;
  height: 100%;
}

.masonry-grid,
.page-stack,
.page-stack-single,
#graduate,
#undergrad {
  overflow: visible !important;
  contain: none !important;
}

.page-figure,
.page-cell {
  z-index: 1;
  overflow: visible !important;
  contain: none !important;
  isolation: auto !important;
  transform-origin: 50% 50%;
}

.page-figure picture,
.page-cell picture {
  z-index: 1;
  overflow: visible !important;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 50% 50%;
  transition:
    transform 520ms cubic-bezier(.16, 1, .3, 1),
    filter 360ms ease;
  will-change: auto;
}

@media (any-hover: hover) {
  .page-figure:hover,
  .page-cell:hover {
    z-index: 80 !important;
    overflow: visible !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }

  .page-figure:hover picture,
  .page-cell:hover picture {
    z-index: 81 !important;
    transform: translate3d(0, -14px, 0) scale(1.14) !important;
    filter: drop-shadow(0 44px 56px rgba(0, 0, 0, .76)) !important;
    will-change: transform;
  }

  .page-figure:hover img,
  .page-cell:hover img {
    transform: none !important;
    border-radius: 7px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) !important;
  }
}

.ai-chat-panel {
  position: fixed !important;
  right: 28px;
  bottom: 28px;
  width: clamp(380px, 34vw, 560px);
  height: min(620px, calc(100svh - 56px));
  min-width: 340px;
  min-height: 420px;
  max-width: calc(100vw - 24px);
  max-height: calc(100svh - 24px);
  resize: both;
  overflow: hidden !important;
}

.ai-chat-panel::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 20;
  width: 13px;
  height: 13px;
  pointer-events: none;
  opacity: .58;
  background: linear-gradient(135deg,
    transparent 0 42%, rgba(255,255,255,.7) 43% 50%,
    transparent 51% 65%, rgba(255,255,255,.7) 66% 73%, transparent 74%);
}

.ai-chat-header {
  flex: 0 0 auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.ai-chat-panel.is-dragging {
  transition: none !important;
  box-shadow: 0 38px 120px rgba(0,0,0,.72) !important;
}

.ai-chat-panel.is-dragging .ai-chat-header { cursor: grabbing; }
.ai-chat-header button,
.ai-chat-header a { cursor: pointer; }

.ai-chat-messages {
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ai-message-bubble {
  max-width: min(88%, 720px);
}

@media (max-width: 700px) {
  .ai-chat-panel {
    position: fixed !important;
    right: 12px !important;
    bottom: 82px !important;
    left: 12px !important;
    top: auto !important;
    width: auto !important;
    height: min(72svh, 620px) !important;
    min-width: 0;
    min-height: 360px;
    max-width: none;
    max-height: calc(100svh - 100px);
    resize: none;
  }

  .ai-chat-header { cursor: default; touch-action: auto; }
  .ai-chat-panel::after { display: none; }
}

@media (prefers-reduced-motion: reduce) and (any-hover: hover) {
  .page-figure:hover picture,
  .page-cell:hover picture {
    transform: translate3d(0, -8px, 0) scale(1.1) !important;
  }
}

/* Detailed resume portal: overview stays here, depth lives on resume.html. */
.resume-portal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(420px, 1.18fr);
  width: min(100%, 1480px);
  min-height: 620px;
  margin: clamp(58px, 7vw, 104px) auto 52px;
  color: #080808;
  background: #f3f3ef;
  border: 1px solid rgba(255,255,255,.32);
  overflow: hidden;
  text-decoration: none;
  isolation: isolate;
}

.resume-portal-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(34px, 5vw, 72px);
  border-right: 1px solid rgba(8,8,8,.18);
}

.resume-portal-brand { position: relative; width: 82px; height: 58px; margin-bottom: 46px; }
.resume-portal-brand i { position: absolute; left: 2px; width: 78px; height: 9px; border-radius: 99px; background: currentColor; }
.resume-portal-brand i:nth-child(1) { top: 2px; }
.resume-portal-brand i:nth-child(2) { top: 24px; transform: rotate(-20deg); }
.resume-portal-brand i:nth-child(3) { bottom: 2px; }
.resume-portal-kicker { display: block; margin-bottom: 22px; color: #696963; font: 10px/1.4 "SFMono-Regular", Consolas, monospace; letter-spacing: .13em; }
.resume-portal h3 { margin: 0; font-size: clamp(42px, 5vw, 74px); line-height: .98; letter-spacing: -.065em; font-weight: 500; }
.resume-portal p { max-width: 570px; margin: 30px 0 0; color: #4b4b47; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.8; }
.resume-portal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.resume-portal-tags span { padding: 7px 11px; border: 1px solid rgba(8,8,8,.25); font-size: 11px; line-height: 1; }
.resume-portal-action { display: flex; align-items: center; justify-content: space-between; margin-top: 48px; padding-top: 18px; border-top: 1px solid #080808; font-size: 13px; }
.resume-portal-action b { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #080808; border-radius: 50%; font-size: 20px; font-weight: 400; transition: transform .35s cubic-bezier(.22,1,.36,1), background .25s ease, color .25s ease; }
.resume-portal-preview { position: relative; min-height: 620px; margin: 0; padding: clamp(28px, 4vw, 54px); background: #d9dad6; overflow: hidden; }
.resume-portal-preview::before { content: ""; position: absolute; inset: 0; opacity: .32; background-image: linear-gradient(rgba(0,0,0,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.12) 1px, transparent 1px); background-size: 42px 42px; }
.resume-portal-preview img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; max-height: 590px; object-fit: contain; filter: drop-shadow(0 22px 42px rgba(0,0,0,.18)); transition: transform .5s cubic-bezier(.22,1,.36,1); }
.resume-portal-preview figcaption { position: absolute; z-index: 2; right: 18px; bottom: 13px; margin: 0; color: #5f5f5a; font: 9px/1.4 "SFMono-Regular", Consolas, monospace; letter-spacing: .11em; }

@media (any-hover: hover) {
  .resume-portal:hover .resume-portal-preview img { transform: translateY(-6px) scale(1.025); }
  .resume-portal:hover .resume-portal-action b { color: #fff; background: #080808; transform: rotate(45deg); }
}

@media (max-width: 860px) {
  .resume-portal { grid-template-columns: 1fr; width: 100%; min-height: 0; }
  .resume-portal-copy { min-height: 520px; border-right: 0; border-bottom: 1px solid rgba(8,8,8,.18); }
  .resume-portal-preview { min-height: 500px; }
  .resume-portal-preview img { max-height: 520px; }
}

@media (max-width: 520px) {
  .resume-portal { margin-top: 42px; }
  .resume-portal-copy { min-height: 500px; padding: 28px 22px; }
  .resume-portal h3 { font-size: 46px; }
  .resume-portal-preview { min-height: 420px; padding: 24px 16px 36px; }
  .resume-portal-preview img { max-height: 430px; }
}
