/*
 * IO Consulting landing
 * Figma: distribuAII — desktop 208:14359 (1920×1080), mobile 208:14450 (390×844)
 *
 * The background is scaled with object-fit: cover, so 1 design px on the
 * 1920×1080 frame becomes --u screen px. Desktop content is anchored to the
 * same spot of the image at any viewport size; at 1920×1080 --u is exactly 1.
 */

/* Custom cut at weight 467 — it is the only face, so weight 400 text resolves to it. */
@font-face {
  font-family: "Timeless Sans";
  src: url("../fonts/TimelessSans-W467.woff2") format("woff2");
  font-weight: 467;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-text: #000;
  --color-logo-ink: #484c4d;
  --color-fade: #f1fcff;

  --font-body: "Timeless Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-taskutark: "Bricolage Grotesque", var(--font-body);
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: #fff;
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

/* Stage — Frame 19 / Background */

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
  container-type: size;
}

/* Same box object-fit: cover would give the image, so overlays can use image coordinates */
.stage__scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100cqw, 100cqh * 16 / 9);
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

.stage__bg,
.stage__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Positions are in px of the 1280×720 source video */
.stage__motion {
  position: absolute;
  object-fit: fill;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Water: strip y 520–680 */
.stage__motion--water {
  left: 0;
  top: calc(520 / 720 * 100%);
  width: 100%;
  height: calc(160 / 720 * 100%);
  -webkit-mask: url("../assets/img/scene-motion-mask.png") 0 0 / 100% 100% no-repeat;
  mask: url("../assets/img/scene-motion-mask.png") 0 0 / 100% 100% no-repeat;
}

/* Person: x 560–700, y 500–640 */
.stage__motion--person {
  left: calc(560 / 1280 * 100%);
  top: calc(500 / 720 * 100%);
  width: calc(140 / 1280 * 100%);
  height: calc(140 / 720 * 100%);
  -webkit-mask: url("../assets/img/scene-person-mask.png") 0 0 / 100% 100% no-repeat;
  mask: url("../assets/img/scene-person-mask.png") 0 0 / 100% 100% no-repeat;
}

.stage__motion.is-playing {
  opacity: 1;
}

/* Mobile-only top fade — Frame 31 */
.stage__fade {
  display: none;
}

/* Content — Frame 20 */

.intro {
  --u: max(100cqw / 1920, 100cqh / 1080);

  position: absolute;
  left: calc(50% - 160 * var(--u));  /* x 800 on 1920 */
  top: calc(50% - 233 * var(--u));   /* y 307 on 1080 */
  /* Snap to whole pixels so the logos' vector edges stay crisp */
  left: round(calc(50% - 160 * var(--u)), 1px);
  top: round(calc(50% - 233 * var(--u)), 1px);
  width: 380px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 64px;
  opacity: 0.7;
}

/* Frame 9 */
.intro__mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  color: var(--color-text);
}

.intro__logo {
  width: 42px;
  height: 32px;
}

/* Frame 27 */
.intro__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  width: 100%;
}

.intro__text {
  width: 100%;
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  overflow-wrap: break-word;
}

/* Figma says 140%, but lays lines out on a 22px grid (text box: 6 × 22 + 12 = 144) */
.intro__text p {
  margin: 0;
  line-height: 22px;
  text-wrap: balance;
}

.intro__text p + p {
  margin-top: 12px;
}

/* Frame 21 */
.intro__logos {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo {
  flex-shrink: 0;
}

.logo--rahva-raamat .logo__svg {
  width: 93.6085px;
  height: 20px;
}

/* Frame 25 */
.logo--distribuai {
  position: relative;
  width: 89px;
  height: 22px;
}

.logo--distribuai .logo__svg {
  position: absolute;
  left: 0.33px;
  top: -2.67px;
  width: 82.2441px;
  height: 23.1111px;
}

/* NavLogo */
.logo--taskutark {
  display: flex;
  align-items: center;
  gap: 4.375px;
  width: 83.75px;
  height: 20px;
}

.logo--taskutark .logo__svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.logo--taskutark span {
  flex-shrink: 0;
  font-family: var(--font-taskutark);
  font-size: 12.5px;
  font-weight: 700;
  line-height: normal;
  letter-spacing: -0.375px;
  color: var(--color-logo-ink);
  white-space: nowrap;
  font-variation-settings: "opsz" 14, "wdth" 100;
}

/* Mobile — iPhone 13 & 14 (390×844) */

@media (max-width: 600px) {
  .stage__fade {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(165 / 844 * 100%);
    background: linear-gradient(to bottom, var(--color-fade) 60%, rgb(241 252 255 / 0) 100%);
    pointer-events: none;
  }

  .intro {
    left: 32px;
    right: 32px;
    top: calc(210 / 844 * 100%);
    top: round(calc(210 / 844 * 100%), 1px);
    width: auto;
  }
}
