/* Aegvõte — styles
   One full-page background video, everything else quiet type on top of it. */

:root {
  --ink: #0e1317;
  --fog: #f3f4f3;
  --rec: #e5484d;

  --muted: rgba(243, 244, 243, .84);     /* body copy on the dark scrim */
  --rule: rgba(243, 244, 243, .2);
  --rule-strong: rgba(243, 244, 243, .34);

  --font-display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-h3: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
  --fs-body: 1.0625rem;
  --gutter: clamp(20px, 4vw, 56px);
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fog);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 12px 16px;
  background: var(--fog);
  color: var(--ink);
  font-size: .9375rem;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* ── Full-page background ───────────────────────────────── */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--ink);
}
.bg > * { position: absolute; inset: 0; }

/* Stand-in until assets/hero.mp4 exists: a slow dusk over a dark horizon. */
.bg__fallback {
  background:
    radial-gradient(70% 50% at 8% 0%, rgba(96, 128, 148, .3), transparent 62%),
    linear-gradient(180deg, #0c1318 0%, #14202a 55%, #1d2c36 100%);
}
.bg__fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 46% at 68% 106%, rgba(226, 158, 108, .42), transparent 64%);
  animation: dusk 24s ease-in-out infinite alternate;
}
.bg__fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.bg__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: blur(2px);
  transform: scale(1.02);
  transition: opacity 1.2s ease;
}
.bg.has-video .bg__video { opacity: 1; }

/* Keeps type legible over any footage: light at the top so the video reads, deeper below. */
.bg__shade {
  background: linear-gradient(
    180deg,
    rgba(14, 19, 23, .55) 0%,
    rgba(14, 19, 23, .16) 30%,
    rgba(14, 19, 23, .5) 62%,
    rgba(14, 19, 23, .78) 100%
  );
}

