:root {
  --red: #ef1010;
  --ink: #111111;
  --muted: #5e5e5e;
  --paper: #ffffff;
  --soft: #f2f2ef;
  --line: #111111;
  --max: 760px;
  --r2: "https://pub-a642c329ad3c4b6c8d20fb262ef78840.r2.dev";
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #e9e9e7;
  font-family: Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img,
video {
  max-width: 100%;
}

main {
  width: min(100%, var(--max));
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
}

/* HERO */
.hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: 42% 58%;
  position: relative;
  background: #fff;
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-height: 420px;
  padding: 138px 0 52px 22px;
  background-color: #fff;
  background-image: radial-gradient(#d9d9d9 0.9px, transparent 0.9px);
  background-size: 9px 9px;
}

.kicker {
  margin: 0 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1;
}

.hero h1 {
  width: max-content;
  max-width: 122%;
  margin: 0;
  color: var(--red);
  font: 900 clamp(78px, 17vw, 106px) / 0.82 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: -0.045em;
  text-shadow: 0 2px 1px rgba(0, 0, 0, 0.12);
}

.hero-contacts {
  position: absolute;
  left: 22px;
  bottom: 48px;
  display: grid;
  gap: 5px;
  font: 600 10px/1.1 Georgia, "Times New Roman", serif;
}

.hero-contacts a {
  width: fit-content;
}

.hero-contacts a:hover,
.socials a:hover {
  color: var(--red);
}

.hero-photo {
  min-height: 420px;
  background-color: #d7d7d7;
  background-image: image-set(
    url("https://pub-a642c329ad3c4b6c8d20fb262ef78840.r2.dev/images/hero.avif") type("image/avif"),
    url("https://pub-a642c329ad3c4b6c8d20fb262ef78840.r2.dev/images/hero.webp") type("image/webp")
  );
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* PROFILE */
.profile {
  padding: 28px 22px 36px;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(150px, 0.82fr);
  gap: 24px 44px;
}

.name-block {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: flex-end;
  width: max-content;
  max-width: 100%;
}

.name-block h2 {
  margin: 0;
  font: 900 clamp(40px, 7vw, 48px) / 0.86 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: -0.03em;
}

.name-block p {
  margin: 0 0 -2px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.experience h3,
.facts h3 {
  margin: 0 0 13px;
  font-size: 25px;
  line-height: 1;
  font-weight: 500;
}

.experience article {
  margin: 0 0 21px;
}

.experience h4 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.12;
  font-weight: 800;
}

.experience p {
  margin: 0;
  max-width: 470px;
  color: #222;
  font-size: 10.5px;
  line-height: 1.35;
}

.facts {
  align-self: center;
  display: grid;
  gap: 34px;
}

.facts ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  font-size: 11px;
  line-height: 1.1;
}

.facts li::before {
  content: "· ";
}

/* WORK GRID */
.work {
  padding: 22px 7% 38px;
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: end;
  border-bottom: 2px solid var(--line);
  margin-bottom: 14px;
}

.section-label span {
  padding-bottom: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.section-label h2 {
  margin: 0;
  font: 900 clamp(38px, 7vw, 56px) / 0.9 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: -0.03em;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-flow: dense;
  gap: 6px;
}

.media-card {
  position: relative;
  display: block;
  margin: 0;
  min-height: 170px;
  overflow: hidden;
  border-radius: 7px;
  background: #181818;
  isolation: isolate;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: 205px;
}

.media-card:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.media-card::before {
  content: "▶";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #111;
  background: rgba(255, 255, 255, 0.86);
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  pointer-events: none;
  font-size: 18px;
  line-height: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.media-card:hover::before,
.media-card:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.media-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 65%, rgba(0, 0, 0, 0.18));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.media-card:hover::after {
  opacity: 1;
}

.media-card video,
.media-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transform: scale(1.001);
  user-select: none;
}

.media-card.wide {
  grid-column: span 3;
  min-height: 185px;
}

.media-card.wide-small {
  grid-column: span 2;
  min-height: 185px;
}

.media-card.tall {
  grid-column: span 1;
  min-height: 205px;
}

.final-visual {
  margin-top: 8px;
  min-height: 340px;
  border-radius: 7px;
  overflow: hidden;
  background-color: #f5e9d7;
  background-image: image-set(
    url("https://pub-a642c329ad3c4b6c8d20fb262ef78840.r2.dev/images/final.avif") type("image/avif"),
    url("https://pub-a642c329ad3c4b6c8d20fb262ef78840.r2.dev/images/final.webp") type("image/webp")
  );
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* CLOSING */
.closing {
  padding: 20px 7% 44px;
  text-align: center;
}

.closing h2 {
  margin: 0 0 34px;
  font: 500 clamp(58px, 11vw, 78px) / 0.92 Inter, Arial, sans-serif;
  letter-spacing: -0.055em;
}

.socials {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  text-align: left;
  font: 700 clamp(18px, 3.1vw, 24px) / 1 Georgia, "Times New Roman", serif;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.socials svg {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

/* REVEAL ANIMATION */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}


/* FULLSCREEN VIDEO PLAYER */
.no-scroll {
  overflow: hidden;
}

.fullscreen-player {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.92);
}

.fullscreen-player.is-open {
  display: flex;
}

.fullscreen-player__video {
  display: block;
  width: min(100%, 520px);
  max-height: 92vh;
  border-radius: 14px;
  background: #000;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

.fullscreen-player__close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #111;
  background: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.fullscreen-player__hint {
  position: fixed;
  left: 50%;
  bottom: 14px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  transform: translateX(-50%);
}

@media (orientation: landscape) {
  .fullscreen-player__video {
    width: min(100%, 86vw);
    max-height: 88vh;
  }
}

/* RESPONSIVE */
@media (max-width: 700px) {
  :root {
    --max: 100%;
  }

  main {
    box-shadow: none;
  }

  .hero {
    grid-template-columns: 42% 58%;
  }

  .profile {
    grid-template-columns: minmax(0, 2fr) minmax(135px, 0.8fr);
    gap: 22px 28px;
  }

  .facts ul {
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
  }
}

@media (max-width: 560px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 720px;
  }

  .hero-photo {
    position: absolute;
    inset: 0 0 auto 34%;
    min-height: 480px;
  }

  .hero-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #fff 0, transparent 56%);
  }

  .hero-copy {
    min-height: 720px;
    padding: 168px 16px 34px;
    background-color: transparent;
    background-image:
      linear-gradient(180deg, transparent 48%, #fff 70%),
      radial-gradient(#d9d9d9 0.9px, transparent 0.9px);
  }

  .hero h1 {
    font-size: 28vw;
  }

  .hero-contacts {
    left: 16px;
    bottom: 38px;
  }

  .profile {
    padding: 34px 18px 36px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .name-block {
    display: block;
  }

  .name-block p {
    margin: 7px 0 0;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .section-label {
    display: block;
  }

  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .media-card,
  .media-card.tall {
    min-height: 260px;
  }

  .media-card.wide,
  .media-card.wide-small {
    grid-column: span 2;
    min-height: 230px;
  }

  .final-visual {
    min-height: 300px;
  }

  .closing {
    padding-inline: 18px;
  }

  .closing h2 {
    font-size: 16vw;
  }

  .socials {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* MOBILE LAYOUT FIXES */
@media (max-width: 560px) {
  /* 1) Hero: photo becomes a full background, text sits on top */
  .hero {
    min-height: 620px;
    display: block;
    position: relative;
    overflow: hidden;
    background: #fff;
  }

  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.84) 36%, rgba(255, 255, 255, 0.28) 68%, rgba(255, 255, 255, 0) 100%),
      linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 56%, #ffffff 92%);
  }

  .hero-photo {
    position: absolute;
    inset: 0;
    z-index: 0;
    min-height: 620px;
    background-position: center top;
    background-size: cover;
  }

  .hero-photo::after {
    content: none;
  }

  .hero-copy {
    position: relative;
    z-index: 2;
    min-height: 620px;
    padding: 150px 16px 34px;
    background-color: transparent;
    background-image: radial-gradient(rgba(217, 217, 217, 0.65) 0.9px, transparent 0.9px);
    background-size: 9px 9px;
  }

  .kicker {
    font-size: 12px;
  }

  .hero h1 {
    width: auto;
    max-width: 100%;
    font-size: clamp(76px, 25vw, 112px);
    line-height: 0.82;
    overflow-wrap: normal;
  }

  .hero-contacts {
    left: 16px;
    bottom: 34px;
    font-size: 10px;
  }

  /* 2) Works: every mobile item is exactly 1 of 2 columns */
  .work {
    padding: 22px 14px 34px;
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .media-card,
  .media-card.tall,
  .media-card.wide,
  .media-card.wide-small {
    grid-column: span 1;
    min-height: auto;
    aspect-ratio: 9 / 16;
  }

  .media-card img,
  .media-card video {
    min-height: 0;
    height: 100%;
  }

  .media-card::before {
    width: 34px;
    height: 34px;
    font-size: 15px;
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
  }

  /* 3) Hide final photo on mobile */
  .final-visual {
    display: none;
  }
}
