/* =========================================================
   OSG — Base styles
   Fluid root font-size: 1rem = 16px at design width (1440px)
   Figma px → rem = px / 16
   ========================================================= */

/* ---- Fonts ---- */
@font-face {
  font-family: "GT America";
  src: url("../assets/fonts/GT-America-Standard-Light-Trial.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GT America";
  src: url("../assets/fonts/GT-America-Standard-Regular-Trial.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

img, picture, video, canvas, svg, iframe {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* ---- Root: fluid font-size (1rem = 16px at design width) ---- */
:root {
  font-size: calc(clamp(1300px, 100vw, 1440px) / 90);

  --color-bg: #f1f1f1;
  --color-fg: rgba(0, 0, 0, 0.98);
  --color-muted: rgba(0, 0, 0, 0.5);

  --font-sans: "GT America", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Arial, sans-serif;

  --radius-case: 1.25rem; /* 20px */
  --radius-btn:  0.25rem; /* 4px */
}

@media (max-width: 991px) { :root { font-size: calc(clamp(768px, 100vw, 991px) / 62); } }
@media (max-width: 767px) { :root { font-size: calc(clamp(480px, 100vw, 767px) / 48); } }
@media (max-width: 479px) { :root { font-size: calc(clamp(320px, 100vw, 479px) / 30); } }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   Layout container
   ========================================================= */
.page {
  display: flex;
  flex-direction: column;
  gap: 3.75rem; /* 60px — Hero → CaseBlock */
  width: 100%;
}

/* =========================================================
   Fixed nav (full-width white strip across viewport)
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-bg);
  width: 100%;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 90rem; /* 1440px */
  margin: 0 auto;
  padding: 1.25rem 2.5rem; /* 20px 40px */
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  display: flex;
  flex-direction: column;
  /* top padding = nav height (1.25 + 1.75 + 1.25 = 4.25rem) + 190px gap */
  padding: 16.125rem 2.5rem 0; /* 258px 40px 0 */
  width: 100%;
  max-width: 90rem; /* 1440px */
  margin: 0 auto;
}

.nav__logo {
  font-size: 0.875rem; /* 14px — Figma LogoTitle */
  font-weight: 400;
  line-height: 0.99;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #000;
}

.nav__links {
  display: flex;
  gap: 0.5rem; /* 8px */
  align-items: center;
}

.nav__btn {
  position: relative;
  display: inline-block;
  width: 5.8125rem;  /* 93px */
  height: 1.75rem;   /* 28px */
  overflow: hidden;
  border-radius: var(--radius-btn);
  text-transform: uppercase;
  color: #000;
  background: transparent;
  /* Outline pins the border to the pixel grid (no subpixel fuzz from
     fluid rem sizing); outline-offset keeps it inside the radius. */
  outline: 1.5px solid transparent;
  outline-offset: -1.5px;
  /* Match label slide: smooth ease, no overshoot, 480ms. */
  transition: outline-color 0.48s cubic-bezier(0.68, 0, 0.32, 1);
}

.nav__btn__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  /* No overshoot — pure ease-in-out; duration +20% from the button outline. */
  transition: transform 0.48s cubic-bezier(0.68, 0, 0.32, 1);
}

.nav__btn__label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem; /* 28px — match button height */
  flex-shrink: 0;
  font-size: 0.75rem; /* 12px — Figma Button Md */
  font-weight: 500;
  line-height: 1;
}

/* Hover: visuals identical to default — only the label slide plays. */
.nav__btn.is-hovering .nav__btn__slide {
  transform: translateY(-1.75rem);
}

.nav__btn:active .nav__btn__slide {
  transform: translateY(-3.5rem);
}

.nav__btn--active {
  /* Selected state: black border only, no fill, no color change. */
  outline-color: #000;
}

.nav__btn--active .nav__btn__slide {
  transform: translateY(-3.5rem);
}

.nav__btn--active:active {
  outline-color: transparent;
}

.nav__btn--active:active .nav__btn__slide {
  transform: translateY(0);
}

/* ---- Info block ---- */
/* Grid with a hard 50/50 split: bio's left edge is always pinned to
   the page center at every viewport, and bio shrinks inside its half
   so the text wraps to more lines as the viewport narrows. */
.hero__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  align-items: start;
}

