:root {
  --ink: #0B0B0C;          /* dark "material" (tiles, buttons) — same in both themes */
  --text: #0B0B0C;         /* body text */
  --muted: #66666B;
  --bg: #F4F4F5;
  --bg-2: #F4F4F5;         /* alternating section background */
  --surface: #FFFFFF;      /* nav, cards */
  --surface-2: #EFEFF1;    /* small controls */
  --nav-link: #374151;
  --sub: #2D3748;
  --word-dim: #CFCFD4;
  --sky-top: #7CBDF7; --sky-bottom: #BFDDF8;
  --dash-card: #F4F4F5;
  --shadow: rgba(0, 0, 0, .16);
  color-scheme: light;
  --blue: #4963F4;   /* Fitxlink brand blue (logo) */
  --sky: #8EC5F5;
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* hero stage = the 1808×870 background image, scaled to cover the viewport */
  --sw: max(100vw, calc(100vh * 2.0782));
  --u: calc(var(--sw) / 1808);
  --sh: calc(var(--sw) * 0.48119);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  transition: background-color .4s ease, color .4s ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; z-index: 50; top: 14px; left: 50%;
  width: min(1180px, calc(100% - 32px));
  display: flex; align-items: center; gap: 20px;
  padding: 10px 10px 10px 28px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 12px 32px -14px var(--shadow);
  transition: background-color .4s ease;
  transform: translateX(-50%);
  animation: navIn 1s var(--ease) .05s both;
}
.brand { display: flex; align-items: center; flex: none; padding: 10px 0; margin: -10px 0; }
.brand img { height: 30px; width: auto; }
.nav-links { display: flex; gap: 24px; margin: 0 auto; font-size: 15px; font-weight: 500; white-space: nowrap; color: var(--nav-link); }
.nav-links a, .nav-login { transition: color .2s; }
.nav-links a:hover, .nav-login:hover { color: var(--blue); }
.nav-login { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; }
.nav-login-m { display: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 999px; }
.btn-dark {
  display: inline-flex; align-items: center; gap: 10px; flex: none; white-space: nowrap;
  padding: 6px 6px 6px 20px; border-radius: 999px;
  background: #0B0B0C; color: #fff;   /* solid, no ring */
  font-size: 14px; font-weight: 600;
  transition: transform .25s var(--ease);
}
.btn-dark:hover { transform: translateY(-1px); }
.hero-cta { display: none; }
.arrow { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; transition: transform .3s var(--ease); }
.arrow svg { width: 15px; height: 15px; }
a:hover > .arrow { transform: translateX(2px) rotate(-45deg); }
.menu-btn { display: none; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--surface-2); cursor: pointer; position: relative; flex: none; -webkit-tap-highlight-color: transparent; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .35s var(--ease); }
.menu-btn span:first-child { top: 16px; }
.menu-btn span:last-child { top: 22px; }
.nav.open .menu-btn span:first-child { transform: translateY(3px) rotate(45deg); }
.nav.open .menu-btn span:last-child { transform: translateY(-3px) rotate(-45deg); }

/* language + theme controls */
.nav-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.nav-tools-m { display: none; }
.tool-btn {
  height: 40px; min-width: 40px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--surface-2); color: var(--text); font: 600 13.5px Inter, sans-serif;
  transition: background-color .25s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tool-btn:active { transform: scale(.94); }
.tool-btn svg { width: 12px; height: 12px; transition: transform .3s var(--ease); }
.lang { position: relative; }
.lang.open .lang-btn svg { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 2; min-width: 190px; padding: 6px;
  background: var(--surface); border-radius: 20px; box-shadow: 0 20px 40px -16px var(--shadow), 0 0 0 1px var(--line);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top right;
  transition: opacity .2s ease, transform .3s var(--ease), visibility 0s .3s;
}
.lang.open .lang-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .3s var(--ease); }
.lang-menu { max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lang-menu li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; transition: background-color .2s ease; }
.lang-menu li:hover { background: var(--surface-2); }
.lang-menu li.is-on { color: var(--blue); font-weight: 600; }
.lang-menu li span { width: 22px; flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.lang-menu li.is-on span { color: var(--blue); }
.theme-btn { width: 40px; padding: 0; position: relative; overflow: hidden; }
.theme-btn svg { position: absolute; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease; }
.theme-btn .i-moon { transform: translateY(26px) rotate(-40deg); opacity: 0; }
[data-theme="dark"] .theme-btn .i-sun { transform: translateY(-26px) rotate(60deg); opacity: 0; }
[data-theme="dark"] .theme-btn .i-moon { transform: none; opacity: 1; }

/* ---------- HERO ---------- */
.hero { position: relative; height: 280vh; }
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--sky-top); }

