:root {
  --bg: #f4f4f4;
  --ink: #050505;
  --muted: rgba(5, 5, 5, .42);
  --line: rgba(5, 5, 5, .82);
  --cell-pad: clamp(10px, .78vw, 20px);
  --block-gap: 17px;
  --nav-h: clamp(38px, 2.95vw, 76px);
  --nav-font: clamp(17px, 1.34vw, 34px);
  --body-font: clamp(17px, 1.34vw, 34px);
  --display-font: clamp(94px, 12.5vw, 320px);
  --category-title-font: clamp(72px, min(13vw, 24svh), 300px);
  --category-title-gap: clamp(36px, min(6.5vw, 12svh), 150px);
  --category-title-line-half: clamp(31px, min(5.59vw, 10.32svh), 129px);
  --ease: cubic-bezier(.19, 1, .22, 1);
  --font: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--body-font);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a,
button {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

.tri-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tri-cell {
  min-width: 0;
  padding-left: var(--cell-pad);
  padding-right: var(--cell-pad);
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  font-size: var(--nav-font);
  line-height: var(--nav-h);
}

.site-nav.is-scrolled {
  border-bottom-color: var(--line);
}

.home-view {
  position: relative;
  min-height: 100svh;
  padding-top: var(--nav-h);
  overflow: hidden;
  background: var(--bg);
}

.carousel-track {
  position: relative;
  height: calc(100svh - var(--nav-h));
}

.carousel-slide {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  background: var(--block-bg, #ddd);
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.01);
  pointer-events: none;
  transition: opacity 620ms var(--ease), transform 920ms var(--ease);
}

.carousel-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.carousel-block {
  display: none;
}

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  min-height: var(--nav-h);
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(244, 244, 244, .72);
  font-size: var(--nav-font);
  line-height: 1;
}

.carousel-counter {
  text-align: right;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 8;
  width: clamp(54px, 7vw, 112px);
  height: clamp(54px, 7vw, 112px);
  border: 1px solid rgba(5, 5, 5, .22);
  border-radius: 999px;
  background: rgba(244, 244, 244, .24);
  color: rgba(5, 5, 5, .48);
  font-size: 0;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  transition: background 180ms ease, color 180ms ease, opacity 180ms ease;
}

.carousel-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  width: clamp(16px, 2vw, 30px);
  height: clamp(16px, 2vw, 30px);
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
}

.carousel-arrow-prev {
  left: var(--cell-pad);
}

.carousel-arrow-prev::before {
  left: 56%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.carousel-arrow-next {
  right: var(--cell-pad);
}

.carousel-arrow-next::before {
  left: 44%;
  transform: translate(-50%, -50%) rotate(135deg);
}

.carousel-arrow:hover {
  background: rgba(244, 244, 244, .42);
  color: rgba(5, 5, 5, .72);
}

.nav-cell {
  padding-left: var(--cell-pad);
  padding-right: var(--cell-pad);
  white-space: nowrap;
}

.nav-center,
.nav-info {
  text-align: left;
}

.index-view {
  position: relative;
  min-height: 100svh;
  padding-top: var(--nav-h);
  scroll-margin-top: var(--nav-h);
  overflow: visible;
}

.index-title {
  min-height: clamp(250px, 54svh, 560px);
  align-items: center;
}

.index-title h1 {
  font-size: var(--display-font);
  font-weight: 800;
  line-height: .82;
  white-space: nowrap;
  text-align: left;
}

.intro-grid {
  align-items: start;
  padding-bottom: clamp(18px, 2.8vw, 48px);
}

.intro-address p,
.intro-copy p {
  max-width: 15.5em;
}

.intro-copy p {
  max-width: 22em;
}

.brand-strip {
  height: 100px;
  align-items: stretch;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.brand-strip-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: var(--nav-font);
  line-height: 1;
}

.brand-strip-title a {
  width: fit-content;
  margin-top: .18em;
  color: var(--muted);
  font-size: .62em;
}

.brand-marquee {
  grid-column: span 2;
  min-width: 0;
  overflow: hidden;
}

.brand-marquee-track {
  display: flex;
  width: max-content;
  height: 100%;
  align-items: center;
  gap: clamp(36px, 5vw, 96px);
  padding-left: var(--cell-pad);
  animation: brand-marquee var(--brand-speed, 28s) linear infinite;
}

.brand-logo {
  display: inline-flex;
  height: 68px;
  min-width: 120px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--ink);
}

