:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #62676f;
  --paper: #f8f7f4;
  --line: rgba(23, 23, 23, 0.12);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --teal: #207d7a;
  --green: #3e9858;
  --blue: #146fd7;
  --rose: #b95f9d;
  --amber: #c19433;
  --shadow: 0 24px 80px rgba(33, 34, 37, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #fbfbfa;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#fluid {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  opacity: 0.16;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 28px;
  left: 28px;
  display: flex;
  width: auto;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transform: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 14px 8px 10px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #111;
  color: #fff;
  font-size: 0.78rem;
}

.socials {
  display: none;
  align-items: center;
  gap: 4px;
}

.socials a {
  border-radius: 999px;
  padding: 9px 12px;
  color: #383b40;
  font-size: 0.86rem;
  font-weight: 650;
  transition: background 0.2s ease, color 0.2s ease;
}

.socials a:hover {
  background: #111;
  color: #fff;
}

.page-shell {
  position: relative;
  width: min(980px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 104px 0 48px;
}

.page-shell.chat-mode {
  width: min(1040px, calc(100% - 32px));
  padding: 24px 0 0;
}

.watermark {
  position: fixed;
  right: 8vw;
  bottom: -10vw;
  z-index: -1;
  color: rgba(17, 17, 17, 0.035);
  font-size: clamp(7rem, 22vw, 20rem);
  font-weight: 950;
  line-height: 0.8;
  pointer-events: none;
  user-select: none;
}

.hero {
  display: flex;
  min-height: auto;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.chat-mode .hero,
.chat-mode .watermark,
.chat-mode .folder-section {
  display: none;
}

.hero-copy,
.assistant-panel,
.portfolio-folder,
.portrait-wrap {
  animation: lift-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.assistant-panel {
  animation-delay: 0.12s;
}

.portfolio-folder:nth-child(2) {
  animation-delay: 0.08s;
}

.portfolio-folder:nth-child(3) {
  animation-delay: 0.16s;
}

.logo-chip,
.greeting,
.eyebrow {
  letter-spacing: 0;
}

.logo-chip {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin: 0 auto 14px;
  border: 0;
  border-radius: 19px;
  background: #fff;
  color: #070707;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.18s ease;
}

.logo-chip:active {
  transform: scale(0.95);
}

.greeting {
  margin: 0 0 8px;
  color: #24262b;
  font-size: clamp(1.28rem, 2.2vw, 1.7rem);
  font-weight: 800;
  line-height: 1.15;
}

.eyebrow {
  margin: 22px 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 0;
  font-size: clamp(4rem, 7.6vw, 6.05rem);
  font-weight: 850;
  line-height: 0.95;
  letter-spacing: 0;
}

.intro {
  max-width: 680px;
  margin-bottom: 0;
  color: #3d4148;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.58;
}

.portrait-wrap {
  position: relative;
  display: grid;
  width: min(280px, 52vw);
  min-height: 220px;
  place-items: center;
  cursor: grab;
  touch-action: none;
  animation: none;
  transform: translate3d(var(--avatar-x, 0), var(--avatar-y, 0), 0);
  transition: filter 0.2s ease;
  will-change: transform;
}

.portrait-wrap::before {
  content: none;
}

.portrait {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.34);
  filter: saturate(0.95);
}

.portrait-wrap.is-dragging {
  z-index: 12;
  cursor: grabbing;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.16));
}

.avatar3d {
  position: relative;
  overflow: visible;
  user-select: none;
}

.avatar3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.32s ease;
}

.avatar3d.is-ready canvas {
  opacity: 1;
}

.avatar3d::after {
  position: absolute;
  inset: auto 18% 5% 18%;
  z-index: -1;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17, 17, 17, 0.12), transparent 68%);
  filter: blur(10px);
  content: "";
  pointer-events: none;
}

.avatar3d--small::after {
  inset: auto 20% -8% 20%;
  height: 26%;
  opacity: 0.5;
}

