/* 1440 × 900 reference. Desktop dimensions use a 12px base unit. */
:root { color-scheme: dark; --text: #f5f5f5; --muted: #797979; --subtle: #383838; --panel: #151515; font-size: 12px; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; background: #000; color: var(--text); font-family: Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif; -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid #eee; outline-offset: 6px; border-radius: 2px; }
button, a { touch-action: manipulation; }
p, h1, h2, h3, figure { margin: 0; }
.page { width: 88.888889%; max-width: 1600px; margin: 0 auto; padding: 5rem 0 7rem; }
.site-header { height: 2rem; display: flex; align-items: center; justify-content: space-between; gap: 3rem; margin-bottom: 6.583333rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; flex: none; font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.brand-logo { display: block; width: 1.7rem; height: 1.7rem; object-fit: contain; flex: none; }
.main-nav { display: flex; align-items: center; justify-content: space-between; gap: 3.9rem; }
.main-nav a, .main-nav button { padding: 0; background: none; border: 0; white-space: nowrap; font-size: 1.166667rem; color: var(--muted); line-height: 1.5; transition: color .18s ease; }
.main-nav a:hover, .main-nav button:hover { color: #fff; }
.site-header :is(a, button):focus-visible { outline: none; color: #fff; text-decoration: underline dotted; text-underline-offset: .18em; }
.main-nav .active { position: relative; color: #fff; -webkit-text-stroke: .4px currentColor; }
.main-nav .active::after { content: ''; position: absolute; left: 8%; right: 8%; height: 2px; bottom: -.6rem; background: #cfcfcf; border-radius: 2px; }
.portfolio { display: grid; grid-template-columns: minmax(0, 864fr) minmax(0, 348fr); gap: 5.666667rem; }
.overview { display: grid; grid-template-columns: minmax(0, 478fr) minmax(0, 316fr); column-gap: 5.833333rem; row-gap: 6.75rem; align-items: start; }
.portfolio > *, .overview > * { min-width: 0; }
.portrait { position: relative; aspect-ratio: 478 / 220; overflow: hidden; border-radius: .42rem; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption { position: absolute; left: .5rem; bottom: .5rem; color: #fff; font-size: 1rem; line-height: 1.2; pointer-events: none; }
.intro h1 { font-size: 2.583333rem; font-weight: 700; line-height: 1.2; letter-spacing: -.035em; margin: -.1rem 0 .65rem; }
.tagline { font-size: 1.666667rem; line-height: 1.5; white-space: nowrap; }
.intro-rule { width: .85rem; height: 2px; background: #777; margin-top: 1rem; }
.facts { margin: 3.05rem 0 0; font-size: 1rem; line-height: 2; color: var(--muted); }
.facts > div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .833333rem; }
.facts dt { color: var(--subtle); }
.facts dd { margin: 0; white-space: nowrap; }
.text-action { background: none; border: 0; padding: 0; text-align: left; color: #eee; line-height: inherit; }
.text-action:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.chevron { display: inline-block; width: .5rem; height: .5rem; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); margin: 0 .25rem .05rem .25rem; }
h2 { font-size: 1.166667rem; line-height: 1.5; font-weight: 600; margin-bottom: 1.25rem; }
.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .666667rem .75rem; }
.skill-card { display: flex; align-items: center; gap: 1.1rem; background: var(--panel); border-radius: .45rem; min-height: 4rem; padding: 0 1.166667rem; color: var(--muted); white-space: nowrap; }
.skill-card svg { width: 1.7rem; height: 1.7rem; flex: none; color: #f6f6f6; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skill-icon { display: block; width: 1.7rem; height: 1.7rem; object-fit: contain; flex: none; }
.skill-copy { display: flex; align-items: center; gap: .9rem; }
.skill-copy i { display: block; width: 1px; height: 1.1rem; background: #343434; }
.basic-grid { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 2rem; color: var(--muted); }
.basic-grid dl { margin: .1rem 0 0; }
.basic-grid dl > div { display: flex; line-height: 1.666667; }
.basic-grid dt { flex: none; }
.basic-grid dd { margin: 0 0 0 .7rem; }
.basic-grid a:hover { color: #fff; }
.copy-button { padding: 0; background: none; border: 0; color: inherit; text-align: left; line-height: inherit; }
.copy-button:hover { color: #fff; }
.partners { margin-top: 5rem; }
.partners h2 { margin-bottom: 1.333333rem; }
.partner-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1rem .75rem; }
.partner-grid img { width: 100%; height: auto; aspect-ratio: 300 / 132; display: block; border-radius: .5rem; }
.experience > h2 { margin-top: -.25rem; margin-bottom: 1.866667rem; }
.job { margin-bottom: 2.916667rem; }
.job h3 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: 1rem; font-weight: 400; line-height: 1.5; }
.job-name { display: flex; align-items: center; gap: .3rem; white-space: nowrap; }
.job-name i, .early-jobs i { font-style: normal; color: #333; padding: 0 .25rem; }
.job time { color: var(--muted); white-space: nowrap; font-size: .98rem; }
.company-icon { display: block; width: 1.333333rem; height: 1.333333rem; flex: none; }
.company-icon.wide { width: 4.75rem; height: auto; object-fit: contain; }
.company-icon.meituan-logo { width: auto; height: 1.333333rem; object-fit: contain; }
.job ul { margin: .416667rem 0 0; padding-left: 1.2rem; font-size: .958333rem; color: var(--muted); line-height: 1.666667rem; }
.job li { padding-left: .25rem; }
.job li::marker { font-size: .65em; }
.mentor { display: inline-block; width: 1.25rem; height: 1.25rem; object-fit: contain; vertical-align: -.25em; }
.job.secondary { color: var(--subtle); margin-bottom: 2.333333rem; }
.job.secondary time { color: inherit; }
.job.secondary p { margin-top: .416667rem; line-height: 1.7; }
.early-jobs { display: flex; justify-content: space-between; gap: 1rem; color: var(--subtle); line-height: 1.666667; }
.early-jobs p + p { margin-top: 0; }
.detail-dialog { width: min(460px, calc(100% - 40px)); padding: 32px; border: 1px solid #333; border-radius: 12px; background: #151515; color: #f5f5f5; }
.detail-dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
.detail-dialog h2 { font-size: 22px; margin-bottom: 18px; padding-right: 24px; }
.detail-dialog p { color: #aaa; font-size: 15px; line-height: 1.8; white-space: pre-line; }
.close-dialog { position: absolute; top: 17px; right: 18px; padding: 6px; background: none; border: 0; font-size: 24px; color: #999; line-height: 1; }
.dialog-contact { display: inline-block; border-bottom: 1px solid #777; margin-top: 24px; padding-bottom: 4px; font-size: 14px; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(15px); opacity: 0; pointer-events: none; color: #eee; background: #252525; border: 1px solid #444; padding: 12px 20px; border-radius: 8px; transition: opacity .2s, transform .2s; font-size: 14px; z-index: 10; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 1200px) {
  :root { font-size: clamp(10px, .833333333vw, 15px); }
  .overview { grid-template-rows: 18.333333rem auto; }
  .facts { margin-top: 3.716667rem; }
  .experience { display: flex; flex-direction: column; }
  .experience .job:last-of-type { margin-bottom: 2.416667rem; }
  .early-jobs { margin-top: auto; }
}
@media (max-width: 1199px) {
  :root { font-size: 14px; }
  .page { width: calc(100% - 80px); padding-top: 40px; padding-bottom: 60px; }
  .site-header { height: auto; align-items: flex-start; gap: 24px; margin-bottom: 56px; }
  .main-nav { flex-wrap: wrap; justify-content: flex-end; gap: 22px 28px; }
  .main-nav a, .main-nav button { font-size: 14px; }
  .portfolio { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .overview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 42px 32px; }
  .portrait { aspect-ratio: 1.65; }
  .intro h1 { font-size: 30px; margin-bottom: 12px; }
  .tagline { font-size: 18px; white-space: normal; }
  .intro-rule { margin-top: 14px; }
  .facts { margin-top: 22px; line-height: 1.85; }
  .facts > div { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .facts dd { white-space: normal; }
  .skill-grid { grid-template-columns: minmax(0, 1fr); }
  .skill-card { min-height: 54px; }
  .basic-grid { grid-template-columns: 1fr; gap: 10px; }
  .basic-grid dl { margin: 0; }
  .basic-grid dl > div { line-height: 1.8; }
  .basic-grid dd { overflow-wrap: anywhere; }
  .partners { margin-top: 48px; }
  .partner-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .experience { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 32px; align-items: start; }
  .experience > h2, .early-jobs { grid-column: 1 / -1; }
  .experience > h2 { margin: 0; }
  .job, .job.secondary { margin: 0; }
  .job h3 { align-items: flex-start; flex-direction: column; gap: 8px; }
  .job ul { font-size: 1rem; line-height: 1.9; }
  .job-name { flex-wrap: wrap; white-space: normal; }
  .job time { font-size: 12px; }
}
@media (max-width: 699px) {
  .page { width: calc(100% - 40px); padding-top: 28px; padding-bottom: 44px; }
  .site-header { display: block; margin-bottom: 36px; }
  .brand { font-size: 17px; }
  .main-nav { margin-top: 28px; justify-content: flex-start; flex-wrap: nowrap; gap: 28px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav button, .main-nav a { min-height: 32px; display: flex; align-items: center; }
  .main-nav .active::after { bottom: -4px; }
  .overview { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .portrait { aspect-ratio: 478 / 220; }
  .intro h1 { font-size: 32px; }
  .tagline { font-size: 19px; }
  .facts { margin-top: 24px; line-height: 2; }
  .intro-rule { margin-top: 20px; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .skill-card { align-items: flex-start; gap: 12px; padding: 16px 12px; white-space: normal; }
  .skill-card svg, .skill-icon { width: 22px; height: 22px; }
  .skill-copy { display: block; font-size: 12px; line-height: 1.8; }
  .skill-copy span { display: block; color: #aaa; }
  .skill-copy i { display: none; }
  .basic-grid { grid-template-columns: 1fr; gap: 14px; }
  .basic-grid dl:first-child { display: grid; grid-template-columns: 1fr 1fr; }
  .basic-grid dl > div { line-height: 2; }
  .partners { margin-top: 36px; }
  .partner-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .partner-grid img { border-radius: 4px; }
  .portfolio { gap: 44px; }
  .experience { display: block; }
  .experience > h2 { margin-bottom: 28px; }
  .job, .job.secondary { margin-bottom: 34px; }
  .early-jobs { flex-wrap: wrap; gap: 22px; font-size: 12px; }
  h2 { font-size: 16px; margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Reference-based portfolio tabs. All text and controls are native HTML. */
[hidden] { display: none !important; }
html, body { overflow-x: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body[data-page="visual"] .site-header { margin-bottom: 4.666667rem; }
body[data-page="model"] .site-header { margin-bottom: 5.333333rem; }
body[data-page="skill"] .site-header { margin-bottom: 10.333333rem; }
.page-panel { animation: reveal-page .32s ease both; }
@keyframes reveal-page { from { opacity: 0; } to { opacity: 1; } }
.visual-categories { display: flex; flex-wrap: wrap; gap: 1rem; padding-bottom: calc(2.916667rem - 10px); border-bottom: 1px solid #242424; }
.visual-categories a { display: block; flex: none; white-space: nowrap; padding: .666667rem 1rem; border: 1px solid #252525; border-radius: .666667rem; color: #777; font-size: 1.166667rem; line-height: 1.5; transition: background .2s, color .2s; }
.visual-categories a:hover { color: #fff; border-color: #666; }
.visual-categories a.selected { color: #000; background: #fff; border-color: #fff; font-weight: 600; }
.design-section { display: grid; grid-template-columns: 15rem minmax(0,1fr); gap: 2rem; padding: 5rem 0; border-bottom: 1px solid #242424; scroll-margin-top: 2rem; }
.design-section:last-child { border-bottom: 0; padding-bottom: 3rem; }
.design-intro :is(h1, h2) { font-size: 1.666667rem; line-height: 1.2; margin: .166667rem 0 1.5rem; font-weight: 600; }
.design-intro p { max-width: 12.166667rem; font-size: 1rem; color: #6f6f6f; line-height: 1.7; }
.project-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5rem 2rem; }
.project-card { display: block; min-width: 0; width: 100%; background: none; border: 0; padding: 0; text-align: left; align-self: start; }
/* Project covers include their own rounded corners and borders; preserve the full image. */
.project-card img { width: 100%; height: auto; display: block; transition: transform .25s, filter .25s; }
.project-card:hover img { transform: translateY(-4px); filter: brightness(1.08); }
.project-card span { display: block; }
.project-title { font-size: 1.166667rem; line-height: 1.5; margin-top: 1.5rem; }
.project-meta { font-size: 1rem; color: #676767; line-height: 1.5; margin-top: .25rem; }
.model-carousel { position: relative; height: 33.333333rem; isolation: isolate; outline-offset: 8px; touch-action: pan-y; }
.model-stage { position: absolute; inset: 0; }
.model-card { --render-scale: var(--scale); position: absolute; left: 50%; top: 12.916667rem; width: 19.5rem; height: 25.833333rem; margin: 0; border: 0; border-radius: .4rem; overflow: visible; background: transparent; transform: translate(-50%,-50%) translate(var(--x),var(--y)) rotate(var(--rotate)) scale(var(--scale)); z-index: var(--layer); opacity: var(--opacity,1); box-shadow: 0 .4rem .9rem #0009, 0 1rem 2.5rem #000a; filter: brightness(var(--brightness,1)); transition: transform .55s cubic-bezier(.22,.75,.22,1), opacity .4s, filter .4s; }
/* Covers have slightly different aspect ratios and include their own white edges. */
.model-card img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Restore only the baked-in button area; all other artwork remains the original PNG. */
.model-card .model-button-repair { position: absolute; inset: 0; object-fit: fill; mask-image: var(--button-repair-mask); mask-composite: intersect; pointer-events: none; }
/* Match the reference pill at every depth, compensating for the card's scale. */
.model-card .model-details { position: absolute; bottom: .75rem; right: .75rem; width: 4.5rem; height: 2.25rem; border: 0; outline: 0; box-shadow: none; border-radius: 999px; padding: 0; display: flex; align-items: center; justify-content: center; gap: .375rem; color: #090909; background: #fff; font-size: 1rem; font-weight: 400; line-height: 1; white-space: nowrap; transform: scale(calc(1 / var(--render-scale))); transform-origin: bottom right; transition: transform .55s cubic-bezier(.22,.75,.22,1), background-color .18s ease, color .18s ease; }
.model-card .model-details::after { content: ''; flex: none; width: .5rem; height: .5rem; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
@media (hover: hover) { .model-card .model-details:hover { background: #090909; color: #fff; } }
.model-card:focus-visible .model-details { background: #090909; color: #fff; }
.model-card:focus-visible { outline: none; }
.model-card.is-ghost { pointer-events: none; }
@keyframes model-float {
  0%, 100% { translate: 0 3px; }
  50% { translate: 0 -3px; }
}
@media (prefers-reduced-motion: no-preference) {
  .model-card { animation: model-float 6s ease-in-out infinite; }
  .model-card:nth-child(3n + 2) { animation-delay: -2s; }
  .model-card:nth-child(3n) { animation-delay: -4s; }
  .model-card:focus-visible { animation-play-state: paused; }
}
@media (hover: hover) {
  .model-card:hover { animation-play-state: paused; }
}
.carousel-arrow { position: absolute; z-index: 10; top: 26.333333rem; width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 0; padding: 0; background: transparent; display: grid; place-items: center; transition: filter .2s, transform .2s; }
.carousel-arrow:hover { filter: brightness(1.4); transform: scale(1.06); }
.carousel-arrow.previous { left: 0; }
.carousel-arrow.next { right: 0; }
.carousel-arrow img { display: block; width: 100%; height: 100%; object-fit: contain; }
.model-intro { position: relative; z-index: 8; width: 72%; margin: 0 auto; text-align: center; }
.model-intro h1 { font-size: 2.333333rem; line-height: 3.666667rem; margin-bottom: .666667rem; color: #fff; }
.model-intro p, .model-profile { font-size: 1rem; line-height: 2; color: #9c9c9c; }
.model-profile { display: block; overflow-wrap: anywhere; }
.model-profile:hover { color: #fff; }
.mobile-link-label { display: none; }
.model-stats { width: max-content; margin: 3.75rem auto 0; display: grid; grid-template-columns: repeat(5, auto); }
.model-stats > div { text-align: center; border-right: 1px solid #595959; padding: 0 3.625rem; }
.model-stats > div:last-child { border: 0; }
.model-stats dt { font-size: 3.333333rem; font-weight: 700; line-height: 1.1; color: #fff; }
.model-stats dd { margin: .166667rem 0 0; color: #9c9c9c; font-size: 1rem; line-height: 2; }
.skill-page { position: relative; }
.skill-introduction { display: grid; grid-template-columns: 20.166667rem 29.333333rem 28rem; align-items: center; }
.skill-introduction h1 { font-size: 2.333333rem; line-height: 1.55; font-weight: 600; }
.skill-impact { border-left: 1px solid #3c3c3c; border-right: 1px solid #3c3c3c; padding: 0 3.833333rem; }
.impact-number { display: flex; align-items: center; font-size: 5.833333rem; font-weight: 700; line-height: .85; letter-spacing: -.12rem; white-space: nowrap; }
.impact-approval { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-left: .4rem; }
.impact-approval span { border: 1px solid #aaa; border-radius: .3rem; font-size: 1rem; font-weight: 400; line-height: 1.2; padding: .2rem .25rem; letter-spacing: 0; }
.impact-approval svg { width: 2.333333rem; height: 2.8rem; }
.skill-impact p { margin-top: .6rem; font-size: 1.166667rem; white-space: nowrap; }
.skill-description { padding-left: 3.583333rem; color: #777; font-size: 1rem; line-height: 1.5; }
.skill-board { position: relative; height: 31.666667rem; margin-top: 12.416667rem; isolation: isolate; }
.automation-card { --sway-angle: 2deg; --sway-distance: .35rem; position: absolute; width: 17.5rem; height: 24.166667rem; border-radius: .35rem; padding: 1rem; background: var(--card-color); color: #000; top: var(--top); left: var(--left); transform: rotate(var(--tilt)); transform-origin: 50% 65%; box-shadow: 0 .35rem .9rem #0005, 0 1.4rem 2.6rem #0007; transition: transform .3s ease, box-shadow .3s ease; animation: skill-card-sway var(--sway-duration,6s) ease-in-out var(--sway-delay,0s) infinite; z-index: var(--order,2); display: flex; flex-direction: column; }
/* Animate individual properties so the base tilt and hover lift stay independent. */
@keyframes skill-card-sway {
  0%, 100% { rotate: calc(var(--sway-angle) * -1); translate: calc(var(--sway-distance) * -1) 0; }
  50% { rotate: var(--sway-angle); translate: var(--sway-distance) 0; }
}
.automation-card:focus-within { animation-play-state: paused; z-index: 10; transform: rotate(0deg) translateY(-.8rem); box-shadow: 0 .5rem 1rem #0006, 0 2rem 3.5rem #0009; }
@media (hover: hover) and (pointer: fine) {
  .automation-card:hover { animation-play-state: paused; z-index: 10; transform: rotate(0deg) translateY(-.8rem); box-shadow: 0 .5rem 1rem #0006, 0 2rem 3.5rem #0009; }
}
.automation-card h2 { font-size: 1.333333rem; line-height: 1.35; font-weight: 500; margin: 0; }
.automation-card .skill-view { border: 1px solid #000; border-radius: 2rem; color: #000; background: transparent; font-size: 1rem; line-height: 1.35; padding: .4rem .7rem; align-self: flex-start; margin-top: .85rem; }
.automation-card .skill-view:hover { background: #000; color: #fff; }
.automation-card > img { display: block; margin-top: auto; width: 100%; height: 12.3rem; object-fit: contain; border-radius: .35rem; }
.automation-card[data-skill="compress"] > img { object-fit: contain; border-radius: .8rem; }
.detail-dialog.has-art { width: min(840px,calc(100% - 40px)); max-height: calc(100dvh - 48px); overflow-y: auto; }
.detail-dialog #dialog-image { display: block; width: 100%; max-height: 60dvh; object-fit: contain; background: #060606; border-radius: 7px; margin: 20px 0; }
.detail-dialog .dialog-meta { font-size: 13px; color: #888; margin-top: -8px; }
.dialog-external { display: inline-block; margin-top: 20px; padding: 10px 17px; background: #fff; color: #000; border-radius: 30px; font-size: 14px; }
body:has(dialog[open]) { overflow: hidden; }
@media (max-width:1199px) {
  body[data-page] .site-header { margin-bottom: 48px; }
  .design-section { grid-template-columns: 140px minmax(0,1fr); gap: 24px; padding: 42px 0; }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px 16px; }
  .design-intro p { max-width: 140px; }
  .model-carousel { font-size: 12px; height: 380px; }
  .model-card { width: 210px; height: 278px; top: 140px; transform: translate(-50%,-50%) translate(calc(var(--x) * .67),calc(var(--y) * .7)) rotate(var(--rotate)) scale(var(--scale)); }
  .carousel-arrow { top: 300px; }
  .model-intro { width: 88%; }
  .model-stats { width: 100%; grid-template-columns: repeat(5, minmax(0,1fr)); }
  .model-stats > div { padding: 0 1rem; }
  .model-stats dt { font-size: 25px; line-height: 1.5; }
  .skill-introduction { grid-template-columns: 1fr 1.2fr; gap: 28px; }
  .skill-introduction h1 { font-size: 30px; }
  .skill-impact { padding: 0 28px; border-right: 0; }
  .impact-number { font-size: 64px; }
  .skill-description { grid-column: 1/-1; max-width: 680px; padding: 0; font-size: 14px; line-height: 1.8; }
  .skill-board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 30px 20px; height: auto; margin-top: 52px; }
  .automation-card { --sway-angle: .7deg; --sway-distance: 2px; position: relative; width: 100%; height: 310px; top: auto; left: auto; transform: rotate(0deg); padding: 16px; }
  .automation-card h2 { font-size: 17px; }
  .automation-card > img { height: 165px; }
}
@media (max-width:699px) {
  body[data-page] .site-header { margin-bottom: 32px; }
  .visual-categories { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 0 2px 14px; scrollbar-width: thin; }
  .visual-categories a { padding: 10px 8px; font-size: 12px; border-radius: 7px; white-space: nowrap; }
  .design-section { grid-template-columns: minmax(0,1fr); gap: 24px; padding: 30px 0; }
  .design-intro :is(h1, h2) { font-size: 22px; margin: 0 0 12px; }
  .design-intro :is(h1, h2) br { display: none; }
  .design-intro p { max-width: 100%; font-size: 13px; }
  .project-grid { grid-template-columns: minmax(0,1fr); gap: 32px; }
  .project-title { font-size: 15px; line-height: 1.5; margin-top: 14px; }
  .project-meta { font-size: 12px; margin-top: 5px; }
  .model-carousel { height: 354px; }
  .model-card { --render-scale: calc(var(--scale) * .9); top: 138px; width: 204px; height: 270px; transform: translate(-50%,-50%) translate(calc(var(--x) * .31),calc(var(--y) * .35)) rotate(var(--rotate)) scale(calc(var(--scale) * .9)); }
  .model-card.is-ghost { opacity: 0; }
  .carousel-arrow { top: 296px; width: 38px; height: 38px; }
  .carousel-arrow.previous { left: calc(50% - 55px); }
  .carousel-arrow.next { right: calc(50% - 55px); }
  .model-intro { width: 100%; }
  .model-intro h1 { font-size: 29px; line-height: 1.25; margin-bottom: 12px; }
  .model-intro p { font-size: 13px; line-height: 1.8; }
  .model-profile { font-size: 0; margin-top: 12px; }
  .model-profile > span:not(.mobile-link-label) { display: none; }
  .model-profile .mobile-link-label { display: inline; font-size: 13px; border-bottom: 1px solid #555; padding-bottom: 3px; }
  .model-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 0; margin-top: 34px; }
  .model-stats > div { padding: 0 8px; }
  .model-stats > div:nth-child(even) { border-right: 0; }
  .model-stats > div:last-child { grid-column: 1/-1; }
  .model-stats dt { font-size: 25px; line-height: 1.5; }
  .model-stats dd { font-size: 12px; }
  .skill-introduction { display: block; }
  .skill-introduction h1 { font-size: 31px; line-height: 1.5; }
  .skill-impact { margin-top: 30px; padding: 24px 0; border-left: 0; border-top: 1px solid #333; border-bottom: 1px solid #333; }
  .impact-number { font-size: 70px; }
  .skill-impact p { font-size: 14px; }
  .skill-description { margin-top: 24px; font-size: 13px; }
  .skill-board { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 12px; margin-top: 30px; }
  .automation-card { min-width: 0; height: 240px; padding: 12px; }
  .automation-card h2 { font-size: 14px; }
  .automation-card .skill-view { font-size: 12px; padding: 4px 10px; }
  .automation-card > img { height: 110px; }
  .detail-dialog, .detail-dialog.has-art { padding: 24px 20px; }
  .detail-dialog h2 { font-size: 20px; }
}
@media (prefers-reduced-motion:reduce) { .page-panel, .automation-card { animation: none; } }

.detail-dialog.skill-preview { width: min(520px,calc(100% - 40px)); }
.detail-dialog.skill-preview #dialog-image { width: auto; max-width: 100%; height: auto; margin: 20px auto; background: transparent; }

/* Show the category navigation on upward scroll. */
.visual-floating-navigation { position: fixed; z-index: 30; inset: 0 0 auto; padding-top: env(safe-area-inset-top); background: #000; border-bottom: 1px solid #242424; transform: translateY(-100%); opacity: 0; visibility: hidden; transition: transform .22s ease, opacity .18s ease, visibility 0s .22s; }
.visual-floating-navigation.is-visible { transform: translateY(0); opacity: 1; visibility: visible; transition-delay: 0s; }
.visual-floating-inner { display: flex; align-items: center; gap: 2rem; width: 88.888889%; max-width: 1600px; margin: 0 auto; padding: 1rem 0; }
.visual-floating-inner .visual-categories { position: relative; flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 6px 2px; border: 0; }
.visual-floating-inner .visual-categories::-webkit-scrollbar { display: none; }
#page-visual .design-section { scroll-margin-top: calc(var(--visual-nav-height, 80px) + 16px); }
@media (max-width: 1199px) {
  .visual-floating-inner { width: calc(100% - 80px); gap: 20px; }
}
@media (max-width: 699px) {
  .visual-floating-inner { width: calc(100% - 40px); gap: 12px; padding: 8px 0; }
  .visual-floating-inner .visual-categories { gap: 8px; }
  .visual-floating-inner .visual-categories a { min-height: 44px; display: flex; align-items: center; }
}