.brand-logo img {
  display: block;
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
}

.brand-logo-text {
  font-size: var(--nav-font);
  white-space: nowrap;
}

@keyframes brand-marquee {
  to {
    transform: translateX(-50%);
  }
}

.rule-line {
  height: 1px;
  margin: 0 var(--cell-pad);
  background: var(--line);
}

.category-index {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 var(--cell-pad);
  margin-bottom: 0;
  overflow: visible;
  scroll-margin-top: var(--nav-h);
}

.category-zone {
  position: relative;
}

.category-toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.category-toolbar .work-filter {
  padding-top: 20px;
  padding-bottom: 20px;
}

.work-filter {
  position: relative;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 0 .5em;
  padding: clamp(8px, .8vw, 18px) var(--cell-pad) 0;
  font-size: var(--nav-font);
}

.work-filter .category-button {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: auto;
  min-height: 0;
  max-width: none;
  font-size: var(--nav-font);
  line-height: 1.1;
  text-align: left;
}

.work-filter .category-main {
  display: inline;
}

.work-filter .category-button sup {
  position: relative;
  left: auto;
  top: -.15em;
  margin-left: .02em;
  font-size: .62em;
  transform: none;
}

.work-filter .category-button small {
  display: none;
}

.category-button {
  position: relative;
  display: block;
  width: fit-content;
  max-width: calc(100vw - var(--cell-pad) * 2);
  padding: 0;
  margin: 0 auto;
  font-size: clamp(48px, min(8.15vw, 10.2svh), 190px);
  font-weight: 800;
  line-height: .82;
  text-align: center;
  white-space: nowrap;
  transition: opacity 240ms ease, transform 520ms var(--ease);
}

.category-main {
  display: inline-block;
}

.home-category-section {
  position: relative;
  min-height: 100svh;
  scroll-margin-top: var(--nav-h);
}

.category-section-title {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--category-title-gap) var(--block-gap);
}

.category-section-title h2 {
  position: relative;
  width: fit-content;
  max-width: calc(100vw - var(--cell-pad) * 2);
  font-size: var(--category-title-font);
  font-weight: 800;
  line-height: .86;
  text-align: center;
  white-space: nowrap;
}

.category-section-title sup {
  position: absolute;
  left: calc(100% + .02em);
  top: .05em;
  margin-left: 0;
  font-size: .32em;
  line-height: 0;
}

.category-section-title small {
  position: absolute;
  left: calc(100% + 1.25em);
  top: 50%;
  display: block;
  margin-left: 0;
  font-size: .105em;
  font-weight: 600;
  line-height: 1;
  opacity: .48;
  transform: translateY(-50%);
}

.home-category-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--block-gap);
  padding: 0 var(--block-gap) clamp(80px, 9vw, 180px);
}

.category-button:hover,
.category-button:focus-visible,
.site-nav a:hover,
.site-nav a:focus-visible,
.feature-bar a:hover,
.feature-bar a:focus-visible,
.site-row a:hover,
.site-row a:focus-visible,
.project-card:hover,
.project-card:focus-visible {
  color: #fff;
  opacity: 1;
}

.project-card:hover .project-meta,
.project-card:focus-visible .project-meta {
  color: #fff;
}

.category-button sup {
  position: absolute;
  left: calc(100% + .02em);
  top: .03em;
  margin-left: 0;
  font-size: .32em;
  line-height: 0;
}

.category-button small {
  position: absolute;
  left: calc(100% + 1.25em);
  top: 50%;
  display: block;
  margin-left: 0;
  font-size: .105em;
  font-weight: 600;
  line-height: 1;
  opacity: .48;
  transform: translateY(-50%);
}