.avatar3d.is-failed {
  background: url("./assets/portfolio-avatar.png") center / cover no-repeat;
}

.nameplate {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 28px;
  width: min(260px, 76%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.nameplate strong,
.nameplate span {
  display: block;
}

.nameplate strong {
  font-size: 1.8rem;
  line-height: 1;
}

.nameplate span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.assistant-panel {
  width: min(640px, 100%);
  margin: 4px auto 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.chat-mode .assistant-panel {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  width: min(900px, 100%);
  margin-top: 34px;
  padding: 12px 0 18px;
  background: linear-gradient(to top, #fff 0%, #fff 82%, rgba(255, 255, 255, 0));
}

.panel-header,
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-header .eyebrow,
.drawer-header .eyebrow {
  margin-top: 0;
}

.panel-header h2,
.drawer-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #171717;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.icon-button:hover {
  background: #111;
  color: #fff;
}

.icon-button:active {
  transform: scale(0.95);
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.icon-button.dark {
  background: #111;
  color: #fff;
}

.chat-log {
  display: grid;
  max-height: 360px;
  min-height: 0;
  gap: 14px;
  overflow: auto;
  margin-top: 22px;
  padding: 2px;
  scroll-behavior: smooth;
}

.chat-log[hidden] {
  display: none;
}

.response-stage {
  min-height: calc(100vh - 168px);
  padding: 0 0 36px;
  animation: view-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.response-stage[hidden] {
  display: none;
}

.chat-close-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #242831;
  cursor: pointer;
  padding: 0 14px 0 11px;
  font-size: 0.88rem;
  font-weight: 760;
  box-shadow: 0 12px 34px rgba(33, 34, 37, 0.08);
  backdrop-filter: blur(18px);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.chat-close-button:hover {
  background: #111;
  color: #fff;
}

.chat-close-button:active {
  transform: scale(0.96);
}

.chat-close-button svg {
  width: 18px;
  height: 18px;
}

.chat-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 34px;
  place-items: center;
  overflow: visible;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.22);
}

.query-bubble {
  width: fit-content;
  max-width: min(560px, 86vw);
  margin: 0 auto 30px;
  border-radius: 999px;
  background: #2f7df6;
  color: #fff;
  padding: 11px 20px;
  font-size: 0.92rem;
  box-shadow: 0 12px 36px rgba(47, 125, 246, 0.22);
  animation: bubble-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.thread-mode .query-bubble {
  display: none;
}

.chat-thread {
  display: grid;
  gap: 10px;
  padding-bottom: 260px;
}

.thread-message {
  width: fit-content;
  max-width: min(680px, 78%);
  border: 0;
  border-radius: 28px;
  padding: 10px 16px 12px;
  opacity: 0;
  scroll-margin-bottom: 220px;
  transform: translateY(14px);
  box-shadow: none;
}

.thread-message.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.thread-user {
  justify-self: center;
  max-width: min(560px, 86vw);
  border-radius: 999px;
  background: #2f7df6;
  color: #fff;
  padding: 11px 20px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(47, 125, 246, 0.22);
}

.thread-assistant {
  justify-self: start;
  max-width: min(620px, 72%);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-bottom-left-radius: 9px;
  background: rgba(244, 244, 245, 0.92);
  color: #202126;
  backdrop-filter: blur(14px);
}

.thread-rich-answer {
  width: min(900px, 100%);
  max-width: 100%;
  padding: 18px;
}

.thread-rich-answer .answer-section + .answer-section {
  margin-top: 18px;
}

.thread-message p,
.thread-message ul {
  margin-bottom: 0;
}

.thread-message p {
  font-size: 1.08rem;
  line-height: 1.35;
}

.thread-user .thread-label {
  display: none;
}

.thread-user p {
  font-size: 0.92rem;
  font-weight: inherit;
  line-height: 1.25;
}

.thread-message p + p {
  margin-top: 12px;
}

.thread-message ul {
  padding-left: 20px;
}

.thread-label {
  display: block;
  margin-bottom: 5px;
  color: inherit;
  font-size: 0.66rem;
  font-weight: 850;
  opacity: 0.68;
  text-transform: uppercase;
}

.typing-row {
  display: inline-flex;
  gap: 7px;
  margin: 0 0 64px 18%;
  animation: view-rise 0.28s ease both;
}

.typing-row[hidden] {
  display: none;
}

.typing-row span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #111;
  animation: blink 1s ease-in-out infinite;
}

.typing-row span:nth-child(2) {
  animation-delay: 0.12s;
}

.typing-row span:nth-child(3) {
  animation-delay: 0.24s;
}

.response-content {
  width: min(900px, 100%);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
}

.response-content.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.answer-section {
  display: grid;
  gap: 18px;
}

.profile-answer {
  display: grid;
  grid-template-columns: minmax(220px, 0.74fr) minmax(300px, 1fr);
  gap: 34px;
  align-items: center;
}

.profile-photo {
  min-height: 285px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 52% 38%, rgba(32, 125, 122, 0.14), transparent 34%),
    linear-gradient(135deg, #eef8ff, #f7f7f7);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transform: scale(1.36) translateY(6%);
}

.profile-photo.avatar3d {
  min-height: 330px;
}

.profile-copy h2,
.projects-answer h2,
.skills-answer h2,
.fun-answer h2,
.contact-answer h2 {
  margin: 0;
  color: #191a1e;
  font-size: clamp(2rem, 3.9vw, 3.05rem);
  line-height: 1;
  letter-spacing: 0;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 12px 0 22px;
  color: #747882;
  font-size: clamp(0.98rem, 1.9vw, 1.22rem);
}

.profile-meta span + span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 20px 4px 0;
  border-radius: 50%;
  background: #d9dbe1;
}

.answer-section p {
  max-width: 860px;
  color: #202126;
  font-size: clamp(1rem, 1.55vw, 1.16rem);
  line-height: 1.5;
}

.profile-copy p {
  max-width: 650px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-row span {
  border-radius: 999px;
  background: #f1f1f3;
  padding: 8px 14px;
  color: #202126;
  font-size: 0.92rem;
}

.project-carousel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 12px 0 24px;
}

.project-card {
  position: relative;
  min-height: 235px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 22px;
  background: #111;
  color: #fff;
  padding: 24px;
}

.project-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--project-bg);
  content: "";
}

