/*
 * Pachi landing page (pachi.se/).
 *
 * Implements the "Pachi Landing v2" Claude Design canvas. The design file
 * carries its styling inline; here it is lifted into classes, but the values
 * are the design's own. Tokens and component classes live in
 * /assets/pachi-ds.css — nothing below should hard-code a brand colour that
 * has a token.
 *
 * Scroll state arrives as custom properties set by landing.js on .lp-root:
 *   --sy   window.scrollY, unitless
 *   --prog 0..1 document scroll progress (drives the top bar)
 *   --seq  0..1 progress through the pinned "Appen" section
 *   --mxp  pointer x offset from viewport centre, unitless px
 *   --myp  pointer y offset from viewport centre, unitless px
 *   --k    parallax intensity multiplier
 */

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--pachi-bg);
  font-family: var(--pachi-font-body);
  color: var(--pachi-ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pachi-primary); text-decoration: none; }
a:hover { color: var(--pachi-ink); }

:where(h1, h2, h3, p) { margin: 0; }

.lp-root {
  position: relative;
  overflow-x: clip;
  --sy: 0;
  --prog: 0;
  --seq: 0;
  --mxp: 0;
  --myp: 0;
  --k: 1;
}

.lp-wrap { max-width: 1140px; width: 100%; margin: 0 auto; padding-inline: 24px; }

/* Sections sit above the fixed background layers. */
.lp-layer { position: relative; z-index: 10; }

/* The sticky header overlaps in-page anchors by its own height. */
:where(#appen, #hur, #funktioner, #demo, #integritet) { scroll-margin-top: 64px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- motion ---------- */

@keyframes pachiRise { from { opacity: 0; transform: translate3d(0, 110%, 0) rotate(4deg); } to { opacity: 1; transform: translate3d(0,0,0) rotate(0); } }
@keyframes pachiFade { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pachiFloat { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(0,-16px,0); } }
@keyframes pachiDrift { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(34px,-26px,0) scale(1.12); } }
@keyframes pachiSpin { to { transform: rotate(360deg); } }
@keyframes pachiPulse { 0%,100% { opacity: .45; transform: scale(1); } 50% { opacity: .8; transform: scale(1.14); } }

/* Reveal-on-scroll. Hidden only once JS is running, so a page without
   JavaScript shows every section instead of a blank scroll. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px) scale(0.985);
  transition:
    opacity .8s ease var(--reveal-delay, 0s),
    transform .9s cubic-bezier(.2,.85,.2,1) var(--reveal-delay, 0s);
}
.js [data-reveal].is-revealed { opacity: 1; transform: none; }

/* ---------- fixed chrome ---------- */

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  transform-origin: 0 50%;
  transform: scaleX(var(--prog));
  background: linear-gradient(90deg, var(--pachi-primary), var(--pachi-violet), var(--pachi-mint));
}

.bg-liquid { position: fixed; inset: 0; z-index: 0; }

.bg-blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; }
.blob--sun {
  top: 4%; left: 60%; width: 48vw; height: 48vw; filter: blur(80px); opacity: .5;
  background: radial-gradient(circle at 40% 40%, var(--pachi-sunshine), transparent 68%);
  animation: pachiDrift 26s ease-in-out infinite;
  transform: translate3d(0, calc(var(--sy) * -0.06px * var(--k)), 0);
}
.blob--mint {
  top: 46%; left: -16%; width: 56vw; height: 56vw; filter: blur(90px); opacity: .45;
  background: radial-gradient(circle at 60% 40%, var(--pachi-mint), transparent 68%);
  animation: pachiDrift 34s ease-in-out infinite reverse;
  transform: translate3d(0, calc(var(--sy) * 0.05px * var(--k)), 0);
}
.blob--violet {
  top: 82%; left: 52%; width: 44vw; height: 44vw; filter: blur(80px); opacity: .4;
  background: radial-gradient(circle at 50% 50%, var(--pachi-violet), transparent 68%);
  animation: pachiDrift 30s ease-in-out infinite;
  transform: translate3d(0, calc(var(--sy) * -0.04px * var(--k)), 0);
}
/* Follows the pointer; landing.js writes the transform directly. */
.blob--cursor {
  top: -160px; left: -160px; width: 320px; height: 320px; filter: blur(60px); opacity: .38;
  background: radial-gradient(circle, var(--pachi-primary), transparent 65%);
  transform: translate3d(calc(var(--mxp) * 1px), calc(var(--myp) * 1px), 0);
  transition: opacity .4s;
}

