:root {
  color-scheme: light;
  --scrollbar-track: #f8f7f4;
  --scrollbar-thumb: #858b95;
  --ink: #182333;
  --muted: #535f70;
  --surface: #f8f7f4;
  --paper: #fff;
  --line: #d9dce2;
  --brand: #1769ff;
  --brand-strong: #0e55df;
  --brand-light: #89b2ff;
  --blue: var(--brand);
  --navy: #071b56;
  --measure: 43rem;
  --gutter: clamp(1rem, 3.6vw, 3.25rem);
  --page: 83rem;
  --header-height: 76px;
  --system-font: "PingFang SC", "Microsoft YaHei", system-ui, "Noto Sans CJK SC", sans-serif;
  font-family: var(--system-font);
  font-synthesis: none;
}

/* Keep the reserved gutter while blending native scrollbars into each theme. */
html:has(body.showcase) {
  color-scheme: dark;
  --scrollbar-track: #101113;
  --scrollbar-thumb: #656872;
}
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
@supports not (scrollbar-color: auto) {
  html::-webkit-scrollbar { width: 10px; height: 10px; }
  html::-webkit-scrollbar-track,
  html::-webkit-scrollbar-corner { background: var(--scrollbar-track); }
  html::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 2px solid var(--scrollbar-track);
    border-radius: 999px;
  }
  html::-webkit-scrollbar-thumb:hover { background: #7b8290; }
}
@media (forced-colors: active) {
  html { scrollbar-color: auto; scrollbar-width: auto; }
}

