/* Onest font, self-hosted (latin + latin-ext subsets only).
   Previously loaded from fonts.googleapis.com, which sends every visitor's
   IP address to Google on each page load. Self-hosting removes that
   third-party connection entirely — no visitor IP reaches Google. */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/onest-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Apex Digital Automation — landing page
   Register: category standard, played straight (apple.com / consulting.com / antigravity.google). */

:root {
  --ground: #ffffff;
  --ground-quiet: #f5f6f8;
  --ink: #0b1220;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --hair: rgba(11, 18, 32, 0.08);
  --hair-strong: rgba(11, 18, 32, 0.14);
  --accent: #0f4c81;
  --accent-hover: #0c3f6b;
  --on-dark: #ffffff;
  --on-dark-2: rgba(255, 255, 255, 0.72);
  --selection: rgba(15, 76, 129, 0.18);

  /* Elevation: one light source from top-center, ink-tinted two-layer shadows. */
  --elev-1: 0 1px 2px rgba(11, 18, 32, 0.05), 0 1px 3px rgba(11, 18, 32, 0.08);
  --elev-2: 0 4px 10px -2px rgba(11, 18, 32, 0.12), 0 2px 4px -2px rgba(11, 18, 32, 0.08);
  --elev-3: 0 28px 56px -16px rgba(11, 18, 32, 0.22), 0 10px 20px -10px rgba(11, 18, 32, 0.12), 0 0 0 1px rgba(11, 18, 32, 0.04);
  --elev-3-hover: 0 36px 64px -16px rgba(11, 18, 32, 0.26), 0 14px 24px -10px rgba(11, 18, 32, 0.14), 0 0 0 1px rgba(11, 18, 32, 0.05);
  --elev-nav: 0 1px 0 rgba(11, 18, 32, 0.06);

  --font: "Onest", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;

  --r-pill: 999px;
  --r-plate: 20px;
  --r-row: 12px;

  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-arrive: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 64px;
  --max: 1120px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }

/* Browser surfaces */
::selection { background: var(--selection); color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible { border-radius: var(--r-pill); }
.seg__tab:focus-visible { outline-offset: -2px; border-radius: var(--r-pill); }

h1, h2, h3 { text-wrap: balance; font-weight: 600; letter-spacing: -0.02em; }
p { text-wrap: pretty; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0);
  transition: background-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--elev-nav);
}
.nav__inner {
  max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 32px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; min-height: 44px; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff;
  display: inline-grid; place-items: center; flex: none;
  transition: transform 300ms var(--ease-arrive);
}
.brand:hover .brand__mark { transform: translateY(-2px); }
.brand__short { display: none; }
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a, .footer__links a {
  position: relative;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  font-size: 15px; font-weight: 500; color: var(--ink-2); border-radius: 8px;
  transition: color 150ms var(--ease-out);
}
.nav__links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 10px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 260ms var(--ease-arrive);
}
.nav__links a:hover::after { transform: scaleX(1); }
.nav__links a:hover, .footer__links a:hover { color: var(--ink); }

/* Buttons and links */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px 0 24px;
  border-radius: var(--r-pill);
  font-size: 16px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  --bx: 0px; --by: 0px; --bs: 1;
  transform: translate(var(--bx), var(--by)) scale(var(--bs));
  transition: transform 240ms var(--ease-arrive), background-color 200ms var(--ease-out), color 200ms var(--ease-out), box-shadow 240ms var(--ease-out);
}
.btn:active { --bs: 0.96; }
.btn__icon { transition: transform 200ms var(--ease-out); }
.btn:hover .btn__icon { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--elev-1); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: var(--elev-2); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: #f1f3f6; box-shadow: 0 10px 28px -8px rgba(11, 18, 32, 0.6); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 14px; background: var(--ink); color: #fff; }
.btn--small:hover { background: #1c2536; }
.link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px;
  font-size: 16px; font-weight: 500; color: var(--accent);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; text-decoration-thickness: 1px;
  transition: text-decoration-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.link:hover { text-decoration-color: currentColor; }
.link svg { transition: transform 200ms var(--ease-out); }
.link:hover svg { transform: translateY(2px); }
.link--light { color: var(--on-dark-2); }
.link--light:hover { color: #fff; }

/* Hero: a physical scene. --px/--py = pointer (-1..1); --mx/--my = pointer in px; --sy = scroll progress (0..1). */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 88px 24px 40px;
  --mx: 50%; --my: 40%; --lo: 0; --sy: 0;
}
.hero__atmosphere {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% 30%, rgba(15, 76, 129, 0.14), transparent 72%),
    radial-gradient(45% 40% at 80% 78%, rgba(15, 76, 129, 0.09), transparent 70%),
    linear-gradient(#fff, var(--ground-quiet) 58%, #fff);
}
.hero__light {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(560px circle at var(--mx) var(--my), rgba(15, 76, 129, 0.18), rgba(15, 76, 129, 0.05) 45%, transparent 70%);
  opacity: var(--lo);
  transition: opacity 600ms var(--ease-out);
}
.hero__copy {
  max-width: 760px; margin: 0 auto; text-align: center;
  transform: translateY(calc(var(--sy) * 90px));
  opacity: calc(1 - var(--sy) * 1.1);
}
h1 {
  font-size: clamp(2.5rem, 2rem + 3.6vw, 4.5rem);
  line-height: 1.05; letter-spacing: -0.03em; font-weight: 600;
}
.lede { max-width: 620px; margin: 24px auto 0; font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); line-height: 1.5; color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px; margin-top: 36px; }