.project-card::after {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: -1;
  height: 110px;
  border-radius: 999px;
  background: var(--project-glow);
  filter: blur(18px);
  content: "";
}

.project-card small {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.88;
}

.project-card strong {
  display: block;
  font-size: clamp(1.35rem, 2.45vw, 2rem);
  line-height: 0.96;
}

.project-card p {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  line-height: 1.32;
}

.carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  width: min(920px, 100%);
  margin-left: auto;
}

.round-control {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f5f5f6;
  color: #6f7480;
  cursor: pointer;
  font-size: 1.55rem;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.round-control:hover {
  background: #111;
  color: #fff;
}

.round-control:active {
  transform: scale(0.94);
}

.skill-group {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.skill-group h3 {
  margin: 0;
  color: #1f2025;
  font-size: clamp(1.25rem, 2.3vw, 1.7rem);
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pills span {
  border-radius: 12px;
  background: #17181d;
  color: #f8f8f8;
  padding: 11px 16px;
  font-size: clamp(0.92rem, 1.55vw, 1.06rem);
}

.fun-card,
.contact-card {
  border-radius: 26px;
  background: #f4f4f5;
  padding: clamp(24px, 4.5vw, 48px);
}

.fun-card img {
  display: block;
  width: min(400px, 74%);
  margin: 18px auto 0;
  opacity: 0.92;
  transform: scale(1.06);
}

.fun-avatar {
  width: min(320px, 72%);
  height: clamp(190px, 34vw, 300px);
  margin: 12px auto 0;
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  color: #2e82ff;
  font-size: clamp(1.12rem, 2.2vw, 1.45rem);
  font-weight: 650;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 26px;
  color: #777b85;
  font-size: 1rem;
}

.message {
  width: min(780px, 92%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.06);
}

.message p,
.message ul {
  margin-bottom: 0;
}

.message p {
  line-height: 1.58;
}

.message ul {
  padding-left: 20px;
}

.message li {
  margin: 6px 0;
}

.message-label {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.assistant-message {
  justify-self: start;
  background: rgba(255, 255, 255, 0.82);
}

.user-message {
  justify-self: end;
  background: #111;
  color: #fff;
}

.user-message .message-label {
  color: #aee2dc;
}

.typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: blink 1s ease-in-out infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.12s;
}

.typing span:nth-child(3) {
  animation-delay: 0.24s;
}

.question-form {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  min-height: 68px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 8px 8px 26px;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.045);
  backdrop-filter: blur(20px);
}

.chat-mode .question-form {
  order: 3;
  width: min(900px, 100%);
  min-height: 74px;
  margin: 0 auto;
  background: #ececf1;
  padding: 9px 10px 9px 28px;
}

.question-form input {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-size: 1.08rem;
  outline: 0;
}

.question-form input::placeholder {
  color: rgba(23, 23, 23, 0.48);
}

.send-button {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #5a9ff2;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.send-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.send-button:not(:disabled):active {
  transform: scale(0.94);
}

.send-button svg {
  width: 22px;
  height: 22px;
}

.chat-mode .send-button {
  width: 56px;
  height: 56px;
  background: #79aaf0;
}

.chat-mode .send-button svg {
  transform: rotate(-90deg);
}

.settings-button {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  color: #5f6874;
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.settings-button:hover {
  background: #111;
  color: #fff;
}

.settings-button:active {
  transform: scale(0.94);
}

.settings-button svg {
  width: 19px;
  height: 19px;
}

.chat-mode .settings-button {
  display: none;
}

.quick-toggle {
  display: none;
  width: fit-content;
  margin: 0 auto 12px;
  border: 0;
  background: transparent;
  color: #69707d;
  cursor: pointer;
  font-size: 0.9rem;
}

.chat-mode .quick-toggle {
  display: flex;
  order: 1;
  align-items: center;
  gap: 9px;
}

.quick-toggle[hidden] {
  display: none;
}

.prompts-hidden .quick-toggle {
  margin-bottom: 8px;
}

.prompts-hidden .prompt-grid {
  display: none;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: min(560px, 100%);
  margin: 12px auto 0;
}

.prompt-grid button {
  display: grid;
  min-height: 56px;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: #32363c;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 760;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
  backdrop-filter: blur(16px);
}

.prompt-grid button:hover {
  background: #111;
  color: #fff;
}

.prompt-grid button:active {
  transform: scale(0.96);
}

.chat-mode .prompt-grid {
  order: 2;
  width: min(760px, 100%);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}

.chat-mode .prompt-grid button {
  min-height: 56px;
  border-radius: 15px;
  background: #fff;
  color: #354052;
  font-size: 0.92rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.035);
}

.folder-section {
  display: grid;
  gap: 28px;
  margin-top: 86px;
}

.folder-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(32, 125, 122, 0.13), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(185, 95, 157, 0.12), transparent 30%),
    rgba(255, 255, 255, 0.68);
  padding: 24px;
  box-shadow: 0 22px 70px rgba(33, 34, 37, 0.1);
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  backdrop-filter: blur(24px);
}

