/* sashayutsov.com — base styles */

:root {
  --black: #000;
  --panel: #161617;
  --panel-2: #1d1d1f;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #6e6e73;
  --line: rgba(255, 255, 255, 0.14);
  --paper: #f5f5f7;
  --ink: #1d1d1f;
  --ink-muted: #6e6e73;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1200px;
  --gutter: 20px;
  --nav-h: 52px;
  --radius-lg: 28px;
  --radius-md: 18px;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */

.display {
  margin: 0;
  font-size: clamp(44px, 8.2vw, 116px);
  line-height: 1.02;
  font-weight: 650;
  text-wrap: balance;
}

.h2 {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 72px);
  line-height: 1.05;
  font-weight: 650;
  text-wrap: balance;
}

.h3 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.15;
  font-weight: 600;
  text-wrap: balance;
}

.lead {
  margin: 0;
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.45;
  color: var(--muted);
  max-width: 34em;
  text-wrap: pretty;
}

.lead strong { color: var(--text); font-weight: 500; }

.body { margin: 0; color: var(--muted); max-width: 38em; text-wrap: pretty; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
  cursor: pointer;
}

.btn-primary { background: var(--text); color: var(--black); }
.btn-primary:hover { background: #fff; }

.btn-ghost { color: var(--text); border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--text); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.text-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 4px;
  transition: text-decoration-color 160ms ease-out;
}
.text-link:hover { text-decoration-color: var(--text); }

.text-link-ink { color: var(--ink); text-decoration-color: var(--ink-muted); }
.text-link-ink:hover { text-decoration-color: var(--ink); }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  padding-top: env(safe-area-inset-top);
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease-out;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-cta {
  font-size: 14px;
  min-height: 32px;
  padding: 0 14px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 5px auto;
  background: currentColor;
  transition: transform 200ms ease-out;
}

@media (max-width: 1023px) {
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: rgba(0, 0, 0, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 200ms ease-out, transform 200ms ease-out;
  }
  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav[data-open="true"] .nav-links {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav[data-open="true"] .nav-toggle span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .nav[data-open="true"] .nav-toggle span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: 230vh;
}

.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.hero-copy {
  position: absolute;
  inset: 0 0 auto 0;
  padding-top: calc(var(--nav-h) + 9vh);
  text-align: center;
  z-index: 2;
  opacity: calc(1 - var(--p, 0) * 2.2);
  transform: translateY(calc(var(--p, 0) * -6vh));
}

.hero-copy .lead { margin: 20px auto 0; }
.hero-copy .btn-row { justify-content: center; margin-top: 28px; }

.hero-frame {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  transform:
    translateY(calc((1 - var(--p, 0)) * var(--drop, 16vh)))
    scale(calc(0.5 + 0.5 * var(--p, 0)));
  border-radius: calc((1 - var(--p, 0)) * 56px);
  overflow: hidden;
  will-change: transform;
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-caption {
  position: absolute;
  left: var(--gutter);
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 3;
  font-size: 14px;
  color: rgba(245, 245, 247, 0.85);
  opacity: clamp(0, calc((var(--p, 0) - 0.75) * 4), 1);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 767px) {
  /* On phones the scene is static: copy first, then the image. */
  .hero { height: auto; }
  .hero-stage { position: relative; height: auto; overflow: visible; }
  .hero-copy {
    position: relative;
    opacity: 1;
    transform: none;
    padding-top: calc(var(--nav-h) + 56px);
    padding-bottom: 40px;
  }
  .hero-frame {
    position: relative;
    transform: none;
    border-radius: 0;
    aspect-ratio: var(--ar, 2752 / 1536);
    will-change: auto;
  }
  .hero-caption { opacity: 1; bottom: 14px; }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(96px, 14vw, 180px); }
.section-tight { padding-block: clamp(64px, 9vw, 120px); }

.section-head { display: grid; gap: 20px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head.center { text-align: center; justify-items: center; }

/* ---------- Light sequence ---------- */

.light-intro { padding-top: clamp(120px, 16vw, 200px); padding-bottom: clamp(32px, 5vw, 64px); }

.pair { position: relative; height: 210vh; }

.pair-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
}

.pair-frame {
  position: relative;
  width: 100%;
  max-height: 100dvh;
  aspect-ratio: 2752 / 1536;
  overflow: hidden;
}

@media (min-width: 768px) {
  .pair-frame { height: 100dvh; width: 100%; aspect-ratio: auto; }
}

.pair-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pair-frame .after { opacity: var(--t, 0); }

.pair-labels {
  position: absolute;
  left: var(--gutter);
  bottom: calc(28px + env(safe-area-inset-bottom));
  display: grid;
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 500;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.55);
}

.pair-labels span { grid-area: 1 / 1; transition: opacity 200ms ease-out; }
.pair-labels .l-before { opacity: calc(1 - var(--t, 0) * 2); }
.pair-labels .l-after { opacity: calc(var(--t, 0) * 2 - 1); }

.pair-meter {
  position: absolute;
  right: var(--gutter);
  bottom: calc(36px + env(safe-area-inset-bottom));
  width: 72px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.pair-meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--text);
  transform-origin: 0 50%;
  transform: scaleX(var(--t, 0));
}

