/* NACremote: nac.tn graphic chart, Apple-style spacing */
:root {
  --blue: #0c5adb;
  --lime: #d0ff71;
  --lime-deep: #c3f264;
  --ink: #141618;
  --text: #303133;
  --muted: #777777;
  --mist: #f5f5f5;
  --line: #eaeaea;
  --white: #ffffff;

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --nav-h: 56px;
  --gutter: clamp(20px, 5vw, 64px);
  --section: clamp(80px, 10vw, 140px);
  --radius-scene: clamp(18px, 2.4vw, 32px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: var(--blue); }
svg { display: block; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--blue); color: var(--white); padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

.lead { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.45; color: var(--text); }
.fine { font-size: 14px; color: var(--muted); }

/* ---------- Buttons ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 32px;
  border-radius: 130px;
  background: var(--lime);
  color: var(--blue);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.pill:hover { background: var(--lime-deep); }
.pill:active { transform: scale(.97); }
.pill-sm { min-height: 34px; padding: 0 16px; font-size: 14px; }

.text-link { font-size: 17px; font-weight: 500; color: var(--blue); text-decoration: none; }
.text-link::after { content: " ›"; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: 1200px;
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark { font-size: 20px; font-weight: 900; letter-spacing: -0.01em; color: var(--blue); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.pill) { font-size: 14px; color: var(--text); text-decoration: none; }
.nav-links a:not(.pill):hover { color: var(--blue); }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 7vw, 96px) var(--gutter) 0; text-align: center; }
.hero-product { font-size: clamp(19px, 1.8vw, 24px); font-weight: 600; color: var(--blue); }
.hero-title {
  margin: 12px auto 0;
  font-size: clamp(52px, 8.6vw, 124px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: .95;
  color: var(--blue);
  text-wrap: balance;
}
.hero-lead { max-width: 40ch; margin: 28px auto 0; text-wrap: pretty; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 32px;
  margin-top: 36px;
}
.hero .fine { margin-top: 20px; }

/* One short sequence on load */
.hero > * { animation: rise .9s var(--ease) both; }
.hero > :nth-child(2) { animation-delay: .06s; }
.hero > :nth-child(3) { animation-delay: .14s; }
.hero > :nth-child(4) { animation-delay: .2s; }
.hero > :nth-child(n+5) { animation-delay: .26s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Steps: desktop that flattens, pins, then plays each step ---------- */
.steps { padding-top: clamp(48px, 6vw, 88px); }
.steps-track { --sp: 0; position: relative; height: 300vh; }
.steps-sticky {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(12px, 3vh, 32px) var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(20px, 4vh, 44px);
}
.steps-visual {
  container-type: inline-size;
  width: min(100%, 1040px, calc((100svh - var(--nav-h) - 240px) * 1.6));
  margin: 0 auto;
  perspective: 1600px;
}

.desktop {
  --p: 0;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-scene);
  overflow: hidden;
  font-size: max(7px, 1.25cqi);
  background:
    radial-gradient(120% 90% at 85% 10%, #4f8bf0 0%, transparent 55%),
    radial-gradient(90% 80% at 10% 100%, #0a3fa0 0%, transparent 60%),
    var(--blue);
  isolation: isolate;
  transform-origin: 50% 0%;
  transform:
    translateY(calc((1 - var(--p)) * 48px))
    rotateX(calc((1 - var(--p)) * 28deg))
    scale(calc(.86 + var(--p) * .14));
  box-shadow: 0 calc(30px + var(--p) * 30px) calc(60px + var(--p) * 40px) -40px rgba(12, 90, 219, calc(.25 + var(--p) * .3));
  will-change: transform;
}

.taskbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  height: 3.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.tb-apps { display: flex; gap: .8em; }
.tb-apps i { width: 1.9em; aspect-ratio: 1; border-radius: .45em; background: rgba(12, 90, 219, .18); }
.tb-apps .tb-nac {
  display: grid;
  place-items: center;
  background: var(--blue);
  color: var(--white);
  font-style: normal;
  font-weight: 900;
  font-size: .95em;
}
.tb-clock { position: absolute; right: 1.2em; font-size: 1em; color: var(--ink); }

/* States */
.state {
  position: absolute;
  inset: 0 0 3.6em;
  opacity: 0;
  transform: translateY(24px) scale(.98);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  pointer-events: none;
}
[data-step="0"] .state-app,
[data-step="1"] .state-1,
[data-step="2"] .state-2,
[data-step="3"] .state-app { opacity: 1; transform: none; }

/* Windows */
.app, .installer, .browser, .dl-card, .uac {
  position: absolute;
  background: var(--white);
  overflow: hidden;
  text-align: left;
  color: var(--ink);
}
.app, .installer {
  border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(5, 25, 70, .45), 0 0 0 1px rgba(20, 22, 24, .06);
}
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3em;
  padding-left: 1.2em;
  border-bottom: 1px solid var(--line);
}
.app-title { display: inline-flex; align-items: center; gap: .6em; font-weight: 500; }
.app-icon {
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: .4em;
  background: var(--blue);
  color: var(--white);
  font-style: normal;
  font-size: .8em;
  font-weight: 900;
}
.app-ctrl { display: flex; height: 100%; }
.app-ctrl i { position: relative; width: 3.4em; }
.app-ctrl i::before { content: ""; position: absolute; left: 50%; top: 50%; width: .9em; transform: translate(-50%, -50%); }
.app-ctrl i:nth-child(1)::before { border-top: 1px solid var(--muted); }
.app-ctrl i:nth-child(2)::before { height: .9em; border: 1px solid var(--muted); }
.app-ctrl i:nth-child(3)::before { height: 1px; background: var(--muted); transform: translate(-50%, -50%) rotate(45deg); }
.app-ctrl i:nth-child(3)::after { content: ""; position: absolute; left: 50%; top: 50%; width: .9em; height: 1px; background: var(--muted); transform: translate(-50%, -50%) rotate(-45deg); }

/* NACremote main window (intro and step 3) */
.app {
  left: 50%;
  top: 50%;
  width: 72%;
  transform: translate(-50%, calc(-50% + (1 - var(--p)) * 56px));
}
.app-body { display: grid; grid-template-columns: 1fr 1.15fr; }
.app-side { padding: 2em 2.2em 2.4em; background: var(--mist); }
.app-main { padding: 2em 2.2em 2.4em; }
.app-h { font-size: 1.15em; font-weight: 600; }
.app-help { margin-top: .4em; color: var(--muted); font-size: .9em; line-height: 1.4; }
.app-mark {
  margin: 1em -1.2em 0;
  padding: .2em 1.2em 1em;
  border-radius: .8em;
  box-shadow: 0 0 0 .3em transparent;
  transition: background-color .5s var(--ease), box-shadow .5s var(--ease);
}
[data-step="3"] .app-mark { background: var(--white); box-shadow: 0 0 0 .3em var(--lime); }
.app-k { margin-top: 1em; font-size: .85em; color: var(--muted); }
.app-id { font-size: 2.6em; font-weight: 600; letter-spacing: .01em; line-height: 1.15; }
.app-pw { font-size: 1.7em; font-weight: 500; letter-spacing: .04em; }
.app-input { margin-top: 1.2em; padding: .9em 1em; border: 1px solid var(--line); border-radius: .6em; color: var(--muted); }
.app-btn { display: inline-block; margin-top: 1em; padding: .7em 1.3em; border-radius: .6em; background: var(--blue); color: var(--white); font-weight: 500; }
.app-status { display: flex; align-items: center; gap: .5em; margin-top: 3.2em; color: var(--muted); font-size: .9em; }
.app-status i { width: .6em; height: .6em; border-radius: 50%; background: #28de72; }

/* Step 1: download */
.browser {
  left: 6%;
  top: 7%;
  width: 88%;
  height: 86%;
  border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(5, 25, 70, .35);
}
.browser-bar { display: flex; align-items: center; gap: 1.2em; height: 3.2em; padding: 0 1.2em; background: var(--mist); border-bottom: 1px solid var(--line); }
.browser-dots { display: flex; gap: .45em; }
.browser-dots i { width: .7em; height: .7em; border-radius: 50%; background: #dddddd; }
.browser-url { flex: 1; height: 1.9em; border-radius: 1em; background: var(--white); border: 1px solid var(--line); }
.browser-page { display: grid; justify-items: center; gap: .9em; padding: 14em 2em 0; }
.browser-page i { display: block; border-radius: 1em; }
.browser-page .bp-a { width: 14%; height: .9em; background: rgba(12, 90, 219, .3); }
.browser-page .bp-b { width: 56%; height: 3em; background: rgba(12, 90, 219, .18); }
.browser-page .bp-c { width: 26%; height: 2.6em; margin-top: 1em; background: var(--lime); }
.dl-card {
  top: 14%;
  right: 8%;
  width: 42%;
  padding: 1.4em 1.6em 1.6em;
  border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(5, 25, 70, .45), 0 0 0 1px rgba(20, 22, 24, .06);
}
.dl-title { font-weight: 600; font-size: 1.1em; }
.dl-row { display: flex; align-items: center; gap: 1em; margin-top: 1.2em; }
.file-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.6em;
  height: 4.2em;
  border-radius: .5em;
  background: var(--mist);
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 800;
  font-size: .85em;
}
.dl-meta { display: grid; gap: .5em; min-width: 0; flex: 1; }
.dl-meta strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-bar, .inst-bar { display: block; height: .45em; border-radius: 1em; background: var(--line); overflow: hidden; }
.dl-bar i, .inst-bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.dl-bar i { width: calc(min(1, var(--sp) * 1.6) * 100%); }
.dl-size { font-size: .9em; color: var(--muted); }
.dl-done { display: none; color: var(--blue); font-weight: 600; }
.dl-finished .dl-pending { display: none; }
.dl-finished .dl-done { display: inline; }

/* Step 2: install */
.installer { left: 8%; top: 10%; width: 60%; }
.installer-body { padding: 2em 2em 2.4em; }
.installer-h { font-weight: 600; font-size: 1.2em; margin-bottom: 1.2em; }
.inst-bar i { width: calc(max(0, var(--sp) * 1.6 - .6) * 100%); }
.installer-s { margin-top: .8em; color: var(--muted); font-size: .9em; }
.uac {
  right: 7%;
  bottom: 8%;
  width: 46%;
  border-radius: 10px;
  box-shadow: 0 30px 70px -10px rgba(5, 25, 70, .55);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.uac-accepted .uac { opacity: 0; transform: scale(.96); }
.uac-head { padding: .9em 1.4em; background: var(--blue); color: var(--white); font-size: .9em; }
.uac-body { padding: 1.4em; }
.uac-q { font-weight: 600; font-size: 1.1em; line-height: 1.3; }
.uac-app { display: flex; align-items: center; gap: .6em; margin-top: 1em; color: var(--text); }
.uac-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; margin-top: 1.4em; }
.uac-btns span { padding: .7em; text-align: center; border-radius: .5em; background: var(--mist); }
.uac-btns .uac-yes { background: var(--blue); color: var(--white); box-shadow: 0 0 0 .3em var(--lime); }

/* Step captions */
.steps-list {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
}
.step { opacity: .3; transition: opacity .5s var(--ease); }
.step h3 {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--blue);
}
.step sup { font-size: .5em; letter-spacing: 0; vertical-align: top; position: relative; top: .05em; margin-left: .1em; }
.step-bar { display: block; height: 2px; margin: 14px 0 12px; border-radius: 2px; background: var(--line); overflow: hidden; }
.step-bar i { display: block; height: 100%; width: 0; background: var(--blue); }
.step p { font-size: 16px; line-height: 1.5; color: var(--text); }

[data-step="1"] .step[data-i="1"],
[data-step="2"] .step[data-i="2"],
[data-step="3"] .step[data-i="3"] { opacity: 1; }
[data-step="1"] .step[data-i="1"] .step-bar i,
[data-step="2"] .step[data-i="2"] .step-bar i,
[data-step="3"] .step[data-i="3"] .step-bar i { width: calc(var(--sp) * 100%); }
[data-step="2"] .step[data-i="1"] .step-bar i,
[data-step="3"] .step[data-i="1"] .step-bar i,
[data-step="3"] .step[data-i="2"] .step-bar i { width: 100%; }

/* ---------- Closing ---------- */
.closing { padding: var(--section) var(--gutter); text-align: center; }
.closing-title {
  font-size: clamp(44px, 7vw, 96px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: .98;
  color: var(--blue);
}

/* ---------- Footer ---------- */
.footer { background: var(--mist); }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px var(--gutter) 36px;
  font-size: 13px;
  color: var(--muted);
}
.specs {
  display: grid;
  grid-template-columns: repeat(3, auto) 1fr;
  gap: 16px 40px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #dddddd;
}
.specs dd { color: var(--text); margin-top: 2px; }
.specs code { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.copyright { margin-top: 28px; }

/* Download confirmation */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 22px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--white);
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .steps-track { height: 260vh; }
  .steps-visual { width: 100%; }
  .desktop { aspect-ratio: 4 / 3.4; font-size: max(6.5px, 2.1cqi); }
  .app { width: 84%; }
  .app-body { grid-template-columns: 1fr; }
  .app-main { display: none; }
  .dl-card, .uac { width: 78%; right: 11%; }
  .installer { width: 80%; }
  .steps-list { position: relative; grid-template-columns: 1fr; min-height: 8.5em; }
  .step { position: absolute; inset: 0 0 auto; opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
  [data-step="0"] .step[data-i="1"] { opacity: .3; transform: none; }
  [data-step="1"] .step[data-i="1"],
  [data-step="2"] .step[data-i="2"],
  [data-step="3"] .step[data-i="3"] { opacity: 1; transform: none; }
  .specs { grid-template-columns: repeat(3, auto); }
  .specs-hash { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .nav-links a:not(.pill) { display: none; }
  .cta-row .pill { width: 100%; max-width: 360px; }
  .specs { grid-template-columns: 1fr 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero > * { animation: none; }
  .desktop { --p: 1 !important; }
  .state, .step, .uac, .toast, .app-mark { transition: none; }
}