.folder-stage[hidden] {
  display: none;
}

.folder-stage.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.folder-stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.folder-stage-header .eyebrow {
  margin: 0 0 8px;
}

.folder-stage-header h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 0.95;
}

.folder-card-row {
  display: grid;
  grid-auto-columns: minmax(200px, 230px);
  grid-auto-flow: column;
  gap: 18px;
  min-height: 394px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px 4px 28px;
  scroll-snap-type: x mandatory;
}

.folder-info-card {
  position: relative;
  display: flex;
  aspect-ratio: 9 / 14;
  min-height: 310px;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 244, 245, 0.78)),
    #fff;
  padding: 22px;
  color: #1b1d22;
  scroll-snap-align: start;
  box-shadow: 0 16px 38px rgba(33, 34, 37, 0.11);
  transform: translateY(54px) rotate(var(--card-tilt, 0deg));
  animation: folder-card-rise 0.58s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--card-index) * 0.055s);
}

.folder-info-card:nth-child(2n) {
  --card-tilt: -1.4deg;
}

.folder-info-card:nth-child(3n) {
  --card-tilt: 1.2deg;
}

.folder-info-card::before {
  position: absolute;
  inset: auto 18px 18px;
  height: 42%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(32, 125, 122, 0.32), transparent 64%);
  filter: blur(14px);
  content: "";
}