@media (max-width: 767px) {
  .pair { height: 170vh; }
  .pair-frame { aspect-ratio: var(--ar, 2752 / 1536); overflow: visible; }
  .pair-labels { bottom: auto; top: calc(100% + 16px); text-shadow: none; }
  .pair-meter { bottom: auto; top: calc(100% + 26px); }
}

/* ---------- Projects ---------- */

.projects { display: grid; gap: clamp(64px, 8vw, 112px); }

.project { display: grid; gap: 20px; text-decoration: none; }

.project-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  aspect-ratio: 16 / 9;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project:hover .project-media img { transform: scale(1.025); }

.project-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}

.project-text p { margin: 0; color: var(--muted); max-width: 32em; }

.project-duo {
  display: grid;
  gap: clamp(64px, 8vw, 112px);
}

@media (min-width: 900px) {
  .project-duo { grid-template-columns: 1fr 1fr; gap: 24px; }
  .project-duo .project-media { aspect-ratio: 4 / 3; }
  .project-duo .project-text { display: grid; }
}

/* ---------- Interiors strip ---------- */

.strip-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.strip-controls { display: flex; gap: 10px; flex: none; }

.round-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--panel-2);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 160ms ease-out, opacity 160ms ease-out;
}
.round-btn:hover { background: #333336; }
.round-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.round-btn svg { width: 18px; height: 18px; }

.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78vw, 560px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding-inline: var(--gutter);
  padding-bottom: 8px;
  scrollbar-width: none;
  margin: 0;
  list-style: none;
}
.strip::-webkit-scrollbar { display: none; }

@media (min-width: 1280px) {
  .strip {
    padding-inline: calc((100vw - var(--wrap)) / 2);
    scroll-padding-inline: calc((100vw - var(--wrap)) / 2);
  }
}

.strip li { scroll-snap-align: start; }

.strip figure { margin: 0; }

.strip .media {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--panel);
}

.strip img { width: 100%; height: 100%; object-fit: cover; }

.strip figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* ---------- Lived-in ---------- */

.lived-media {
  margin: clamp(40px, 6vw, 72px) 0 0;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--panel);
}

.lived-media img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }

@media (max-width: 767px) {
  .lived-media { aspect-ratio: 4 / 3; }
  .lived-media img { object-position: 22% 50%; }
}

/* ---------- Product (light panel) ---------- */

.paper {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 72px);
}

.paper .lead,
.paper .body { color: var(--ink-muted); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: clamp(32px, 5vw, 56px);
}

@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.product-grid figure {
  margin: 0;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
}

.product-grid img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Tours teaser ---------- */

.teaser {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  display: grid;
}

@media (min-width: 900px) {
  .teaser { grid-template-columns: 1.1fr 1fr; }
}

.teaser-media { position: relative; min-height: 320px; }

.teaser-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teaser-badge {
  position: absolute;
  left: 20px;
  top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 14px;
  font-weight: 500;
}

.teaser-badge svg { width: 18px; height: 18px; }

.teaser-copy {
  padding: clamp(32px, 5vw, 64px);
  display: grid;
  align-content: center;
  gap: 18px;
}

.status {
  justify-self: start;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

/* ---------- About ---------- */

.about-grid { display: grid; gap: clamp(40px, 6vw, 80px); }

@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1.4fr 1fr; align-items: end; }
}

.facts { margin: 0; display: grid; gap: 0; }

.facts div {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--faint); font-size: 15px; }
.facts dd { margin: 0; font-size: 15px; }

/* ---------- Closing CTA ---------- */

