:root {
  --bg: #171615;
  --fg: #f2eee8;
  --muted: #b7b0a8;
  --photo-content-width: 74rem;
  --project-photo-gap: clamp(.5rem, 1.15vw, 1rem);
  --project-title-size: clamp(1.375rem, 1.2rem + .85vw, 2rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    animation: scroll-reveal .72s cubic-bezier(.22, .61, .36, 1);
  }
}

@keyframes scroll-reveal {
  from {
    opacity: .38;
    transform: translateY(clamp(14px, 2.2vw, 22px));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Arial, 'Noto Sans KR', sans-serif;
}

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

button {
  font: inherit;
  cursor: pointer;
}

:where(a, button, summary):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 5%;
  z-index: 5;
  padding: 0.625rem 1rem;
  background: var(--bg);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.back-to-top {
  position: fixed;
  inset-inline-end: max(.875rem, env(safe-area-inset-right));
  inset-block-end: calc(.875rem + env(safe-area-inset-bottom));
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #635b53;
  background: #1e1b19;
  color: var(--fg);
  transition: background-color .2s, border-color .2s;
}

.back-to-top:hover { border-color: var(--muted); background: #2a2521; }

.back-to-top::before,
.back-to-top::after {
  content: '';
  position: absolute;
}

.back-to-top::before {
  width: 1px;
  height: 15px;
  background: currentColor;
}

.back-to-top::after {
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  transform: translateY(-6px) rotate(45deg);
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: 100%;
  padding: 34px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

:is(.gallery-page, .journal-page):not(:has(.hero)) .site-header { position: relative; }

.logo {
  font-family: Georgia, serif;
  letter-spacing: .24em;
  font-size: clamp(1rem, 2.1vw, 1.75rem);
  line-height: 1.3;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 32px;
  align-items: center;
  font-size: 12px;
  letter-spacing: .16em;
}

.nav a:hover { opacity: .65; }

.menu {
  display: none;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 27px;
}

.mobile-panel { display: none; }

.hero {
  position: relative;
  height: clamp(21rem, 34vw, 36rem);
  overflow: hidden;
  background: #3b332c;
}

.hero-media,
.hero img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero img {
  object-fit: cover;
  object-position: center 56%;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(16 12 9 / .38), transparent 28%, transparent 64%, rgb(16 12 9 / .43));
}

.hero-bottom {
  position: absolute;
  bottom: clamp(1.5rem, 2.7vw, 2.3rem);
  left: 5%;
  right: 5%;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.hero-title {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(13px, 1.7vw, 22px);
  font-weight: 400;
  letter-spacing: .15em;
}

.hero-bottom a {
  padding-bottom: 8px;
  border-bottom: 1px solid #fff;
  font-size: 12px;
  letter-spacing: .15em;
  white-space: nowrap;
}

.section { padding: 85px 5% 95px; }
.journal-page .section { padding-top: clamp(1.75rem, 4vw, 4rem); }
.home-page .home-journal { padding-bottom: clamp(1.75rem, 5vw, 3.5rem); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 26px;
}

.section h1,
.section h2 {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 36px);
  font-weight: 400;
  letter-spacing: .18em;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .25em;
}

.home-page #projects:has(> #project-list) > :is(.section-head, #project-list) {
  max-width: 72rem;
  margin-inline: auto;
}

.gallery {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-item { scroll-margin-top: 1rem; }

.gallery-link { display: block; }

.project {
  position: relative;
  display: block;
  overflow: hidden;
  background: #292723;
  aspect-ratio: 2.15;
}

.project img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s;
}

.gallery-link:hover img { transform: scale(1.035); }

.project-info {
  display: flex;
  align-items: baseline;
  gap: .875rem;
  padding: .75rem 0 0;
  color: var(--fg);
  font-size: clamp(.875rem, 1.45vw, 1.0625rem);
  line-height: 1.4;
}

.project-info time {
  color: var(--muted);
  font-size: .875em;
  font-variant-numeric: tabular-nums;
}

.project-example {
  position: absolute;
  inset: auto .65rem .65rem auto;
  padding: .3rem .45rem;
  background: rgb(23 22 21 / .92);
  color: var(--fg);
  font-size: .6875rem;
}

.company-footer { background: var(--bg); }

.studio {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding: 110px 5%;
  border-top: 1px solid #34312e;
}

.studio h2 {
  font-weight: 400;
  letter-spacing: .2em;
}

.studio-details,
.contact-details {
  width: min(100%, 19.5rem);
}

.studio-description {
  color: #bdb7b0;
  font-size: 14px;
  line-height: 2;
}

.studio-locations {
  display: grid;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  color: #bdb7b0;
  font-size: 14px;
  line-height: 1.6;
}

.studio-locations div {
  display: flex;
  gap: 0.85rem;
}

.studio-locations dt {
  flex: none;
  color: var(--fg);
}

.studio-locations dd { margin: 0; }

.contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 100px 5%;
  border-top: 1px solid #34312e;
  background: #1e1c1a;
  color: var(--fg);
}

