:root {
  --ink: #111111;
  --paper: #f7f7f4;
  --line: rgba(17, 17, 17, 0.72);
  --gap: 0.45rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(17rem, 1fr) auto;
  align-items: start;
  gap: 2rem;
  padding: 1.25rem 1rem 2.75rem;
  background: #ffffff;
}

.identity {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) minmax(12rem, 18rem);
  gap: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.05;
}

.identity strong {
  display: grid;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.85rem, 2.7vw, 2.8rem);
  font-weight: 400;
  line-height: 0.78;
  letter-spacing: -0.065em;
}
.identity > span { padding-top: 0.15rem; }

nav {
  display: flex;
  gap: clamp(0.5rem, 5vw, 5rem);
}

.pill {
  display: inline-flex;
  min-width: 7.5rem;
  justify-content: center;
  padding: 0.25rem 1rem 0.22rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.76rem;
  line-height: 1;
  text-transform: uppercase;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.pill:hover,
.pill:focus-visible,
.pill.is-active {
  color: var(--paper);
  background: var(--ink);
}

.pill:active { transform: scale(0.97); }

.works {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--gap);
  padding: 1.5rem var(--gap) 0;
  border-top: 2px solid rgba(17, 17, 17, 0.42);
}

.work-card {
  position: relative;
  min-width: 0;
  padding-bottom: 1.5rem;
}

.work-card:nth-child(n + 3) { padding-top: 1.5rem; }

.work-card:nth-child(odd):nth-child(n + 3)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: calc(200% + var(--gap));
  height: 2px;
  background: rgba(17, 17, 17, 0.42);
}

.cover {
  position: relative;
  display: block;
  aspect-ratio: 1.4 / 1;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #e4e4df;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.22,.61,.36,1), filter 300ms ease;
}

.view-label {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  color: white;
  background: rgba(17,17,17,.9);
  font-size: 0.74rem;
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity 200ms ease, transform 200ms ease;
}

.cover:hover img { transform: scale(1.025); }
.cover:hover .view-label,
.cover:focus-visible .view-label { opacity: 1; transform: translateY(0); }

.caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12rem;
  gap: 1rem;
  align-items: start;
  min-height: 5.1rem;
  padding: 0.65rem 0.1rem 0;
}

.caption h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2rem, 3.25vw, 3.2rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.caption p {
  margin: 0.12rem 0 0;
  font-size: 0.94rem;
  line-height: 1.15;
  text-wrap: pretty;
}

footer {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  padding: 5rem 1rem 1.2rem;
  font-size: 0.86rem;
}

footer p { margin: 0; }
footer a { text-decoration: underline; text-underline-offset: 0.2em; }
.footer-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.45rem 1.5rem; }

/* Project pages */
.project-page {
  --project-bg: #f1efe9;
  --project-ink: #111;
  min-height: 100vh;
  color: var(--project-ink);
  background: var(--project-bg);
}

