:root {
  color-scheme: dark;
  --page: #0d1821;
  --ink: #efeeed;
  --secondary: #c4cdd4;
  --line: #3a4a56;
  --gutter: clamp(24px, 4.15vw, 80px);
  --serif: Georgia, "Times New Roman", serif;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 2px solid #e8c9ad; outline-offset: 5px; }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: #101b25;
  background: #fff2e6;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.masthead {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 3.1vw 0 3.7vw;
}
.masthead--home { justify-content: flex-end; }
.wordmark {
  font-family: var(--serif);
  font-size: clamp(27px, 3.1vw, 52px);
  line-height: 1;
  letter-spacing: -.045em;
  text-decoration: none;
}
.nav-link {
  border-bottom: 1px solid currentColor;
  padding-block: 7px;
  font-size: clamp(15px, 1.55vw, 25px);
  line-height: 1.2;
  text-decoration: none;
}
.nav-link:hover, .detail__back:hover { color: #f1cbac; }

.hero {
  --hero-height: min(33.054vw, 720px);
  --display-size: clamp(72px, 8.7vw, 172px);
  --word-top: calc(var(--hero-height) * .275);
  position: relative;
  isolation: isolate;
  height: var(--hero-height);
  overflow: hidden;
  background: #0d1821;
  border-bottom: 1px solid #2d3b47;
}
.hero__view {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}
.hero__copy {
  padding: calc(var(--word-top) + var(--display-size) * .99 + clamp(12px, 2vw, 34px)) var(--gutter) 0;
}
.hero__word {
  position: absolute;
  inset: 0;
  display: block;
  padding: var(--word-top) var(--gutter) 0;
  color: #e0d2c0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--display-size);
  letter-spacing: -.066em;
  line-height: 1;
  pointer-events: none;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero__word {
    /* Sample the window of the same image without shifting its horizon vertically. */
    background: url("./hero-tikhvinskaya.webp") -46vw 0 / 100% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.hero__subtitle {
  position: relative;
  display: inline-block;
  font-size: clamp(23px, 2.9vw, 50px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .04em;
  text-transform: uppercase;
  transform: scaleX(1.08);
  transform-origin: left;
}
.hero__copy p {
  position: relative;
  max-width: 36ch;
  margin-top: 13px;
  font-size: clamp(16px, 1.48vw, 24px);
  line-height: 1.38;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.catalog {
  --rail-top: clamp(12px, 1.38vw, 26px);
  --peek: 44px;
  position: relative;
  overflow-x: clip;
  padding: var(--rail-top) 1.24vw 22px;
}
.catalog__tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 1.95vw, 38px);
}
.catalog__tiles > * { position: relative; min-width: 0; }
.listing__link { display: block; text-decoration: none; }
.film {
  display: grid;
  grid-template-columns: 1.95fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: clamp(156px, 16.7vw, 368px);
  gap: clamp(3px, .33vw, 6px);
  overflow: hidden;
}
.film img { width: 100%; height: 100%; object-fit: cover; }
.film__lead { grid-row: span 2; object-position: center 49%; }
.film__side--street { object-position: center 53%; }
.film__side--quarter { object-position: center 73%; }
.listing__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .38em;
  row-gap: .2em;
  padding: .38em .5em .48em;
  color: var(--ink);
  font-size: clamp(14px, 1.78vw, 31px);
  line-height: 1.22;
  font-weight: 400;
}
.listing__caption h3 { font: inherit; }
.listing__meta { color: var(--secondary); white-space: nowrap; }
.listing__meta::before {
  content: "·";
  margin-inline: .05em .36em;
}
.listing__arrow { margin-left: .2em; line-height: 1; }
.listing__link:hover .listing__arrow { color: #f1cbac; }

.add-drawer {
  position: absolute;
  z-index: 2;
  top: var(--rail-top);
  right: 0;
  width: min(345px, calc(100% - 25px));
  transform: translateX(calc(100% - var(--peek)));
  transition: transform 520ms cubic-bezier(.22, 1, .36, 1);
}
.add-drawer[data-open], .add-drawer:not([data-ready]):focus-within { transform: translateX(0); }
.add-drawer__card {
  display: grid;
  grid-template-columns: var(--peek) 1fr;
  min-height: clamp(156px, 16.7vw, 290px);
  background: #192b37;
  border: 1px solid #627781;
  border-right: 0;
  transform-origin: right 9%;
  box-shadow: 0 18px 46px #070d14a6;
}
.add-drawer[data-open] .add-drawer__card {
  animation: drawer-settle 820ms ease-out, drawer-sway 4s 820ms ease-in-out infinite;
}
@keyframes drawer-settle {
  0% { transform: rotate(0); }
  35% { transform: rotate(-2.4deg); }
  60% { transform: rotate(1.15deg); }
  82% { transform: rotate(-.42deg); }
  100% { transform: rotate(0); }
}
@keyframes drawer-sway {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-.65deg); }
  75% { transform: rotate(.65deg); }
}
.add-drawer__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 10px 0;
  border: 0;
  border-right: 1px solid #627781;
  background: #263d4b;
  color: var(--ink);
  cursor: pointer;
  font: 400 22px/1 system-ui, sans-serif;
}
.add-drawer__tab:focus-visible { outline-offset: -5px; }
.add-drawer__tab-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 12px;
  line-height: 1;
}
.add-drawer__panel { align-self: center; padding: 17px 20px; }
.add-drawer__title { font: 400 clamp(23px, 2.1vw, 32px)/1.05 var(--serif); }
.add-drawer__panel > a { display: block; width: fit-content; margin-top: 10px; padding-block: 3px; font-size: 14px; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .add-drawer { transition: none; }
  .add-drawer[data-open] .add-drawer__card { animation: none; }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-inline: var(--gutter);
  padding-block: 17px 21px;
  border-top: 1px solid var(--line);
  color: var(--secondary);
  font-size: 13px;
}
.placement {
  margin-inline: var(--gutter);
  padding-block: clamp(33px, 5vw, 82px);
  border-top: 1px solid var(--line);
}
.placement h2, .placement h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; }
.placement h2 { font-size: clamp(33px, 4vw, 61px); }
.placement h3 { font-size: clamp(24px, 2.4vw, 38px); }
.placement p, .project-links p { color: var(--secondary); line-height: 1.55; }
.placement__intro p { max-width: 63ch; margin-top: 14px; }
.placement__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(25px, 6vw, 100px); margin-top: 29px; }
.placement__option { border-top: 1px solid var(--line); padding-block: 15px 6px; scroll-margin-top: 22px; }
.placement .placement__number { margin-bottom: 8px; color: #e8c9ad; font-size: 13px; font-variant-numeric: tabular-nums; }
.placement h3 + p { margin-top: 10px; max-width: 60ch; }
.placement__links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 16px; font-size: 14px; }
.placement a, .project-links a { text-underline-offset: 4px; }
.placement a:hover, .project-links a:hover, .add-drawer__panel a:hover { color: #f1cbac; }
.site-footer--home { display: block; padding-block: 22px; }
.project-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 26px; }
.project-links a { color: var(--ink); font-size: 15px; }
.project-links p { margin-top: 5px; max-width: 38ch; }
.site-footer__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.masthead--detail { position: static; padding-bottom: 25px; }
.detail { margin: 24px auto 56px; padding-inline: var(--gutter); max-width: 1500px; }
.detail h1 {
  margin-top: 12px;
  font: 400 clamp(36px, 6vw, 88px)/1.05 var(--serif);
  letter-spacing: -.052em;
}
.detail__intro {
  max-width: 63ch;
  margin-top: 16px;
  color: var(--secondary);
  line-height: 1.55;
}
.detail__gallery {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 12px;
  margin-top: 29px;
}
.detail__gallery figure:first-child { grid-row: span 2; }
.detail__gallery img { width: 100%; height: auto; aspect-ratio: 2.15; object-fit: cover; }
.detail__gallery figure:first-child img { aspect-ratio: 1.5; }
.detail__gallery figure:last-child img { object-position: center 43%; }
.detail__gallery figcaption {
  padding-top: 8px;
  color: var(--secondary);
  font-size: 14px;
}
.detail__back { display: inline-block; margin-top: 30px; text-underline-offset: 5px; }
.detail__back span { margin-right: 7px; }