.contact h2 {
  font-size: clamp(25px, 4vw, 52px);
  font-weight: 400;
  letter-spacing: .13em;
}

.contact-channels {
  display: grid;
  justify-items: start;
  gap: 0.5rem;
  font-style: normal;
  overflow-wrap: anywhere;
}

.contact-channels a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.contact-action {
  margin-top: 1.125rem;
  display: inline-block;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--muted);
  color: inherit;
  background: none;
  letter-spacing: .1em;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 36px 5%;
  color: #aaa;
  font-size: 11px;
  letter-spacing: .08em;
}

.business-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
  margin: 0.5rem 0 0;
  line-height: 1.5;
  letter-spacing: normal;
}

.business-info div {
  display: flex;
  gap: 0.35rem;
}

.business-info dd { margin: 0; }

.footer-domain { flex: none; }

.detail-page { background: #151413; }

.detail { padding: 25px 5% 60px; }

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.close {
  border: 1px solid #777;
  padding: 10px 16px;
  color: #fff;
  white-space: nowrap;
}

.detail h1 {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: .1em;
}

.detail p {
  color: #aaa;
  font-size: 13px;
}

.project-photos img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  margin-bottom: 12px;
}

.detail-journal {
  max-width: 82rem;
  margin-inline: auto;
}

.detail-journal .detail-head { margin-bottom: clamp(2rem, 5vw, 4rem); }

.detail-journal .close {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: .625rem .875rem;
  font-size: .8125rem;
}

.detail-journal h1 {
  margin: 0;
  font-size: var(--project-title-size);
  letter-spacing: -.025em;
  line-height: 1.22;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.detail-journal .project-metadata {
  margin: .55rem 0 clamp(1.25rem, 3vw, 2.25rem);
  color: var(--muted);
}

.project-journal {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--project-photo-gap);
  align-items: start;
}

.project-journal figure {
  grid-column: 1 / -1;
  margin: 0;
}

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

.project-journal [data-composition='cover-crop'] img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center 55%;
}

.project-journal [data-composition='inset-left'] { grid-column: 1 / span 7; }
.project-journal [data-composition='detail-right'] { grid-column: 9 / -1; }
.project-journal [data-composition='detail-left'] { grid-column: 2 / span 4; }
.project-journal [data-composition='inset-right'] { grid-column: 7 / -1; }

.project-journal [data-composition^='detail-'] img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.project-journal [data-composition='detail-right'] img { object-position: 45% center; }
.project-journal [data-composition='detail-left'] img { object-position: 92% center; }

.project-journal [data-composition='pair-left'] { grid-column: 1 / span 6; }
.project-journal [data-composition='pair-right'] { grid-column: 7 / -1; }

.project-journal [data-composition^='pair-'] img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.project-photo-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.project-photo-trigger:focus-visible { outline-offset: -4px; }

.project-editorial-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-areas: "scenes insert";
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: var(--project-photo-gap);
}

.project-editorial-row[data-editorial-side='left'] {
  grid-template-areas: "insert scenes";
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr);
}

.project-editorial-scenes {
  display: grid;
  min-width: 0;
  gap: var(--project-photo-gap);
}

.project-editorial-scenes[data-paired] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.project-editorial-scenes:not([data-paired]) [data-composition^='inset-'] img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.project-journal :is(.project-editorial-scenes, .project-editorial-row) > figure {
  min-width: 0;
}

