/* Page sections: hero, stats, bento, workspace, scrollytelling, reliability, technology, CTA */

/* ------------------------------------------------------------------ */
/* Hero                                                                 */
/* ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding-top: clamp(24px, 3vw, 36px);
  padding-bottom: clamp(24px, 4vw, 56px);
  overflow: clip;
  text-align: center;
}
.hero__aurora {
  position: absolute;
  inset: -10% 0 auto 0;
  height: 80%;
  pointer-events: none;
  z-index: 0;
  contain: layout paint;
}
/* Pre-blurred blobs: a soft radial gradient stands in for filter: blur(90px), so the layer is
   rasterised once and only its transform animates on the compositor. */
.hero__aurora i {
  --blob: min(60vw, 720px);
  position: absolute;
  width: calc(var(--blob) * 1.4);
  aspect-ratio: 1;
  margin: calc(var(--blob) * -0.2);
  border-radius: 50%;
  will-change: transform;
  animation: drift 18s ease-in-out infinite alternate;
}
.hero__aurora i:nth-child(1) {
  left: -10%;
  top: 0;
  background: radial-gradient(closest-side, var(--aurora-a) 40%, transparent);
}
.hero__aurora i:nth-child(2) {
  right: -12%;
  top: 6%;
  background: radial-gradient(closest-side, var(--aurora-b) 40%, transparent);
  animation-delay: -6s;
  animation-duration: 22s;
}
.hero__aurora i:nth-child(3) {
  left: 30%;
  top: 30%;
  background: radial-gradient(closest-side, var(--aurora-c) 40%, transparent);
  animation-delay: -11s;
}
@keyframes drift {
  from {
    transform: translate3d(-4%, -3%, 0);
  }
  to {
    transform: translate3d(6%, 5%, 0) scale(1.06);
  }
}