.featured-view,
.detail-view,
.info-view {
  position: relative;
  min-height: 100svh;
  padding-top: 0;
  overflow: hidden;
}

.feature-bar {
  position: sticky;
  top: 0;
  z-index: 12;
  height: var(--nav-h);
  align-items: center;
  background: #e8e8e8;
  font-size: var(--nav-font);
  line-height: var(--nav-h);
}

.feature-close {
  text-align: right;
}

.site-row {
  position: sticky;
  top: var(--nav-h);
  z-index: 11;
  height: var(--nav-h);
  align-items: center;
  background: var(--bg);
  font-size: var(--nav-font);
  line-height: var(--nav-h);
}

.watermark {
  position: absolute;
  top: calc(var(--nav-h) * 2 + clamp(56px, 7vw, 150px));
  left: 28vw;
  z-index: 0;
  color: rgba(255, 255, 255, .72);
  font-size: var(--display-font);
  font-weight: 800;
  line-height: .78;
  pointer-events: none;
  white-space: nowrap;
}

.project-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--block-gap);
  padding: clamp(190px, 21vw, 480px) var(--block-gap) clamp(40px, 6vw, 120px);
}

.project-card-wrap {
  min-width: 0;
  opacity: 0;
  transform: translateY(18vh);
}

.project-card-wrap.is-visible {
  animation: project-in 720ms var(--ease) forwards;
}

.project-card {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
}

.project-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--block-bg, #ddd);
}

.project-thumb img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb::before,
.gallery-block::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(120deg, rgba(255,255,255,.68), transparent 45%),
    radial-gradient(circle at 70% 25%, rgba(255,255,255,.5), transparent 20%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.project-thumb::after,
.gallery-block::after {
  content: attr(data-index);
  position: absolute;
  right: clamp(10px, .8vw, 18px);
  bottom: clamp(8px, .65vw, 16px);
  color: rgba(255,255,255,.72);
  font-size: clamp(64px, 8vw, 190px);
  font-weight: 800;
  line-height: .72;
  mix-blend-mode: difference;
  z-index: 2;
}

.project-title {
  margin-top: clamp(7px, .55vw, 14px);
  font-size: var(--nav-font);
  font-weight: 700;
  line-height: 1;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--cell-pad);
  margin-top: clamp(6px, .45vw, 12px);
  color: var(--muted);
  font-size: clamp(14px, 1vw, 25px);
}

@keyframes project-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-view {
  overflow: visible;
}

.detail-intro {
  min-height: clamp(260px, 31vw, 620px);
  padding-top: 0;
}

.detail-meta,
.detail-title-copy {
  padding-top: clamp(8px, .7vw, 18px);
}

.detail-meta dl {
  display: grid;
  grid-template-columns: 1fr 1.75fr;
  column-gap: var(--cell-pad);
}

.detail-meta dt,
.detail-meta dd {
  font-size: var(--nav-font);
  line-height: 1.15;
}

.detail-meta dt {
  color: var(--muted);
}

.detail-title-copy h1,
.detail-title-copy h2 {
  margin-bottom: clamp(22px, 3vw, 66px);
  font-size: clamp(34px, 3vw, 76px);
  line-height: .95;
}

.detail-title-copy p {
  max-width: 27em;
  font-size: clamp(20px, 1.85vw, 48px);
  line-height: 1.06;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--block-gap);
  padding: 0 var(--block-gap) clamp(50px, 8vw, 160px);
}

.more-projects .project-grid {
  padding-top: clamp(120px, 13vw, 260px);
}

.gallery-block {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--block-bg, #ddd);
  border-top: 1px solid var(--line);
}

.gallery-block img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-block.wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

.gallery-block .frame-count {
  position: absolute;
  top: clamp(9px, .78vw, 20px);
  left: 0;
  z-index: 2;
  font-size: var(--nav-font);
  font-weight: 700;
}

.info-view {
  min-height: 72svh;
}

.info-content {
  padding-top: clamp(110px, 15vw, 320px);
  padding-bottom: clamp(42px, 6vw, 120px);
}

.info-content h2 {
  font-size: var(--display-font);
  font-weight: 800;
  line-height: .78;
}