.folder-info-card:nth-child(2)::before {
  background: radial-gradient(circle, rgba(20, 111, 215, 0.28), transparent 64%);
}

.folder-info-card:nth-child(3)::before {
  background: radial-gradient(circle, rgba(193, 148, 51, 0.3), transparent 64%);
}

.folder-info-card:nth-child(4)::before {
  background: radial-gradient(circle, rgba(185, 95, 157, 0.3), transparent 64%);
}

.folder-info-card > * {
  position: relative;
  z-index: 1;
}

.folder-card-kicker,
.folder-card-meta,
.download-pill {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
}

.folder-card-kicker {
  color: var(--teal);
}

.folder-info-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.32rem, 2.7vw, 1.66rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.folder-info-card p {
  margin: 18px 0;
  color: #3d4148;
  font-size: 0.86rem;
  line-height: 1.42;
}

.folder-card-meta {
  margin-top: auto;
  color: #747882;
}

.download-card {
  background:
    linear-gradient(180deg, #17181d, #20242a 48%, #edf7f3),
    #17181d;
  color: #fff;
}

.download-card .folder-card-kicker,
.download-card .folder-card-meta {
  color: rgba(255, 255, 255, 0.7);
}

.download-card p {
  color: rgba(255, 255, 255, 0.82);
}

.download-pill {
  width: fit-content;
  margin-top: 10px;
  border-radius: 999px;
  background: #fff;
  color: #171717;
  padding: 9px 12px;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.portfolio-folder {
  position: relative;
  display: grid;
  min-height: 245px;
  place-items: end center;
  border: 0;
  background: transparent;
  color: #1c1f24;
  cursor: pointer;
  padding: 0;
  text-align: center;
}

.portfolio-folder::before,
.portfolio-folder::after,
.folder-body {
  border: 1px solid rgba(17, 17, 17, 0.12);
  box-shadow: 0 18px 50px rgba(33, 34, 37, 0.12);
  backdrop-filter: blur(24px);
}

.portfolio-folder::before {
  position: absolute;
  right: 8%;
  bottom: 28px;
  left: 10%;
  height: 145px;
  border-radius: 20px 20px 24px 24px;
  background: rgba(255, 255, 255, 0.38);
  content: "";
  transform: rotate(-2deg);
}

.portfolio-folder::after {
  position: absolute;
  right: 13%;
  bottom: 118px;
  width: 36%;
  height: 42px;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.5);
  content: "";
}

.folder-previews {
  position: absolute;
  right: 8%;
  bottom: 120px;
  left: 8%;
  z-index: 1;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.folder-previews span {
  display: grid;
  width: 76px;
  height: 90px;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: #2d3138;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.05;
  box-shadow: 0 12px 32px rgba(33, 34, 37, 0.12);
  transform: translateY(8px) rotate(-9deg);
  backdrop-filter: blur(18px);
}

.folder-previews span:nth-child(2) {
  margin-left: -18px;
  transform: translateY(-12px) rotate(2deg);
}

.folder-previews span:nth-child(3) {
  margin-left: -18px;
  transform: translateY(6px) rotate(10deg);
}

.folder-body {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  min-height: 140px;
  place-items: center;
  align-content: center;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(241, 244, 247, 0.52)),
    rgba(255, 255, 255, 0.42);
  padding: 34px 18px 24px;
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.folder-body::after {
  width: min(72%, 210px);
  height: 9px;
  margin-top: 22px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  box-shadow: 0 8px 0 rgba(17, 17, 17, 0.04);
  content: "";
}

.folder-body strong {
  display: block;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1;
}

.folder-body small {
  display: block;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  padding: 8px 12px;
  color: #62676f;
  font-size: 0.83rem;
  font-weight: 760;
}

.portfolio-folder:hover .folder-body,
.portfolio-folder.is-active .folder-body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(231, 239, 244, 0.68)),
    rgba(255, 255, 255, 0.58);
  box-shadow: 0 24px 70px rgba(33, 34, 37, 0.16);
  transform: translateY(-8px);
}