.closing { text-align: center; }
.closing .lead { margin: 20px auto 0; }
.closing .btn-row { justify-content: center; margin-top: 32px; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: 32px calc(32px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--faint);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer ul { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; margin: 0; padding: 0; }
.footer a { text-decoration: none; color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ---------- Inner pages ---------- */

.page-hero { padding-top: calc(var(--nav-h) + clamp(72px, 12vw, 160px)); padding-bottom: clamp(48px, 8vw, 96px); }
.page-hero .lead { margin-top: 20px; }

.service-list { list-style: none; margin: 0; padding: 0; }

.service-list li {
  display: grid;
  gap: 8px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.service-list li:last-child { border-bottom: 1px solid var(--line); }

@media (min-width: 900px) {
  .service-list li { grid-template-columns: 1fr 1.4fr; gap: 40px; }
}

.service-list p { margin: 0; color: var(--muted); }

.placeholder {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 72px);
  display: grid;
  gap: 16px;
  justify-items: start;
}

.placeholder p { margin: 0; color: var(--muted); max-width: 36em; }

/* ---------- Category pages ---------- */

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
}

.jump a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 160ms ease-out;
}
.jump a:hover { border-color: var(--text); }

.group { padding-bottom: clamp(80px, 11vw, 140px); }
.group-head { display: grid; gap: 16px; margin-bottom: clamp(28px, 4vw, 48px); }

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 40px) 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .wide { grid-column: 1 / -1; }
  .gallery .tall { grid-column: 1 / -1; justify-self: center; width: calc(50% - 8px); }
}

.gallery-4 { grid-template-columns: 1fr 1fr; gap: 24px 12px; }

@media (min-width: 900px) {
  .gallery-4 { grid-template-columns: repeat(4, 1fr); gap: 32px 16px; }
}

.g-item { min-width: 0; }

.g-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--panel);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
}

.g-open img { width: 100%; height: auto; transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.g-open:hover img { transform: scale(1.02); }

.g-cap { margin: 12px 0 0; font-size: 15px; color: var(--muted); }

.paper .g-open { background: #fff; }
.paper .g-cap { color: var(--ink-muted); }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: var(--text);
}

.lightbox::backdrop { background: #000; }
.lightbox[open] { display: grid; place-items: center; }

.lb-figure {
  margin: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: calc(56px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .lb-figure { padding-inline: 72px; }
}

.lb-img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  min-height: 0;
  min-width: 0;
}

.lb-cap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  font-size: 15px;
  color: var(--muted);
}

.lb-count { font-variant-numeric: tabular-nums; }

.lb-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 160ms ease-out;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lb-btn svg { width: 20px; height: 20px; }

.lb-close { top: calc(8px + env(safe-area-inset-top)); right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

@media (max-width: 767px) {
  .lb-prev, .lb-next { top: auto; bottom: calc(52px + env(safe-area-inset-bottom)); transform: none; }
}

/* ---------- Contact & About ---------- */

.contact-grid { display: grid; gap: 16px; }

@media (min-width: 768px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

.contact-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  gap: 14px;
  justify-items: start;
}

.contact-card p { margin: 0 0 8px; font-size: clamp(17px, 1.6vw, 21px); }

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--panel-2);
  display: grid;
  place-items: center;
}
.contact-icon svg { width: 22px; height: 22px; }

.send-list { margin-top: clamp(80px, 11vw, 140px); display: grid; gap: clamp(28px, 4vw, 40px); }

.prose { display: grid; gap: 20px; max-width: 38em; }
.prose p { margin: 0; color: var(--muted); font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; text-wrap: pretty; }

.footer p a { color: var(--muted); text-decoration: none; margin-left: 6px; }
.footer p a:hover { color: var(--text); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero-stage { position: relative; height: auto; overflow: visible; }
  .hero-copy { position: relative; opacity: 1; transform: none; padding-bottom: 48px; }
  .hero-frame { position: relative; transform: none; border-radius: 0; aspect-ratio: 16 / 9; }
  .hero-caption { opacity: 1; }
  .pair { height: auto; }
  .pair-stage { position: relative; height: auto; display: grid; gap: 4px; }
  .pair-frame { height: auto; aspect-ratio: auto; display: grid; gap: 4px; }
  .pair-frame img { position: relative; height: auto; }
  .pair-frame .after { opacity: 1; }
  .pair-labels, .pair-meter { display: none; }
  .project-media img { transition: none; }
  * { transition-duration: 0ms !important; }
}
