/* ==========================================================================
   KATER'INA — portfolio
   Source: Figma frames 1:2 (desktop 1920x1080) and 1:52 (mobile 375x991).

   Desktop scales proportionally: --u equals 1px at the 1920 reference width
   and shrinks/grows with the viewport, so every dimension keeps the exact
   Figma proportions at any desktop size. Tablet/phone reset --u to 1px and
   restructure the layout.
   ========================================================================== */

:root {
  --bg: #0d0e0e;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.4);
  --surface: #161717;
  --line: rgba(255, 255, 255, 0.08);

  --u: calc(100vw / 1920);
}

.light {
  --bg: #f2f2f2;
  --fg: #0d0e0e;
  --muted: rgba(13, 14, 14, 0.4);
  --surface: #e7e7e7;
  --line: rgba(13, 14, 14, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(18 * var(--u));
  line-height: normal;
  letter-spacing: -0.03em;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* White-on-transparent assets become dark in light mode */
.light .title-block__wordmark,
.light .available__arrow {
  filter: invert(1);
}

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

ul {
  list-style: none;
}

img {
  display: block;
}

/* Grain overlay (Figma: Rectangle 6, mix-blend overlay, 20%).
   Absolutely positioned within body so it is clipped to the actual content
   height and never bleeds into the overscroll area on touch devices. */
.noise {
  position: absolute;
  inset: 0;
  background: url("../assets/noise.png") top left / 1024px 1024px repeat;
  mix-blend-mode: overlay;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  padding: calc(40 * var(--u));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  display: flex;
  justify-content: space-between;
  gap: calc(20 * var(--u));
}

.header__left,
.header__right {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}

.header__left {
  justify-content: space-between;
  gap: calc(96 * var(--u));
}

/* Contacts ---------------------------------------------------------------- */

.contacts {
  display: flex;
  gap: calc(82 * var(--u));
  font-size: calc(16 * var(--u));
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.contacts__labels,
.contacts__values {
  display: flex;
  flex-direction: column;
  gap: calc(10 * var(--u));
}

.contacts__labels {
  font-weight: 700;
  text-transform: uppercase;
  min-width: calc(73 * var(--u));
}

.contacts__values {
  width: calc(212 * var(--u));
}

.contacts__values p:nth-child(2) {
  text-transform: uppercase;
}

.contacts__links {
  display: flex;
  justify-content: space-between;
  max-width: calc(180 * var(--u));
  text-transform: uppercase;
}

/* Tagline ----------------------------------------------------------------- */

.tagline {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(125 * var(--u));
  color: var(--muted);
}

.tagline__text {
  font-size: calc(35.2 * var(--u));
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.tagline__slash {
  font-size: calc(18 * var(--u));
  letter-spacing: -0.03em;
}

/* Services ---------------------------------------------------------------- */

.header__right {
  justify-content: flex-start;
}

.services {
  display: flex;
  gap: calc(43 * var(--u));
  font-size: calc(18 * var(--u));
  letter-spacing: -0.03em;
}

.services__col {
  display: flex;
  flex-direction: column;
  gap: calc(20 * var(--u));
}

.services__col--create {
  max-width: calc(267 * var(--u));
}

.services__col--services {
  width: calc(136 * var(--u));
  flex-shrink: 0;
}

.services__heading {
  font-size: calc(18 * var(--u));
  font-weight: 400;
  color: var(--muted);
}

.services__list--muted {
  color: var(--muted);
}

/* Switch + photo ---------------------------------------------------------- */

.header__side {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: calc(112 * var(--u));
  flex-shrink: 0;
}

/* Geometry from switch.svg: 46x22 pill, r8.94 knob at x2.75 */
.theme-toggle {
  position: relative;
  width: calc(46 * var(--u));
  height: calc(22 * var(--u));
  border: none;
  border-radius: calc(11 * var(--u));
  background: var(--fg);
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.theme-toggle__knob {
  position: absolute;
  top: calc(2.06 * var(--u));
  left: calc(2.75 * var(--u));
  width: calc(17.88 * var(--u));
  height: calc(17.88 * var(--u));
  border-radius: 50%;
  background: var(--bg);
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.light .theme-toggle__knob {
  transform: translateX(calc(22.68 * var(--u)));
}

.header__photo {
  width: calc(46 * var(--u));
  height: calc(44 * var(--u));
  object-fit: cover;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: calc(20 * var(--u));
  margin-top: calc(245 * var(--u));
}

.hero__left,
.hero__right {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hero__left {
  justify-content: space-between;
  gap: calc(208 * var(--u));
}

/* Intent text ------------------------------------------------------------- */

.intent {
  align-self: center;
  display: flex;
  gap: calc(150 * var(--u));
  font-size: calc(18 * var(--u));
}

.intent__title {
  white-space: nowrap;
}

.intent__body {
  max-width: calc(290 * var(--u));
}

.intent__body p + p {
  margin-top: 1.15em;
}

/* Wordmark + caption ------------------------------------------------------ */

.title-block {
  display: flex;
  flex-direction: column;
  gap: calc(20 * var(--u));
}

.title-block__wordmark {
  width: 100%;
  height: auto;
}

.title-block__caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: calc(18 * var(--u));
  letter-spacing: -0.04em;
  text-transform: capitalize;
}

.title-block__name {
  flex: 1;
}

.title-block__meta {
  display: flex;
  justify-content: space-between;
  flex-basis: 48.9%;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Reel -------------------------------------------------------------------- */

.hero__right {
  justify-content: flex-end;
  gap: calc(30 * var(--u));
}

.available {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  font-size: calc(18 * var(--u));
}

.available__arrow {
  width: calc(15 * var(--u));
  height: calc(13 * var(--u));
}

.reel {
  width: 100%;
  aspect-ratio: 910 / 511;
  border-radius: calc(15 * var(--u));
  background: var(--surface);
  overflow: hidden;
  transition: background-color 0.25s ease;
}

.reel__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Tablet (768 - 1199): stacked adaptation, design px restored
   ========================================================================== */

@media (max-width: 1199px) {
  :root {
    --u: 1px;
  }

  .page {
    padding: 32px;
    justify-content: flex-start;
  }

  .header {
    flex-direction: column;
    gap: 56px;
  }

  .header__left {
    justify-content: space-between;
    gap: 40px;
  }

  .contacts {
    gap: 43px;
  }

  .tagline {
    gap: 0;
    justify-content: flex-end;
  }

  .tagline__text {
    font-size: clamp(24px, 3.4vw, 35.2px);
  }

  .tagline__slash {
    display: none;
  }

  .header__right {
    justify-content: space-between;
    gap: 40px;
  }

  .header__side {
    margin-left: 0;
    gap: 0;
    justify-content: space-between;
  }

  .hero {
    flex-direction: column;
    margin-top: 96px;
    gap: 72px;
  }

  .hero__left {
    gap: 80px;
  }

  .intent {
    align-self: flex-start;
    gap: clamp(48px, 10vw, 150px);
  }

  .intent__body {
    max-width: 420px;
  }

  .hero__right {
    gap: 24px;
  }
}

/* ==========================================================================
   Phone (< 768): Figma mobile frame 1:52 (375 reference)
   Source order is rearranged via display:contents + order:
   wordmark+caption, tagline, services, contacts, intent, available+reel.
   ========================================================================== */

@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  .page {
    padding: 48px 20px;
    justify-content: flex-start;
  }

  /* Flatten wrappers so the groups become direct flex items of .page */
  .header,
  .header__left,
  .header__right,
  .hero,
  .hero__left {
    display: contents;
  }

  .header__side {
    display: none;
  }

  /* 1. Wordmark + caption */
  .title-block {
    order: 1;
    gap: 15px;
  }

  .title-block__caption {
    font-size: 14px;
    letter-spacing: -0.04em;
    gap: 17px;
  }

  .title-block__name {
    flex: 0 0 auto;
  }

  .title-block__meta {
    flex: 1;
    flex-basis: auto;
    justify-content: space-between;
    gap: 17px;
  }

  /* 2. Tagline */
  .tagline {
    order: 2;
    flex: 0 0 auto;
    margin-top: 48px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
  }

  .tagline__text {
    font-size: 28px;
    letter-spacing: -0.04em;
    white-space: nowrap;
  }

  .tagline__slash {
    display: block;
    font-size: 22px;
  }

  /* 3. What I create / Services */
  .services {
    order: 3;
    margin-top: 30px;
    justify-content: space-between;
    gap: 20px;
    font-size: 14px;
  }

  .services__col {
    gap: 10px;
  }

  .services__col--create {
    max-width: 158px;
  }

  .services__col--services {
    width: auto;
    flex-shrink: 0;
  }

  .services__heading {
    font-size: 14px;
  }

  /* 4. Contacts */
  .contacts {
    order: 4;
    margin-top: 48px;
    gap: 20px;
    font-size: 14px;
  }

  .contacts__labels,
  .contacts__values {
    gap: 10px;
  }

  .contacts__labels {
    min-width: 73px;
  }

  .contacts__values {
    width: 157px;
  }

  .contacts__links {
    max-width: none;
  }

  /* 5. Intent: title flows into the paragraph, as in the mobile frame */
  .intent {
    order: 5;
    margin-top: 48px;
    display: block;
    font-size: 14px;
  }

  .intent__title {
    display: inline;
    white-space: normal;
  }

  .intent__title::after {
    content: " ";
  }

  .intent__body {
    display: inline;
    max-width: none;
  }

  .intent__body p:first-child {
    display: inline;
  }

  /* 6. Available + reel */
  .hero__right {
    order: 6;
    margin-top: 48px;
    gap: 20px;
    justify-content: flex-start;
  }

  .available {
    font-size: 14px;
  }

  .available__arrow {
    width: 13px;
    height: 10px;
  }

  .reel {
    aspect-ratio: 335 / 188;
    border-radius: 10px;
  }
}