*, *::before, *::after { box-sizing: border-box; }
:root[data-platform="windows"] { --system-font: "Microsoft YaHei", "Microsoft YaHei UI", system-ui, sans-serif; }
:root[data-platform="apple"] { --system-font: "PingFang SC", -apple-system, system-ui, sans-serif; }
:root[data-platform="android"] { --system-font: Roboto, "Noto Sans CJK SC", "Noto Sans SC", system-ui, sans-serif; }
html { scrollbar-gutter: stable; scroll-behavior: smooth; scroll-padding-top: var(--header-height); }
body { margin: 0; background: var(--surface); color: var(--ink); font-size: 1rem; line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, .gallery-image:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
h2 { font-size: clamp(1.85rem, 3.45vw, 3.25rem); letter-spacing: -.045em; }
h3 { font-size: clamp(1.125rem, 1.8vw, 1.5rem); }
[id] { scroll-margin-top: 1.4rem; }
.wrap { width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.skip { position: fixed; z-index: 11; top: .5rem; left: .75rem; transform: translateY(-160%); background: white; padding: .6rem 1rem; }
.skip:focus { transform: translateY(0); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  --header-solid: #f8f7f4;
  --header-glass: rgb(248 247 244 / .86);
  --header-divider: rgb(24 35 51 / .12);
}
.site-header.is-scrolled {
  background-color: var(--header-solid);
  box-shadow: 0 1px 0 var(--header-divider);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.is-scrolled {
    background-color: var(--header-glass);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    backdrop-filter: blur(18px) saturate(145%);
  }
}
.header-inner { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.signature { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; min-height: 44px; white-space: nowrap; }
.signature img { flex: none; }
.signature.logo-only { justify-content: center; min-width: 44px; }
.logo-only img { width: 44px; height: 44px; }
.roman { margin-left: .35rem; color: var(--muted); font-size: .825rem; font-weight: 560; }
.site-header nav { display: flex; align-items: center; gap: clamp(.125rem, 1.4vw, 1.25rem); }
.site-header nav a { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; min-width: 44px; padding-inline: .35rem; font-size: .875rem; font-weight: 400; white-space: nowrap; }
.site-header nav a:hover { color: var(--blue); }

.home-hero { min-height: clamp(29rem, 42vw, 37rem); position: relative; isolation: isolate; display: grid; align-items: center; overflow: hidden; border-radius: 1.5rem; background: #061847; color: #fff; }
.hero-art, .hero-art img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.hero-art img { object-fit: cover; object-position: 50% 16%; }
.home-hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(5, 18, 61, .8), rgba(5, 18, 61, .18) 50%, transparent 66%); pointer-events: none; }
.hero-copy { width: min(59%, 41rem); padding: clamp(2rem, 5.6vw, 5.4rem); padding-right: 0; }
.hero-role { width: fit-content; margin-bottom: 1.1rem; background: #0d2a76; border: 1px solid #7296e1; border-radius: 100px; padding: .25rem .7rem; color: #fff; font-size: .81rem; font-weight: 650; }
.hero-copy h1 { font-size: clamp(2.65rem, 5.15vw, 4.7rem); font-weight: 850; letter-spacing: -.075em; line-height: 1.13; }
.hero-intro { max-width: 25em; margin-top: 1.5rem; font-size: clamp(.9375rem, 1.28vw, 1.125rem); color: #e7eeff; }
.hero-actions { margin-top: 1.55rem; display: flex; align-items: center; gap: clamp(.65rem, 2vw, 1.5rem); flex-wrap: wrap; }
.button, .hero-about { min-height: 48px; display: inline-flex; align-items: center; gap: .6rem; font-size: .925rem; font-weight: 750; }
.button { padding-inline: 1.05rem; border-radius: 100px; }
.button-white { background: white; color: var(--navy); }
.button-white:hover { background: #e6edff; }
.hero-about { color: #fff; }
.hero-about:hover { color: var(--ink); }
.home-hero a:focus-visible, .closing a:focus-visible { outline-color: #fff; }

.home-section { margin-block: clamp(3.5rem, 7vw, 6.5rem); }
#projects { margin-top: clamp(3rem, 5.1vw, 5.2rem); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.55rem; }
.section-head p { color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.875rem, 2.2vw, 2rem); }
.project-card { display: flex; position: relative; min-width: 0; padding-top: .6rem; }
.project-card::before { content: ""; width: 34%; height: 1.375rem; background: var(--tab); position: absolute; top: 0; left: 0; border-radius: .775rem .775rem 0 0; }
.project-card a { position: relative; width: 100%; border: 1px solid var(--line); border-radius: 0 1.15rem 1.15rem 1.15rem; overflow: hidden; background: white; }
.project-card a:hover { border-color: var(--accent); }
.project-card a:hover .card-arrow { background: var(--accent); color: white; border-color: transparent; }
.project-art { height: auto; aspect-ratio: 1.58; display: grid; place-items: center; overflow: hidden; }
.project-art > img { height: 100%; width: 100%; object-fit: cover; }
.card-content { position: relative; padding: 1.15rem 1.3rem 1.3rem; }
.card-content :is(h2, h3) { font-size: clamp(1.25rem, 2.05vw, 1.75rem); margin-block: .15rem .65rem; letter-spacing: normal; }
.card-content > p:last-of-type { color: var(--muted); max-width: 26em; }
.project-kind { color: var(--accent); font-size: .8125rem; font-weight: 750; }
.card-arrow { display: grid; place-items: center; position: absolute; top: 1.15rem; right: 1.125rem; width: 2.15rem; height: 2.15rem; border-radius: 50%; border: 1px solid var(--line); font-weight: 750; transition: background-color .2s, color .2s; }
.tone-rongji { --accent: #126174; --tint: #e6f3f5; --tab: #a7dadd; }
.tone-retail { --accent: #8c4806; --tint: #fff0db; --tab: #f5c688; }
.tone-wellness { --accent: #a0244b; --tint: #fbe9ee; --tab: #e7a9bb; }
.rongji-art { background: radial-gradient(ellipse at 38% 15%, #a9e4e2, #4d9da9 55%, #245367 100%); }
.retail-art { background: #f4d2a8; }
.wellness-art { background: #27252b url("wellness-cover.webp") center / cover no-repeat; }

.board { width: 90%; display: grid; grid-template-columns: 23% 1fr; border: 1px solid #a5bdc6; background: white; color: #25384f; border-radius: .65rem; overflow: hidden; box-shadow: 0 .9rem 2.1rem #12354742; transform: rotate(-4deg); text-align: left; }
.board-nav { padding: clamp(.4rem, 1.35vw, 1.15rem) clamp(.28rem, 1vw, .8rem); display: grid; align-content: start; gap: .3rem; background: #142d3a; color: #dfedf0; font-size: .55rem; }
.board-nav b { margin: .1rem .2rem .5rem; font-size: .8rem; color: #fff; }
.board-nav span { padding: .15rem .2rem; white-space: nowrap; }
.board-nav .selected { background: #246078; border-radius: .18rem; color: #fff; }
.board-main { min-width: 0; background: #f6fafb; padding: 6%; }
.board-heading { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .6rem; font-size: clamp(.58rem, 1vw, .85rem); }
.board-heading span { font-size: .64em; color: #386370; }
.board-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .22rem; }
.board-steps span { background: #dff2f4; border-radius: .2rem; text-align: center; font-size: clamp(.42rem, .8vw, .65rem); font-weight: 700; padding: .52em .1em; }
.board-rows { margin-top: .5rem; display: grid; gap: .3rem; }
.board-rows i { display: block; height: .55rem; background: repeating-linear-gradient(90deg, #dce6ea, #dce6ea 21%, #f5fafb 21%, #f5fafb 25%); border-radius: .12rem; }
.board-mini { max-width: 25rem; }

.well-phone { width: 38%; max-width: 12.4rem; aspect-ratio: .66; display: flex; flex-direction: column; border: .3rem solid #171c27; background: #fffcfc; box-shadow: 0 .9rem 1.75rem #0009; border-radius: clamp(.75rem, 2vw, 1.6rem); overflow: hidden; transform: rotate(8deg); color: #3f2130; }
.well-phone-small { width: 35%; max-width: 10rem; }
.phone-cap { flex: none; background: #171c27; width: 36%; height: .36rem; border-radius: 0 0 .5rem .5rem; margin-inline: auto; }
.well-phone::after { content: ""; flex: none; height: .15rem; width: 30%; margin: auto auto .25rem; border-radius: 1rem; background: #263345; }
.well-screen { padding: 7% 7% 8%; display: grid; gap: .45rem; font-size: clamp(.53rem, 1vw, .95rem); }
.well-score { display: grid; gap: .2rem; color: #fff; background: #a5204a; border-radius: .35rem; padding: .55em .65em; }
.well-score span { font-size: .72em; }
.well-bars { display: flex; gap: 8%; height: clamp(.8rem, 1.95vw, 1.7rem); align-items: end; margin: .2rem .1rem; }
.well-bars i { flex: 1; height: 42%; background: #c6597d; border-radius: 50px 50px 0 0; }
.well-bars i:nth-child(2n) { height: 66%; }
.well-bars i:nth-child(3n) { height: 86%; }
.well-bars i:nth-child(5) { height: 57%; }
.well-bars i:nth-child(6) { height: 84%; }
.well-bars i:last-child { height: 98%; background: #a5204a; }
.well-medals { display: flex; gap: .3rem; justify-content: space-around; margin-top: .3rem; }
.well-medals i { font-style: normal; display: grid; place-items: center; font-size: .7em; width: 1.8em; height: 1.8em; border-radius: 35%; color: #4a2031; background: #ffc782; }
.well-medals i:nth-child(2) { background: #f3a0ba; }
.well-medals i:nth-child(3) { background: #b4dac6; }

.about-section { padding-top: 3rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(2rem, 6vw, 6rem); }
.about-copy p { color: var(--muted); margin-top: .9rem; max-width: 42ch; }
.about-copy .about-lead { margin-top: 1.15rem; color: var(--ink); font-weight: 730; font-size: clamp(1.125rem, 1.95vw, 1.45rem); }
.about-experience h3 { margin-bottom: .875rem; }
.timeline > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .7rem; padding-block: .9rem; border-top: 1px solid var(--line); }
.timeline dt { font-size: .813rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .16rem; }
.timeline dd { display: grid; gap: .16rem; }
.timeline dd span { color: var(--muted); font-size: .875rem; }
.closing { position: relative; isolation: isolate; min-height: 19rem; overflow: hidden; display: flex; align-items: center; border-radius: 1.4rem; background: radial-gradient(ellipse at 83% 83%, #1a58de 0%, #10296e 52%, #071a4d 100%); color: white; }
.closing-copy { padding: clamp(1.75rem, 5vw, 4rem); position: relative; z-index: 1; width: 64%; }
.closing-copy h2 { color: white; }
.closing-label { font-size: .8125rem; color: #d4e1ff; margin-bottom: .7rem; }
.closing-copy p:last-child { max-width: 27em; color: #e1eaff; margin-top: 1rem; }
.closing img { position: absolute; right: 4%; bottom: -10%; width: min(44%, 25rem); height: auto; }
.site-footer { padding-block: 1rem; min-height: 4.5rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; font-size: .83rem; color: var(--muted); }
.site-footer a { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; }
.site-footer a:hover { color: var(--blue); }
.portfolio-case-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.75rem, 4vw, 3rem);
  padding-block: clamp(1.25rem, 3.5vw, 2.75rem);
}
.portfolio-case-switch > div { display: grid; align-content: center; justify-items: start; gap: .35rem; }
.portfolio-case-switch > div:last-child { justify-items: end; text-align: right; }
.portfolio-case-switch span { color: var(--muted); font-size: .85rem; }
.portfolio-case-switch a { font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 700; line-height: 1.45; }
.portfolio-case-switch a:is(:hover, :focus-visible) { color: #101113; }
.portfolio-case-switch + .site-footer { border-top: 1px solid #d9dce2; }
.case-detail .site-header:not([data-theme="dark"]) nav a:is(:hover, :focus-visible),
.case-detail .site-footer a:is(:hover, :focus-visible) { color: #101113; }

.case { padding-bottom: 2rem; }
.case-intro { margin-top: .35rem; }
.crumb { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .875rem; color: var(--muted); margin-bottom: 1rem; }
.crumb:hover { color: var(--accent); }
.case-hero { display: grid; grid-template-columns: 1fr 1.1fr; background: var(--tint); border-radius: 1.4rem; overflow: hidden; }
.case-hero-copy { min-width: 0; padding: clamp(1.55rem, 4vw, 3.6rem); align-self: center; }
.case-hero h1 { margin: .35rem 0 1.05rem; font-size: clamp(2.2rem, 4.25vw, 4.65rem); letter-spacing: -.065em; font-weight: 850; }
.case-deck { font-size: clamp(1.04rem, 1.65vw, 1.35rem); color: #344457; max-width: 31ch; }
.case-visual { min-height: max(100%, 17rem); display: grid; place-items: center; overflow: hidden; position: relative; }
.case-visual > img { width: 100%; height: 100%; object-fit: cover; position: absolute; }
.case-visual .board { width: 84%; max-width: 31rem; }
.case-visual .board-nav { font-size: clamp(.58rem, .92vw, .75rem); }
.case-visual .board-nav b { font-size: 1rem; }
.case-visual .board-heading { font-size: clamp(.8rem, 1.35vw, 1.1rem); }
.case-visual .board-rows i { height: clamp(.65rem, 1.4vw, 1.1rem); }
.case-visual .well-phone { width: min(39%, 10rem); transform: rotate(4deg); }
.case-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; margin-block: 1.35rem 2.5rem; padding: 1.3rem 0; border-block: 1px solid var(--line); }
.case-facts dt { color: var(--accent); font-size: .8rem; font-weight: 750; margin-bottom: .3rem; }
.case-facts dd { color: var(--ink); }
.case-layout { display: grid; grid-template-columns: minmax(9rem, 13.25rem) minmax(0, 59rem); justify-content: start; gap: clamp(1.5rem, 4vw, 4.5rem); }
.case-nav { align-self: start; position: sticky; top: calc(var(--header-height) + 1.4rem); }
.case-nav p { color: var(--muted); font-size: .8rem; font-weight: 700; padding: 0 .65rem .45rem; }
.case-nav a { display: flex; align-items: center; min-height: 44px; padding-inline: .65rem; color: #415063; border-radius: .5rem; font-size: .9rem; }
.case-nav a:hover { background: var(--tint); color: var(--accent); }
.case-content { min-width: 0; }
.case-section { padding-top: 1.8rem; margin-bottom: clamp(2.5rem, 5.7vw, 4.5rem); border-top: 1px solid var(--line); }
.case-section h2 { font-size: clamp(1.68rem, 3.1vw, 2.7rem); max-width: 25em; }
.case-section h3 { margin-bottom: .4rem; }
.case-section > p { max-width: var(--measure); margin-top: .85rem; color: #485770; }
.case-section .lead { color: var(--ink); font-size: clamp(1.03rem, 1.4vw, 1.13rem); }
.case-section strong { color: var(--ink); }
.section-kicker { color: var(--accent); font-size: .813rem; font-weight: 770; margin-bottom: .45rem; }
.workflow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin: 1.25rem 0 0; }
.workflow li { display: grid; align-content: start; gap: .28rem; min-width: 0; background: var(--tint); color: var(--ink); border-radius: .6rem; padding: .8rem; font-weight: 730; }
.workflow span { color: var(--muted); font-size: .8125rem; font-weight: 450; }
.evidence { margin-block: 1.25rem .25rem; }
.evidence figcaption, .mini-caption { color: var(--muted); font-size: .85rem; margin-top: .58rem; }
.demo { border: 1px solid var(--line); border-radius: .9rem; overflow: hidden; background: #fff; }
.demo-top { display: flex; gap: .5rem; justify-content: space-between; align-items: baseline; background: var(--tint); padding: .75rem 1rem; font-size: .925rem; }
.demo-top span { color: var(--accent); font-weight: 700; font-size: .75rem; }
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demo-panel { min-width: 0; padding: 1.05rem; }
.demo-panel + .demo-panel { border-left: 1px solid var(--line); }
.demo-panel p { color: var(--muted); font-size: .9rem; }
.demo-title { margin-bottom: .35rem; font-size: 1rem; font-weight: 750; }
.demo-item { display: flex; align-items: center; justify-content: space-between; gap: .45rem; background: #f5f7f9; border: 1px solid #e2e8ed; border-radius: .45rem; padding: .45rem .6rem; margin-top: .55rem; font-size: .85rem; }
.demo-item span:last-child { color: var(--accent); font-weight: 690; text-align: right; }
.demo-item[data-highlight] { background: var(--tint); }
.demo-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: .85rem; gap: .55rem; list-style-type: none; counter-reset: demo; }
.demo-steps li { border: 1px solid var(--line); border-radius: .5rem; padding: .75rem; counter-increment: demo; }
.demo-steps li::before { content: counter(demo, decimal-leading-zero); display: block; font-variant-numeric: tabular-nums; color: var(--accent); font-size: .75rem; font-weight: 750; }
.demo-steps span { display: block; color: var(--muted); font-size: .85rem; }
.evidence-photo { overflow: hidden; border-radius: .85rem; border: 1px solid var(--line); background: white; }
.evidence-photo img { width: 100%; }
.evidence-photo:hover { border-color: var(--accent); }
.photo-link { display: block; }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.compare-title { font-weight: 750; font-size: .9375rem; margin-bottom: .4rem; }
.device-set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(.55rem, 2vw, 1.65rem); justify-items: stretch; padding: clamp(.65rem, 2.7vw, 1.9rem); background: var(--tint); border-radius: .85rem; }
.device { display: flex; min-width: 0; flex-direction: column; align-items: center; }
.device .device-label { align-self: stretch; color: var(--accent); font-size: .825rem; font-weight: 740; text-align: center; margin-bottom: .5rem; }
.device .photo-link { max-width: 14.5rem; overflow: hidden; border-radius: 1rem; border: 1px solid #b9b7b4; background: white; height: fit-content; }
.device .photo-link:hover { border-color: var(--accent); }
.device .photo-link img { width: 100%; }
.device .demo-panel { width: 100%; border-radius: .65rem; background: #fff; }
.device .device-compact { max-width: 9.5rem; }
.device-inline { display: grid; grid-template-columns: minmax(5rem, 8rem) minmax(0, 16rem); justify-content: center; align-items: center; gap: clamp(.85rem, 3vw, 2rem); padding: 1rem; background: var(--tint); border-radius: .85rem; }
.device-inline figcaption { margin: 0; }
.insights { margin-top: 1.1rem; }
.insights > div { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr); gap: .85rem; padding: .85rem .8rem; border-top: 1px solid var(--line); }
.insights dt { color: var(--ink); font-weight: 750; }
.insights dd { color: var(--muted); }
.case-callout { margin-top: 1.15rem; padding: .95rem 1.05rem; background: var(--tint); border-left: .23rem solid var(--accent); border-radius: .2rem .6rem .6rem .2rem; }
.case-callout p { color: #3c4a5d; margin-top: .25rem; }
.medal-visual { min-height: 13rem; display: grid; place-items: center; background: #363536 url("wellness-stage.webp") center 60% / cover no-repeat; border-radius: .85rem; }
.medal-visual .well-medals { width: min(75%, 13rem); margin: 0 0 1rem; font-size: clamp(1.4rem, 3.5vw, 2.75rem); }
.medal-visual i { box-shadow: 0 .35rem 1rem #16161688; border: 2px solid #fff8; }

.gallery-dialog { width: min(70rem, calc(100% - 1.5rem)); max-width: none; max-height: 94dvh; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: .9rem; overflow: hidden; }
.gallery-dialog[open] { display: flex; flex-direction: column; }
.gallery-dialog::backdrop { background: #09142dda; }
.gallery-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem; padding: .55rem 1rem; border-bottom: 1px solid var(--line); }
.gallery-head h2 { flex: 1 0 min(100%, 10rem); font-size: 1rem; letter-spacing: 0; }
.gallery-actions { display: flex; align-items: center; gap: .5rem; }
.gallery-actions button { min-height: 44px; padding: .45rem .7rem; font: inherit; font-size: .875rem; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: .45rem; cursor: pointer; }
.gallery-actions button:hover { background: var(--tint); }
.gallery-image { overflow: auto; padding: .7rem; background: #eef0f3; }
.gallery-image:focus-visible { outline-offset: -4px; }
.gallery-image img { width: auto; max-height: 75dvh; margin-inline: auto; object-fit: contain; }
.gallery-image.actual-size img { max-width: none; max-height: none; }

@media (min-width: 681px) and (max-width: 870px) {
  .home-hero { min-height: 27rem; }
  .hero-copy { padding-left: 2rem; width: 62%; }
  .hero-art img { object-position: 57% 40%; }
  .hero-copy h1 { font-size: clamp(2.5rem, 5.8vw, 3.2rem); }
  .card-content { padding-inline: .9rem; }
  .card-arrow { top: .85rem; right: .65rem; }
  .about-section { gap: 2rem; }
  .timeline > div { grid-template-columns: 1fr; gap: .1rem; }
}

@media (max-width: 800px) {
  .case-layout { grid-template-columns: minmax(0, 1fr); gap: 1.15rem; }
  .case-nav { position: static; }
  .case-nav p { padding-left: 0; }
  .case-nav nav { display: flex; gap: .35rem .45rem; flex-wrap: wrap; }
  .case-nav a { border: 1px solid var(--line); background: white; }
}

@media (max-width: 680px) {
  :root { --header-height: 62px; }
  .logo-only img { width: 38px; height: 38px; }
  .signature { gap: .35rem; font-size: .94rem; }
  .signature .roman { display: none; }
  .home-hero { display: flex; flex-direction: column; align-items: stretch; min-height: 0; border-radius: 1.05rem; background: #061847; }
  .hero-copy { order: -1; width: 100%; padding: clamp(1.25rem, 5vw, 2rem) clamp(1.125rem, 5vw, 2rem) 1rem; }
  .hero-copy h1 { font-size: clamp(2.2rem, 8.3vw, 3.45rem); letter-spacing: -.065em; }
  .hero-role { margin-bottom: .9rem; }
  .hero-intro { margin-top: .95rem; }
  .hero-actions { margin-top: .85rem; gap: .15rem 1rem; }
  .hero-art, .hero-art img { position: relative; z-index: auto; }
  .hero-art { display: block; aspect-ratio: 1.31; overflow: hidden; }
  .hero-art img { object-position: center; }
  .hero-art::after { content: ""; inset: 0; position: absolute; background: linear-gradient(#061847, transparent 16%); pointer-events: none; }
  .home-hero::after { display: none; }
  .section-head { display: grid; gap: .25rem; margin-bottom: 1.15rem; }
  .section-head p { font-size: .91rem; }
  .project-grid, .about-section { grid-template-columns: minmax(0, 1fr); }
  .project-grid { gap: 1.2rem; }
  .project-art { aspect-ratio: 1.65; }
  .card-content > p:last-of-type { font-size: .9375rem; }
  .about-section { padding-top: 2rem; }
  .timeline > div { grid-template-columns: minmax(6.65rem, 7.5rem) 1fr; gap: .55rem; }
  .timeline dt, .timeline dd span { font-size: .8rem; }
  .closing { display: grid; min-height: 0; border-radius: 1.05rem; }
  .closing-copy { width: 100%; padding: 1.4rem 1.3rem .2rem; }
  .closing img { position: relative; right: auto; bottom: auto; justify-self: end; width: min(58%, 14rem); margin-right: 1rem; }
  .case-hero { grid-template-columns: 1fr; border-radius: 1rem; }
  .case-hero-copy { padding: 1.3rem; }
  .case-hero h1 { margin-bottom: .8rem; }
  .case-visual { min-height: clamp(11rem, 51vw, 20rem); }
  .case-facts { grid-template-columns: 1fr; gap: .85rem; margin-block: 1rem 1.4rem; padding-block: .9rem; }
  .case-facts dt { margin-bottom: .12rem; }
  .case-facts dd { font-size: .92rem; }
  .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-panel + .demo-panel { border-left: 0; border-top: 1px solid var(--line); }
  .demo-steps { grid-template-columns: 1fr; }
  .comparison { grid-template-columns: 1fr; }
  .insights > div { grid-template-columns: 1fr; gap: .25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Global interaction rule: links never gain an underline; preserve focus outlines. */
a:is(:hover, :focus-visible, :active) { text-decoration: none; }

@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }
