:root {
  --paper: #c8c1af;
  --paper-deep: #bfb7a3;
  --ink: #111;
  --line: rgba(17, 17, 17, 0.64);
  --line-soft: rgba(17, 17, 17, 0.18);
  --pad: clamp(18px, 1.5vw, 30px);
  --panel-max: min(1920px, calc(100vw - (var(--pad) * 2)));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

img {
  display: block;
  width: 100%;
}

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

button {
  border: 0;
  color: inherit;
  font: inherit;
}

.hero {
  position: relative;
  height: 80svh;
  min-height: 620px;
  overflow: hidden;
  background: #2f3136;
  color: #fff;
  overscroll-behavior: auto;
}

.hero-slides,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  z-index: 0;
  visibility: hidden;
  clip-path: inset(100% 0 0);
  transform: scale(1.02);
  transition: clip-path 0.25s cubic-bezier(0.76, 0, 0.24, 1), transform 0.34s ease, visibility 0.25s;
}

.hero-slide.is-active {
  z-index: 1;
  visibility: visible;
  clip-path: inset(0);
  transform: scale(1);
}

.hero-slide.is-leaving {
  z-index: 2;
  visibility: visible;
  clip-path: inset(0 0 100%);
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 38%, rgba(0, 0, 0, 0.48)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 55%);
  pointer-events: none;
}

.hero-header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: var(--pad);
  right: var(--pad);
}

.hero-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(108px, 16vh, 156px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  font-size: clamp(64px, 10.4vw, 200px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero-nav,
.profile-nav {
  display: grid;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-nav {
  grid-template-columns: repeat(6, 1fr);
}

.hero-nav a,
.profile-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
  font-size: clamp(12px, 1vw, 18px);
  font-weight: 700;
  white-space: nowrap;
}

.hero-nav a:nth-child(n + 5),
.profile-nav a:nth-child(n + 5) {
  text-align: inherit;
}

.hero-nav span,
.profile-nav span {
  margin-right: 0;
  font-weight: 400;
}

.hero-copy {
  position: absolute;
  z-index: 5;
  left: var(--pad);
  bottom: 24px;
  width: min(610px, 47vw);
}

.hero-copy > p {
  margin: 0 0 16px;
  font-size: clamp(13px, 1.05vw, 20px);
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.hero-meta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
}

.hero-meta span {
  font-size: 10px;
  letter-spacing: 0.1em;
}

.hero-meta strong {
  font-size: 16px;
  font-weight: 400;
}

.next-cover {
  position: absolute;
  z-index: 5;
  right: 9vw;
  bottom: 0;
  width: min(31vw, 560px);
  height: min(24vh, 220px);
  overflow: hidden;
  padding: 0;
  background: #222;
  color: #fff;
  cursor: pointer;
}

.next-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.next-cover:hover img {
  transform: scale(1.02);
}

.next-cover span {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 6px 8px;
  background: #111;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.scroll-hint {
  position: absolute;
  z-index: 5;
  right: var(--pad);
  bottom: 18px;
  writing-mode: vertical-rl;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.projects {
  padding: 54px var(--pad) 100px;
  background: var(--paper);
}

.projects-topline,
.project-viewer-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.category-row {
  display: grid;
  grid-template-columns: 5vw minmax(220px, 18vw) minmax(0, 1fr);
  gap: clamp(18px, 2.2vw, 42px);
  min-height: 500px;
  padding: 24px 0 34px;
  border-bottom: 1px solid var(--line);
}

.category-sign {
  font-size: 31px;
  font-weight: 200;
  line-height: 1;
}

.category-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 34px;
}

.category-name h2 {
  margin: 0;
  font-size: clamp(17px, 1.25vw, 24px);
  font-weight: 700;
}

.category-name p {
  margin: 8px 0 0;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.category-intro {
  max-width: 290px;
  margin: 0;
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.35;
}

.category-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: start;
  gap: clamp(14px, 1.2vw, 24px);
  min-width: 0;
}

.project-card {
  display: block;
  grid-column: span 3;
  min-width: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.project-card.is-panoramic {
  grid-column: span 5;
}

.project-card.is-landscape {
  grid-column: span 4;
}

.project-card.is-portrait,
.project-card.is-square {
  grid-column: span 3;
}

.project-card-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: var(--image-ratio);
  max-height: 390px;
  min-height: 220px;
  padding: clamp(8px, 0.75vw, 14px);
  background: #b8ae9a;
  transition: transform 0.4s ease, background 0.35s ease;
}

.project-card:hover .project-card-frame,
.project-card:focus-visible .project-card-frame {
  transform: translateY(-4px);
  background: #aea38d;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-card-title {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.45;
}

.project-viewer {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.project-viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: clamp(22px, 2vw, 38px);
  margin-top: 26px;
}

.project-viewer-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  padding: 20px;
  background: var(--paper-deep);
}

.project-viewer-cover img {
  width: 100%;
  height: 100%;
  max-height: 560px;
  object-fit: contain;
}

.project-viewer-meta {
  display: flex;
  flex-direction: column;
}

.viewer-kicker {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.project-viewer-meta h2 {
  margin: 0 0 20px;
  font-size: clamp(30px, 3vw, 48px);
  line-height: 1;
}

.viewer-type {
  margin: 0 0 16px !important;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px !important;
  letter-spacing: 0.08em;
}

.viewer-facts {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.project-viewer-meta p {
  margin: 0;
  font-size: 15px;
  line-height: 1.68;
}

.viewer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
}

.viewer-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: start;
  gap: clamp(14px, 1.2vw, 24px);
  margin-top: 34px;
}

.viewer-gallery figure {
  grid-column: span 4;
  margin: 0;
}

.viewer-gallery figure.is-panoramic {
  grid-column: span 8;
}

.viewer-gallery figure.is-landscape {
  grid-column: span 6;
}

.viewer-gallery figure.is-portrait {
  grid-column: span 3;
}

.viewer-gallery figure.is-square {
  grid-column: span 4;
}

.viewer-gallery-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: var(--image-ratio);
  max-height: 620px;
  min-height: 220px;
  padding: clamp(8px, 0.75vw, 14px);
  background: rgba(17, 17, 17, 0.06);
}