.hero__copy {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 18px;
}
.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-pill);
  /* No backdrop-filter: it would re-blur the animated aurora behind it every frame. */
  background: color-mix(in srgb, var(--bg-glass) 70%, var(--bg-elevated));
  box-shadow: var(--shadow-sm);
  font-size: var(--text-callout);
  font-weight: 600;
}
.hero__pill img {
  border-radius: 5px;
}
.hero__title {
  max-width: 14ch;
  margin: 0;
  font-size: var(--text-display);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero__title .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.04em 0.02em 0.14em;
  margin: -0.04em -0.02em -0.14em;
}
.hero__title .w > span {
  display: inline-block;
  transform: translate3d(0, 112%, 0);
  opacity: 0;
  animation: wordUp 1.1s var(--ease-spring) forwards;
  animation-delay: calc(var(--i) * 80ms + 120ms);
}
.hero__title .w--grad > span {
  background: linear-gradient(100deg, var(--grad-a), var(--grad-b) 50%, var(--grad-c) 100%);
  background-size: 260% 100%;
  background-position: calc(var(--gi) * 38%) 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
@keyframes wordUp {
  to {
    transform: none;
    opacity: 1;
  }
}
.hero__lead {
  max-width: 54ch;
}
.hero__cta {
  justify-content: center;
}
.hero__fine {
  font-size: var(--text-footnote);
  color: var(--label-tertiary);
}

.hero__stage {
  position: relative;
  z-index: 1;
  margin-top: clamp(24px, 2.4vw, 32px);
  perspective: 2000px;
  perspective-origin: 50% 0;
}
.hero__window {
  width: min(100%, 1120px);
  margin-inline: auto;
  /* Tilt at rest; motion.js writes the scroll-driven transform straight onto this element. */
  transform: rotateX(14deg) scale(0.93);
  transform-origin: 50% 0;
  will-change: transform;
  animation: stageIn 1.2s var(--ease-out) 0.5s backwards;
}
@keyframes stageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.hero__glow {
  position: absolute;
  inset: -4% -4% -20%;
  z-index: -1;
  /* Pre-blurred (no live filter); motion.js drives opacity on this own compositor layer. */
  background: radial-gradient(45% 50% at 30% 45%, var(--aurora-a), transparent 100%),
    radial-gradient(42% 50% at 72% 55%, var(--aurora-b), transparent 100%);
  opacity: 0.55;
  will-change: opacity;
}

/* Floating keycaps */
.hero__keys {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.fk {
  --kc-h: clamp(30px, 3.6vw, 50px);
  --r: -6deg;
  position: absolute;
  animation: floaty 7s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  will-change: transform;
}
/* Static box-shadow instead of filter: drop-shadow, which re-rasterised every frame. */
.fk .keycap {
  box-shadow: 0 1px 0 1px var(--keycap-edge), 0 4px 0 1px var(--keycap-edge), 0 8px 16px rgba(60, 56, 54, 0.22),
    0 18px 24px -6px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
/* Off-screen hero: freeze the ambient loops. */
.hero.is-off .hero__aurora i,
.hero.is-off .fk,
.hero.is-off .fk .keycap {
  animation-play-state: paused;
}
.fk .keycap {
  animation: press 5s ease-in-out infinite;
  animation-delay: calc(var(--n, 0) * 0.22s + var(--d, 0s));
}
.fk .keycap:nth-child(2) {
  --n: 1;
}
.fk .keycap:nth-child(3) {
  --n: 2;
}
.fk--1 {
  left: -1%;
  top: -6%;
  --r: -7deg;
  --d: 0s;
}
.fk--2 {
  right: -1%;
  top: 14%;
  --r: 6deg;
  --d: -2s;
}
.fk--3 {
  left: 1%;
  bottom: 14%;
  --r: 5deg;
  --d: -4s;
}
.fk--4 {
  right: 4%;
  bottom: -5%;
  --r: -5deg;
  --d: -1s;
}
.fk--5 {
  left: 42%;
  top: -7%;
  --r: 4deg;
  --d: -3s;
}
@keyframes floaty {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(var(--r));
  }
  50% {
    transform: translate3d(0, -16px, 0) rotate(calc(var(--r) * -0.5));
  }
}
@keyframes press {
  0%,
  86%,
  100% {
    transform: none;
  }
  91% {
    transform: translate3d(0, 3px, 0);
  }
}
@media (max-width: 899px) {
  .fk--1,
  .fk--2,
  .fk--3 {
    display: none;
  }
  .fk--4 {
    --kc-h: 28px;
    right: 6%;
    bottom: -14px;
  }
}

/* ------------------------------------------------------------------ */
/* Stats                                                                */
/* ------------------------------------------------------------------ */
.stats {
  padding-block: clamp(36px, 6vw, 72px);
}
.stats__grid {
  display: grid;
  gap: 28px 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stats__grid li {
  display: grid;
  gap: 6px;
  align-content: start;
  text-align: center;
  color: var(--label-secondary);
  font-size: var(--text-callout);
  line-height: 1.35;
}
.stats__grid b {
  display: block;
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.75rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--label);
  font-variant-numeric: tabular-nums;
}
.stats__grid small {
  font-size: 0.42em;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--label-secondary);
}
@media (min-width: 860px) {
  .stats__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------------ */
/* Bento cards (keyboard section)                                       */
/* ------------------------------------------------------------------ */
.bento {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  overflow: hidden;
}
.card__title {
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.card .muted {
  font-size: var(--text-callout);
  line-height: 1.5;
}
.card__text {
  display: grid;
  gap: 12px;
}
.card .mac--flat {
  margin-top: 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.card .mac--flat .media {
  --ar: 16 / 9.4;
}
.twins {
  margin-top: 8px;
}
.twins li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 0.5px solid var(--separator);
  font-size: var(--text-callout);
}
@media (min-width: 900px) {
  .bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .card--palette {
    grid-column: span 7;
  }
  .card--search {
    grid-column: span 5;
  }
  .card--sheet {
    grid-column: span 5;
  }
  .card--layer {
    grid-column: span 7;
  }
}

/* ------------------------------------------------------------------ */
/* Workspace                                                            */
/* ------------------------------------------------------------------ */
.split {
  display: grid;
  gap: 36px;
  align-items: center;
  margin-bottom: clamp(56px, 9vw, 120px);
}
.split__text {
  display: grid;
  gap: 16px;
}
.split__text .h2 {
  text-wrap: balance;
}
@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 72px;
  }
  .split--reverse {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  }
  .split--reverse .split__visual {
    order: -1;
  }
}

.ticks {
  display: grid;
  gap: 12px;
}
.ticks li {
  position: relative;
  padding-left: 30px;
  font-size: var(--text-callout);
  line-height: 1.5;
  color: var(--label-secondary);
}
.ticks li strong {
  color: var(--label);
  font-weight: 650;
}
.ticks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0.12em;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 800;
}
.ticks--roomy {
  gap: 18px;
  margin-top: 8px;
}
.ticks code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  border-radius: 5px;
  background: var(--fill-tertiary);
}

.pair {
  display: grid;
  gap: 28px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.pair figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: var(--text-callout);
  color: var(--label-secondary);
}
@media (min-width: 820px) {
  .pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }
}

.mini-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.mini-grid li {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.mini-grid h4 {
  margin-bottom: 6px;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.mini-grid p {
  font-size: var(--text-callout);
  line-height: 1.5;
  color: var(--label-secondary);
}
.mini-grid--3 {
  margin-top: 48px;
}
.section:not(.section--tint) .mini-grid li {
  background: var(--bg-secondary);
  box-shadow: none;
}

/* ------------------------------------------------------------------ */
/* Scrollytelling                                                       */
/* ------------------------------------------------------------------ */
.scrolly {
  display: grid;
  gap: 0;
}
.scrolly__steps {
  display: grid;
  gap: 72px;
}
.step {
  display: grid;
  gap: 16px;
  align-content: center;
}
.step__media .mac {
  margin-top: 8px;
}
.scrolly__sticky {
  display: none;
}
@media (min-width: 980px) {
  .scrolly {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 64px;
  }
  .scrolly__steps {
    gap: 0;
  }
  .step {
    min-height: 92vh;
    padding-block: 10vh;
    opacity: 0.32;
    transition: opacity 0.6s var(--ease-out);
  }
  .step[data-active='true'] {
    opacity: 1;
  }
  .step__media {
    display: none;
  }
  .scrolly__sticky {
    position: sticky;
    top: calc(50vh - 260px);
    display: grid;
    gap: 22px;
    align-self: start;
    justify-items: center;
  }
  .scrolly__frame {
    width: 100%;
  }
  .scrolly__stack {
    position: relative;
    aspect-ratio: 16 / 10;
  }
  .scrolly__stack .media {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    opacity: 0;
    transform: scale(1.025);
    transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-spring);
  }
  .scrolly__stack .media[data-active='true'] {
    opacity: 1;
    transform: none;
  }
}
.scrolly__dots {
  display: flex;
  gap: 8px;
}
.scrolly__dots li {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--label-quaternary);
  transition: width 0.4s var(--ease-spring), background 0.3s;
}
.scrolly__dots li[data-active='true'] {
  width: 26px;
  border-radius: 99px;
  background: var(--accent);
}