.stage {
  position: absolute; left: 50%; bottom: calc(-1 * var(--hero-stage-offset, 0px));
  width: var(--sw); height: var(--sh);
  margin-left: calc(var(--sw) / -2);
  transform-origin: 50% 62%;
  will-change: transform;
  pointer-events: none;
}
.stage img { width: 100%; height: 100%; user-select: none; }
.layer-bg img { animation: bgIn 1.8s var(--ease) both; }
/* the photo sinks while scrolling; fade its top edge into the solid sky so no seam shows */
.layer-bg { -webkit-mask-image: linear-gradient(transparent, #000 16%); mask-image: linear-gradient(transparent, #000 16%); }
.layer-front { z-index: 4; clip-path: inset(91.45% 29.7% 0 30.05%); }
.layer-front img { animation: bgIn 1.8s var(--ease) both; }

/* gym interior photo (its own alpha fades the top into the sky); rises from behind the dumbbell */
.gym {
  --gw: max(110vw, calc(100vh * 2.6));
  position: absolute; z-index: 1; top: 0; left: 50%;
  width: var(--gw); aspect-ratio: 2400 / 1028; margin-left: calc(var(--gw) / -2);
  background: url(assets/gym-bg.webp) center / cover no-repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 32%); mask-image: linear-gradient(transparent, #000 32%);
  opacity: 0; pointer-events: none;
  will-change: transform, opacity, clip-path;
}

.copy {
  position: absolute; z-index: 2; left: 0; right: 0;
  top: max(112px, calc(100vh - var(--sh) + 150 * var(--u)));
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 16px;
  will-change: transform, opacity;
}
.headline {
  font-family: Manrope, sans-serif; font-weight: 700;
  font-size: min(calc(82 * var(--u)), 6.8vw);
  line-height: 1.04; letter-spacing: -.045em;
  display: flex; flex-direction: column; align-items: center;
  white-space: nowrap;
}
.headline .line { display: flex; align-items: center; justify-content: center; gap: .24em; }
.headline .w { display: inline-block; animation: rise 1.1s var(--ease) var(--d) both; }

/* glossy 3D tile, raised slightly above the words it sits between; the mascot lives inside it */
.tile {
  position: relative; z-index: 1; top: -.2em;
  display: inline-block; flex: none;
  width: 1.12em; height: 1.12em; margin: 0 -.04em;
  border-radius: .26em;
  rotate: -8deg;
  background: radial-gradient(120% 90% at 30% 12%, #4A4A4C 0%, #1C1C1E 45%, #0B0B0C 100%);
  box-shadow: 0 .2em .34em -.12em rgba(0,0,0,.6), 0 0 0 .035em rgba(255,255,255,.22);
  animation: tileIn 1.2s var(--ease) .35s both;
}
/* bevel + glass highlight drawn above the mascot */
.tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 38%);
  box-shadow: inset 0 .025em .012em rgba(255,255,255,.4), inset 0 -.07em .16em rgba(0,0,0,.55);
}
.tile-stage { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
/* at rest the mascot hides in the bottom-right corner and peeks out;
   .is-out (hover / tap) springs it to the centre */
.mascot-anim {
  position: absolute; width: 112%; height: 112%; left: -6%; top: -6%;
  transform: translate(25%, 25%) rotate(-24deg);
  transition: transform .55s cubic-bezier(.5, 0, .2, 1);
}
.tile.is-out .mascot-anim {
  transform: none;
  transition: transform .7s cubic-bezier(.34, 1.56, .64, 1);
}
.tile { cursor: pointer; }

.sub {
  margin-top: calc(18 * var(--u));
  font-size: max(15px, min(calc(19 * var(--u)), 20px)); line-height: 1.5;
  color: var(--sub); font-weight: 500;
  animation: rise 1s var(--ease) .65s both;
}

/* ---------- DASHBOARD (product screenshot, 1200px design width, scaled by JS) ---------- */
.dash {
  position: absolute; z-index: 3; top: 0; left: 0;
  width: 1200px; --s: 1;
}
.dash-inner {
  border-radius: calc(22px * var(--s)); overflow: hidden; background: #fff;
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 0 0 calc(7px * var(--s)) rgba(255,255,255,.55), 0 40px 80px -30px rgba(20,50,90,.55);
  animation: dashIn 1.6s var(--ease) .55s both;
}
.dash-inner img { width: 100%; height: auto; user-select: none; }
/* light/dark product captures follow the site theme */
.d-dark, [data-theme="dark"] .d-light { display: none; }
[data-theme="dark"] .d-dark { display: block; }
/* =========================================================
   SECTIONS — shared
   Motion identity (motion-design skill): one signature curve (--ease),
   three durations (fast .25s / standard .6s / slow .9s), one entrance
   pattern (rise 28px + unblur), staggers ≤ 400ms total.
   ========================================================= */
:root {
  --muted: #66666B;
  --line: #E7E7EA;
  --card: var(--surface);
  --soft: #F9F9FA;
  --t-fast: .25s; --t-std: .6s; --t-slow: .9s;
}
.sec { position: relative; z-index: 5; padding: 140px 0; }
.wrap { width: min(1200px, 100% - 48px); margin: 0 auto; }
.sec-head { max-width: 760px; margin: 0 auto 64px; text-align: center; }
.sec-head h2 {
  font-family: Manrope, sans-serif; font-weight: 700;
  font-size: clamp(36px, 4.6vw, 62px); line-height: 1.04; letter-spacing: -.045em;
}
.lead { margin: 18px auto 0; max-width: 560px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* small version of the hero's glossy tile — the page's recurring motif */
.mini-tile {
  flex: none; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 14px; color: #fff;
  background: radial-gradient(120% 90% at 30% 12%, #4A4A4C 0%, #1C1C1E 45%, #0B0B0C 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -4px 10px rgba(0,0,0,.45), 0 8px 18px -8px rgba(0,0,0,.55);
  transition: transform var(--t-std) cubic-bezier(.34, 1.56, .64, 1);
}
.mini-tile.sm { width: 42px; height: 42px; border-radius: 12px; }
.mini-tile.sm .ic { width: 21px; height: 21px; }

/* scroll reveal (only when JS is running, so no-JS still shows content) */
/* the entrance uses the individual `translate` property so it never fights
   with hover/state transforms on the same element */
.js [data-reveal] {
  --d: calc(var(--i, 0) * 70ms);
  opacity: 0; translate: 0 28px; filter: blur(6px);
  transition-property: opacity, translate, filter, transform, box-shadow, border-color, background-color;
  transition-duration: var(--t-std), var(--t-slow), var(--t-std), var(--t-std), var(--t-std), var(--t-fast), var(--t-fast);
  transition-timing-function: ease, var(--ease), ease, var(--ease), var(--ease), ease, ease;
  transition-delay: var(--d), var(--d), var(--d), 0s, 0s, 0s, 0s;
}
.js [data-reveal].in { opacity: 1; translate: none; filter: none; }

/* ---------- 1 · WHO WE ARE ---------- */
.who { background: var(--surface); padding-top: 160px; }
.statement {
  max-width: 1040px; margin: 0 auto; text-align: center;
  font-family: Manrope, sans-serif; font-weight: 700;
  font-size: clamp(28px, 3.7vw, 52px); line-height: 1.16; letter-spacing: -.035em;
  color: var(--text);
}
.js .statement .wd { color: var(--word-dim); transition: color .35s ease; }
.js .statement .wd.lit { color: var(--text); }
.statement .wd.is-brand { color: var(--blue); }
.js .statement .wd.is-brand:not(.lit) { color: var(--word-dim); }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 88px; }
.pillar {
  background: var(--card); border-radius: 26px; padding: 28px 26px 30px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -28px var(--shadow);
  transition: transform var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease), opacity var(--t-std) ease, filter var(--t-std) ease;
}
.pillar h3 { font-family: Manrope, sans-serif; font-size: 19px; letter-spacing: -.02em; margin-top: 22px; }
.pillar p { color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 6px; }
.pillar:hover { transform: translateY(-6px); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 28px 50px -26px rgba(0,0,0,.22); }
.pillar:hover .mini-tile { transform: rotate(-8deg) scale(1.08); }

/* ---------- 2 · FOR BUSINESS (bento) ---------- */
.business { background: var(--soft); }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(210px, auto); grid-auto-flow: dense; gap: 16px; }
.card {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--card); border-radius: 28px; padding: 26px;
  display: flex; flex-direction: column; justify-content: flex-end;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -30px var(--shadow);
  transition: transform var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease), opacity var(--t-std) ease, filter var(--t-std) ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 30px 54px -30px rgba(0,0,0,.24); }