.hero__logo-block {
  /* Pin the name to column 3 of the Figma 16-col stretch grid (margin
     40 + 2 cols + 2 gutters = 211px from viewport edge at 1440). From
     the hero content-box this is 10.6875rem. Logo lives inside the
     reserved column, left-aligned; its width and the gap to the name
     become cosmetic — if either changes, the name stays on-grid. */
  display: grid;
  grid-template-columns: 10.6875rem 1fr; /* 171px reserved for logo */
  align-items: start;
  min-width: 0;
}

.hero__logo {
  width: 8.25rem;  /* 132px */
  height: 8.25rem;
  flex-shrink: 0;
  /* Pin the logo so its vertical center sits on the midpoint of the
     first two lines of the name (one line-height from text top =
     2rem × 0.94). Independent of total line count — if the name wraps
     to 3 or 4 lines the logo stays anchored to lines 1–2. */
  margin-top: calc(2rem * 0.94 - 8.25rem / 2);
}

.hero__name {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 2rem; /* 32px */
  line-height: 0.94;
  letter-spacing: -0.04rem; /* -0.64px */
  color: var(--color-fg);
}

.hero__name-sub {
  color: var(--color-muted);
}

.hero__bio {
  max-width: 42.25rem; /* 676px — design width cap inside its half */
  min-width: 0;
  font-size: 1.125rem; /* 18px */
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03125rem; /* -0.5px */
  color: var(--color-muted);
}

/* =========================================================
   Works / CaseBlock
   ========================================================= */
.works {
  display: flex;
  flex-direction: column;
  gap: 3.75rem; /* 60px between cases */
  width: 100%;
  padding: 0 2.5rem; /* 40px horizontal — match hero */
  scroll-margin-top: 4.25rem;
}

.case {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.case__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 0; /* 12px vertical — horizontal handled by .works */
}

.case__link {
  font-size: 1.125rem; /* 18px */
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03125rem; /* -0.5px */
  color: var(--color-muted);
  text-decoration: none;
}

.case__video {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 768; /* Figma case proportions (15:8) */
  overflow: hidden;
  border-radius: var(--radius-case);
  background: #000;
}

.case__video video,
.case__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

/* =========================================================
   About page
   ========================================================= */
.about {
  padding: 2.5rem;
  max-width: 90rem;
  margin: 0 auto;
  scroll-margin-top: 4.25rem; /* clear fixed nav when anchor-scrolled */
}

.about__title {
  font-size: 2rem;
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.04rem;
  margin-bottom: 1.5rem;
}

.about__text {
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.03125rem;
  color: var(--color-muted);
  max-width: 42.25rem;
}

/* =========================================================
   Responsive
   ========================================================= */
/* Subtitle breaks into two lines once viewport drops below the
   design width (1300px). Above 1300 it stays on a single line. */
@media (max-width: 1299px) {
  .hero__name-sub > span { display: block; }
}

/* "Pavel Mostovshchikov" wraps "Mostovshchikov" to its own line
   at <=1100px so the name doesn't crowd the bio before the 991
   breakpoint stacks the layout. */
@media (max-width: 1100px) {
  .hero__name-first { display: block; }
}

@media (max-width: 991px) {
  .nav__inner { padding: 1rem 1.5rem; }
  .hero {
    padding: 8rem 1.5rem 0;
  }
  .hero__info {
    grid-template-columns: 1fr; /* stack to single column */
    gap: 2.5rem;
  }
  .hero__logo-block {
    gap: 2rem;
  }
  .hero__bio { max-width: 42.25rem; }
  .works { padding: 0 1.5rem; }
}

@media (max-width: 767px) {
  .nav__inner { padding: 0.875rem 1rem; }
  .hero {
    padding: 6rem 1rem 0;
  }
  .hero__logo {
    width: 5.25rem; /* 84px — 80px × 1.05 */
    height: 5.25rem;
    margin-top: calc(1.5rem * 0.94 - 5.25rem / 2);
  }
  .hero__name { font-size: 1.5rem; white-space: normal; }
  .hero__bio { font-size: 1rem; }
  .nav__btn { width: 5rem; font-size: 0.6875rem; }
  .works { padding: 0 1rem; }
}