.portfolio-folder:hover .folder-previews span,
.portfolio-folder.is-active .folder-previews span {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-folder:hover .folder-previews span:first-child,
.portfolio-folder.is-active .folder-previews span:first-child {
  transform: translateY(-2px) rotate(-12deg);
}

.portfolio-folder:hover .folder-previews span:nth-child(2),
.portfolio-folder.is-active .folder-previews span:nth-child(2) {
  transform: translateY(-28px) rotate(0deg);
}

.portfolio-folder:hover .folder-previews span:nth-child(3),
.portfolio-folder.is-active .folder-previews span:nth-child(3) {
  transform: translateY(-2px) rotate(12deg);
}

.drawer-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.34);
  padding: 16px;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer {
  width: min(420px, 100%);
  height: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  animation: drawer-in 0.24s ease both;
}

.drawer.wide {
  width: min(620px, 100%);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.field span {
  color: #3c4148;
  font-size: 0.88rem;
  font-weight: 760;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  outline: 0;
}

.field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(32, 125, 122, 0.12);
}

.drawer-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 760;
}

.primary-action {
  border: 0;
  background: #111;
  color: #fff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: #171717;
}

.note,
.profile-details {
  color: #4b5057;
  line-height: 1.6;
}

.note {
  margin-top: 18px;
  font-size: 0.92rem;
}

.profile-details {
  margin-top: 28px;
}

.profile-details ul {
  margin: 20px 0 0;
  padding-left: 20px;
}

.profile-details a {
  color: var(--blue);
  font-weight: 750;
}

@keyframes lift-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes view-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes folder-card-rise {
  from {
    opacity: 0;
    transform: translateY(54px) rotate(var(--card-tilt, 0deg)) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--card-tilt, 0deg)) scale(1);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 900px) {
  .topbar {
    left: 16px;
    top: 16px;
  }

  .page-shell {
    padding-top: 104px;
  }

  .hero {
    gap: 34px;
  }

  .portrait-wrap {
    width: min(290px, 68vw);
    min-height: 245px;
  }

  .portrait {
    transform: scale(1.28);
  }

  .prompt-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .profile-answer,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    min-height: 360px;
  }

  .project-carousel {
    grid-template-columns: 1fr;
  }

  .chat-mode .assistant-panel {
    width: 100%;
  }

  .folder-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .portfolio-folder {
    min-height: 230px;
  }

  .folder-card-row {
    grid-auto-columns: minmax(180px, 210px);
  }
}

