/* The finishing layer (2026-11-09). Loaded last: one rhythm for sections and headings,
   the surfaces the browser draws, press and pointer feedback, and three authored
   motions (the hero title, the reading statement, section titles). Everything here
   holds still under prefers-reduced-motion and the footer's motion switch. */

:root {
  --pm-ease: cubic-bezier(0.2, 0, 0, 1);
  --pm-section: clamp(64px, 8vw, 112px);
  --pm-ring: color-mix(in srgb, var(--focus) 28%, transparent);
  --pm-edge: #0000001a;
  --pm-lift:
    0 1px 1px #0b10190a, 0 4px 8px -2px #0b10190f, 0 18px 36px -18px #0b101926;
  accent-color: var(--action);
  caret-color: var(--accent);
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}
:root[data-theme="dark"] {
  --pm-edge: #ffffff1a;
  --pm-lift: 0 1px 1px #0006, 0 18px 36px -18px #000c;
}

/* Browser surfaces ------------------------------------------------------- */
::selection {
  background: var(--navy);
  color: var(--cream);
}
:root[data-theme="dark"] ::selection {
  background: var(--sky);
  color: #10203a;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--pm-ring);
}
a:not(.button) {
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}

/* One rhythm ---------------------------------------------------------------- */
.edition .section {
  padding-block: var(--pm-section);
}
.edition .uu-riyadh {
  padding-block: 0 var(--pm-section);
}
.edition .section-heading {
  margin-block-end: clamp(40px, 5vw, 64px);
}
.edition .section-heading h2,
.edition .feature-copy h2,
.edition .demo-intro h2,
.asst .heading h2 {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600;
  line-height: 1.3;
}
.edition .section-heading p,
.edition .feature-copy > p,
.asst .heading p {
  max-width: 48ch;
  margin-inline: auto;
  text-wrap: pretty;
}
.edition .feature-copy > p,
.asst .heading:not(.center) p {
  margin-inline: 0;
}
.edition p,
.edition li {
  text-wrap: pretty;
}

/* Hero: a headline, a sentence, the hand-off strip, two buttons ------------- */
.edition .uu-copy h1 {
  margin-block: 0 20px;
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 1.2;
}
.edition .uu-copy > p {
  max-width: 40ch;
}
.edition .uu-copy .uu-duo {
  margin-block-start: 28px;
}
.edition .uu-copy .actions {
  margin-block-start: 28px;
}

/* The reading statement: one sentence, lit word by word as it is scrolled ---- */
.pm-statement {
  width: min(980px, calc(100% - 48px));
  margin-inline: auto;
  padding-block: clamp(96px, 13vw, 184px);
}
.pm-read {
  font-size: clamp(28px, 4.1vw, 54px);
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}
.pm-read .w {
  transition: opacity 240ms var(--pm-ease);
}
.pm-read.is-reading .w:not(.on) {
  opacity: 0.16;
}

/* Titles rise out of their own line ---------------------------------------- */
.pm-line {
  display: block;
  overflow: hidden;
  padding-block: 0.16em;
  margin-block: -0.16em;
}
.pm-line > span {
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="paused"]) .pm-rise .pm-line > span {
    transform: translateY(112%);
    transition: transform 720ms var(--pm-ease);
    transition-delay: calc(var(--l, 0) * 80ms);
  }
  :root:not([data-motion="paused"]) .pm-rise.is-in .pm-line > span {
    transform: none;
  }
  /* the block's own fade would hide the rise, so the title's block only fades */
  .js-motion .reveal:has(> .pm-rise),
  .js-motion .reveal {
    transform: translateY(12px);
    transition-duration: 480ms;
    transition-timing-function: var(--pm-ease);
  }
  .js-motion .reveal.visible,
  .js-motion .reveal:focus-within {
    transform: none;
  }
}

/* Press and pointer --------------------------------------------------------- */
.button,
.icon-button,
.cta-link {
  transition:
    background-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease),
    transform 120ms var(--pm-ease);
}
@media (prefers-reduced-motion: no-preference) {
  .button:active:not(:focus-visible),
  .icon-button:active:not(:focus-visible),
  .cta-link:active:not(:focus-visible) {
    transform: scale(0.97);
  }
}

/* Cards: depth from light, and an edge that follows the pointer (Spotlight) -- */
.edition .bento,
.edition .role-card,
.edition .start-grid li {
  position: relative;
}
.edition .bento,
.edition .role-card {
  box-shadow: 0 1px 2px #0b10190d;
}
.pm-spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    var(--accent),
    transparent 70%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 240ms var(--pm-ease);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .edition .bento,
  .edition .role-card {
    transition:
      transform 240ms var(--pm-ease),
      box-shadow 240ms var(--pm-ease);
  }
  .edition .bento:hover,
  .edition .role-card:hover {
    transform: translateY(-2px);
    border-color: var(--line);
    box-shadow: var(--pm-lift);
  }
  .pm-spot:hover::after {
    opacity: 1;
  }
}

/* Pictures get one quiet edge, so a pale photo never bleeds into the page ---- */
.edition .bento-photo,
.edition .section-photo,
.edition .security-photo,
.edition .uu-browser,
.edition .uu-phone {
  outline: 1px solid var(--pm-edge);
  outline-offset: -1px;
}

/* Header: a hairline and glass only once the page has moved ----------------- */
.edition .site-header.is-scrolled,
.edition .site-header:has([aria-expanded="true"]) {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
}

@media (max-width: 640px) {
  .pm-read {
    text-align: start;
    line-height: 1.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pm-read .w {
    opacity: 1 !important;
  }
}
:root[data-motion="paused"] .pm-read .w {
  opacity: 1 !important;
}

/* The mode key, in the header: sun and moon cross-fade in place ------------- */
#theme-toggle {
  position: relative;
}
#theme-toggle svg,
[data-theme="dark"] #theme-toggle svg {
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  transition:
    opacity 120ms var(--pm-ease),
    filter 120ms var(--pm-ease);
}
#theme-toggle svg:first-child,
[data-theme="dark"] #theme-toggle svg:last-child {
  opacity: 0;
  filter: blur(2px);
}
[data-theme="dark"] #theme-toggle svg:first-child {
  opacity: 1;
  filter: none;
}
/* Photos: a ground in the page's own tone while they load, then a short fade -- */
.uu-riyadh-frame {
  background: linear-gradient(#1b2f55, #0b1222);
}
.pm-wait {
  opacity: 0;
}
.pm-loaded {
  transition: opacity 320ms var(--pm-ease);
}
@media (max-width: 420px) {
  .edition .header-actions .button {
    padding-inline: 10px;
  }
}
/* The two small photo cards keep their photo's shape before it arrives, so the grid
   (and the tall card beside them) never jumps when the pictures load. */
@media (min-width: 961px) {
  .edition .bento:nth-child(n + 3) .bento-photo {
    flex: none;
    aspect-ratio: 3 / 2;
  }
}