/* Demo: segmented control + layered stack */
.demo { max-width: 920px; margin: 72px auto 0; perspective: 1400px; }
.seg {
  position: relative; isolation: isolate;
  display: inline-flex; gap: 2px; padding: 4px;
  margin: 0 auto; left: 50%; transform: translateX(-50%);
  background: rgba(11, 18, 32, 0.06); border-radius: var(--r-pill);
}
.seg__indicator {
  position: absolute; top: 4px; left: 0; z-index: -1; height: calc(100% - 8px);
  width: var(--w, 0px); transform: translateX(var(--x, 0px));
  background: #fff; border-radius: var(--r-pill); box-shadow: var(--elev-1);
  transition: transform 320ms var(--ease-out);
}
.seg__tab {
  min-height: 40px; width: 128px; padding: 0 12px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; color: var(--ink-2);
  transition: color 200ms var(--ease-out);
}
.seg__tab:hover { color: var(--ink); }
.seg__tab[aria-selected="true"] { color: var(--ink); }

.stack {
  position: relative; isolation: isolate;
  display: grid; margin-top: 40px;
  --px: 0; --py: 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--py) * -3deg)) rotateY(calc(var(--px) * 4deg));
  transition: transform 700ms var(--ease-arrive);
}
/* Deepest layer: a dot field that drifts against the pointer. */
.stack__field {
  position: absolute; z-index: -2; pointer-events: none;
  left: -6%; right: -6%; top: -8%; bottom: -8%;
  background-image: radial-gradient(rgba(11, 18, 32, 0.16) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(60% 60% at 50% 50%, #000 30%, transparent 100%);
  transform: translate(calc(var(--px) * -18px), calc(var(--py) * -18px + var(--sy) * 40px));
  transition: transform 800ms var(--ease-arrive);
}
.stack__glow {
  position: absolute; z-index: -1; pointer-events: none;
  left: 10%; right: 10%; top: 12%; bottom: 8%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(15, 76, 129, 0.18), transparent 72%);
  transform: translate(calc(var(--px) * -10px), calc(var(--py) * -10px + var(--sy) * 20px));
  transition: transform 700ms var(--ease-arrive);
}
.scene {
  grid-area: 1 / 1;
  position: relative; min-height: 470px;
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out), visibility 0s linear 360ms;
  opacity: 0; transform: translateY(6px); visibility: hidden; pointer-events: none;
}
.scene.is-active { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }

