:root {
  color-scheme: light;
  --bg: #f5f2ec;
  --panel: #fffcf6;
  --ink: #171511;
  --muted: #756f65;
  --line: rgba(23, 21, 17, 0.12);
  --soft-line: rgba(23, 21, 17, 0.07);
  --accent: #9b2f1e;
  --accent-dark: #671f16;
  --shadow: 0 24px 80px rgba(34, 28, 20, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 242, 236, 0) 28rem),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  animation: pageFade 520ms ease both;
}

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

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(18px, env(safe-area-inset-left)) 10px;
  background: rgba(245, 242, 236, 0.76);
  border-bottom: 1px solid rgba(23, 21, 17, 0.08);
  backdrop-filter: blur(18px);
  animation: headerDrop 520ms ease both;
}

.brand,
nav,
.hero-actions,
.filter-bar {
  display: flex;
  align-items: center;
}

.brand {
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #16130f;
  color: #fff8ee;
  font-size: 13px;
}

nav {
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

main {
  overflow: clip;
}

.hero {
  min-height: 92svh;
  display: grid;
  align-items: end;
  padding: 74px 18px 28px;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #19150f;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.2) 36%, rgba(0, 0, 0, 0.74)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  animation: heroDrift 12s ease-in-out infinite alternate;
}

.hero-copy {
  max-width: 680px;
  color: #fffaf2;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  animation: copyRise 720ms 120ms ease both;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0c9a1;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12em;
  margin-bottom: 16px;
  font-size: clamp(40px, 13vw, 74px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 8vw, 48px);
  line-height: 1.04;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.72;
}

.hero-copy p:not(.eyebrow) {
  max-width: 32rem;
  color: rgba(255, 250, 242, 0.82);
}

.hero-actions {
  gap: 10px;
  margin-top: 24px;
}

.button,
.filter {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  font-size: 14px;
  font-weight: 650;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: #fffaf2;
  color: #1d1915;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf2;
  border-color: rgba(255, 255, 255, 0.32);
}

.section {
  padding: 76px 18px;
}

.intro {
  display: grid;
  gap: 20px;
  border-bottom: 1px solid var(--soft-line);
}

.intro p {
  margin-bottom: 0;
  max-width: 44rem;
  font-size: 18px;
}

.section-heading {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.section-heading p {
  max-width: 27rem;
  margin-bottom: 0;
}

.filter-bar {
  gap: 8px;
  padding-bottom: 16px;
  margin: 0 -18px 10px;
  padding-inline: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: 0 0 auto;
  padding: 0 15px;
  background: rgba(255, 252, 246, 0.68);
  color: var(--muted);
  font-size: 13px;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.filter:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 21, 17, 0.2);
}

.filter.active {
  background: #181512;
  color: #fff8ee;
}

.gallery {
  display: grid;
  gap: 18px;
}

.work-card {
  position: relative;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(42, 34, 22, 0.08);
  color: inherit;
  cursor: pointer;
  text-align: left;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms ease,
    transform 520ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
  transition-delay: var(--delay, 0ms);
}

.work-card[hidden] {
  display: none;
}

.work-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.work-card:hover {
  border-color: rgba(23, 21, 17, 0.2);
  box-shadow: 0 24px 68px rgba(42, 34, 22, 0.16);
  transform: translateY(-3px);
}

.image-frame {
  display: block;
  overflow: hidden;
}

.work-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 16%;
  background: #ddd7cc;
  transition: transform 620ms ease;
}

.work-card:hover img {
  transform: scale(1.035);
}

.work-card.featured img {
  aspect-ratio: 3 / 4;
}

.work-card-body {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.work-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.08;
}

.work-card p {
  margin: 0;
  font-size: 14px;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.contact {
  padding-bottom: 34px;
}

.contact-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: #171410;
  color: #fff8ee;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-card img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.contact-card p,
.contact-card .eyebrow {
  color: rgba(255, 248, 238, 0.72);
}

.contact-card h2 {
  color: #fff8ee;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

dt {
  color: rgba(255, 248, 238, 0.54);
  font-size: 12px;
}

dd {
  margin: 3px 0 0;
  font-size: 18px;
  font-weight: 720;
}

.site-footer {
  padding: 26px 20px 34px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 8, 0.76);
  backdrop-filter: blur(14px);
  animation: modalFade 180ms ease both;
}

.modal-panel {
  position: relative;
  min-height: 92svh;
  margin-top: 8svh;
  overflow: visible;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.35);
  animation: modalSlide 280ms ease both;
}

.modal-close {
  position: sticky;
  z-index: 2;
  top: 12px;
  left: calc(100% - 54px);
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.78);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-copy {
  padding: 18px 18px 6px;
}

.modal-copy p {
  margin-bottom: 14px;
}

#modalTags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.modal-images {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.modal-images img {
  width: 100%;
  border-radius: var(--radius);
  background: #ddd7cc;
  animation: imageLift 420ms ease both;
}

body.modal-lock {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

@media (min-width: 720px) {
  .site-header {
    padding-inline: 32px;
  }

  .hero,
  .section {
    padding-inline: max(32px, calc((100vw - 1180px) / 2));
  }

  .hero {
    min-height: 88vh;
    padding-bottom: 56px;
  }

  .hero-media img {
    object-position: center 18%;
  }

  .intro,
  .section-heading {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: end;
  }

  .filter-bar {
    margin-inline: 0;
    padding-inline: 0;
  }

  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .work-card.featured {
    grid-column: span 2;
  }

  .contact-card {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    padding: 28px;
  }

  dl {
    min-width: 210px;
  }

  .modal-panel {
    max-height: 90vh;
    margin: 5vh max(24px, calc((100vw - 1180px) / 2));
    overflow: auto;
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 0;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .modal-close {
    position: absolute;
    right: 16px;
    left: auto;
  }

  .modal-copy {
    position: sticky;
    top: 0;
    align-self: start;
    padding: 34px 26px;
  }

  .modal-images {
    padding: 24px 24px 24px 0;
  }
}

@media (min-width: 1040px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@keyframes pageFade {
  from {
    opacity: 0;
  }
}

@keyframes headerDrop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes copyRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.045) translateY(-8px);
  }
}

@keyframes modalFade {
  from {
    opacity: 0;
  }
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes imageLift {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