.project-page.organza { --project-bg: #718e72; --project-ink: #f6f0e6; }
.project-page.neo { --project-bg: #0d442f; --project-ink: #f0d585; }
.project-page.naomi { --project-bg: #d8c8d6; --project-ink: #201920; }
.project-page.scramble { --project-bg: #ffdf5c; --project-ink: #7d1026; }
.project-page.texas { --project-bg: #111a35; --project-ink: #ffd136; }
.project-page.adat { --project-bg: #e7e5df; --project-ink: #101010; }
.project-page.awake { --project-bg: #efefec; --project-ink: #111; }
.project-page.poneslos { --project-bg: #9b342f; --project-ink: #f5eee8; }
.project-page.rodnoy { --project-bg: #b21f2d; --project-ink: #f5dcae; }
.project-page.dadiani { --project-bg: #d78217; --project-ink: #16100a; }
.project-page.bulochnaya { --project-bg: #ed84a4; --project-ink: #a90f4b; }
.project-page.tochka-opory { --project-bg: #20213d; --project-ink: #f5f2ed; }
.project-page.les-krolik { --project-bg: #173d30; --project-ink: #f1e9dc; }
.project-page.chaika { --project-bg: #123e50; --project-ink: #ffd322; }

.project-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 24vw) minmax(0, 1fr);
  min-height: 100vh;
}

.project-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  padding: 1.1rem 1rem 1rem;
  container-type: inline-size;
}

.back-link {
  width: fit-content;
  font-size: 0.76rem;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
}

.project-intro { margin: auto 0; }

.project-kicker {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-intro h1 {
  margin: 0 0 1.8rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(3.6rem, 7vw, 7.2rem);
  font-weight: 400;
  line-height: 0.83;
  letter-spacing: -0.065em;
}

.project-intro h1.long-title { font-size: clamp(3rem, 4.7vw, 5.3rem); }

.scramble .project-intro h1 {
  font-size: clamp(3.4rem, 22cqi, 6.8rem);
}

.project-intro p {
  max-width: 28rem;
  margin: 0 0 0.85rem;
  font-size: clamp(0.95rem, 1.2vw, 1.12rem);
  line-height: 1.25;
  text-wrap: pretty;
}

.project-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-top: 2.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid currentColor;
  font-size: 0.75rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.project-nav { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.76rem; text-transform: uppercase; }
.project-nav a { border-bottom: 1px solid currentColor; }
.project-gallery { min-width: 0; padding: 0.45rem 0.45rem 0.45rem 0; }
.project-gallery img { height: auto; border-radius: 0.38rem; }
.project-gallery figure { margin: 0 0 0.45rem; overflow: hidden; background: rgba(255,255,255,.12); }
.project-gallery .media-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.project-gallery .media-pair figure { margin-bottom: 0.45rem; }
.project-gallery.project-gallery--posters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  align-content: start;
}
.project-gallery.project-gallery--posters figure { margin: 0; }

.next-project-card {
  position: relative;
  display: grid;
  width: min(100%, 26rem);
  min-height: 0;
  aspect-ratio: 4 / 3;
  margin: 1.5rem 0 0 auto;
  overflow: hidden;
  border-radius: 0.38rem;
  color: white;
  background: #111;
  isolation: isolate;
}
.project-gallery--posters .next-project-card { grid-column: 1 / -1; justify-self: end; }
.next-project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.62));
}
.next-project-card img { position: absolute; inset: 0; height: 100%; object-fit: cover; transition: transform 650ms cubic-bezier(.22,.61,.36,1); }
.next-project-card:hover img { transform: scale(1.025); }
.next-project-copy { position: relative; z-index: 2; align-self: end; display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: 0.8rem; }
.next-project-copy small { font-size: 0.68rem; text-transform: uppercase; }
.next-project-copy strong { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.2rem, 4vw, 3.6rem); font-weight: 400; line-height: .84; letter-spacing: -.055em; }

/* About */
.about-page { min-height: 100vh; background: #e8e5de; }
.about-main { padding: 13vh 1rem 1rem; }
.about-title {
  max-width: 18ch;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(3.2rem, 8vw, 8.8rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.065em;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 8vw, 10rem);
  margin-top: 13vh;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}
.about-copy { max-width: 42rem; font-size: clamp(1.1rem, 2vw, 2rem); line-height: 1.12; }
.about-copy p { margin: 0 0 1em; }
.about-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; font-size: 0.9rem; line-height: 1.3; }
.about-list h2 { margin: 0 0 0.75rem; font-size: 0.72rem; font-weight: 400; text-transform: uppercase; }
.about-list p { margin: 0; }
.contact-stack { display: grid; gap: 0.55rem; }
.contact-stack a { width: fit-content; font-size: clamp(1rem, 1.5vw, 1.35rem); text-decoration: underline; text-underline-offset: .16em; }

[data-reveal] {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 500ms ease, transform 600ms cubic-bezier(.22,.61,.36,1);
}

[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.9rem 0.6rem 1.5rem;
  }

  .identity { grid-template-columns: 8.5rem 1fr; gap: 1rem; }
  .identity strong { font-size: 2.05rem; }
  nav { gap: 0.35rem; overflow-x: auto; padding-bottom: 0.1rem; }
  .pill { min-width: 6.4rem; padding-inline: 0.75rem; }
  .works { grid-template-columns: 1fr; padding: 1rem 0.35rem 0; gap: 0; }
  .work-card { padding-bottom: 1rem; }
  .work-card:nth-child(n + 2) { padding-top: 1rem; }
  .work-card:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(17, 17, 17, 0.42);
  }
  .work-card:nth-child(odd):nth-child(n + 3)::before { width: 100%; }
  .cover { aspect-ratio: 1.25 / 1; border-radius: 0.4rem; }
  .caption { grid-template-columns: minmax(0, 1fr) 9rem; min-height: 4.8rem; }
  .caption h2 { font-size: clamp(2.2rem, 12vw, 3.2rem); }
  .caption p { font-size: 0.82rem; }
  .view-label { opacity: 1; transform: none; }
  footer { grid-template-columns: 1fr; padding: 4rem 0.7rem 1rem; }

  .project-layout { display: block; }
  .project-sidebar { position: relative; height: auto; min-height: 78svh; padding: 0.9rem 0.7rem 1rem; }
  .project-intro { margin: auto 0 3rem; padding-top: 18vh; }
  .project-intro h1 { font-size: clamp(4rem, 22vw, 6.5rem); }
  .project-intro p { font-size: 1rem; }
  .project-gallery { padding: 0.35rem; background: #f6f5f1; }
  .project-gallery .media-pair { grid-template-columns: 1fr; gap: 0; }
  .project-gallery.project-gallery--posters { grid-template-columns: 1fr; gap: 0.35rem; }
  .project-gallery figure, .project-gallery .media-pair figure { margin-bottom: 0.35rem; }
  .project-gallery img { border-radius: 0.28rem; }
  .next-project-card { width: min(100%, 22rem); min-height: 0; aspect-ratio: 4 / 3; margin: 1rem 0 0 auto; }
  .next-project-copy { display: grid; gap: 0.35rem; }
  .next-project-copy strong { font-size: clamp(2.2rem, 10vw, 3.4rem); }

  .about-main { padding: 12vh 0.7rem 1rem; }
  .about-title { font-size: clamp(3.5rem, 17vw, 6rem); }
  .about-grid { grid-template-columns: 1fr; margin-top: 10vh; gap: 3rem; }
  .about-list { gap: 1rem; }
}