.info-content h1 {
  font-size: var(--display-font);
  font-weight: 800;
  line-height: .78;
}

.info-content p {
  max-width: 23em;
}

.contact-line {
  margin-top: clamp(26px, 3vw, 70px);
}

.admin-view {
  padding-top: var(--nav-h);
}

.admin-hero {
  padding: clamp(110px, 15vw, 280px) var(--block-gap) clamp(42px, 5vw, 96px);
}

.admin-hero h1 {
  font-size: var(--display-font);
  font-weight: 800;
  line-height: .78;
}

.admin-hero p {
  max-width: 28em;
  margin-top: clamp(18px, 2vw, 42px);
}

.admin-panel,
.admin-toolbar,
.admin-actions {
  border-top: 1px solid var(--line);
  padding: var(--block-gap);
}

.admin-toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--block-gap);
  background: rgba(244, 244, 244, .96);
  border-bottom: 1px solid var(--line);
}

.admin-save-status {
  min-width: min(360px, 100%);
  margin-left: auto;
  font-size: clamp(14px, 1vw, 22px);
}

.admin-save-bar {
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.admin-save-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 220ms ease;
}

.admin-panel-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--block-gap);
  margin-bottom: var(--block-gap);
}

.admin-panel-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-panel h2 {
  font-size: clamp(34px, 4.5vw, 98px);
  line-height: .86;
}

.admin-panel label {
  display: grid;
  grid-template-columns: minmax(110px, 18vw) 1fr;
  gap: var(--block-gap);
  align-items: start;
  margin-top: var(--block-gap);
}

.admin-panel input,
.admin-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 8px;
}

.admin-panel textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-upload {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  margin-top: 0 !important;
}

.admin-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.admin-upload-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  cursor: pointer;
}

.admin-upload:hover .admin-upload-button,
.admin-upload:focus-within .admin-upload-button {
  color: #fff;
}

.admin-upload-note {
  color: var(--muted);
  font-size: clamp(13px, .9vw, 18px);
  line-height: 1.05;
}

.admin-upload-compact {
  width: auto !important;
}

.admin-panel button,
.admin-toolbar button,
.admin-actions button {
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: transparent;
}

.admin-panel button:disabled {
  cursor: default;
  opacity: .28;
}

.admin-panel button:hover,
.admin-panel button:focus-visible,
.admin-toolbar button:hover,
.admin-toolbar button:focus-visible,
.admin-actions button:hover,
.admin-actions button:focus-visible,
.admin-panel-head button.is-saved {
  color: #fff;
}

.admin-list {
  display: grid;
  gap: var(--block-gap);
}

.admin-brand-list {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.admin-brand-item {
  flex: 1 1 min(380px, 100%);
  display: grid;
  grid-template-columns: minmax(180px, 42%) minmax(0, 1fr);
  gap: var(--block-gap);
  padding-top: var(--block-gap);
  border-top: 1px solid rgba(5, 5, 5, .22);
}

.admin-brand-preview {
  min-height: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #d6e8f7;
  padding: var(--block-gap);
  text-align: center;
}

.admin-brand-preview img {
  display: block;
  max-width: 100%;
  max-height: 118px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.admin-brand-controls {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--block-gap);
}

.admin-speed-control {
  display: inline-flex;
  border: 1px solid var(--line);
}

.admin-speed-control button {
  border: 0;
  border-right: 1px solid var(--line);
}

.admin-speed-control button:last-child {
  border-right: 0;
}

.admin-speed-control button.is-active {
  color: #fff;
  background: var(--ink);
}

.admin-item {
  display: grid;
  grid-template-columns: minmax(140px, 18vw) minmax(0, 1fr);
  gap: var(--block-gap);
  padding-top: var(--block-gap);
  border-top: 1px solid rgba(5, 5, 5, .22);
}

.admin-preview {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #d6e8f7;
  padding: var(--block-gap);
  text-align: center;
}

.admin-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: var(--block-gap);
}

.admin-gallery-admin {
  margin-top: var(--block-gap);
}