@media (max-width: 850px) {
  .hero {
    --display-size: clamp(57px, 12vw, 87px);
    --word-top: 72px;
    display: flex;
    flex-direction: column;
    height: auto;
  }
  .hero__view {
    position: static;
    order: 1;
    height: clamp(185px, 36vw, 290px);
    object-fit: cover;
    object-position: 81% center;
  }
  .hero__word { background-size: auto 320px; background-position: 86% top; }
  .hero__copy { padding-top: calc(var(--word-top) + var(--display-size) + 7px); padding-bottom: 18px; }
  .hero__subtitle { transform: none; }
  .hero__copy p { max-width: 36ch; }
  .desktop-break { display: none; }
  .listing__price { display: none; }
}

@media (max-width: 620px) {
  .placement__options, .project-links { grid-template-columns: 1fr; }
  .hero {
    --display-size: clamp(57px, 14.1vw, 87px);
  }
  .hero__subtitle { font-size: clamp(19px, 5.6vw, 32px); }
  .hero__copy p { margin-top: 8px; }
  .masthead { padding-inline: var(--gutter); }
  .catalog { --rail-top: 14px; --peek: 38px; padding: var(--rail-top) calc(var(--peek) + 12px) 25px 12px; }
  .catalog__tiles { grid-template-columns: 1fr; gap: 16px; }
  .film { height: clamp(138px, 49vw, 250px); gap: 3px; }
  .listing__caption { font-size: clamp(16px, 4.3vw, 23px); }
  .listing__price { display: inline; }
  .detail__gallery { grid-template-columns: 1fr; gap: 20px; }
  .detail__gallery figure:first-child { grid-row: auto; }
  .detail__gallery figure:first-child img { aspect-ratio: 1.5; }
}