/* ---------- downtime overlay ---------- */

.dt-scrim {
  position: fixed; inset: 0; z-index: 52;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 24px 40px;
  border: 0;
  font: inherit;
  background: rgba(24,18,15,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .55s ease;
  cursor: pointer;
}
.dt-scrim__label { font-family: var(--pachi-font-display); font-size: 20px; color: rgba(255,255,255,0.82); }
.is-downtime .dt-scrim { opacity: 1; pointer-events: auto; }

/* ---------- header ---------- */

.site-top {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(251,247,240,0.7);
  border-bottom: 1px solid var(--pachi-hairline);
}
.site-top__inner { display: flex; align-items: center; gap: 24px; padding-block: 12px; }
.site-top__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--pachi-font-display); font-size: 22px; color: var(--pachi-ink);
}
.site-top__brand img { width: 30px; height: 30px; animation: pachiFloat 7s ease-in-out infinite; }
.site-top__nav {
  margin-left: auto;
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center;
  gap: 14px 22px;
  font-size: 14px; font-weight: 600;
}
.site-top__nav a { color: var(--pachi-ink-soft); }
.site-top__nav a:hover { color: var(--pachi-ink); }
/* Scoped under the nav: a bare .site-top__cta loses to `.site-top__nav a`
   above it on specificity, and the button renders with the muted link grey. */