.card:hover .mini-tile { transform: rotate(-8deg) scale(1.08); }
.card h3 { font-family: Manrope, sans-serif; font-size: 19px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.card p { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin-top: 6px; }
.c-feat { justify-content: space-between; }

.c-dash { grid-column: span 2; grid-row: span 2; justify-content: space-between; padding: 30px 0 0 30px; background: linear-gradient(160deg, var(--dash-card) 0%, var(--surface) 60%); }
.c-dash .card-copy { padding-right: 30px; max-width: 440px; }
.c-dash h3 { font-size: 28px; line-height: 1.1; letter-spacing: -.035em; }
.c-dash p { font-size: 15.5px; }
.dash-peek {
  margin-top: 28px; align-self: flex-end; width: 92%; height: 260px; overflow: hidden;
  border-radius: 18px 0 0 0; box-shadow: 0 0 0 6px color-mix(in srgb, var(--surface) 70%, transparent), -10px -10px 40px -20px rgba(0,0,0,.2);
}
.dash-peek img { width: 175%; max-width: none; transform: translate3d(-2%, calc(-31% + var(--py, 0px)), 0); will-change: transform; }
.chip-live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--blue); background: rgba(73,99,244,.1); padding: 7px 12px; border-radius: 999px; }
.chip-live i, .dot-live { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: pulse 2s ease-out infinite; flex: none; }