.viewer-gallery img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer-gallery figcaption {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.5;
  word-break: break-all;
}

.profile {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  padding: 18px var(--pad) 38px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
}

.profile-nav {
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  border-bottom-color: var(--line);
}

.profile-brand {
  align-self: center;
  text-align: center;
}

.profile-brand h2 {
  margin: 0;
  font-size: clamp(88px, 15.6vw, 298px);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.profile-brand p {
  margin: 32px 0 0;
  font-size: clamp(24px, 3.3vw, 62px);
  letter-spacing: 0.25em;
}

.profile-columns {
  display: grid;
  grid-template-columns: 5vw 13vw 1.2fr 1fr 0.85fr;
  gap: clamp(22px, 4vw, 90px);
  align-items: start;
}

.profile-plus {
  font-size: 36px;
  font-weight: 200;
  line-height: 1;
}

.profile-index {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-index a {
  font-size: clamp(20px, 1.6vw, 30px);
}

.profile-columns h3 {
  margin: 0 0 20px;
  font-size: clamp(16px, 1.2vw, 23px);
  font-weight: 500;
}

.profile-subtitle {
  margin-top: 28px !important;
}

.career-list {
  display: grid;
  gap: 12px;
}

.career-list p {
  display: grid;
  grid-template-columns: minmax(112px, 0.65fr) 1.35fr;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.career-list time {
  white-space: nowrap;
}

.profile-columns p,
.profile-columns a {
  margin: 0 0 8px;
  font-size: clamp(12px, 0.95vw, 17px);
  line-height: 1.45;
}

.profile-columns a {
  display: inline-block;
  width: max-content;
  margin-top: 14px;
}

@media (max-width: 1180px) {
  .hero-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-nav a:nth-child(n) {
    text-align: left;
  }

  .category-row {
    grid-template-columns: 40px 190px minmax(0, 1fr);
  }

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

  .viewer-gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .viewer-gallery figure,
  .viewer-gallery figure.is-landscape,
  .viewer-gallery figure.is-square {
    grid-column: span 3;
  }

  .viewer-gallery figure.is-panoramic {
    grid-column: span 6;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 560px;
    height: 80svh;
  }

  .hero-wordmark {
    height: 82px;
    font-size: 10vw;
    line-height: 1.15;
    letter-spacing: 0.01em;
  }

  .hero-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-nav a {
    font-size: 10px;
  }

  .hero-copy {
    width: calc(100% - 36px);
  }

  .hero-copy > p {
    width: 78%;
    font-size: 14px;
  }

  .next-cover {
    right: 18px;
    bottom: 122px;
    width: 46vw;
    height: 136px;
  }

  .scroll-hint {
    display: none;
  }

  .projects {
    padding-top: 28px;
  }

  .category-row {
    grid-template-columns: 26px 1fr;
    min-height: 0;
  }

  .category-gallery {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card,
  .project-card.is-panoramic,
  .project-card.is-landscape,
  .project-card.is-portrait,
  .project-card.is-square {
    grid-column: span 1;
  }

  .project-card.is-panoramic {
    grid-column: span 2;
  }

  .project-card-frame {
    min-height: 150px;
  }

  .project-viewer {
    margin-top: 28px;
  }

  .project-viewer-cover {
    min-height: 260px;
  }

  .viewer-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-gallery figure,
  .viewer-gallery figure.is-landscape,
  .viewer-gallery figure.is-portrait,
  .viewer-gallery figure.is-square {
    grid-column: span 1;
  }

  .viewer-gallery figure.is-panoramic {
    grid-column: span 2;
  }

  .viewer-gallery-frame {
    min-height: 150px;
  }

  .profile {
    min-height: 100svh;
    height: auto;
    padding-bottom: 55px;
  }

  .profile-nav {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 10px;
  }

  .profile-nav a:nth-child(n) {
    text-align: left;
  }

  .profile-brand h2 {
    font-size: 11.5vw;
    letter-spacing: 0.01em;
  }

  .profile-brand p {
    margin-top: 18px;
    font-size: 4.6vw;
  }

  .profile-columns {
    grid-template-columns: 28px 1fr;
    gap: 28px 22px;
  }

  .profile-index,
  .profile-contact,
  .profile-address,
  .profile-location {
    grid-column: 2;
  }

  .profile-plus {
    grid-row: 1 / 5;
  }

  .career-list p {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