.plate {
  position: absolute;
  background: #fff; border-radius: var(--r-plate); box-shadow: var(--elev-3);
  text-align: left;
  --lx: 50%; --ly: 50%;
  transition: transform 600ms var(--ease-arrive);
}
/* Light on the plate follows the pointer. */
.plate::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(320px circle at var(--lx) var(--ly), rgba(15, 76, 129, 0.10), transparent 62%);
  opacity: var(--lo, 0);
  transition: opacity 400ms var(--ease-out);
}
.plate > * { position: relative; z-index: 1; }
.plate::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: var(--elev-3-hover); opacity: 0; transition: opacity 250ms var(--ease-out);
}
.plate:hover::after { opacity: 1; }
.plate--mail {
  z-index: 1; width: 480px; left: 0; top: 0;
  transform: translate(calc(var(--px) * 14px), calc(var(--py) * 14px + var(--sy) * -30px));
}
.plate--out {
  z-index: 3; width: 520px; right: 0; top: 168px;
  transform: translate(calc(var(--px) * 34px), calc(var(--py) * 34px + var(--sy) * -140px));
}
.plate:hover { transform: translate(calc(var(--px) * 14px), calc(var(--py) * 14px + var(--sy) * -30px)) translateY(-4px); }
.plate--out:hover { transform: translate(calc(var(--px) * 34px), calc(var(--py) * 34px + var(--sy) * -140px)) translateY(-4px); }
.plate__head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px; border-bottom: 1px solid var(--hair);
  font-size: 14px;
}
.plate__glyph { color: var(--ink-3); }
.plate__title { font-weight: 600; }
.plate__meta { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mail { padding: 18px 22px 22px; font-size: 15px; line-height: 1.5; }
.plate--mail .mail { padding-right: 104px; }
.mail__from { color: var(--ink-3); font-size: 14px; }
.mail__subject { margin-top: 4px; font-weight: 600; letter-spacing: -0.01em; }
.mail__body { margin-top: 12px; color: var(--ink-2); }
.mail__attach {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  padding: 6px 12px 6px 10px; border-radius: 8px;
  background: var(--ground-quiet); font-size: 13px; color: var(--ink-2);
}
.tasks { padding: 8px 8px 10px; }
.task {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-row);
  font-size: 15px; line-height: 1.45;
}
.task svg { flex: none; margin-top: 3px; }
.task.is-done { color: var(--ink); }
.task.is-done svg { color: var(--accent); }
.js .scene.is-active .task.is-done svg { animation: check-in 420ms var(--ease-out) both; }
.js .scene.is-active .task.is-done:nth-child(1) svg { animation-delay: 320ms; }
.js .scene.is-active .task.is-done:nth-child(2) svg { animation-delay: 420ms; }
.js .scene.is-active .task.is-done:nth-child(3) svg { animation-delay: 520ms; }
@keyframes check-in {
  from { opacity: 0; transform: scale(0.25); filter: blur(4px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}
.task.is-open { color: var(--ink-2); }
.task.is-open svg { color: var(--ink-3); }

.agent {
  position: absolute; z-index: 4; left: 5%; top: 67%;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; box-shadow: var(--elev-2);
  font-size: 13px; white-space: nowrap;
  transform: translate(calc(var(--px) * 24px), calc(var(--py) * 24px + var(--sy) * -80px));
  transition: transform 600ms var(--ease-arrive);
}
.agent__mark { width: 24px; height: 24px; border-radius: 999px; background: #fff; color: var(--ink); display: inline-grid; place-items: center; }
.agent__name { font-weight: 600; }
.agent__does { color: rgba(255, 255, 255, 0.72); }

.demo__note { margin-top: 28px; text-align: center; font-size: 13px; color: var(--ink-3); }

/* Sections */
.section { padding: 128px 24px; }
.section--quiet { background: var(--ground-quiet); }
.section__inner { position: relative; max-width: var(--max); margin: 0 auto; }
.section__inner--narrow { max-width: 720px; }
h2 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.75rem); line-height: 1.12; letter-spacing: -0.025em; }
.section p { color: var(--ink-2); font-size: 17px; line-height: 1.6; max-width: 62ch; }
.section__inner--narrow p { margin-top: 24px; font-size: 19px; line-height: 1.55; }

.steps {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px;
  margin-top: 64px; padding-top: 40px;
}
.steps::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: var(--hair-strong);
}
.step h3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.015em; }
.step p { margin-top: 12px; font-size: 16px; }

/* About: a large mark sits behind the copy and moves on scroll. --ap = -1..1 viewport position. */
.about { position: relative; overflow: hidden; --ap: 0; }
.about__mark {
  position: absolute; z-index: 0; pointer-events: none;
  width: 560px; height: 560px; right: -120px; top: 50%;
  color: rgba(11, 18, 32, 0.05);
  transform: translateY(calc(-50% + var(--ap) * 120px));
  transition: transform 200ms linear;
}

/* Close: dark band with a cursor light. */
.close { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); color: var(--on-dark); padding: 136px 24px; --cx: 50%; --cy: 40%; --lo: 0; }
.close__light {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(560px circle at var(--cx) var(--cy), rgba(15, 76, 129, 0.55), rgba(15, 76, 129, 0.12) 45%, transparent 70%);
  opacity: var(--lo);
  transition: opacity 700ms var(--ease-out);
}
.close__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.close h2 { letter-spacing: -0.03em; }
.close p { margin: 24px auto 0; max-width: 56ch; font-size: 19px; line-height: 1.5; color: var(--on-dark-2); }
.close__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px; margin-top: 40px; }

