:root {
  color-scheme: light;
  --ink: #111111;
  --ink-soft: #4f4f4c;
  --muted: #858580;
  --line: #d8d7d2;
  --paper: #f5f4f0;
  --paper-deep: #eceae5;
  --white: #ffffff;
  --accent: #a84b34;
  --gutter: clamp(12px, 1.25vw, 24px);
  --section-space: clamp(72px, 8vw, 132px);
  --header-height: 52px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  font: inherit;
}

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

::selection {
  background: var(--accent);
  color: var(--white);
}

.site-header {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.brand-link,
.modal-brand {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 38px);
  font-size: 13px;
}

.client-login-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ink);
}

.nav-links a,
.brand-link,
.modal-brand {
  transition: color 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.brand-link:hover,
.brand-link:focus-visible,
.modal-brand:hover,
.modal-brand:focus-visible {
  color: var(--accent);
  outline: 0;
}

main {
  padding-top: var(--header-height);
}

.hero {
  position: relative;
  width: 100%;
  height: calc(100dvh - var(--header-height));
  min-height: 560px;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: var(--paper-deep);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.hero-media,
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media img {
  object-fit: cover;
  object-position: center;
  transition: transform 500ms ease;
}

.hero:hover .hero-media img,
.hero:focus-visible .hero-media img {
  transform: scale(1.008);
}

.hero:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.hero-caption {
  position: absolute;
  inset: auto 0 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(150px, 0.28fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px var(--gutter);
  background: var(--white);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.hero-number,
.project-number,
.modal-index,
.section-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-project-name {
  font-weight: 700;
}

.hero-location {
  color: var(--ink-soft);
}

.hero-action {
  justify-self: end;
}

.work-section,
.studio-section,
.awards-section,
.approach-section,
.contact-section {
  scroll-margin-top: var(--header-height);
}

.work-section {
  padding-bottom: var(--section-space);
  background: var(--white);
}

.work-heading {
  min-height: 130px;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 24px var(--gutter) 20px;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 12px;
}

.work-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(34px, 3.4vw, 58px);
  font-weight: 400;
  line-height: 1.02;
}

.work-heading > p,
.awards-heading > p,
.studio-copy,
.contact-copy {
  margin: 0;
  color: var(--ink-soft);
}

.project-index-meta {
  display: grid;
  grid-template-columns: auto 32px auto;
  gap: 18px;
  align-items: center;
  font-size: 12px;
}

.project-index-meta span:nth-child(2) {
  color: var(--accent);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 10px;
  padding: var(--gutter) var(--gutter) 0;
}

.loading-note,
.error-note {
  grid-column: 1 / -1;
  min-height: 160px;
  margin: 0;
  color: var(--muted);
}

.project-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  align-content: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.project-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper-deep);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 360ms ease, opacity 180ms ease;
}

.project-card:hover .project-image img,
.project-card:focus-visible .project-image img {
  transform: scale(1.012);
  opacity: 0.94;
}

.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.project-info {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: baseline;
}

.project-number {
  grid-row: 1 / span 2;
}

.project-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.project-meta {
  display: grid;
  justify-items: end;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.studio-section,
.approach-section,
.contact-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1fr);
  gap: 52px clamp(48px, 8vw, 140px);
  padding: var(--section-space) var(--gutter);
  border-top: 1px solid var(--line);
}

.studio-founder {
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.studio-founder p {
  margin: 0;
}

.studio-copy {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.65;
}

.studio-copy p,
.contact-copy p,
.approach-list p {
  margin: 0;
}

.studio-copy p + p {
  margin-top: 18px;
}

.studio-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.studio-stats span {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.studio-stats span + span {
  padding-left: var(--gutter);
  border-left: 1px solid var(--line);
}

.studio-stats strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 400;
}

.awards-section {
  padding: var(--section-space) var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.awards-heading {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1fr);
  gap: 14px clamp(48px, 8vw, 140px);
  margin-bottom: 64px;
}

.awards-heading .section-kicker {
  grid-column: 1 / -1;
}

.awards-heading > p {
  align-self: end;
}

.awards-group-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}

.awards-group-heading h3,
.awards-group-heading p {
  margin: 0;
}

.awards-group-heading h3 {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 17px;
  font-weight: 700;
}

.awards-group-heading h3 span,
.awards-group-heading p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
}

.award-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(200px, 0.7fr);
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.award-year {
  color: var(--accent);
  font-size: 15px;
}

.award-title {
  display: grid;
  gap: 3px;
}

.award-title strong {
  font-size: 16px;
  font-weight: 700;
}