/* ── Wordmark ───────────────────────────────────────────── */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-block: 12px;
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1;
  text-decoration: none;
}
.wordmark__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rec);
  animation: rec-blink 1.4s ease-in-out infinite;
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.wordmark--sm { font-size: 1.125rem; padding-block: 0; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  --hdr: 0; /* 0 at the top of the page, 1 after ~160px of scroll (set in script.js) */
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(14, 19, 23, calc(var(--hdr) * .8));
  box-shadow: 0 1px 0 rgba(243, 244, 243, calc(var(--hdr) * .2));
}
@supports (backdrop-filter: blur(1px)) {
  .site-header {
    backdrop-filter: blur(calc(var(--hdr) * 14px)) saturate(1.2);
    -webkit-backdrop-filter: blur(calc(var(--hdr) * 14px)) saturate(1.2);
  }
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header__end { display: flex; align-items: center; gap: 20px; }

.nav { display: none; gap: 8px; }
.nav a {
  padding: 12px;
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  opacity: .82;
  transition: opacity .2s;
}
.nav a:hover { opacity: 1; }
@media (min-width: 760px) { .nav { display: flex; } }

.lang { display: flex; }
.lang button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 6px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  opacity: .7;
  transition: opacity .2s;
}
.lang button:hover { opacity: 1; }
.lang button[aria-pressed="true"] {
  opacity: 1;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.site-header__end .btn { display: none; }
@media (min-width: 520px) { .site-header__end .btn { display: inline-flex; } }

/* ── Buttons & links ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--sm { min-height: 44px; padding: 0 18px; font-size: .9375rem; }
.btn--light { background: var(--fog); color: var(--ink); }
.btn--light:hover { background: #fff; }
.btn--ghost { border-color: var(--rule-strong); }
.btn--ghost:hover { background: var(--fog); color: var(--ink); border-color: var(--fog); }
.arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.link-quiet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  opacity: .86;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: opacity .2s;
}
.link-quiet:hover { opacity: 1; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.hero__body {
  padding-top: calc(var(--header-h) + 64px);
  padding-bottom: clamp(56px, 11vh, 120px);
}
.hero__title {
  font-size: clamp(2.375rem, 1rem + 6vw, 6.5rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-shadow: 0 1px 32px rgba(0, 0, 0, .25);
}
.hero__title .line {
  display: block;
  animation: rise 1s var(--ease) both;
  animation-delay: calc(var(--i) * 110ms + 200ms);
}
.hero__lede {
  max-width: 46ch;
  margin-top: 28px;
  font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem);
  line-height: 1.55;
  color: rgba(243, 244, 243, .92);
  text-shadow: 0 1px 20px rgba(0, 0, 0, .35);
  animation: rise 1s var(--ease) 480ms both;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  margin-top: 36px;
  animation: rise 1s var(--ease) 600ms both;
}

/* Pause control for the background video (only shown once a video has loaded). */
.bg-toggle {
  position: fixed;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: rgba(14, 19, 23, .45);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.bg-toggle[hidden] { display: none; }
.bg-toggle:hover { border-color: rgba(243, 244, 243, .7); background: rgba(14, 19, 23, .7); }
.bg-toggle .icon-play { display: none; }
.bg-toggle[data-paused="true"] .icon-play { display: block; }
.bg-toggle[data-paused="true"] .icon-pause { display: none; }

/* ── Sections ───────────────────────────────────────────── */
.section {
  padding-block: clamp(80px, 12vw, 176px);
  background: rgba(14, 19, 23, .78);
}
.section--tint { background: rgba(14, 19, 23, .82); }
.section--dark { background: rgba(14, 19, 23, .88); }

.h2 {
  max-width: 16ch;
  margin-bottom: clamp(48px, 7vw, 96px);
  font-size: clamp(2rem, 1rem + 3.6vw, 4.25rem);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -.03em;
  text-wrap: balance;
}

/* Services — compact grid, each cell opens on click */
.services {
  display: grid;
  gap: 0 clamp(32px, 4vw, 64px);
  align-items: start;
}
@media (min-width: 720px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .services { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.service { border-top: 1px solid var(--rule-strong); }
.service__btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(24px, 3vw, 32px) 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.025em;
  opacity: .78;
  transition: opacity .2s;
}
.service__btn:hover, .service.is-open .service__btn { opacity: 1; }
.service__icon { position: relative; flex: none; width: 18px; height: 18px; }
.service__icon::before, .service__icon::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 1.5px;
  background: currentColor;
  transition: transform .3s var(--ease);
}
.service__icon::after { transform: rotate(90deg); }
.service.is-open .service__icon::after { transform: rotate(0); }

.service__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease);
}
.service__panel > div { overflow: hidden; visibility: hidden; transition: visibility 0s .35s; }
.service.is-open .service__panel { grid-template-rows: 1fr; }
.service.is-open .service__panel > div { visibility: visible; transition-delay: 0s; }
.service__text {
  max-width: 44ch;
  padding-bottom: clamp(28px, 4vw, 48px);
  color: var(--muted);
}

/* Process — three stages */
.stages { display: grid; gap: 48px; }
.stage {
  padding-top: 32px;
  border-top: 1px solid var(--rule-strong);
}
.stage__when {
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.stage__name {
  margin-bottom: 12px;
  font-size: var(--fs-h3);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.stage__text { max-width: 36ch; color: var(--muted); }
@media (min-width: 900px) {
  .stages { grid-template-columns: repeat(3, 1fr); gap: 0 clamp(32px, 5vw, 72px); }
}

/* Contact */
.contact .h2 {
  max-width: 13ch;
  margin-bottom: 32px;
  font-size: clamp(2.25rem, 1rem + 5.2vw, 5.5rem);
}
.contact__lede {
  max-width: 44ch;
  margin-bottom: 44px;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--muted);
}
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; }
.contact__mail {
  padding-block: 10px;
  font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
}

/* Footer */
.site-footer { background: rgba(14, 19, 23, .9); color: var(--muted); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  padding-block: 28px 36px;
  border-top: 1px solid var(--rule);
}
.site-footer .wordmark { color: var(--fog); }
.site-footer__meta {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Motion ─────────────────────────────────────────────── */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.service:nth-child(2), .stage:nth-child(2) { --d: 70ms; }
.service:nth-child(3), .stage:nth-child(3) { --d: 140ms; }
.service:nth-child(4) { --d: 210ms; }
.service:nth-child(5) { --d: 280ms; }
.service:nth-child(6) { --d: 350ms; }
.contact__lede { --d: 80ms; }
.contact__actions { --d: 160ms; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes dusk {
  from { opacity: .3; transform: translateX(-5%); }
  to { opacity: 1; transform: translateX(5%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .bg__video, .arrow, .service__panel, .service__icon::before, .service__icon::after { transition: none; }
}