/* Footer */
.footer { border-top: 1px solid var(--hair); }
.footer__inner {
  max-width: var(--max); margin: 0 auto; padding: 28px 24px;
  display: flex; align-items: center; gap: 24px; font-size: 14px; color: var(--ink-2);
}
.footer__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); }
.footer__links { display: flex; gap: 4px; margin-left: auto; }
.footer__links a { font-size: 14px; }

/* Entrances: visible by default; JS opts in. Each section has its own. */
.reveal--rise { overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.js .reveal--rise h2 { transform: translateY(110%); transition: transform 900ms var(--ease-arrive); }
.js .reveal--rise.is-in h2 { transform: none; }
.js .reveal--fade { opacity: 0; filter: blur(6px); transform: translateY(10px); transition: opacity 700ms var(--ease-out), filter 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: 120ms; }
.js .reveal--fade.is-in { opacity: 1; filter: blur(0); transform: none; }
.js .reveal--scale { opacity: 0; transform: scale(0.94); transition: opacity 700ms var(--ease-arrive), transform 900ms var(--ease-arrive); }
.js .reveal--scale.is-in { opacity: 1; transform: none; }
.js .reveal--line::before { transform: scaleX(0); transform-origin: left; transition: transform 1100ms var(--ease-arrive); }
.js .reveal--line.is-in::before { transform: scaleX(1); }
.js .reveal--line .step { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.js .reveal--line.is-in .step { opacity: 1; transform: none; }
.js .reveal--line.is-in .step:nth-child(1) { transition-delay: 250ms; }
.js .reveal--line.is-in .step:nth-child(2) { transition-delay: 370ms; }
.js .reveal--line.is-in .step:nth-child(3) { transition-delay: 490ms; }

/* Responsive */
@media (max-width: 960px) {
  .plate--mail { width: 56%; }
  .plate--out { width: 60%; top: 170px; }
  .agent { left: 34%; }
}
@media (max-width: 760px) {
  .hero { padding-top: 64px; --sy: 0; }
  .hero__copy { transform: none; opacity: 1; }
  .demo { margin-top: 56px; perspective: none; }
  .stack { transform: none; }
  .scene { min-height: 0; display: grid; gap: 16px; }
  .plate, .plate:hover { position: relative; width: auto; left: auto; right: auto; top: auto; transform: none; }
  .plate--mail .mail { padding-right: 22px; }
  .agent { position: static; justify-self: center; transform: none; }
  .btn--small, .seg__tab { min-height: 44px; }
  .stack__glow, .stack__field { display: none; }
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .section { padding: 96px 24px; }
  .about__mark { width: 360px; height: 360px; right: -140px; }
  .close { padding: 104px 24px; }
  .brand__name { display: none; }
  .brand__short { display: inline; }
  .nav__links { display: none; }
  .btn--small { margin-left: auto; }
  .footer__inner { flex-wrap: wrap; gap: 12px 24px; }
  .footer__copy { width: 100%; }
}
@media (max-width: 420px) {
  .seg { display: flex; left: 0; transform: none; }
  .plate--out .plate__head { flex-wrap: wrap; row-gap: 2px; }
  .plate--out .plate__meta { flex-basis: 100%; margin-left: 0; }
  .seg__tab { flex: 1; width: auto; padding: 0 8px; font-size: 14px; }
  .mail, .plate__head { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { --sy: 0; }
  .hero__copy { transform: none; opacity: 1; }
  .stack, .stack__field, .stack__glow, .plate, .agent, .about__mark { transform: none; transition: none; }
  .plate:hover, .plate--out:hover { transform: none; }
  .hero__light, .close__light, .plate::before { display: none; }
  .seg__indicator, .scene, .btn, .btn__icon, .link svg, .brand__mark, .nav__links a::after { transition: none; }
  .js .scene.is-active .task.is-done svg { animation: none; }
  .js .reveal, .js .reveal--rise h2, .js .reveal--fade, .js .reveal--scale, .js .reveal--line .step { opacity: 1; transform: none; filter: none; transition: none; }
  .js .reveal--line::before { transform: none; transition: none; }
}
