/* Archived interactive workspace v7. */
:root {
  --paper: #f1ebe3;
  --paper-soft: #f8f4ee;
  --paper-deep: #e6ddd2;
  --ink: #211813;
  --muted: #776b63;
  --rust: #b84d27;
  --rust-bright: #e7683b;
  --dark: #24150f;
  --dark-soft: #342019;
  --rule: rgba(33, 24, 19, 0.17);
  --light-rule: rgba(255, 246, 238, 0.17);
  --font: "Microsoft YaHei", "微软雅黑", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  --expo: cubic-bezier(.16, 1, .3, 1);
  --shell-radius: 14px;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  content: "";
  opacity: .1;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { color: var(--paper-soft); background: var(--rust); }
:focus-visible { outline: 3px solid var(--rust-bright); outline-offset: 4px; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 200;
  padding: 10px 16px;
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 999px;
  transform: translate(-50%, -150%);
  transition: transform 220ms var(--expo);
}
.skip-link:focus { transform: translate(-50%, 0); }

.portfolio-shell {
  min-height: 100dvh;
  padding: 14px;
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr) 40px;
  gap: 10px;
}
.app-ready body { height: 100dvh; overflow: hidden; }
.shell-topbar,
.module-rail,
.workspace,
.shell-status {
  border: 1px solid var(--rule);
  background: rgba(248, 244, 238, .72);
}

.shell-topbar {
  min-width: 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-radius: var(--shell-radius);
}
.brand { justify-self: start; display: flex; align-items: baseline; gap: 12px; }
.brand strong { font-size: 18px; letter-spacing: .06em; }
.brand > span { color: var(--rust); font-size: 9px; letter-spacing: .13em; }
.topbar-context {
  min-width: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
}
.status-light {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--rust-bright);
  box-shadow: 0 0 0 5px rgba(184, 77, 39, .1);
}
.topbar-link {
  justify-self: end;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 11px;
  transition: color 200ms var(--expo), border-color 200ms var(--expo), transform 200ms var(--expo);
}
.topbar-link:hover { color: var(--rust); border-color: currentColor; transform: translateY(-2px); }