.award-title small,
.award-subject,
.award-project-link {
  color: var(--ink-soft);
  font-size: 12px;
}

.award-actions {
  justify-self: end;
  text-align: right;
}

.award-project-link {
  width: fit-content;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.award-project-link:hover,
.award-project-link:focus-visible {
  border-color: currentColor;
  color: var(--accent);
  outline: 0;
}

.approach-list {
  border-top: 1px solid var(--ink);
}

.approach-list p {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.approach-list strong {
  color: var(--ink);
  font-size: 13px;
}

.approach-list strong span {
  display: inline-block;
  width: 32px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
}

.contact-section {
  min-height: 380px;
  background: var(--white);
}

.contact-copy {
  align-self: start;
}

.contact-name {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.contact-phone-inline {
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  font-weight: 400;
  transition: color 160ms ease;
}

.contact-phone-inline:hover,
.contact-phone-inline:focus-visible {
  color: var(--accent);
  outline: 0;
}

.contact-qr {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 20px;
}

.contact-qr img {
  width: 196px;
  height: auto;
}

.contact-note {
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  font-size: 12px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--white);
}

.modal-panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(270px, 0.42fr) minmax(0, 1fr);
  column-gap: clamp(24px, 4vw, 72px);
  align-items: start;
  overflow: auto;
  padding: 0 var(--gutter) 80px;
  background: var(--white);
}

.modal-header {
  position: sticky;
  z-index: 4;
  top: 0;
  grid-column: 1 / -1;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.modal-close {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--accent);
  outline: 0;
}

.modal-text {
  position: sticky;
  top: calc(var(--header-height) + 36px);
  align-self: start;
  padding-top: 36px;
}

.modal-index {
  margin: 0 0 12px;
}

.modal-text h2 {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 54px);
  font-weight: 400;
  line-height: 1.08;
}

.modal-meta {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 6px 14px;
  margin: 28px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

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

.modal-meta dd {
  margin: 0;
}

#modal-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.modal-gallery {
  display: grid;
  gap: 10px;
  padding-top: var(--gutter);
}

.modal-gallery figure {
  margin: 0;
  background: var(--paper-deep);
}

.modal-gallery img {
  width: 100%;
  height: auto;
}

@media (max-width: 980px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-heading {
    grid-template-columns: 1fr 1fr;
  }

  .project-index-meta {
    grid-column: 1 / -1;
    justify-content: end;
  }

  .modal-panel {
    grid-template-columns: minmax(240px, 0.48fr) minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 14px;
    --header-height: 48px;
    --section-space: 70px;
  }

  body {
    font-size: 14px;
  }

  .brand-link,
  .modal-brand {
    font-size: 18px;
  }

  .nav-links {
    gap: 12px;
    font-size: 11px;
  }

  .nav-links a[href="#studio"],
  .nav-links a[href="#awards"] {
    display: none;
  }

  .client-login-link {
    gap: 6px;
    padding: 0 9px;
    min-height: 34px;
  }

  .hero {
    height: calc(82dvh - var(--header-height));
    min-height: 560px;
  }

  .hero-caption {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 5px 8px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .hero-number {
    grid-row: 1 / span 2;
  }

  .hero-location {
    grid-column: 2;
    font-size: 11px;
  }

  .hero-action {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .work-heading,
  .studio-section,
  .awards-heading,
  .approach-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .work-heading {
    min-height: 0;
    gap: 14px;
    padding-top: 28px;
  }

  .work-heading h1,
  .section-heading h2 {
    font-size: 36px;
  }

  .project-index-meta {
    grid-column: 1;
    justify-content: start;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .project-title {
    font-size: 16px;
  }

  .studio-section,
  .approach-section,
  .contact-section {
    gap: 42px;
  }

  .studio-stats {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .studio-stats span {
    min-height: 74px;
  }

  .studio-stats span + span {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .awards-heading .section-kicker {
    grid-column: 1;
  }

  .awards-heading {
    gap: 20px;
    margin-bottom: 46px;
  }

  .awards-group-heading {
    align-items: flex-start;
  }

  .awards-group-heading h3 {
    display: grid;
    gap: 3px;
  }

  .award-row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
  }

  .award-actions {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .approach-list p {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
  }

  .contact-section {
    min-height: 320px;
  }

  .contact-qr img {
    width: 168px;
  }

  .modal-panel {
    grid-template-columns: 1fr;
    padding-bottom: 44px;
  }

  .modal-text {
    position: static;
    padding: 34px 0 26px;
  }

  .modal-gallery {
    padding-top: 0;
  }
}

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

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