/* Brand it easy — ONO studio
   Layout constants measured from zadání/koncept.pdf mockups
   (fractions of viewport width/height, converted through SVG glyph bboxes). */

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

:root {
  --khaki: #626357;
  --white: #ffffff;
  --orange: #f15a24;
}

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

html,
body {
  height: 100%;
}

body {
  height: 100dvh;
  overflow: hidden;
  background: var(--khaki);
  font-family: "Figtree", sans-serif;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

/* --- swap pairs (passive / active state stacked on top of each other) --- */

.swap {
  position: relative;
  display: block;
}

.swap img {
  display: block;
  width: 100%;
  height: auto;
}

.swap .active {
  position: absolute;
  inset: 0;
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .swap:hover .passive { opacity: 0; }
  .swap:hover .active { opacity: 1; }
}

.swap.is-active .passive { opacity: 0; }
.swap.is-active .active { opacity: 1; }

/* --- logo (rule 1: pinned top-left) --- */

/* Widths carry a dvh cap (vw value × 16/9) so viewports wider than the 16:9
   mockup — typically phones in landscape — scale by height instead of width. */
.logo {
  position: fixed;
  left: calc(4.795vw + env(safe-area-inset-left));
  top: 4.954dvh;
  width: min(9.704vw, 17.25dvh);
  z-index: 3;
}

/* --- hero: blob + headline (rule 2: centered, scales with window) --- */

.hero {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* The video and the reduced-motion still (blob.svg = frame 0 of the same
   master) share one 1200x1200 canvas, so one width serves both and the two
   variants cannot drift apart — switching between them moves nothing.
   The canvas has only ~3.6% khaki padding around the drawing, against ~15% in
   the previous export, so the width is the old one × 0.75; that keeps the
   artwork at the size measured from the mockups. */
.blob {
  position: absolute;
  left: calc(50% + 1.97vw);
  top: 50.11dvh;
  display: block;
  width: min(30.69vw, 54.56dvh);
  height: auto;
  transform: translate(-50%, -50%);
  /* Decorative background — no right-click media menu, no PiP entry point;
     clicks fall through to the page. */
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* The extra translate3d/rotate/scale vars are driven by js/blob-motion.js
   (pointer parallax, device tilt, shake pulse) and default to neutral. */
.blob-video {
  transform: translate(-50%, -50%)
    translate3d(var(--bx, 0px), var(--by, 0px), 0)
    rotate(var(--br, 0deg))
    scale(var(--bs, 1));
}

.blob-static {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .blob-video { display: none; }
  .blob-static { display: block; }
}

/* Headline counter-moves against the blob (weaker, opposite) for depth. */
.headline {
  position: absolute;
  left: 50%;
  top: 52.70dvh;
  width: min(74.48vw, 132.41dvh);
  transform: translate(-50%, -50%)
    translate3d(var(--hx, 0px), var(--hy, 0px), 0);
  z-index: 2;
}

.hl { display: block; }
.hl-mobile { display: none; }

/* --- footer links (rules 3 & 4: pinned bottom corners) --- */

footer a.link {
  position: fixed;
  bottom: calc(8.45dvh + env(safe-area-inset-bottom) - 0.55em);
  z-index: 3;
  color: var(--white);
  text-decoration: none;
  font-size: clamp(12px, 1.70dvh, 22px);
  line-height: 1;
  padding-bottom: 0.55em; /* reserve space for the hover underline */
}

.link-ig { left: calc(4.84vw + env(safe-area-inset-left)); }
.link-mail { right: calc(4.70vw + env(safe-area-inset-right)); }

footer a.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.28em;
  background: var(--orange);
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  footer a.link:hover::after { opacity: 1; }
}

footer a.link:focus-visible {
  outline: none;
}

footer a.link:focus-visible::after {
  opacity: 1;
}

/* --- mobile layout (measured from Mobile / passive mockup) ---
   Portrait only: a phone held landscape is wider than tall, so it gets the
   desktop composition (with the dvh caps above) instead of the stacked
   portrait mockup, whose vw-based sizes would overflow the short viewport. */

@media (max-width: 768px) and (orientation: portrait) {
  .logo {
    left: 10.85vw;
    top: 2.84dvh;
    width: 32.50vw;
  }

  .blob {
    left: calc(50% + 3.35vw);
    top: 52.19dvh;
    width: 73.61vw;
  }

  .headline {
    top: 51.82dvh;
    width: 91.45vw;
  }

  .hl-desktop { display: none; }
  .hl-mobile { display: block; }

  footer a.link {
    bottom: calc(3.91dvh + env(safe-area-inset-bottom) - 0.55em);
    font-size: clamp(11px, 1.56dvh, 18px);
  }

  .link-ig { left: calc(10.86vw + env(safe-area-inset-left)); }
  .link-mail { right: calc(10.23vw + env(safe-area-inset-right)); }
}

/* Logo and headline swap instantly on purpose — no crossfade (client request).
   Only the footer link underline keeps a fade. */
@media (prefers-reduced-motion: no-preference) {
  footer a.link::after {
    transition: opacity 120ms ease;
  }
}