.shell-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 10px;
}
.module-rail {
  min-height: 0;
  padding: 7px;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 5px;
  border-radius: var(--shell-radius);
}
.module-link {
  position: relative;
  min-height: 0;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  overflow: hidden;
  transition: color 260ms var(--expo), background-color 260ms var(--expo), border-color 260ms var(--expo), transform 260ms var(--expo);
}
.module-link::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 22px;
  height: 22px;
  content: "";
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0;
  transition: opacity 220ms var(--expo), transform 220ms var(--expo);
  transform: translate(5px, 5px);
}
.module-link:hover { color: var(--ink); background: rgba(255, 255, 255, .32); border-color: var(--rule); }
.module-link.is-active { color: var(--paper-soft); background: var(--ink); border-color: var(--ink); }
.module-link.is-active::after { opacity: .55; transform: none; }
.module-index { color: var(--rust); font-size: 10px; letter-spacing: .12em; }
.module-link.is-active .module-index { color: #f39772; }
.module-label { font-size: 15px; font-weight: 700; }
.module-meta { font-size: 8px; letter-spacing: .1em; line-height: 1.4; }

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  border-radius: var(--shell-radius);
  overflow: hidden;
  box-shadow: 0 24px 70px -56px rgba(33, 24, 19, .55);
}
.workspace-bar {
  min-width: 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  background: rgba(248, 244, 238, .9);
}
.workspace-dots { display: flex; gap: 6px; }
.workspace-dots i { width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; }
.workspace-dots i:first-child { border-color: var(--rust); background: var(--rust); }
.workspace-title { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.workspace-title > span { color: var(--rust); font-size: 9px; letter-spacing: .1em; }
.workspace-title strong { font-weight: 600; letter-spacing: .05em; }
.workspace-hint { justify-self: end; color: var(--muted); font-size: 9px; letter-spacing: .07em; }
.view-stage { min-height: 0; overflow-y: auto; background: var(--paper-soft); }

.portfolio-view {
  min-height: 100%;
  padding: clamp(22px, 2.3vw, 38px);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-soft);
}
.portfolio-view:last-child { border-bottom: 0; }
.app-ready .view-stage { position: relative; overflow: hidden; }
.app-ready .portfolio-view {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-bottom: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.app-ready .portfolio-view.is-entering { animation: view-in 480ms var(--expo) both; }

.view-kicker,
.card-topline,
.note-top,
.note-bottom,
.portrait-card figcaption,
.view-heading > div > p {
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Profile */
.profile-view { overflow: hidden; }
.profile-layout {
  height: 100%;
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(300px, .76fr);
  gap: clamp(30px, 4vw, 74px);
}
.profile-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.view-kicker { margin: 0 0 clamp(28px, 4vh, 50px); display: flex; justify-content: space-between; color: var(--rust); }
.profile-copy h1 {
  margin: 0;
  font-size: clamp(49px, 5.15vw, 82px);
  font-weight: 600;
  line-height: 1.09;
  letter-spacing: -.04em;
}
.profile-copy h1 > span { display: block; text-wrap: balance; }
.profile-copy h1 strong { color: var(--rust); font-weight: 700; box-shadow: inset 0 -.12em rgba(184, 77, 39, .13); }
.profile-intro {
  max-width: 760px;
  margin: clamp(28px, 4vh, 46px) 0 0;
  color: #594f49;
  font-size: clamp(14px, 1.08vw, 17px);
  line-height: 1.9;
  text-wrap: pretty;
}
.profile-actions { margin-top: clamp(24px, 3.5vh, 40px); display: flex; gap: 10px; }
.button {
  min-width: 170px;
  min-height: 45px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  transition: color 220ms var(--expo), background-color 220ms var(--expo), transform 220ms var(--expo);
}
.button-primary { color: var(--paper-soft); background: var(--ink); }
.button:hover { transform: translateY(-3px); }
.button-quiet:hover { color: var(--paper-soft); background: var(--ink); }

.profile-aside {
  min-width: 0;
  padding-left: clamp(24px, 3vw, 48px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-content: center;
  border-left: 1px solid var(--rule);
}
.portrait-card { width: min(100%, 315px); margin: 0 auto; }
.portrait-stage { position: relative; perspective: 900px; }
.portrait-motion {
  --portrait-rx: 0deg;
  --portrait-ry: 0deg;
  --portrait-scale: 1;
  position: relative;
  transform: rotateX(var(--portrait-rx)) rotateY(var(--portrait-ry)) scale3d(var(--portrait-scale), var(--portrait-scale), var(--portrait-scale));
  transform-style: preserve-3d;
  transform-origin: 50% 68%;
  will-change: transform;
  transition: transform 200ms ease-out;
}
.portrait-crop {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 16px;
  background: #d7cdc2;
  box-shadow: 0 24px 50px -32px rgba(33, 24, 19, .55);
}
.portrait-crop::after { position: absolute; inset: 0; content: ""; border: 1px solid rgba(33, 24, 19, .16); border-radius: inherit; pointer-events: none; }
.portrait-crop img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(1.05); pointer-events: none; user-select: none; -webkit-user-drag: none; }
.portrait-card figcaption { margin-top: 10px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }
.focus-list { border-top: 1px solid var(--rule); }
.focus-list p {
  margin: 0;
  min-height: 36px;
  padding: 9px 2px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  color: #554b45;
  font-size: 11px;
}
.focus-list p span { color: var(--rust); font-size: 8px; }
.profile-aside blockquote { margin: 0; color: var(--muted); font-size: 11px; font-style: italic; line-height: 1.7; }

/* Shared view and deck */
.writing-view,
.github-view,
.xhs-view { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: clamp(16px, 2vh, 24px); }
.view-heading {
  min-width: 0;
  min-height: 66px;
  padding-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: clamp(18px, 3vw, 48px);
  border-bottom: 1px solid currentColor;
}
.view-heading > div > p { margin: 0 0 7px; color: var(--rust); }
.view-heading h2 { margin: 0; font-size: clamp(29px, 2.5vw, 42px); line-height: 1; letter-spacing: -.03em; }
.view-summary { margin: 0; color: var(--muted); font-size: 11px; }
.view-summary strong { margin-right: 3px; color: var(--ink); font-size: 24px; font-weight: 500; }
.view-exit {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
  transition: color 220ms var(--expo), background-color 220ms var(--expo), transform 220ms var(--expo);
}
.view-exit:hover { color: var(--paper-soft); background: var(--ink); transform: translateY(-2px); }
.view-exit span { color: var(--rust); }

.deck-shell { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 42px; gap: 8px; }
.deck-viewport { min-height: 460px; display: grid; gap: 16px; outline-offset: -3px; touch-action: pan-y; }
.deck-card { position: relative; min-height: 430px; }
.card-surface {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper-soft);
}
.card-select { display: none; }
.app-ready .deck-viewport { position: relative; min-height: 0; display: block; overflow: hidden; perspective: 1500px; perspective-origin: 50% 44%; }
.app-ready .deck-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(59vw, 650px);
  height: min(56vh, 500px);
  min-height: 0;
  z-index: var(--card-order, 1);
  opacity: var(--card-opacity, 0);
  filter: saturate(var(--card-saturation, .75)) brightness(var(--card-brightness, .86)) blur(var(--card-blur, 0px));
  transform: translate(-50%, -50%) translateX(var(--card-x, 0%)) translateY(var(--card-y, 0px)) translateZ(var(--card-z, 0px)) rotateY(var(--card-rotate, 0deg)) scale(var(--card-scale, 1));
  transform-style: preserve-3d;
  transform-origin: center;
  pointer-events: none;
  transition: transform 620ms var(--expo), opacity 420ms var(--expo), filter 420ms var(--expo);
  will-change: transform, opacity, filter;
}
.app-ready .deck-card.is-active,
.app-ready .deck-card.is-adjacent { pointer-events: auto; }
.app-ready .deck-card.is-active .card-surface { box-shadow: 0 36px 75px -48px rgba(33, 24, 19, .58); }
.app-ready .deck-card.is-far { visibility: hidden; }
.app-ready .deck-card.is-adjacent .card-select {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.app-ready .deck-card.is-adjacent .card-select:focus-visible { outline-offset: -6px; }
.deck-controls { min-width: 0; display: grid; grid-template-columns: 38px auto 1fr 38px; align-items: center; gap: 10px; }
.deck-controls > button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: color 180ms var(--expo), background-color 180ms var(--expo), transform 180ms var(--expo);
}
.deck-controls > button:hover { color: var(--paper-soft); background: var(--ink); transform: scale(1.06); }
.deck-pagination { display: flex; gap: 4px; }
.deck-pagination button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}
.deck-pagination button.is-active { color: var(--paper-soft); background: var(--ink); }
.deck-status { justify-self: end; margin: 0; color: var(--muted); font-size: 9px; letter-spacing: .06em; white-space: nowrap; }