@media (max-width: 620px) {
  body:has(.page-shell.chat-mode) .topbar {
    min-height: 44px;
    padding: 6px;
  }

  body:has(.page-shell.chat-mode) .brand span:not(.brand-mark) {
    display: none;
  }

  .topbar {
    position: absolute;
    top: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    min-height: 48px;
  }

  .brand {
    font-size: 0.86rem;
  }

  .page-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 92px;
  }

  h1 {
    font-size: clamp(3.2rem, 16vw, 4.4rem);
  }

  .greeting {
    font-size: 1.16rem;
  }

  .logo-chip {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }

  .portrait-wrap {
    width: min(245px, 76vw);
    min-height: 210px;
  }

  .assistant-panel {
    margin-top: 4px;
  }

  .question-form {
    grid-template-columns: 1fr auto;
    min-height: 62px;
    border-radius: 999px;
    padding: 7px 7px 7px 20px;
  }

  .question-form input {
    min-height: 46px;
    font-size: 0.98rem;
  }

  .send-button,
  .settings-button {
    width: 48px;
    height: 48px;
  }

  .settings-button {
    display: none;
  }

  .prompt-grid {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .prompt-grid button {
    min-height: 64px;
    border-radius: 14px;
    font-size: 0.8rem;
  }

  .folder-section {
    gap: 22px;
    margin-top: 58px;
  }

  .folder-stage {
    border-radius: 22px;
    padding: 18px 14px;
  }

  .folder-stage-header h2 {
    font-size: clamp(1.8rem, 10vw, 2.65rem);
  }

  .folder-card-row {
    grid-auto-columns: minmax(170px, 76vw);
    min-height: 332px;
    gap: 14px;
    padding-bottom: 24px;
  }

  .folder-info-card {
    min-height: 278px;
    border-radius: 20px;
    padding: 18px;
  }

  .folder-info-card strong {
    font-size: 1.45rem;
  }

  .folder-info-card p {
    font-size: 0.86rem;
  }

  .folder-grid {
    gap: 28px;
  }

  .portfolio-folder {
    min-height: 215px;
  }

  .portfolio-folder::before {
    bottom: 24px;
    height: 128px;
  }

  .portfolio-folder::after {
    bottom: 108px;
    height: 38px;
  }

  .folder-previews {
    bottom: 108px;
  }

  .folder-previews span {
    width: 68px;
    height: 80px;
  }

  .folder-body {
    min-height: 124px;
    border-radius: 22px;
    padding: 28px 14px 20px;
  }

  .folder-body strong {
    font-size: 1.7rem;
  }

  .chat-mode .page-shell,
  .page-shell.chat-mode {
    width: min(100% - 16px, 1120px);
    padding-top: 18px;
  }

  .chat-avatar {
    width: 50px;
    height: 50px;
    margin-bottom: 28px;
  }

  .chat-close-button {
    min-height: 38px;
    padding: 0 10px;
  }

  .chat-close-button span {
    display: none;
  }

  .query-bubble {
    margin-bottom: 24px;
    padding: 11px 18px;
  }

  .thread-message {
    max-width: 86%;
    border-radius: 22px;
  }

  .chat-thread {
    padding-bottom: 240px;
  }

  .thread-user {
    max-width: min(560px, 86vw);
    padding: 11px 18px;
  }

  .thread-user p {
    font-size: 0.92rem;
  }

  .thread-assistant {
    max-width: 86%;
    border-bottom-left-radius: 8px;
  }

  .answer-section p {
    font-size: 1.04rem;
  }

  .profile-copy h2,
  .projects-answer h2,
  .skills-answer h2,
  .fun-answer h2,
  .contact-answer h2 {
    font-size: clamp(2rem, 10vw, 2.65rem);
  }

  .profile-photo {
    min-height: 245px;
  }

  .project-card {
    min-height: 220px;
  }

  .fun-card,
  .contact-card {
    padding: 22px;
  }

  .fun-card img {
    width: min(170px, 52%);
    margin-top: 10px;
  }

  .chat-mode .prompt-grid {
    grid-template-columns: repeat(5, minmax(118px, 1fr));
    overflow-x: auto;
  }

  .chat-mode .prompt-grid button {
    min-height: 58px;
    font-size: 0.96rem;
  }

  .chat-mode .question-form {
    min-height: 72px;
    padding-left: 22px;
  }

  .chat-mode .send-button {
    width: 54px;
    height: 54px;
  }

  .skill-pills span {
    padding: 11px 15px;
  }

  .message {
    width: 100%;
  }

  .drawer-backdrop {
    padding: 8px;
  }
}
