@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@400;500;600;700;800;900&family=Source+Serif+4:opsz,wght@48,400&display=swap');

@font-face {
  font-family: 'PA Formula';
  src: local('PP Formula Extended Bold'), local('PPFormula-ExtendedBold');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #111;
  --paper: #fff;
  --accent: #ecff2e;
  --brand-sans: 'Red Hat Display', Arial, sans-serif;
  --brand-title: 'PA Formula', var(--brand-sans);
  --brand-serif: 'Source Serif 4', Georgia, serif;
}

body { font-family: var(--brand-sans); }

.brand { display: inline-flex; flex: none; }
.brand img { display: block; width: 165px; height: auto; }
footer .brand img { width: 132px; }
footer { align-items: center; }

.hero, .service { background: #111; }
.hero h1, .intro h2, .section-top h2, .service h3, .project-copy h3,
.algorithm h2, .contact h2, .detail-content h2 {
  font-family: var(--brand-title);
  font-weight: 700;
  letter-spacing: -.045em;
}
.service h3 { font-weight: 700; }
.eyebrow { font-weight: 700; }
.intro h2 span { color: inherit; }
.intro-bottom p, .section-top p, .project-copy p, .detail-content p {
  font-family: var(--brand-serif);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 48;
  color: #454545;
}

.projects { background: #f5f5f5; }
.project-image { background: #ebebeb; }
.project-image span { background: var(--accent); color: #111; }
.tabs { border-color: #a3a3a3; }
.tabs button { color: #4a4a4a; }
.tabs button[aria-selected=true] {
  color: var(--ink);
  border-bottom-color: var(--ink);
  box-shadow: inset 0 -3px var(--accent);
}
.tabs button:focus-visible { outline-color: var(--ink); }
.project-copy dl, footer { border-color: #c5c5c5; }
.project-copy dt, .contact-main p { color: #565656; }

.algorithm { background: #111; color: #fff; }
.algorithm p { color: #d0d0d0; }
.steps { color: #dedede; border-color: #595959; }
.steps span:first-child::before {
  content: '';
  display: inline-block;
  vertical-align: middle;
  width: .45rem;
  height: .45rem;
  margin-right: .5rem;
  background: var(--accent);
}

@media (max-width: 760px) {
  .brand img { width: 133px; }
  footer .brand img { width: 118px; }
  .hero h1 { font-size: clamp(42px, 10vw, 58px); }
  .hero-copy, .hero-foot { z-index: 1; }
}

/* Keep the film in place while the cloud and introduction pass over it. */
.opening-sequence {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.opening-sequence .home-hero {
  position: sticky;
  top: 0;
  z-index: 0;
}

/* Fit the full width of the 16:9 film on desktop.
   Shorter windows crop vertically; mobile keeps the full-height cover. */
@media (min-width: 761px) and (orientation: landscape) {
  .opening-sequence .home-hero {
    height: min(100svh, 56.25vw);
    min-height: 0;
  }
}

.opening-sequence .intro {
  position: relative;
  z-index: 2;
  background: #fff;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100svh;
  align-content: center;
}

.opening-sequence .intro h2 {
  max-width: 900px;
  margin-inline: auto;
  font-size: clamp(29px, 3.5vw, 52px);
  text-align: center;
}
.opening-sequence .intro-bottom {
  grid-column: 1;
  display: block;
  text-align: center;
  margin-top: 20px;
}
.opening-sequence .intro-bottom p {
  max-width: 480px;
  margin: 0 auto;
  font-size: 14px;
}

.home-hero .hero-copy, .home-hero .hero-foot {
  transform: translateY(calc(-1 * var(--opening-travel, 0px)));
}

.intro .hero-mist {
  position: absolute;
  z-index: -1;
  inset: auto 0 100%;
  height: 90svh;
  pointer-events: none;
}

.hero-mist::before, .hero-mist::after, .hero-mist-drift {
  position: absolute;
  inset: 0;
}

.hero-mist::before, .hero-mist::after { content: ''; }

.hero-mist::before, .hero-mist-drift {
  background: url('/assets/hero-mist.svg') center bottom / 100% 100% no-repeat;
}

.hero-mist::before {
  opacity: min(1, calc(var(--mist-progress, 0) * 1.65));
  transform: translateY(calc(20% * (1 - var(--mist-progress, 0))));
}

.hero-mist-drift {
  opacity: calc(var(--mist-progress, 0) * .82);
  transform: translate(calc(9% * (1 - var(--mist-progress, 0))), calc(15% - 18% * var(--mist-progress, 0))) scaleX(-1.25);
}

.hero-mist::after {
  top: auto;
  height: 48%;
  background: linear-gradient(to bottom, transparent, #fff 96%);
  opacity: min(1, calc(var(--mist-progress, 0) * 3.5));
}

@media (max-width: 760px) {
  .intro .hero-mist { height: 85svh; }
  .hero-mist::before, .hero-mist-drift { background-size: max(100%, 680px) 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .opening-sequence .home-hero { position: relative; }
  .home-hero .hero-copy, .home-hero .hero-foot { transform: none; }
  .intro .hero-mist { height: 22svh; }
  .hero-mist::before { opacity: .95; transform: none; }
  .hero-mist-drift { display: none; }
  .hero-mist::after { opacity: 1; }
}

/* Floating WhatsApp contact */
.pa-whatsapp{position:fixed;right:24px;bottom:24px;bottom:max(24px,env(safe-area-inset-bottom));z-index:1000;width:58px;height:58px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#25d366;color:#fff;box-shadow:0 4px 18px #0003;text-decoration:none;transition:transform .18s ease,background .18s ease}
.pa-whatsapp svg{width:31px;height:31px;display:block}.pa-whatsapp:hover{background:#1cba59;transform:translateY(-3px)}.pa-whatsapp:focus-visible{outline:3px solid #111;outline-offset:4px}
@media(max-width:600px){.pa-whatsapp{right:16px;bottom:16px;bottom:max(16px,env(safe-area-inset-bottom));width:54px;height:54px}.pa-whatsapp svg{width:29px;height:29px}}
@media(prefers-reduced-motion:reduce){.pa-whatsapp{transition:none}}