/* Writing cards */
.writing-card .card-surface { padding: clamp(28px, 3.2vw, 48px); display: flex; flex-direction: column; }
.card-topline { position: relative; z-index: 2; display: flex; justify-content: space-between; color: var(--rust); }
.card-ghost {
  position: absolute;
  right: .02em;
  bottom: -.22em;
  color: rgba(184, 77, 39, .06);
  font-size: min(26vh, 230px);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.writing-card h3 {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: auto 0 20px;
  font-size: clamp(29px, 3vw, 47px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.writing-card .card-surface > p { position: relative; z-index: 2; max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.card-footer {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  padding-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .07em;
}
.card-footer a { color: var(--ink); font-size: 11px; letter-spacing: 0; }
.card-footer a:hover { color: var(--rust); }
.writing-card.is-wip .card-surface { background: #e8dfd4; }
.writing-card.is-wip .card-surface::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: repeating-linear-gradient(-35deg, transparent 0 18px, rgba(184, 77, 39, .025) 18px 19px);
}
.wip-label { color: var(--rust); }

/* GitHub cards */
.github-view { color: #f5eee8; background: var(--dark); }
.github-view .view-heading { border-color: var(--light-rule); }
.github-view .view-heading > div > p,
.github-view .view-exit span,
.github-view .card-topline { color: #ef7a51; }
.github-view .view-summary { color: #bcaea5; }
.github-view .view-summary strong { color: #f5eee8; }
.github-view .view-exit:hover { color: var(--dark); background: #f5eee8; }
.github-view .deck-controls > button { border-color: var(--light-rule); }
.github-view .deck-controls > button:hover { color: var(--dark); background: #f5eee8; }
.github-view .deck-pagination button { color: #bcaea5; }
.github-view .deck-pagination button.is-active { color: var(--dark); background: #f5eee8; }
.github-view .deck-status { color: #bcaea5; }
.project-card .card-surface { display: grid; grid-template-rows: 43% minmax(0, 1fr); border-color: var(--light-rule); color: #f5eee8; background: var(--dark-soft); }
.project-preview { min-height: 0; overflow: hidden; background: #160d09; }
.project-preview img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.76) brightness(.85); transition: transform 720ms var(--expo), filter 300ms var(--expo); }
.project-card.is-active:hover .project-preview img { transform: scale(1.035); filter: saturate(.95) brightness(.95); }
.project-content { min-height: 0; padding: clamp(20px, 2.5vw, 34px); display: flex; flex-direction: column; }
.project-content h3 { margin: auto 0 10px; font-size: clamp(28px, 2.8vw, 45px); line-height: 1.08; letter-spacing: -.03em; }
.project-content > p { margin: 0; color: #c3b4aa; font-size: 12px; line-height: 1.65; }
.project-content .card-footer { margin-top: 16px; border-color: var(--light-rule); color: #bcaea5; }
.project-content .card-footer a { color: #f5eee8; }
.project-content .card-footer a:hover { color: #ef7a51; }
.project-card-type .card-surface { grid-template-rows: 48% minmax(0, 1fr); }
.project-type-art {
  position: relative;
  min-height: 0;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  color: #f0ddd2;
  background: #4a261a;
}
.project-type-art::before {
  position: absolute;
  top: -45%;
  right: -18%;
  width: 68%;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(240, 221, 210, .35);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(240, 221, 210, .045), 0 0 0 76px rgba(240, 221, 210, .025);
}
.project-type-art span { position: relative; z-index: 1; font-size: clamp(76px, 9vw, 130px); font-weight: 700; line-height: .72; letter-spacing: -.08em; }
.project-type-art i { position: relative; z-index: 1; font-size: 8px; font-style: normal; letter-spacing: .1em; writing-mode: vertical-rl; }

/* Xiaohongshu cards */
.app-ready .xhs-deck .deck-card { width: min(34vw, 365px); height: min(61vh, 545px); }
.note-card .card-surface { padding: clamp(24px, 2.5vw, 36px); display: flex; flex-direction: column; color: #2a1710; border-color: rgba(33, 24, 19, .42); }
.note-top,
.note-bottom { position: relative; z-index: 2; display: flex; justify-content: space-between; }
.note-en { position: relative; z-index: 2; margin: auto 0 14px; color: var(--rust); font-size: clamp(35px, 4.1vw, 59px); font-weight: 700; line-height: .92; letter-spacing: -.055em; }
.note-card h3 { position: relative; z-index: 2; margin: 0 auto auto 0; font-size: clamp(29px, 2.8vw, 41px); line-height: 1.26; letter-spacing: -.03em; }
.note-bottom { margin-top: 22px; padding-top: 13px; align-items: center; border-top: 1px solid currentColor; font-size: 8px; }
.note-bottom a { min-width: 52px; min-height: 34px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 999px; font-size: 9px; }
.note-orange .card-surface { color: #3b1d13; background: #ef8a62; }
.note-orange .note-en { color: #fff3e8; }
.note-ring {
  position: absolute;
  top: 18%;
  right: -34%;
  width: 86%;
  aspect-ratio: 1;
  border: clamp(30px, 4vw, 56px) solid rgba(255, 245, 234, .3);
  border-radius: 50%;
}
.note-dark .card-surface { color: #f7eee7; background: #2b1811; border-color: rgba(255, 255, 255, .2); }
.note-dark .note-en { color: #ef7950; }
.note-orbit {
  position: absolute;
  top: 29%;
  right: -39%;
  width: 94%;
  aspect-ratio: 1;
  border: 1px solid rgba(239, 121, 80, .55);
  border-radius: 50%;
}
.note-orbit::before,
.note-orbit::after { position: absolute; inset: 18%; content: ""; border: 1px solid rgba(239, 121, 80, .4); border-radius: inherit; }
.note-orbit::after { inset: 36%; }
.note-orbit i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #ef7950; }
.note-orbit i:nth-child(1) { top: 5%; left: 48%; }
.note-orbit i:nth-child(2) { top: 49%; left: 13%; }
.note-orbit i:nth-child(3) { right: 17%; bottom: 18%; }
.note-stone .card-surface { color: #291a14; background: #d9cfc1; }
.note-stone .note-en { color: #96391f; }
.note-path { position: absolute; inset: 25% 12% auto; height: 145px; }
.note-path::before { position: absolute; top: 50%; right: 0; left: 0; height: 1px; content: ""; background: rgba(150, 57, 31, .5); transform: rotate(-12deg); }
.note-path i { position: absolute; width: 14px; height: 14px; border: 2px solid #96391f; border-radius: 50%; background: #d9cfc1; }
.note-path i:nth-child(1) { top: 70%; left: 0; }
.note-path i:nth-child(2) { top: 52%; left: 31%; }
.note-path i:nth-child(3) { top: 36%; left: 63%; }
.note-path i:nth-child(4) { top: 9%; right: 0; background: #96391f; }

.shell-status {
  min-width: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--shell-radius);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .06em;
}
.shell-status p,
.shell-status > div { margin: 0; display: flex; align-items: center; gap: 14px; }
.shell-status .status-light { width: 6px; height: 6px; }
.shell-status strong { color: var(--ink); font-size: 9px; }
.shell-status button { padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; }
.shell-status a,
.shell-status button { transition: color 180ms var(--expo); }
.shell-status a:hover,
.shell-status button:hover { color: var(--rust); }
.copy-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  padding: 12px 16px;
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 8px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 220ms var(--expo), transform 220ms var(--expo);
}
.copy-toast.is-visible { opacity: 1; transform: none; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(13px) scale(.995); }
  to { opacity: 1; transform: none; }
}

@media (hover: hover) and (pointer: fine) {
  .deck-card.is-active .card-surface { transition: box-shadow 360ms var(--expo), transform 360ms var(--expo); }
  .deck-card.is-active:hover .card-surface { box-shadow: 0 40px 80px -50px rgba(33, 24, 19, .68); transform: translateY(-3px); }
  .github-view .deck-card.is-active:hover .card-surface { box-shadow: 0 42px 84px -48px rgba(0, 0, 0, .78); }
}

@media (max-width: 1100px) {
  .profile-layout { grid-template-columns: minmax(0, 1.1fr) minmax(270px, .9fr); gap: 32px; }
  .profile-copy h1 { font-size: clamp(44px, 5vw, 60px); }
  .profile-aside { padding-left: 28px; }
  .app-ready .deck-card { width: min(68vw, 610px); }
  .app-ready .xhs-deck .deck-card { width: min(40vw, 350px); }
}

@media (max-width: 900px) {
  .portfolio-shell { padding: 10px; grid-template-rows: 50px minmax(0, 1fr) 38px; gap: 8px; }
  .shell-main { grid-template-columns: 1fr; grid-template-rows: 58px minmax(0, 1fr); gap: 8px; }
  .module-rail { padding: 5px; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; gap: 4px; }
  .module-link { padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 8px; }
  .module-index { grid-row: 1 / 3; align-self: center; }
  .module-label { font-size: 12px; }
  .module-meta { font-size: 7px; }
  .profile-layout { min-height: 650px; grid-template-columns: minmax(0, 1.12fr) minmax(240px, .88fr); }
  .profile-copy h1 { font-size: clamp(42px, 6vw, 58px); }
  .profile-actions { flex-direction: column; align-items: flex-start; }
  .button { width: min(100%, 320px); }
  .app-ready .deck-card { width: min(76vw, 590px); height: min(54vh, 490px); }
  .app-ready .xhs-deck .deck-card { width: min(48vw, 345px); }
}

@media (max-width: 600px) {
  body::before { opacity: .07; }
  .portfolio-shell { padding: 0; grid-template-rows: 54px minmax(0, 1fr); gap: 0; }
  .shell-topbar { padding: 0 14px; border-width: 0 0 1px; border-radius: 0; background: rgba(248, 244, 238, .94); }
  .brand > span,
  .topbar-context { display: none; }
  .brand strong { font-size: 17px; }
  .topbar-link { padding: 7px 11px; }
  .shell-main { grid-template-rows: minmax(0, 1fr) 66px; gap: 0; }
  .module-rail { order: 2; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); grid-template-columns: repeat(4, 1fr); border-width: 1px 0 0; border-radius: 0; background: rgba(33, 24, 19, .96); }
  .module-link { padding: 7px 3px; display: flex; align-items: center; justify-content: center; gap: 3px; color: #cfc3ba; border-radius: 999px; }
  .module-link:hover { color: #fff; background: rgba(255, 255, 255, .07); border-color: transparent; }
  .module-link.is-active { color: #fff; background: var(--rust); border-color: var(--rust); }
  .module-link::after,
  .module-meta { display: none; }
  .module-index { font-size: 7px; }
  .module-link.is-active .module-index { color: #ffe1d4; }
  .module-label { font-size: 10px; }
  .workspace { order: 1; border: 0; border-radius: 0; box-shadow: none; }
  .workspace-bar { min-height: 42px; padding: 0 13px; grid-template-columns: 1fr auto; }
  .workspace-dots { display: none; }
  .workspace-title { justify-self: start; }
  .workspace-hint { font-size: 8px; }
  .shell-status { display: none; }
  .portfolio-view { padding: 18px; }

  .profile-view { overflow: auto; }
  .profile-layout { height: auto; min-height: 100%; display: block; }
  .view-kicker { margin-bottom: 26px; font-size: 8px; }
  .profile-copy h1 { font-size: clamp(35px, 10.2vw, 44px); line-height: 1.14; letter-spacing: -.03em; }
  .profile-copy h1 > span { white-space: normal; }
  .profile-intro { margin-top: 24px; font-size: 13px; line-height: 1.75; }
  .profile-actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .button { width: 100%; min-width: 0; min-height: 44px; padding: 0 12px; gap: 8px; font-size: 9px; }
  .profile-aside { margin-top: 20px; padding: 18px 0 0; grid-template-columns: 108px minmax(0, 1fr); grid-template-rows: auto auto; gap: 14px; border-top: 1px solid var(--rule); border-left: 0; }
  .portrait-card { width: 108px; margin: 0; grid-row: 1 / 3; }
  .portrait-card figcaption { display: block; font-size: 6px; line-height: 1.6; }
  .portrait-card figcaption span { display: block; }
  .focus-list { align-self: start; }
  .focus-list p { min-height: 30px; padding-block: 6px; grid-template-columns: 23px 1fr; font-size: 9px; }
  .profile-aside blockquote { align-self: end; font-size: 9px; line-height: 1.5; }

  .writing-view,
  .github-view,
  .xhs-view { gap: 10px; }
  .view-heading { min-height: 64px; padding-bottom: 10px; grid-template-columns: 1fr auto; gap: 9px 14px; }
  .view-heading > div { min-width: 0; }
  .view-heading > div > p { margin-bottom: 5px; font-size: 7px; }
  .view-heading h2 { font-size: 27px; }
  .view-summary { justify-self: end; font-size: 8px; }
  .view-summary strong { font-size: 18px; }
  .view-exit { grid-column: 1 / -1; justify-self: start; min-height: 29px; padding: 0 10px; font-size: 8px; }
  .deck-shell { grid-template-rows: minmax(0, 1fr) 40px; }
  .deck-viewport { min-height: 420px; }
  .app-ready .deck-card { width: calc(100vw - 48px); max-width: 360px; height: min(54vh, 450px); }
  .app-ready .xhs-deck .deck-card { width: calc(100vw - 64px); max-width: 330px; height: min(57vh, 470px); }
  .writing-card .card-surface { padding: 23px 20px; }
  .card-topline { font-size: 7px; }
  .writing-card h3 { font-size: clamp(25px, 7.2vw, 31px); line-height: 1.28; }
  .writing-card .card-surface > p { font-size: 11px; line-height: 1.65; }
  .card-footer { margin-top: 16px; font-size: 7px; }
  .card-footer a { font-size: 9px; }
  .card-ghost { font-size: 150px; }
  .project-card .card-surface { grid-template-rows: 40% minmax(0, 1fr); }
  .project-content { padding: 18px; }
  .project-content h3 { font-size: 27px; }
  .project-content > p { font-size: 10px; }
  .project-type-art span { font-size: 82px; }
  .note-card .card-surface { padding: 24px; }
  .note-en { font-size: 42px; }
  .note-card h3 { font-size: 28px; }
  .deck-controls { grid-template-columns: 36px auto 1fr 36px; gap: 7px; }
  .deck-pagination button { width: 25px; height: 25px; }
  .deck-status { font-size: 7px; }
  .copy-toast { right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); font-size: 11px; }
}

@media (max-width: 360px) {
  .portfolio-view { padding-inline: 14px; }
  .profile-copy h1 { font-size: 34px; }
  .profile-actions { grid-template-columns: 1fr; }
  .profile-aside { grid-template-columns: 94px minmax(0, 1fr); }
  .portrait-card { width: 94px; }
  .app-ready .deck-card { width: calc(100vw - 38px); height: min(53vh, 405px); }
  .app-ready .xhs-deck .deck-card { width: calc(100vw - 52px); height: min(55vh, 425px); }
  .writing-card h3 { font-size: 24px; }
  .project-content h3 { font-size: 24px; }
  .note-en { font-size: 38px; }
  .note-card h3 { font-size: 25px; }
  .deck-status { display: none; }
  .deck-controls { grid-template-columns: 36px 1fr 36px; }
  .deck-pagination { justify-self: center; }
  .deck-controls [data-deck-status] { display: none; }
}

@media (max-height: 720px) and (min-width: 601px) {
  .portfolio-view { padding-block: 20px; }
  .profile-layout { min-height: 500px; }
  .profile-copy h1 { font-size: clamp(42px, 4.7vw, 62px); }
  .view-kicker { margin-bottom: 24px; }
  .profile-intro { margin-top: 24px; }
  .profile-actions { margin-top: 20px; }
  .app-ready .deck-card { height: min(58vh, 430px); }
  .app-ready .xhs-deck .deck-card { height: min(60vh, 455px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .portrait-motion { transform: none !important; }
  .app-ready .deck-card {
    filter: none;
    transform: translate(-50%, -50%) translateX(var(--card-x, 0%)) scale(var(--card-scale, 1)) !important;
  }
}