.project-journal .project-editorial-scenes > figure { grid-column: auto; }
.project-editorial-scenes { grid-area: scenes; }

/* The site photographs set the row height. */
.project-editorial-inserts {
  display: grid;
  grid-area: insert;
  grid-auto-rows: minmax(0, 1fr);
  gap: var(--project-photo-gap);
  min-width: 0;
}

.project-journal .project-editorial-inserts > figure {
  grid-column: auto;
  position: relative;
  min-width: 0;
}

.project-editorial-inserts button {
  position: absolute;
  inset: 0;
  height: 100%;
}

.project-editorial-inserts img {
  height: 100%;
  object-fit: cover;
}

.project-editorial-inserts [data-photo-kind='mood'] img,
.project-lightbox[data-photo-kind='mood'] .journal-lightbox-stage img {
  filter: saturate(.92) contrast(.985);
}

.project-lightbox:is([data-photo-kind='site'], [data-photo-kind='detail']) .journal-lightbox-stage img { filter: none; }

.journal-return { margin-top: clamp(2rem, 5vw, 3.5rem); }

@media (min-width: 701px) {
  :is(.home-journal, .journal-page .section) > :is(.section-head, #journal),
  .home-page #projects > :is(.section-head, #project-list) {
    max-width: var(--photo-content-width);
    margin-inline: auto;
  }

  .detail {
    width: min(90%, var(--photo-content-width));
    margin-inline: auto;
    padding-inline: 0;
  }
}

@media (max-width: 700px) {
  .site-header { padding: 26px 6%; }
  .menu-ready .nav { display: none; }
  .menu:not([hidden]) { display: block; }

  .detail-head { gap: .5rem; }
  .detail-head .close {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 44px;
    padding-inline: .625rem;
    font-size: .8125rem;
    white-space: normal;
    word-break: keep-all;
  }

  .nav {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: end;
    padding-left: 12px;
  }

  .mobile-panel[open] {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    overflow-y: auto;
    margin: 0;
    padding: 30px 7%;
    border: 0;
    background: var(--bg);
    color: var(--fg);
  }

  body:has(.mobile-panel[open]) { overflow: hidden; }

  .mobile-panel nav {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .menu-close {
    align-self: end;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: 0;
    color: #fff;
    font-size: 28px;
  }

  .mobile-panel a {
    padding: 10px 0;
    font-size: 23px;
    letter-spacing: .14em;
  }

  .hero { height: clamp(17rem, 44svh, 25rem); }

  .hero-bottom {
    bottom: 24px;
    left: 6%;
    right: 6%;
  }

  .section { padding: 62px 4%; }
  .project { aspect-ratio: 16 / 9; }

  .project-journal > :is([data-composition='inset-left'], [data-composition='inset-right']) { grid-column: 1 / -1; }
  .project-journal [data-composition='detail-right'] { grid-column: 6 / -1; }
  .project-journal [data-composition='detail-left'] { grid-column: 2 / span 7; }
  .project-editorial-row { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .project-editorial-row[data-editorial-side='left'] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  }
  .project-editorial-row:is([data-editorial-kind='mood'], :has(.project-editorial-scenes[data-paired])) {
    grid-template-areas: "scenes" "insert";
    grid-template-columns: minmax(0, 1fr);
  }
  .project-editorial-row:is([data-editorial-kind='mood'], :has(.project-editorial-scenes[data-paired])) .project-editorial-inserts > figure {
    aspect-ratio: 4 / 3;
  }
  .project-editorial-row[data-editorial-kind='mood'] .project-editorial-inserts > figure:only-child {
    aspect-ratio: 16 / 10;
  }
  .project-editorial-inserts:has(> figure + figure) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio {
    display: block;
    padding: 75px 6%;
  }

  .contact {
    display: block;
    padding: 48px 6%;
  }

  .contact h2 { margin: 0; }
  .contact-details { margin-top: 24px; }

  .footer-domain {
    display: inline-block;
    margin-top: 0.75rem;
  }

  .footer {
    display: block;
    padding: 35px 6%;
    line-height: 2;
  }

}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project img { transition: none; }
}