.admin-gallery-admin h3 {
  margin-bottom: 10px;
  font-size: var(--nav-font);
}

.admin-gallery-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: var(--block-gap);
}

.admin-gallery-row {
  display: grid;
  gap: 8px;
}

.admin-gallery-thumb {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #d6e8f7;
}

.admin-gallery-thumb.is-wide {
  aspect-ratio: 16 / 9;
}

.admin-gallery-row label {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 0;
}

.admin-gallery-row select {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 6px;
}

.admin-gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-gallery-actions button:disabled {
  cursor: default;
  opacity: .28;
}

.admin-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-check {
  display: inline-flex !important;
  grid-template-columns: none !important;
  gap: 6px !important;
  margin: 0 !important;
}

.admin-actions {
  display: flex;
  gap: var(--block-gap);
  padding-bottom: clamp(60px, 8vw, 140px);
}

@media (max-width: 820px) {
  :root {
    --nav-h: 40px;
    --nav-font: 17px;
    --body-font: 17px;
    --display-font: clamp(72px, 23vw, 128px);
    --category-title-font: clamp(56px, 17vw, 120px);
    --category-title-gap: clamp(28px, 8.5vw, 60px);
    --category-title-line-half: clamp(24px, 7.31vw, 52px);
  }

  .site-nav,
  .tri-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    height: auto;
    padding-top: 4px;
    padding-bottom: 6px;
    line-height: 1.1;
  }

  .carousel-track {
    height: calc(100svh - 82px);
  }

  .carousel-slide {
    padding: 0;
  }

  .carousel-caption {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 8px 0;
  }

  .carousel-counter {
    text-align: left;
  }

  .carousel-arrow {
    width: 46px;
    height: 46px;
  }

  .nav-cell {
    line-height: 1.22;
  }

  .index-view {
    padding-top: 82px;
  }

  .featured-view,
  .detail-view,
  .info-view {
    padding-top: 0;
  }

  .index-title {
    min-height: 34svh;
    align-items: end;
  }

  .index-title h1 {
    text-align: left;
  }

  .intro-grid {
    gap: 18px;
  }

  .brand-strip {
    height: auto;
    min-height: 116px;
    grid-template-columns: 1fr;
  }

  .brand-marquee {
    grid-column: auto;
    height: 72px;
  }

  .brand-strip-title {
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .category-index {
    padding-left: var(--cell-pad);
    padding-right: var(--cell-pad);
  }

  .category-button {
    max-width: 100%;
    font-size: clamp(42px, 13vw, 82px);
    line-height: .9;
    white-space: nowrap;
  }

  .category-section-title {
    min-height: 0;
    padding: var(--category-title-gap) var(--block-gap);
  }

  .category-section-title h2 {
    font-size: var(--category-title-font);
    white-space: nowrap;
  }

  .category-button small,
  .category-section-title small {
    left: calc(100% + .85em);
  }

  .home-category-grid {
    grid-template-columns: 1fr;
    padding-bottom: clamp(64px, 16vw, 120px);
  }

  .work-filter {
    display: grid;
    gap: 5px;
  }

  .work-filter .category-button {
    font-size: 17px;
    min-height: 0;
  }

  .feature-bar,
  .site-row {
    position: static;
    height: auto;
    gap: 0;
    padding: 6px 0;
    line-height: 1.12;
  }

  .feature-close {
    text-align: left;
  }

  .watermark {
    top: 170px;
    left: var(--cell-pad);
  }

  .project-grid,
  .detail-gallery {
    grid-template-columns: 1fr;
    padding-top: clamp(170px, 42vw, 260px);
  }

  .gallery-block.wide {
    grid-column: auto;
  }

  .detail-intro {
    gap: 28px;
  }

  .detail-gallery {
    padding-top: 34px;
  }

  .admin-panel label,
  .admin-item {
    grid-template-columns: 1fr;
  }

  .admin-brand-item {
    grid-template-columns: 1fr;
  }

  .admin-panel-head {
    grid-template-columns: 1fr;
  }

  .admin-panel-tools {
    justify-content: flex-start;
  }
}