.c-entry { grid-row: span 2; justify-content: space-between; text-align: left; }
.qr-box { position: relative; width: 140px; height: 140px; margin: 14px auto 0; padding: 14px; border-radius: 22px; background: var(--soft); overflow: hidden; }
.qr { width: 100%; height: 100%; fill: var(--text); }
.scan { position: absolute; left: 8px; right: 8px; height: 3px; top: 10%; border-radius: 3px; background: var(--blue); box-shadow: 0 0 16px 4px rgba(73,99,244,.45); animation: scan 2.4s ease-in-out infinite alternate; }
.granted { align-self: center; margin: 14px 0 auto; font-size: 13px; font-weight: 600; color: #15803D; background: #DCFCE7; border-radius: 999px; padding: 6px 12px; animation: granted 4.8s var(--ease) infinite; }

.live-bars { display: flex; align-items: flex-end; gap: 6px; height: 74px; margin-bottom: auto; }
.live-bars i { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(#7088FF, var(--blue)); height: 40%; animation: bar 2.6s ease-in-out infinite alternate; }
.live-bars i:nth-child(2) { animation-duration: 2.1s; animation-delay: -.4s; }
.live-bars i:nth-child(3) { animation-duration: 3s;   animation-delay: -1.2s; }
.live-bars i:nth-child(4) { animation-duration: 2.4s; animation-delay: -.8s; background: linear-gradient(#E9F55A, #D4E20B); }
.live-bars i:nth-child(5) { animation-duration: 2.8s; animation-delay: -1.6s; }
.live-bars i:nth-child(6) { animation-duration: 2.2s; animation-delay: -.2s; }
.live-bars i:nth-child(7) { animation-duration: 3.2s; animation-delay: -2s; }

.c-report { grid-column: span 2; }
.spark { width: 100%; height: 76px; margin-bottom: auto; overflow: visible; }
.spark path { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1600; stroke-dashoffset: 1600; transition: stroke-dashoffset 1.8s var(--ease) .3s; }
.c-report.in .spark path { stroke-dashoffset: 0; }

.c-wide { grid-column: span 2; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 20px; }
.c-wide .mini-tile { margin-bottom: 18px; }
.ticket { flex: none; width: 190px; padding: 16px; border-radius: 18px; background: #111112; color: #fff; box-shadow: 0 18px 30px -18px rgba(0,0,0,.55); transform: rotate(4deg); transition: transform var(--t-std) cubic-bezier(.34,1.56,.64,1); }
.ticket small { display: block; font-size: 12px; color: rgba(255,255,255,.6); }
.ticket b { display: block; font-family: Manrope, sans-serif; font-size: 17px; margin: 4px 0 12px; }
.ticket span { font-size: 13px; font-weight: 600; background: var(--blue); padding: 5px 10px; border-radius: 999px; }
.card:hover .ticket { transform: rotate(0) translateY(-4px); }
.avatars { flex: none; display: flex; align-items: center; }
.avatars i { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); margin-left: -12px; background: var(--c); display: grid; place-items: center; color: #fff; font: 700 14px Manrope, sans-serif; font-style: normal; transition: transform var(--t-std) var(--ease); }
.avatars i:first-child { margin-left: 0; }
.avatars i.plus { background: var(--soft); color: var(--blue); border-style: dashed; border-color: #C9D5F5; }
.card:hover .avatars i { transform: translateX(calc(var(--n, 0) * 4px)); }

/* ---------- 3 · FOR USERS (sticky phone) ---------- */
.users { background: linear-gradient(var(--soft), var(--surface) 30%); }
.users-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.u-list { list-style: none; padding: 12vh 0; counter-reset: none; }
.u-item {
  display: flex; gap: 18px; align-items: flex-start; padding: 26px 24px; min-height: 30vh;
  border-left: 2px solid var(--line); cursor: pointer;
  opacity: .38; transition: opacity var(--t-std) ease, border-color var(--t-std) ease;
}
.u-item h3 { font-family: Manrope, sans-serif; font-size: 24px; letter-spacing: -.03em; line-height: 1.15; }
.u-item p { color: var(--muted); font-size: 16px; line-height: 1.5; margin-top: 8px; max-width: 400px; }
.u-item.is-active { opacity: 1; border-color: var(--blue); }
.u-item.is-active .mini-tile { transform: rotate(-8deg) scale(1.06); }

.phone-col { position: sticky; top: max(96px, calc(50vh - 310px)); display: flex; justify-content: center; }
.phone {
  position: relative; width: 300px; height: 620px; padding: 11px; border-radius: 50px;
  background: linear-gradient(145deg, #2C2C2E, #0B0B0C 40%);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12), 0 50px 80px -40px rgba(20,40,90,.55), 0 20px 40px -30px rgba(20,40,90,.4);
}
.island { position: absolute; z-index: 3; top: 21px; left: 50%; width: 92px; height: 27px; margin-left: -46px; border-radius: 20px; background: #000; }
.screens { position: relative; height: 100%; border-radius: 40px; overflow: hidden; background: var(--screen-bg, #F7F7F8); }
.screen {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(18px) scale(.97); pointer-events: none;
  transition: opacity .4s ease, transform var(--t-std) var(--ease);
}
.screen.is-active { opacity: 1; transform: none; }
.screen img, .screen video { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
/* each screen ships a light and a dark capture; show the one matching the theme */
.screen .sd, [data-theme="dark"] .screen .sl { display: none; }
[data-theme="dark"] .screen .sd { display: block; }


/* gate every ambient loop behind visibility to save battery */
.js .card:not(.in) *, .js .card:not(.in) { animation-play-state: paused; }
/* ---------- KEYFRAMES ---------- */
@keyframes navIn { from { opacity: 0; transform: translate(-50%, -30px); } }
@keyframes rise { from { opacity: 0; transform: translateY(36px); filter: blur(10px); } }
@keyframes bgIn { from { transform: scale(1.12); filter: blur(6px); } }
@keyframes tileIn { from { opacity: 0; transform: scale(.3) rotate(-40deg); filter: blur(8px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } }
@keyframes scan { from { top: 8%; } to { top: 88%; } }
@keyframes granted { 0%, 40% { opacity: 0; transform: translateY(6px) scale(.9); } 48%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes bar { from { height: 22%; } to { height: 96%; } }
@keyframes dashIn { from { transform: translateY(calc(420px * var(--s))); } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1220px) {
  .nav { gap: 8px; }
  .menu-btn { display: block; }
  .btn-dark { margin-left: auto; }
  .nav-login { display: none; }
  .nav-links .nav-login-m { display: block; font-weight: 600; color: var(--text); }
  /* links collapse into a dropdown panel under the bar */
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: -4px; right: -4px;
    flex-direction: column; gap: 2px; margin: 0; padding: 8px;
    background: var(--surface);
    border-radius: 26px; box-shadow: 0 20px 40px -16px var(--shadow), 0 0 0 1px var(--line);
    font-size: 17px;
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top center;
    transition: opacity .25s, transform .35s var(--ease), visibility 0s .35s;
  }
  .nav-links a { padding: 14px 16px; border-radius: 999px; }
  .nav-links a:active { background: var(--surface-2); }
  .nav.open .nav-links { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .35s var(--ease); }
}
/* portrait tablets: size the hero stage by width so the dashboard slot stays on screen */
@media (orientation: portrait) and (min-width: 761px) and (max-width: 1100px) {
  :root { --sw: 180vw; }
  .copy { top: max(110px, calc((100svh - var(--sh) + 462 * var(--u)) / 2 - 130px)); }
  .headline { font-size: min(8.4vw, 72px); }
  .gym { --gw: max(240vw, calc(100svh * 2.4)); }
}
@media (max-width: 760px) {
  /* smaller stage: the dashboard sits between visible dumbbell plates with room on both sides */
  :root { --sw: 170vw; }
  .gym { --gw: max(240vw, calc(100svh * 2.4)); }
  .hero { height: 175vh; }
  .nav { top: 10px; width: calc(100% - 24px); padding: 5px 5px 5px 18px; }
  .brand img { height: 24px; }
  /* phones: language/theme move into the dropdown so the bar keeps its CTA */
  #navTools { display: none; }
  .nav-links .nav-tools-m { display: flex; gap: 8px; padding: 10px 8px 4px; margin-top: 4px; border-top: 1px solid var(--line); }
  .nav-tools-m .lang-menu { top: auto; bottom: calc(100% + 10px); left: 0; right: auto; transform-origin: bottom left; }
  .nav-tools-m .lang-menu { display: grid; grid-template-columns: 1fr 1fr; width: min(320px, calc(100vw - 48px)); max-height: 60vh; }
  .btn-dark { padding: 6px 6px 6px 14px; font-size: 13.5px; gap: 8px; }

  .copy { top: max(92px, calc((100svh - var(--sh) + 462 * var(--u)) / 2 - 190px)); padding: 0 20px; }
  /* the trial CTA moves from the bar into the hero, big and thumb-friendly */
  .nav > .btn-dark { display: none; }
  .menu-btn { margin-left: auto; }
  .hero-cta {
    display: inline-flex; justify-content: space-between; gap: 14px; margin: 24px 0 0; align-self: center;
    min-width: 240px; height: 58px; padding: 0 8px 0 28px; font-size: 17px;
    animation: rise 1s var(--ease) .75s both;
  }
  .hero-cta .arrow { width: 42px; height: 42px; }
  .hero-cta .arrow svg { width: 18px; height: 18px; }
  /* big, stacked headline: Fitnes [tile] / biznesinizi / göylərə / çıxarın */
  .headline { font-size: min(14vw, 64px); line-height: 1.02; white-space: normal; }
  .headline .line { flex-wrap: wrap; column-gap: .2em; }
  .sub { font-size: 15.5px; line-height: 1.45; margin-top: 14px; max-width: 340px; }
  .br { display: none; }
}

@media (max-width: 1000px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .c-dash { grid-row: auto; }
  .users-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .phone-col { position: relative; top: 0; order: -1; }
  /* feature list becomes a swipeable row under the phone */
  .u-list {
    display: flex; gap: 12px; padding: 4px 24px 18px; margin: 0 -24px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .u-list::-webkit-scrollbar { display: none; }
  .u-item {
    flex: 0 0 min(80%, 360px); min-height: 0; flex-direction: column; gap: 14px;
    scroll-snap-align: center; border: 0; border-radius: 22px; padding: 20px;
    background: var(--surface); box-shadow: 0 18px 40px -30px var(--shadow); opacity: .55;
  }
  .u-item h3 { font-size: 20px; }
  .u-item p { font-size: 15px; }
}
@media (max-width: 640px) {
  .sec { padding: 88px 0; }
  .who { padding-top: 64px; }
  .wrap { width: calc(100% - 32px); }
  .sec-head { margin-bottom: 40px; }
  .lead { font-size: 16px; }
  .pillars { grid-template-columns: 1fr; margin-top: 56px; gap: 12px; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 12px; }
  .c-dash, .c-report, .c-wide { grid-column: auto; }
  .c-entry { grid-row: auto; }
  /* phones: compact rows for small feature cards and pillars */
  .card { min-height: 0; padding: 20px; }
  .c-entry, .c-live, .c-report { min-height: 220px; }
  .c-feat { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start; }
  .c-feat .mini-tile { grid-row: span 2; }
  .c-feat p { margin-top: 2px; }
  .pillar { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; padding: 20px; }
  .pillar .mini-tile { grid-row: span 2; width: 44px; height: 44px; border-radius: 13px; }
  .pillar h3 { margin-top: 2px; font-size: 18px; }
  .pillar p { margin-top: 4px; font-size: 14.5px; }
  .c-dash { padding: 24px 0 0 24px; }
  .c-dash h3 { font-size: 24px; }
  .dash-peek { height: 200px; }
  .c-wide { flex-direction: column; align-items: flex-start; }
  .u-list { padding: 4px 16px 18px; margin: 0 -16px; }
  .phone { flex-shrink: 0; transform: scale(.86); margin: -40px 0; }
}

/* =========================================================
   DARK THEME
   ========================================================= */
[data-theme="dark"] {
  color-scheme: dark;
  /* neutral greys only — no blue cast on backgrounds or elevated surfaces */
  --text: #F5F5F5;
  --muted: #A3A3A3;
  --bg: #0A0A0A;
  --bg-2: #0C0C0C;
  --surface: #161616;
  --surface-2: #232323;
  --soft: #101010;
  --line: #2A2A2A;
  --nav-link: #D0D0D0;
  --sub: #DCDCDC;
  --word-dim: #343434;
  --sky-top: #3B5B7E; --sky-bottom: #121212;
  --dash-card: #1E1E1E;
  --shadow: rgba(0, 0, 0, .6);
  --screen-bg: #0E0E0E;
}
/* night sky: dim the photo; the front (bar) layer gets the same filter so the seam stays invisible */
[data-theme="dark"] .stage img { filter: brightness(.5) saturate(1.15) hue-rotate(8deg); }
[data-theme="dark"] .gym { filter: brightness(.55) saturate(1.1); }
[data-theme="dark"] .btn-dark { background: var(--blue); }
[data-theme="dark"] .mini-tile { box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -4px 10px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08); }
[data-theme="dark"] .ticket { box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 18px 30px -18px #000; }
[data-theme="dark"] .granted { background: rgba(34,197,94,.15); color: #4ADE80; }
[data-theme="dark"] .avatars i.plus { border-color: #444; }
[data-theme="dark"] .dash-inner { box-shadow: 0 0 0 7px rgba(255,255,255,.08), 0 40px 80px -30px #000; }

/* Short landscape windows (including display scaling and browser zoom) need
   a compact first screen, without changing the desktop/portrait composition. */
@media (max-height: 500px) and (orientation: landscape) {
  .copy { top: 100px; }
  .headline { font-size: min(6.8vw, 9svh, 48px); }
  .sub { font-size: 14px; line-height: 1.4; margin-top: 10px; max-width: 560px; }
  .hero-cta { height: 44px; min-width: 200px; margin-top: 16px; font-size: 14px; }
}
@media (max-height: 500px) and (max-width: 760px) and (orientation: landscape) {
  .copy { top: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
