@font-face {
  font-family: "Ugolok";
  src: url("fonts/Ugolok.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050505;
  --fg: #f2f1ec;
  --muted: #aaa9a3;
  --quiet: #83837d;
  --line: #232321;
  --ascii: #343430;
  --ascii-dim: #292927;
  --pad: clamp(1.25rem, 4vw, 4.5rem);
  --head-h: 4.25rem;
  --font-display: "Ugolok", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Consolas, "Courier New", monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 1.06rem + 0.28vw, 1.3rem);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

[id] {
  scroll-margin-top: calc(var(--head-h) + 1rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.8rem 1.2rem;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- header ---------- */

.site-head {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: var(--head-h);
  padding: 0 var(--pad);
  background: rgba(5, 5, 5, 0.9);
  border-bottom: 1px solid rgba(242, 241, 236, 0.07);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.site-head a {
  text-decoration: none;
}

.site-head__brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.site-head__nav {
  display: flex;
  gap: clamp(1rem, 2.2vw, 2.4rem);
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}

.site-head__nav a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-head__nav a:hover,
.site-head__nav a:focus-visible {
  color: var(--fg);
}

/* ---------- shared type ---------- */

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--head-h) + 3vh) var(--pad) clamp(1.4rem, 2.8vh, 2.4rem);
  overflow: hidden;
}

.hero__ascii {
  position: absolute;
  inset: var(--head-h) 0 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.hero__ascii pre {
  margin: 0;
  color: var(--ascii);
  font-family: var(--font-mono);
  font-size: clamp(3px, 0.92vh, 9px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
  white-space: pre;
  -webkit-user-select: none;
  user-select: none;
}

.hero__intro {
  position: relative;
  z-index: 2;
  max-width: 100%;
}

.hero h1 {
  margin: clamp(0.8rem, 1.8vh, 1.4rem) 0 0;
  font-size: clamp(3rem, 6.4vw, 7.5rem);
  line-height: 0.86;
  letter-spacing: -0.012em;
}

.hero__foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(242, 241, 236, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.button::after {
  content: "↓";
  font-family: var(--font-mono);
  font-size: 0.92em;
  transform: translateY(-0.06em);
}

.button:hover,
.button:focus-visible {
  background: var(--fg);
  color: var(--bg);
}

.contact {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.04rem;
  letter-spacing: 0.02em;
}

.contact__label {
  color: var(--quiet);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.contact a,
.site-foot a,
.bio__facts a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid #3b3b37;
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

.contact a:hover,
.contact a:focus-visible,
.site-foot a:hover,
.site-foot a:focus-visible,
.bio__facts a:hover,
.bio__facts a:focus-visible {
  border-color: var(--fg);
}

.hero__hint {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: calc(var(--pad) * 0.45);
  margin: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--quiet);
  transform: translateY(-50%);
}

/* ---------- sections ---------- */

.section {
  position: relative;
  padding: clamp(5rem, 10vw, 9rem) var(--pad);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.section > *:not(.section__ascii) {
  position: relative;
  z-index: 1;
}

.section__ascii {
  position: absolute;
  z-index: 0;
  top: clamp(1.8rem, 4vw, 3.8rem);
  right: var(--pad);
  color: var(--ascii-dim);
  pointer-events: none;
}

.section__ascii pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(7px, 1.25vw, 16px);
  line-height: 1.05;
  white-space: pre;
  -webkit-user-select: none;
  user-select: none;
}

.section__ascii--left {
  top: auto;
  right: auto;
  bottom: clamp(2rem, 5vw, 4.5rem);
  left: var(--pad);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(2rem, 6vw, 6rem);
  max-width: 1600px;
  margin: 0 auto clamp(2.8rem, 5vw, 4.8rem);
}

.section__head h2 {
  margin: 0.55rem 0 0;
  font-size: clamp(2.7rem, 7vw, 7.2rem);
  line-height: 0.86;
  letter-spacing: -0.015em;
}

.lead {
  max-width: 38ch;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.5;
}

/* ---------- selected works ---------- */

.works {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(3rem, 6vw, 6rem) clamp(2rem, 4vw, 4rem);
  max-width: 1600px;
  margin: 0 auto;
}

.work {
  min-width: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.work__head,
.sketch__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.work h3 {
  margin: 0;
  font-size: clamp(1.65rem, 2.6vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.work__year {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--quiet);
}

.work__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.work__pair figure,
.sketch__pair figure {
  min-width: 0;
  margin: 0;
}

.work__pair img,
.sketch__pair img {
  display: block;
  width: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}

.work__pair img {
  height: clamp(240px, 36vh, 460px);
}

.sketch__pair img {
  height: clamp(180px, 24vh, 300px);
}

.work__pair figure:hover img,
.sketch__pair figure:hover img {
  opacity: 0.86;
}

figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

figcaption span {
  color: var(--quiet);
}

.work__price {
  margin: 1.2rem 0 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.work__price span {
  color: var(--quiet);
}

/* ---------- sketchbook ---------- */

.sketches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  max-width: 1600px;
  margin: 0 auto;
}

.sketch {
  min-width: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sketch h3 {
  margin: 0;
  font-size: clamp(1.3rem, 1.85vw, 1.85rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
}

.sketch__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 0.7rem;
  margin-top: 1rem;
}

.sketch figcaption {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ---------- biography ---------- */

.bio {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  align-items: start;
  gap: clamp(2.5rem, 6vw, 6rem);
  max-width: 1400px;
  margin: 0 auto;
}

.portrait {
  margin: 0;
}

.portrait img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  filter: grayscale(1) contrast(1.04);
  transition: filter 0.55s ease;
}

.portrait:hover img {
  filter: grayscale(0) contrast(1);
}

.portrait figcaption {
  max-width: 420px;
}

.bio__text {
  max-width: 720px;
}

.bio__lead {
  margin: 0 0 clamp(1.8rem, 3vw, 2.6rem);
  font-size: clamp(1.25rem, 1.8vw, 1.75rem);
  line-height: 1.28;
  letter-spacing: -0.008em;
}

.bio blockquote {
  margin: 0;
  padding: 0;
  border: 0;
}

.bio blockquote p {
  max-width: 65ch;
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.bio__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.bio__facts div {
  min-width: 0;
}

.bio__facts dt {
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--quiet);
}

.bio__facts dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

/* ---------- footer ---------- */

.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  padding: 2rem var(--pad);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.site-foot p {
  margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .works {
    grid-template-columns: 1fr;
  }

  .work__pair img {
    height: clamp(240px, 44vh, 460px);
  }

  .sketches {
    grid-template-columns: 1fr;
    max-width: 780px;
  }

  .sketch__pair img {
    height: clamp(200px, 30vh, 340px);
  }

  .bio {
    grid-template-columns: 1fr;
  }

  .portrait img {
    max-width: 320px;
  }

  .hero__hint {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --head-h: 3.6rem;
  }

  .site-head {
    gap: 1rem;
  }

  .site-head__brand {
    font-size: 1rem;
  }

  .site-head__nav {
    gap: 0.9rem;
    font-size: 0.98rem;
  }

  .hero {
    padding-top: calc(var(--head-h) + 1.7rem);
  }

  .hero h1 {
    font-size: clamp(2.55rem, 12vw, 4.6rem);
  }

  .hero__ascii pre {
    font-size: clamp(3px, 0.62vh, 5.6px);
  }

  .hero__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
  }

  .section {
    padding-top: clamp(4rem, 12vw, 6rem);
    padding-bottom: clamp(4rem, 12vw, 6rem);
  }

  .section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    margin-bottom: 2.6rem;
  }

  .section__head h2 {
    font-size: clamp(2.5rem, 12.5vw, 4.4rem);
  }

  .lead {
    max-width: 40ch;
    font-size: 1.08rem;
  }

  .work h3 {
    font-size: clamp(1.5rem, 5.8vw, 2rem);
  }

  .work__pair {
    gap: 0.6rem;
  }

  .work__pair img {
    height: clamp(180px, 30vh, 320px);
  }

  figcaption {
    font-size: 0.88rem;
  }

  .sketch__pair img {
    height: clamp(160px, 26vh, 260px);
  }

  .bio__lead {
    font-size: 1.3rem;
  }

  .bio__facts {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .section__ascii {
    top: 1.4rem;
    font-size: 0.8em;
  }

  .section__ascii pre {
    font-size: clamp(6px, 2.1vw, 10px);
  }

  .section__ascii--left {
    bottom: 1.4rem;
  }

  .site-foot {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.85rem;
  }
}

@media (max-width: 620px) {
  .site-head {
    justify-content: flex-end;
  }

  .site-head__brand {
    display: none;
  }
}

@media (max-width: 430px) {
  .site-head__nav {
    gap: 0.7rem;
    font-size: 0.86rem;
  }

  .hero h1 {
    font-size: clamp(2.3rem, 13vw, 3.6rem);
  }

  .contact {
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