/* Interaction & usability optimizations */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  animation: page-in 0.38s var(--ease) both;
}

body.is-leaving {
  animation: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.site-nav a.is-active,
.site-row a.is-active {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.back-to-top {
  position: fixed;
  right: clamp(14px, 1.6vw, 24px);
  bottom: clamp(14px, 1.6vw, 24px);
  z-index: 60;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body,
  body.is-leaving {
    animation: none;
    transition: none;
    opacity: 1;
  }
  .back-to-top {
    transition: none;
  }
}

/* Home category toolbar: keep on one row and scale to fit (mobile) */
.category-toolbar .work-filter {
  display: flex;
  flex-wrap: nowrap;
  gap: 0 .5em;
  overflow-x: auto;
}

.category-toolbar .work-filter .category-button {
  flex: 0 0 auto;
  font-size: clamp(7px, calc((100vw - 2 * var(--cell-pad)) / 41), var(--nav-font));
}

@media (max-width: 820px) {
  .category-toolbar {
    top: 73px;
  }
}

/* MacBook scroll showcase */
.macbook-scroll {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(56px, 8vw, 120px) var(--cell-pad);
  background: var(--bg);
  overflow: hidden;
}

.macbook-inner {
  width: min(100%, 880px);
  text-align: center;
}

.macbook-title {
  font-size: clamp(28px, 4.6vw, 64px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.macbook-sub {
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: clamp(28px, 4vw, 56px);
}

.macbook {
  position: relative;
  width: min(100%, 820px);
  margin: 0 auto;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.25));
}

.macbook-screen {
  position: relative;
  border-radius: 22px 22px 6px 6px;
  padding: clamp(10px, 1.4vw, 16px);
  background: linear-gradient(180deg, #2a2a2e 0%, #17171a 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.macbook-screen-clip {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #0b0b0d;
}

.macbook-carousel {
  position: absolute;
  inset: 0;
  transform: scale(1);
  transform-origin: center 30%;
  will-change: transform;
}

.macbook-carousel-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.macbook-carousel-slide.is-active {
  opacity: 1;
}

.macbook-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.macbook-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 55%);
  mix-blend-mode: screen;
}

.macbook-camera {
  position: absolute;
  top: clamp(4px, 0.7vw, 8px);
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #3a3a3e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 2;
}

.macbook-base {
  position: relative;
  height: clamp(40px, 6vw, 66px);
  border-radius: 4px 4px 16px 16px;
  background: linear-gradient(180deg, #2b2b2f 0%, #141416 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -36px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.macbook-trackpad {
  position: absolute;
  left: 50%;
  bottom: clamp(6px, 1vw, 12px);
  width: 26%;
  height: 42%;
  transform: translateX(-50%);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .macbook-carousel {
    transform: none !important;
  }
}

/* Device zoom hero: the whole page (hero carousel) shown inside a browser/laptop, expands to fullscreen on scroll */
.hero-pin {
  position: relative;
  height: 130svh;
}

.hero-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}

.hero-stage .home-view {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  padding-top: 0;
  transform-origin: center;
  will-change: transform;
}

.hero-stage .carousel-track {
  height: 100%;
}

.device-frame {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  transform-origin: center;
  will-change: transform, opacity;
}

.device-browser {
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 34px;
  background: rgba(244, 244, 244, 0.92);
  border: 1px solid #d9d9d9;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.browser-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e5484d;
}

.browser-url {
  flex: 1;
  height: 19px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  font-size: 11px;
  color: #888;
  line-height: 19px;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.device-window {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.device-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  height: 38px;
  padding: 0 12px;
  background: rgba(244, 244, 244, 0.94);
  border-bottom: 1px solid #d9d9d9;
  font-size: 15px;
  font-weight: 700;
}

.device-nav a {
  text-align: center;
}

.device-base {
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 44px;
  background: linear-gradient(180deg, #2a2a2e 0%, #17171a 100%);
  border-radius: 0 0 16px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.device-notch {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 7px;
  border-radius: 5px;
  background: #3a3a3e;
}

.site-nav {
  transition: opacity 0.35s var(--ease);
}

body.is-device-preview .site-nav {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 820px) {
  .hero-pin {
    height: 132svh;
  }
}

/* Aceternity-style MacBook (realistic laptop) with scroll zoom */
.macbook-scroll {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(64px, 10vw, 140px) var(--cell-pad);
  background: var(--bg);
  overflow: hidden;
}

.macbook-inner {
  width: min(100%, 900px);
  text-align: center;
}

.macbook-title {
  font-size: clamp(30px, 5vw, 68px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.macbook-sub {
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: clamp(32px, 5vw, 64px);
}

.macbook {
  position: relative;
  width: min(100%, 840px);
  margin: 0 auto;
  filter: drop-shadow(0 40px 80px rgba(0, 0, 0, 0.3));
}

.macbook-screen {
  position: relative;
  border-radius: 22px 22px 4px 4px;
  padding: clamp(12px, 1.5vw, 18px);
  background: #1c1c1e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.macbook-camera {
  position: absolute;
  top: clamp(7px, 0.8vw, 10px);
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #2c2c2e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 3;
}

.screen-clip {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #0b0b0d;
}

.screen-clip .home-view {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  padding-top: 0;
  transform-origin: center;
  will-change: transform;
}

.screen-clip .carousel-track {
  height: 100%;
}

.macbook-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 55%);
  mix-blend-mode: screen;
  z-index: 2;
}

.macbook-base {
  position: relative;
  height: clamp(120px, 17vw, 190px);
  border-radius: 4px 4px 18px 18px;
  background: linear-gradient(180deg, #f5f5f7 0%, #e4e4e6 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), inset 0 -24px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  margin-top: -2px;
}

.macbook-keyboard {
  position: absolute;
  left: 18%;
  right: 18%;
  top: clamp(22px, 3vw, 38px);
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: clamp(4px, 0.6vw, 7px);
}

.macbook-keyboard .key {
  height: clamp(14px, 2vw, 24px);
  border-radius: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #dcdcde 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14), 0 1px 1px rgba(0, 0, 0, 0.12);
}

.macbook-grille {
  position: absolute;
  top: clamp(24px, 3vw, 40px);
  width: clamp(30px, 5vw, 60px);
  height: clamp(70px, 10vw, 110px);
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.28) 1px, transparent 1.5px);
  background-size: 5px 5px;
}

.macbook-grille-left {
  left: clamp(10px, 2.5vw, 36px);
}

.macbook-grille-right {
  right: clamp(10px, 2.5vw, 36px);
}

.macbook-trackpad {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3vw, 34px);
  width: clamp(150px, 24vw, 240px);
  height: clamp(70px, 10vw, 110px);
  transform: translateX(-50%);
  border-radius: 7px;
  background: linear-gradient(180deg, #e9e9eb 0%, #d9d9db 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.macbook-notch {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 8px;
  border-radius: 8px 8px 0 0;
  background: #cfcfd1;
}

.macbook-badge {
  position: absolute;
  left: clamp(18px, 3vw, 40px);
  bottom: clamp(18px, 3vw, 40px);
  width: clamp(38px, 5vw, 54px);
  height: clamp(38px, 5vw, 54px);
  border-radius: 50%;
  background: #22a06b;
  color: #fff;
  font-weight: 800;
  font-size: clamp(16px, 2.2vw, 26px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

@media (max-width: 820px) {
  .macbook {
    width: min(100%, 560px);
  }
  .macbook-keyboard {
    left: 12%;
    right: 12%;
  }
}

/* Aceternity MacBook 1:1 port (tilted perspective, realistic deck) */
.macbook-scroll {
  position: relative;
  min-height: 120svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(64px, 10vw, 140px) var(--cell-pad);
  background: var(--bg);
  overflow: hidden;
}

.macbook-inner {
  width: min(100%, 560px);
  text-align: center;
}

.macbook-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  transform: scale(0.85);
  transform-origin: top center;
}

.macbook-persp {
  position: relative;
  margin: 0 auto;
  width: 32rem;
  perspective: 800px;
}

.macbook-lid {
  position: relative;
  height: 12rem;
  width: 32rem;
  border-radius: 1rem;
  background: #010101;
  padding: 0.5rem;
  transform: perspective(800px) rotateX(-25deg) translateZ(0);
  transform-origin: bottom;
  transform-style: preserve-3d;
  margin: 0 auto;
}

.macbook-lid-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: #010101;
  box-shadow: 0 2px 0 2px #171717 inset;
  color: #fff;
}

.macbook-apple {
  width: 12px;
  height: 12px;
}

.macbook-screen-content {
  position: absolute;
  top: 0;
  left: 0;
  height: 24rem;
  width: 32rem;
  border-radius: 1rem;
  background: #010101;
  padding: 0.5rem;
  transform-style: preserve-3d;
  transform-origin: top;
  transform: scaleX(1.2) scaleY(0.6) rotateX(-28deg);
  z-index: 1;
}

.macbook-screen-bg {
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
  background: #272729;
}

.macbook-screen-content .home-view {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  padding-top: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  z-index: 1;
  transform-origin: center;
  will-change: transform;
}

.macbook-screen-content .carousel-track {
  height: 100%;
}

.macbook-base {
  position: relative;
  z-index: -10;
  height: 22rem;
  width: 32rem;
  overflow: hidden;
  border-radius: 1rem;
  background: #d6d6d8;
  margin: 0 auto;
}

.macbook-hinge {
  position: relative;
  height: 2.5rem;
  width: 100%;
}

.macbook-hinge-inner {
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  height: 1rem;
  width: 80%;
  background: #050505;
}

.macbook-deck {
  position: relative;
  display: flex;
}

.macbook-grille {
  width: 10%;
  height: 10rem;
  overflow: hidden;
}

.macbook-grille::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, #08080a 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

.macbook-keyboard-frame {
  width: 80%;
}

.macbook-keyboard {
  margin: 0 0.25rem;
  border-radius: 0.375rem;
  background: #050505;
  padding: 0.25rem;
  transform: translateZ(0);
}

.macbook-keyboard .key-row {
  display: flex;
  width: 100%;
  gap: 2px;
  margin-bottom: 2px;
}

.macbook-keyboard .key {
  flex: 1;
  min-width: 0.9rem;
  height: 1.5rem;
  border-radius: 3.5px;
  background: #0a090d;
  box-shadow: 0 -0.5px 2px 0 #0d0d0f inset, -0.5px 0 2px 0 #0d0d0f inset;
}

.macbook-trackpad {
  margin: 0.25rem auto;
  height: 8rem;
  width: 40%;
  border-radius: 0.75rem;
  box-shadow: 0 0 1px 1px #00000020 inset;
}

.macbook-front-notch {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  height: 0.5rem;
  width: 5rem;
  border-radius: 0.75rem 0.75rem 0 0;
  background: linear-gradient(to top, #272729, #050505);
}

.macbook-badge {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: block;
}

@media (max-width: 820px) {
  .macbook-stage {
    transform: scale(0.55);
  }
}

/* MacBook via the reference image, screen content overlaid + scroll zoom */
.macbook-stage {
  position: relative;
  width: min(100%, 820px);
  margin: 0 auto;
  transform: none;
  transform-origin: top center;
}

.macbook-canvas {
  position: relative;
}

.macbook-img {
  display: block;
  width: 100%;
  height: auto;
}

.macbook-screen {
  position: absolute;
  top: 2.7%;
  left: 5%;
  width: 90%;
  height: 36.5%;
  overflow: hidden;
  border-radius: clamp(10px, 1.4vw, 16px);
  transform: perspective(900px) rotateX(-14deg);
  transform-origin: 50% 30%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55);
  z-index: 2;
}

.macbook-screen .home-view {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  padding-top: 0;
  transform-origin: center;
  will-change: transform;
}

.macbook-screen .carousel-track {
  height: 100%;
}

.macbook-screen .carousel-caption {
  min-height: 0;
  font-size: clamp(9px, 1vw, 14px);
}

@media (max-width: 820px) {
  .macbook-stage {
    transform: scale(0.6);
  }
}