.site-top__nav .site-top__cta {
  background: var(--pachi-primary); color: #fff;
  padding: 10px 16px; border-radius: var(--pachi-radius-button);
}
.site-top__nav .site-top__cta:hover { color: #fff; opacity: .92; }

/* ---------- hero ---------- */

.hero {
  display: flex; flex-wrap: wrap; gap: 48px; align-items: center;
  padding-block: 84px 48px;
}
.hero__copy {
  flex: 1 1 430px; min-width: 300px;
  transform: translate3d(0, calc(var(--sy) * -0.1px * var(--k)), 0);
}
.hero__eyebrow { margin-bottom: 22px; animation: pachiFade .7s ease both; }
.hero__eyebrow .pachi-status__dot { background: var(--pachi-mint); animation: pachiPulse 2.4s ease-in-out infinite; }
.hero__title {
  font-family: var(--pachi-font-display);
  font-size: clamp(50px, 6.8vw, 92px);
  line-height: 0.96;
  margin: 0 0 22px;
  letter-spacing: -0.025em;
}
.hero__line { display: block; overflow: hidden; }
.hero__word { display: inline-block; animation: pachiRise .9s cubic-bezier(.2,.9,.2,1) both; }
.hero__word--1 { animation-delay: .05s; }
.hero__word--2 { animation-delay: .18s; }
.hero__word--3 { animation-delay: .3s; }
.hero__accent { color: var(--pachi-primary); font-style: italic; }
.hero__lead {
  font-size: 19px; line-height: 1.6; color: var(--pachi-ink-soft);
  max-width: 46ch; margin: 0 0 30px;
  animation: pachiFade .8s ease .45s both;
}
.hero__actions {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px;
  animation: pachiFade .8s ease .6s both;
}
.btn-lg {
  font-weight: 600; padding: 16px 26px;
  border-radius: var(--pachi-radius-button);
  transition: transform .25s cubic-bezier(.2,1.2,.4,1), box-shadow .25s;
}
.btn-lg--primary { background: var(--pachi-primary); color: #fff; box-shadow: var(--pachi-shadow); }
.btn-lg--primary:hover { color: #fff; }
.btn-lg--ghost { background: var(--pachi-chip); border: 1px solid var(--pachi-hairline); color: var(--pachi-ink); }

.hero__shots {
  flex: 1 1 380px; min-width: 300px;
  position: relative;
  height: min(600px, 145vw);
}
.hero__shot { position: absolute; }
.hero__shot img { display: block; width: 100%; }
.hero__shot-frame {
  border-radius: 30px; overflow: hidden;
  border: 6px solid #fff; box-shadow: var(--pachi-shadow);
  animation: pachiFloat 9s ease-in-out infinite;
}
.hero__shot--left {
  top: 8%; left: 0; width: 34%;
  transform: translate3d(calc(var(--mxp) * 0.016px), calc(var(--sy) * 0.1px * var(--k) + var(--myp) * 0.016px), 0) rotate(-7deg);
}
.hero__shot--right {
  top: 36%; right: 0; width: 32%;
  transform: translate3d(calc(var(--mxp) * -0.02px), calc(var(--sy) * -0.16px * var(--k) + var(--myp) * -0.02px), 0) rotate(6deg);
}
.hero__shot--right .hero__shot-frame { animation-duration: 11s; }
.hero__shot--center {
  top: 14%; left: 50%; width: 46%;
  transform: translateX(-50%) translate3d(calc(var(--mxp) * 0.028px), calc(var(--sy) * -0.05px * var(--k) + var(--myp) * 0.028px), 0);
}
.hero__shot--center .hero__shot-frame {
  border-radius: 40px; border-width: 8px;
  box-shadow: 0 34px 80px rgba(66,39,36,0.22);
  animation: none;
}

/* ---------- steps ---------- */

.steps {
  border-top: 1px solid var(--pachi-hairline);
  border-bottom: 1px solid var(--pachi-hairline);
  background: rgba(255,255,255,0.42);
}
.steps__inner { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; padding-block: 36px; }
.steps__lead { flex: 1 1 200px; max-width: 260px; }
.steps__title { font-family: var(--pachi-font-display); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; margin-top: 6px; }
.step { flex: 1 1 240px; max-width: 320px; display: flex; gap: 16px; align-items: flex-start; }
.step__n {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
  color: var(--step-tint);
  background: color-mix(in srgb, var(--step-tint) 14%, transparent);
}
.step--1 { --step-tint: var(--pachi-primary); }
.step--2 { --step-tint: var(--pachi-mint); }
.step--3 { --step-tint: var(--pachi-violet); }
.step__title { font-family: var(--pachi-font-display); font-size: 21px; line-height: 1.2; }
.step__body { font-size: 14px; line-height: 1.55; color: var(--pachi-ink-soft); margin-top: 4px; }

/* ---------- pinned app showcase ---------- */

.pin { height: 300vh; }
.pin__stage {
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  gap: 20px; padding-block: 24px;
}
.pin__head { text-align: center; }
.pin__title {
  font-family: var(--pachi-font-display);
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.05; margin: 6px 0 0; letter-spacing: -0.02em;
}
.pin__chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.chip {
  flex: 1 1 210px; max-width: 300px;
  padding: 12px 16px;
  border-radius: var(--pachi-radius-button);
  border: 1px solid var(--pachi-hairline);
  background: transparent;
  transition: background .35s, transform .35s;
}
.chip.is-active {
  background: color-mix(in srgb, var(--pachi-primary) 12%, transparent);
  transform: translateY(8px);
}
.chip__title { font-weight: 700; font-size: 15px; }
.chip__body { font-size: 13px; line-height: 1.5; color: var(--pachi-ink-soft); }

.pin__cards { position: relative; flex: 1 1 auto; min-height: 0; }
.pin__card {
  position: absolute; top: 50%; left: 50%;
  width: min(220px, 24vh);
}
.pin__card-frame {
  border-radius: 36px; overflow: hidden;
  border: 7px solid #fff;
  box-shadow: 0 26px 60px rgba(66,39,36,0.2);
}
.pin__card img { display: block; width: 100%; }
.pin__card--1 { transform: translate(-50%, -50%) translate3d(calc(var(--seq) * -30vw), 0, 0) rotate(calc(var(--seq) * -8deg)) scale(calc(1 - var(--seq) * 0.14)); }
.pin__card--2 { transform: translate(-50%, -50%) translate3d(calc((1 - var(--seq)) * 46vw), 0, 0) rotate(calc(6deg - var(--seq) * 6deg)) scale(calc(0.9 + var(--seq) * 0.1)); }
.pin__card--3 { transform: translate(-50%, -50%) translate3d(calc((1 - var(--seq)) * 96vw + var(--seq) * 30vw), 0, 0) rotate(calc(10deg - var(--seq) * 2deg)) scale(calc(0.84 + var(--seq) * 0.02)); }

/* ---------- features ---------- */

.features { padding-block: 88px 64px; }
.features__head { max-width: 620px; margin-bottom: 40px; }
.features__title {
  font-family: var(--pachi-font-display);
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.04; margin: 8px 0 14px; letter-spacing: -0.02em;
}
.features__sub { font-size: 17px; line-height: 1.6; color: var(--pachi-ink-soft); }
.features__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature { transition: transform .3s ease; }
.feature--wide {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 24px;
  align-items: center; justify-content: space-between;
}
.feature__num { font-family: var(--pachi-font-display); font-size: 15px; color: var(--pachi-primary); letter-spacing: .1em; }
.feature__title { font-family: var(--pachi-font-display); font-size: 24px; margin: 4px 0 8px; }
.feature--wide .feature__title { font-size: 30px; }
.feature__body { font-size: 15px; line-height: 1.6; color: var(--pachi-ink-soft); }
.feature--wide .feature__body { max-width: 52ch; }

/* ---------- interactive demo ---------- */

.demo { padding-block: 64px; }
.demo__card {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 48px; align-items: center;
  padding: 40px;
}
.demo__scrim {
  position: absolute; inset: 0; z-index: 2;
  border-radius: var(--pachi-radius-card);
  background: rgba(24,18,15,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .55s ease;
}
.is-downtime .demo__scrim { opacity: 1; pointer-events: auto; }
/* Lift the card above the page-wide scrim so the toggle stays reachable. */
.is-downtime .demo { z-index: 53; }

.demo__ring { flex: 0 1 300px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.demo__controls { flex: 1 1 340px; min-width: 280px; }
.demo__title { font-family: var(--pachi-font-display); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; margin: 8px 0 10px; }
.demo__lead { font-size: 16px; line-height: 1.6; color: var(--pachi-ink-soft); margin: 0 0 24px; }
.demo__label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.demo__slider { width: 100%; accent-color: var(--pachi-primary); margin-bottom: 24px; }
.demo__toggle-wrap {
  position: relative; z-index: 3;
  margin-bottom: 24px;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-radius: var(--pachi-radius-button);
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--pachi-card-border);
  box-shadow: 0 2px 8px rgba(66,39,36,0.08);
  transition: box-shadow .55s ease;
}
.is-downtime .demo__toggle-wrap { box-shadow: 0 0 0 6px rgba(79,130,223,0.35), 0 20px 50px rgba(0,0,0,0.35); }
/* Toggle ships as a real button so it is reachable by keyboard. */
.demo__toggle-wrap .pachi-toggle { border: 0; background: none; padding: 0; font: inherit; text-align: left; }
.demo__buttons { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.demo__buttons > :nth-child(1) { width: 200px; }
.demo__buttons > :nth-child(2) { width: 130px; }
.demo__note { font-size: 13px; color: var(--pachi-ink-soft); }

/* ---------- privacy ---------- */

.privacy { padding-block: 64px; }
.privacy__card { display: flex; flex-wrap: wrap; gap: 40px; }
.privacy__copy { flex: 1 1 300px; min-width: 280px; }
.privacy__title { font-family: var(--pachi-font-display); font-size: clamp(28px, 3vw, 40px); line-height: 1.1; margin: 8px 0 12px; }
.privacy__lead { font-size: 15px; line-height: 1.6; color: var(--pachi-ink-soft); }
.privacy__rows { flex: 1 1 340px; min-width: 280px; }

/* ---------- closing CTA ---------- */

.finale { padding-block: 40px 120px; }
.finale__box {
  position: relative; overflow: hidden;
  border-radius: 32px;
  padding: 96px 40px;
  text-align: center;
  background: linear-gradient(140deg, #4F82DF, #9367F4 68%, #20B478);
  box-shadow: var(--pachi-shadow);
}
.finale__wash {
  position: absolute; inset: -100% -30%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 55%);
  transform: translate3d(0, calc(var(--sy) * -0.05px * var(--k)), 0);
}
.finale__orbit {
  position: absolute; width: 60%; height: 60%; top: 20%; left: 20%;
  border: 1px solid rgba(255,255,255,.25); border-radius: 50%;
  animation: pachiSpin 40s linear infinite;
}
.finale__content { position: relative; }
.finale__title {
  font-family: var(--pachi-font-display);
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.02; margin: 0 0 16px; color: #fff; letter-spacing: -0.02em;
}
.finale__lead { font-size: 17px; color: rgba(255,255,255,.9); margin: 0 auto 30px; max-width: 44ch; }
.finale__cta {
  display: inline-block;
  background: #fff; color: var(--pachi-primary);
  font-weight: 700; padding: 17px 32px;
  border-radius: var(--pachi-radius-button);
  transition: transform .25s cubic-bezier(.2,1.2,.4,1);
}
.finale__cta:hover { color: var(--pachi-primary); }

/* ---------- footer ---------- */

.site-foot { border-top: 1px solid var(--pachi-hairline); background: rgba(255,255,255,0.5); }
.site-foot__inner {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  padding-block: 32px 88px;
  font-size: 14px; color: var(--pachi-ink-soft);
}
.site-foot__brand { display: flex; align-items: center; gap: 10px; }
.site-foot__brand img { width: 24px; height: 24px; }
.site-foot__links { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- sticky bottom CTA ---------- */

.sticky-cta {
  position: fixed; left: 50%; bottom: 20px; z-index: 50;
  transform: translateX(-50%) translateY(140%);
  transition: transform .5s cubic-bezier(.2,.9,.2,1);
  display: flex; align-items: center; gap: 16px;
  padding: 12px 12px 12px 20px;
  border-radius: 999px;
  background: rgba(42,33,29,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(66,39,36,0.28);
}
.sticky-cta.is-visible { transform: translateX(-50%) translateY(0); }
.sticky-cta__label { color: #fff; font-size: 14px; font-weight: 600; }
.sticky-cta__btn {
  background: #fff; color: var(--pachi-ink);
  font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 999px;
}
.sticky-cta__btn:hover { color: var(--pachi-ink); }

/* ---------- responsive ---------- */

/* Below this the six nav items wrap onto two rows, which changes the header
   height the pinned section offsets against. Brand + CTA only; the sticky
   bottom bar and the footer carry the rest. */
@media (max-width: 860px) {
  .site-top__nav a:not(.site-top__cta) { display: none; }
}

@media (max-width: 720px) {
  /* Stacked full chips eat the pinned stage and crop the phone. Keep the
     three-way signpost, drop the descriptions. */
  .pin__chips { flex-wrap: nowrap; gap: 8px; }
  .chip { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
  .chip__title { font-size: 12px; line-height: 1.3; }
  .chip__body { display: none; }
  .chip.is-active { transform: translateY(4px); }

  .hero { padding-block: 56px 32px; gap: 32px; }
  .demo__card { padding: 24px; gap: 32px; }
  .features { padding-block: 64px 48px; }
  .finale__box { padding: 64px 24px; }
  .privacy__card { gap: 28px; }
  .sticky-cta { left: 16px; right: 16px; bottom: 16px; transform: translateY(160%); justify-content: space-between; }
  .sticky-cta.is-visible { transform: translateY(0); }
}

/* The pinned showcase needs vertical room for a phone plus its captions. */
@media (max-height: 620px) {
  .pin__chips { display: none; }
}

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