/* ------------------------------------------------------------------ */
/* Themes screenshot                                                    */
/* ------------------------------------------------------------------ */
.themes-shot {
  margin-top: clamp(40px, 6vw, 72px);
  max-width: 1040px;
  margin-inline: auto;
}

/* ------------------------------------------------------------------ */
/* Reliability                                                          */
/* ------------------------------------------------------------------ */
.rel {
  display: grid;
  gap: 56px;
  align-items: center;
}
.rel__text {
  display: grid;
  gap: 16px;
}
.rel__visual {
  position: relative;
  display: grid;
  justify-items: center;
}
.phone {
  width: min(280px, 72vw);
}
.phone__frame {
  padding: 10px;
  border-radius: 46px;
  background: #0d0e0f;
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px #504945;
}
.phone__frame .media {
  border-radius: 36px;
}
.rel__visual::before {
  content: '';
  position: absolute;
  inset: 8% 8%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--aurora-a), transparent);
  filter: blur(50px);
  z-index: -1;
}
@media (min-width: 900px) {
  .rel {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 96px;
  }
}

/* ------------------------------------------------------------------ */
/* Technology / vision                                                  */
/* ------------------------------------------------------------------ */
.tech {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.tcard {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: transform 0.5s var(--ease-spring), box-shadow 0.5s var(--ease-out);
}
.tcard:hover {
  transform: translate3d(0, -4px, 0);
  box-shadow: var(--shadow-md);
}
.tcard h3 {
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.tcard p {
  font-size: var(--text-callout);
  line-height: 1.5;
  color: var(--label-secondary);
}
.tcard__ico {
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
  color: var(--accent);
}
.tcard__ico--glyph {
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
}
.tcard .tcard__big {
  font-size: clamp(3.5rem, 2.6rem + 3.4vw, 6rem);
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--label);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, var(--grad-a), var(--grad-b) 60%, var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tcard__big small {
  font-size: 0.4em;
  letter-spacing: -0.02em;
}
.tech__fine {
  margin-top: 28px;
  text-align: center;
  font-size: var(--text-footnote);
  color: var(--label-tertiary);
  letter-spacing: 0.01em;
}
@media (min-width: 640px) {
  .tech {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tcard--lg {
    grid-column: 1 / -1;
  }
}
@media (min-width: 980px) {
  .tech {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tcard--lg {
    grid-column: span 2;
  }
}

/* ------------------------------------------------------------------ */
/* Final CTA                                                            */
/* ------------------------------------------------------------------ */
.cta {
  padding-block: clamp(48px, 8vw, 120px) clamp(72px, 10vw, 140px);
}
.cta__band {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: clamp(48px, 8vw, 112px) var(--gutter);
  border-radius: clamp(28px, 4vw, 44px);
  text-align: center;
  color: var(--cta-fg);
  background: var(--cta-grad);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 40px 90px color-mix(in srgb, var(--system-orange) 30%, transparent);
}
.cta__aurora {
  position: absolute;
  inset: -30%;
  z-index: -1;
  background: radial-gradient(40% 40% at 20% 20%, var(--cta-glow-a), transparent 60%),
    radial-gradient(40% 40% at 85% 80%, var(--cta-glow-b), transparent 60%);
  animation: drift 16s ease-in-out infinite alternate;
}
.cta__logo {
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(29, 32, 33, 0.35);
}
.cta__band .lead {
  max-width: 36ch;
  color: var(--cta-fg-soft);
}
.cta__row {
  justify-content: center;
  margin-top: 8px;
}
.cta__btn {
  background: var(--cta-btn-bg);
  color: var(--cta-btn-fg);
}
.cta__btn:hover {
  background: var(--cta-btn-bg);
  filter: brightness(1.15);
}
.cta__btn--ghost {
  background: var(--cta-btn-ghost);
  color: var(--cta-fg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.cta__btn--ghost:hover {
  background: var(--cta-btn-ghost);
  filter: brightness(0.9);
}
.cta__code {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin-top: 8px;
  font-size: var(--text-footnote);
  color: var(--cta-fg-soft);
}
.cta__code code {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(29, 32, 33, 0.28);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--cta-fg);
}
