/* ==========================================================================
   Nous landing page styles. Used by index.html, and by social/posts.html and social/video.html for the fonts and the
   phone frame; owns every rule on the page.
   Colours are the app's own palettes (packages/design/kit/react/nuiTokens.ts): each look has a light and a dark tone,
   chosen with data-look and data-tone on <html>. Saudi has one tone in the app; its dark tone here is the national-day
   palette. Arabic (dir="rtl") is the primary language, so spacing uses logical properties.
   ========================================================================== */

/* === Fonts: Thmanyah (thmanyah's font licence) for headlines (Serif Display) and text (Sans), in both languages === */
@font-face { font-family: "Thmanyah Display"; font-weight: 500; src: url("fonts/thmanyahserifdisplay-Medium.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Thmanyah Display"; font-weight: 700; src: url("fonts/thmanyahserifdisplay-Bold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Thmanyah Display"; font-weight: 900; src: url("fonts/thmanyahserifdisplay-Black.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; font-weight: 400; src: url("fonts/thmanyahsans-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; font-weight: 500; src: url("fonts/thmanyahsans-Medium.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; font-weight: 600 700; src: url("fonts/thmanyahsans-Bold.woff2") format("woff2"); font-display: swap; }

/* === Palettes: one block per look and tone === */
:root, [data-look="original"][data-tone="light"] {
  --bg: #F5F1EB; --raise: #FFFFFF; --sunk: #EDE7DE; --fg: #2A292E; --fg2: #6F6862; --fg3: #9A918B;
  --accent: #E62F17; --on-accent: #FFFFFF; --line: #2A292E1A; --glow: #E62F171F;
}
[data-look="original"][data-tone="dark"] {
  --bg: #2A292E; --raise: #35343A; --sunk: #232227; --fg: #F5F1EB; --fg2: #B5ACA4; --fg3: #8F867F;
  --accent: #F2402A; --on-accent: #14110F; --line: #F5F0EB1F; --glow: #F2402A26;
}
[data-look="saudi"][data-tone="light"] {
  --bg: #F5F1EB; --raise: #FAF6EA; --sunk: #ECE5D1; --fg: #0B3526; --fg2: #2F4B3C; --fg3: #4E6A5A;
  --accent: #C9A24B; --on-accent: #072B20; --line: #0D3B2C29; --glow: #165D311F;
}
[data-look="saudi"][data-tone="dark"] {
  --bg: #062D2D; --raise: #0B3D3B; --sunk: #082F31; --fg: #F4F6E9; --fg2: #C5D9C5; --fg3: #8EAF9B;
  --accent: #00A35B; --on-accent: #F4F8EB; --line: #00A35B3D; --glow: #83CF2F21;
}
[data-look="dusk"][data-tone="light"] {
  --bg: #EAD8E8; --raise: #FFF7F2; --sunk: #F3E6EE; --fg: #2A1740; --fg2: #5B4472; --fg3: #6A5380;
  --accent: #AE3409; --on-accent: #FFFFFF; --line: #2A174024; --glow: #D2552B26;
}
[data-look="dusk"][data-tone="dark"] {
  --bg: #1F1530; --raise: #2E2046; --sunk: #261A3B; --fg: #FFF1E6; --fg2: #EBD0C4; --fg3: #BBA0B6;
  --accent: #FF8A5B; --on-accent: #1F1530; --line: #FF8A5B2E; --glow: #FF8A5B26;
}
[data-look="winter"][data-tone="light"] {
  --bg: #D9E1F6; --raise: #F6F8FF; --sunk: #E7ECFA; --fg: #0F1635; --fg2: #3B4673; --fg3: #4E5C88;
  --accent: #3B4FD8; --on-accent: #FFFFFF; --line: #0F163524; --glow: #5B6EF026;
}
[data-look="winter"][data-tone="dark"] {
  --bg: #0E1226; --raise: #1B2142; --sunk: #151A35; --fg: #EEF0FF; --fg2: #BFC6EA; --fg3: #8E99CC;
  --accent: #AEBBFF; --on-accent: #0E1226; --line: #AEBBFF29; --glow: #8496F02E;
}

/* === Shared tokens: one family (Thmanyah) for both languages; the platform face is only the fallback === */
:root {
  --display: "Thmanyah Display", Georgia, serif;
  --text: "Thmanyah Sans", system-ui, sans-serif;
  --ok: #1F9D63; --warn: #F5B73D; --bad: #D92D20;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --page: min(1080px, 100% - 32px);
}
[lang="ar"] { --text: "Thmanyah Sans", -apple-system, "SF Arabic", "Segoe UI", system-ui, sans-serif; }

/* === Base and browser surfaces === */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; scrollbar-color: var(--fg3) var(--bg); overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--fg); overflow-x: clip; caret-color: var(--accent);
  font: 400 19px/1.55 var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .7s var(--ease), color .7s var(--ease);
}
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--fg); }
a { color: inherit; text-underline-offset: .2em; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.06; margin: 0; text-wrap: balance; }
[lang="ar"] .display { letter-spacing: 0; line-height: 1.25; }
h1.display { font-size: clamp(46px, 7.6vw, 96px); }
h2.display { font-size: clamp(36px, 5.4vw, 68px); }
.lede { font-size: clamp(19px, 1.7vw, 23px); color: var(--fg2); max-width: 32em; margin: 24px auto 0; text-wrap: pretty; }
.fine { font-size: 15px; color: var(--fg2); margin: 20px 0 0; }
.center { text-align: center; }
.section-head { width: var(--page); margin: 0 auto 64px; text-align: center; }

/* === Buttons and links === */
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 14px 26px; border-radius: 999px; border: 0; white-space: nowrap;
  font: 600 18px/1 var(--text); text-decoration: none; color: var(--fg); background: var(--raise); cursor: pointer;
  transition: transform .3s var(--ease), background-color .7s var(--ease), color .7s var(--ease), filter .2s;
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.small { padding: 8px 15px; font-size: 14px; }
/* Hero download pills: Android waits greyed out. */
.btn.soon { color: var(--fg2); background: color-mix(in srgb, var(--fg) 7%, transparent); cursor: default; }
.btn.soon:hover { filter: none; }
.link { display: inline-flex; align-items: center; gap: 6px; color: color-mix(in srgb, var(--accent) 68%, var(--fg)); font-weight: 600; text-decoration: none; font-size: 18px; }
.link:hover span { text-decoration: underline; }
.chev { width: 7px; height: 12px; margin-top: 1px; }
[dir="rtl"] .chev { transform: scaleX(-1); }

/* === Wordmark: letters take the ink, the comma is always brand red (as BrandWordmark on iOS and web) === */
.wordmark { position: relative; display: block; width: 84px; aspect-ratio: 1400 / 312; }
.wordmark span { position: absolute; inset: 0; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.wordmark .letters { background: var(--fg); -webkit-mask-image: url("brand/HeaderWordmark.png"); mask-image: url("brand/HeaderWordmark.png"); transition: background-color .7s var(--ease); }
.wordmark .comma { background: #E62F17; -webkit-mask-image: url("brand/HeaderWordmarkDot.png"); mask-image: url("brand/HeaderWordmarkDot.png"); }

/* === Header: a thin translucent bar, as on Apple's product pages === */
.bar {
  position: sticky; top: 0; z-index: 20; height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px;
  padding-inline: max(16px, (100% - 1080px) / 2);
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid transparent; transition: border-color .3s, background-color .7s var(--ease);
}
.bar.scrolled { border-bottom-color: var(--line); }
.bar-brand { display: block; justify-self: start; }
.bar-actions { justify-self: end; display: flex; align-items: center; gap: 14px; }
.bar-links { display: flex; gap: 24px; }
.bar-links a { text-decoration: none; font-size: 14px; color: var(--fg2); transition: color .2s; }
.bar-links a:hover { color: var(--fg); }
.lang { border: 0; background: none; padding: 6px 10px; border-radius: 99px; font-size: 14px; color: var(--fg2); cursor: pointer; }
.lang:hover { color: var(--fg); }

/* === Phone: iPhone 16 Pro, drawn in points. The screen is 402 x 874 pt (the screenshots' own size, 1206 x 2622 px),
   the bezel 14.6 pt, screen corners 62 pt, Dynamic Island 126 x 37.3 pt at 11 pt. --w sets the body's width. === */
.phone {
  --w: 300px; --u: calc(var(--w) / 431.2);
  width: var(--w); aspect-ratio: 431.2 / 903.2; position: relative; flex: none; direction: ltr;
  padding: calc(var(--u) * 14.6); border-radius: calc(var(--u) * 76.6); background: #050505;
  box-shadow: inset 0 0 0 calc(var(--u) * 1.6) #4A4846, inset 0 0 0 calc(var(--u) * 3) #1E1D1C,
    0 calc(var(--u) * 40) calc(var(--u) * 80) calc(var(--u) * -30) #0007, 0 calc(var(--u) * 14) calc(var(--u) * 28) calc(var(--u) * -14) #0005;
}
/* Side buttons: action button and volume on the left, side button and Camera Control on the right. */
.phone::before, .phone::after { content: ""; position: absolute; top: 0; bottom: 0; width: calc(var(--u) * 3.2); z-index: -1; }
.phone::before {
  left: calc(var(--u) * -2.2);
  background: linear-gradient(transparent calc(var(--u) * 166), #3E3C3A 0 calc(var(--u) * 200), transparent 0 calc(var(--u) * 230),
    #3E3C3A 0 calc(var(--u) * 292), transparent 0 calc(var(--u) * 308), #3E3C3A 0 calc(var(--u) * 370), transparent 0);
  border-radius: calc(var(--u) * 2);
}
.phone::after {
  right: calc(var(--u) * -2.2);
  background: linear-gradient(transparent calc(var(--u) * 240), #3E3C3A 0 calc(var(--u) * 342), transparent 0 calc(var(--u) * 540),
    #3E3C3A 0 calc(var(--u) * 596), transparent 0);
  border-radius: calc(var(--u) * 2);
}
.phone .screen { position: relative; height: 100%; border-radius: calc(var(--u) * 62); overflow: hidden; background: var(--sunk); isolation: isolate; }
.phone .screen > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s var(--ease); }
.phone .island {
  position: absolute; z-index: 3; top: calc(var(--u) * (14.6 + 11)); left: 50%; translate: -50% 0;
  width: calc(var(--u) * 126); height: calc(var(--u) * 37.33); border-radius: calc(var(--u) * 19); background: #000;
}
.phone .statusbar {
  position: absolute; z-index: 2; top: calc(var(--u) * 14.6); left: calc(var(--u) * 14.6); right: calc(var(--u) * 14.6);
  height: calc(var(--u) * 59.4); display: grid; grid-template-columns: 1fr calc(var(--u) * 126) 1fr; align-items: center;
  font: 600 calc(var(--u) * 17)/1 -apple-system, "SF Pro Text", system-ui, sans-serif; letter-spacing: -0.02em; color: #fff;
}
.phone .statusbar[data-ink="dark"] { color: #000; }
.phone .statusbar > span:first-child { grid-column: 1; justify-self: center; padding-left: calc(var(--u) * 8); }
.phone .statusbar .icons { grid-column: 3; justify-self: center; display: flex; gap: calc(var(--u) * 6); align-items: center; padding-right: calc(var(--u) * 4); }
.phone .statusbar svg { height: calc(var(--u) * 12); width: auto; }
.phone .statusbar svg:last-child { height: calc(var(--u) * 13); }

/* Hero demo: invisible buttons over the screenshot's own controls (a ring only for keyboard focus), and a hand-drawn
   note under the phone whose arrow points at the next control to tap (--x, set by landing.js). */
.spot {
  position: absolute; z-index: 4; width: 16%; aspect-ratio: 1; translate: -50% -50%;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.screen .spot[hidden] { display: none; }
.spot:focus { outline: 0; }
.spot:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); }
/* Composer keyboard: invisible keys over the screenshot's keyboard, a soft flash when pressed; the field sits on the
   composer's text line and only paints a background once something is typed. */
.kbd { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.kbd > * { pointer-events: auto; }
.kbd[hidden] { display: none; }
.key {
  position: absolute; translate: -50% -50%; border: 0; border-radius: calc(var(--u, 1px) * 5); background: transparent; padding: 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s;
}
.key:active { background: #FFFFFF40; }
.key:focus { outline: 0; }
.key:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); }
.composer-field {
  position: absolute; left: 5%; right: 3%; top: 52.3%; translate: 0 -50%; height: 4.2%; padding: 0 1%;
  border: 0; outline: 0; background: transparent; color: #1D1D1F; caret-color: #3B82F6;
  font: 400 calc(var(--u, 1px) * 13) / 1.2 -apple-system, "SF Arabic", "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif;
}

/* Send: hidden over the screenshot's grey paper plane until there is text, then lit in the look's accent with a glow. */
.spot.send { width: 11%; z-index: 6; display: grid; place-items: center; color: transparent; transition: background-color .3s, box-shadow .3s, color .3s; }
.spot.send svg { width: 46%; height: 46%; }
.spot.send.ready { background: var(--accent); color: var(--on-accent); animation: send-glow 1.8s ease-in-out infinite; }
@keyframes send-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent), 0 0 12px 2px color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 0%, transparent), 0 0 22px 6px color-mix(in srgb, var(--accent) 55%, transparent); }
}
/* The demo's "download the app" banner: an iOS-style notification that drops in under the Dynamic Island. */
.phone-toast {
  position: absolute; z-index: 7; left: 4%; right: 4%; top: 6.2%; display: flex; align-items: center; gap: calc(var(--u) * 10);
  padding: calc(var(--u) * 11) calc(var(--u) * 13); border-radius: calc(var(--u) * 22); text-decoration: none; color: #1D1D1F;
  background: color-mix(in srgb, #FFFFFF 82%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 calc(var(--u) * 8) calc(var(--u) * 24) calc(var(--u) * -6) #0004, 0 1px 3px #0002;
  translate: 0 -160%; opacity: 0; transition: translate .55s var(--ease), opacity .35s;
  font: 400 calc(var(--u) * 13)/1.3 -apple-system, "SF Arabic", "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif;
}
.phone-toast.in { translate: 0 0; opacity: 1; }
.phone-toast img { width: calc(var(--u) * 34); height: calc(var(--u) * 34); border-radius: calc(var(--u) * 8); flex: none; }
.phone-toast > span { display: grid; gap: calc(var(--u) * 1); }
.phone-toast b { font-weight: 600; }
[dir="rtl"] .phone-toast > span { direction: rtl; text-align: right; flex: 1; }

.hint {
  position: absolute; top: calc(100% + 6px); left: var(--x, 50%); translate: -50% 0; display: grid; justify-items: center; gap: 2px;
  pointer-events: none; transition: left .7s var(--ease), opacity .4s var(--ease);
}
.hint.off { opacity: 0; }
.hint svg { width: 34px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hint span { font: 700 19px/1.2 var(--display); color: var(--fg); white-space: nowrap; }
[dir="rtl"] .hint span { direction: rtl; }

/* === Hero: centred statement, then three phones that open out on arrival === */
.hero { width: var(--page); margin: 0 auto; padding: 96px 0 40px; text-align: center; }
.hero .lede { max-width: 40em; }
.downloads { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin-top: 36px; }
/* The stage is exactly as tall as the front phone (its height is 2.095 times its width). */
.hero-stage { position: relative; height: calc(min(340px, 54vw) * 2.095); margin: 72px 0 84px; display: grid; place-items: start center; }
.hero-stage::before {
  content: ""; position: absolute; z-index: -1; inset: 10% 5% 0; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent); transition: background .7s;
}
.hero-stage .phone { position: absolute; transition: transform 1.6s var(--ease), opacity 1.2s var(--ease); }
.hero-stage .front { --w: min(340px, 54vw); z-index: 2; }
.hero-stage .side { --w: min(300px, 46vw); top: 6%; }
.hero-stage .left { transform: translateX(-74%) rotate(-6deg); }
.hero-stage .right { transform: translateX(74%) rotate(6deg); }
.hero-stage.closed .left, .hero-stage.closed .right { transform: none; opacity: 0; }

/* === Mac: the window on a soft desk, the phone leaning in front === */
.mac { padding: 140px 0 150px; }
.mac-desk {
  width: var(--page); margin: 0 auto; height: 760px; border-radius: 40px; position: relative; display: grid; place-items: center;
  background: radial-gradient(60% 70% at 50% 40%, var(--glow), transparent), var(--sunk); overflow: hidden; transition: background-color .7s var(--ease);
}
/* The screenshot is the window itself; its corners are rounded here as macOS draws them. */
.mac-window { width: 330px; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px #0000001F, 0 40px 80px -30px #0008, 0 16px 32px -16px #0006; transform: translateX(-14%); }
.mac-desk .phone { --w: 230px; position: absolute; top: 210px; left: calc(50% + 40px); transform: rotate(4deg); }

/* === Looks: two phones, then the theme cards and a light/dark control === */
.looks { padding: 160px 0 140px; background: var(--sunk); transition: background-color .7s var(--ease); }
.looks-stage { position: relative; height: min(700px, 150vw); display: grid; place-items: center; }
.looks-stage .phone { --w: min(320px, 62vw); position: absolute; z-index: 2; transform: translateX(-20%); }
.looks-stage .back { --w: min(290px, 56vw); z-index: 1; transform: translateX(26%) translateY(5%) rotate(5deg); opacity: .9; }
.picker { width: min(860px, 100% - 32px); margin: 48px auto 0; display: grid; justify-items: center; gap: 28px; }
/* Theme cards as in the app's Settings: the look's ground, two text lines, a card with the accent dot, the name below. */
.looks-grid { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.look { border: 0; background: none; padding: 0; cursor: pointer; display: grid; gap: 12px; justify-items: center; }
.look-tile {
  position: relative; width: 100%; aspect-ratio: 1.75; border-radius: 22px; background: var(--sw-bg);
  box-shadow: inset 0 0 0 1px #0000001A; transition: box-shadow .3s, transform .4s var(--ease);
}
.look:hover .look-tile { transform: translateY(-3px); }
.look[aria-checked="true"] .look-tile { box-shadow: inset 0 0 0 3px var(--accent); }
.look-tile i, .look-tile b, .look-tile em { position: absolute; border-radius: 99px; }
.look-tile i:nth-child(1) { inset-inline-start: 10%; top: 15%; width: 26%; height: 7%; background: var(--sw-ink); }
.look-tile i:nth-child(2) { inset-inline-start: 10%; top: 28%; width: 40%; height: 5%; background: var(--sw-ink2); }
.look-tile b { inset-inline-start: 10%; top: 46%; width: 66%; height: 30%; border-radius: 10px; background: var(--sw-card); }
.look-tile em { inset-inline-end: 8%; top: 52%; width: 12%; aspect-ratio: 1; border-radius: 50%; background: var(--sw-accent); }
.look-label { display: inline-flex; align-items: center; gap: 7px; font: 600 17px/1.2 var(--text); color: var(--fg); }
.look[aria-checked="true"] .look-label::after {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3 7 10.6l4.6-5' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
[data-tone="light"] [data-pick="original"] { --sw-bg: #F5F1EB; --sw-card: #FFFFFF; --sw-ink: #2A292E; --sw-ink2: #8C857E; --sw-accent: #E62F17; }
[data-tone="dark"] [data-pick="original"] { --sw-bg: #2A292E; --sw-card: #35343A; --sw-ink: #F5F1EB; --sw-ink2: #B5ACA4; --sw-accent: #F2402A; }
[data-tone="light"] [data-pick="saudi"] { --sw-bg: #F5F1EB; --sw-card: #E9E2CD; --sw-ink: #0B3526; --sw-ink2: #4E6A5A; --sw-accent: #165D31; }
[data-tone="dark"] [data-pick="saudi"] { --sw-bg: #062D2D; --sw-card: #0B3D3B; --sw-ink: #F4F6E9; --sw-ink2: #8EAF9B; --sw-accent: #00A35B; }
[data-tone="light"] [data-pick="dusk"] { --sw-bg: #EAD8E8; --sw-card: #FFF7F2; --sw-ink: #2A1740; --sw-ink2: #6A5380; --sw-accent: #AE3409; }
[data-tone="dark"] [data-pick="dusk"] { --sw-bg: #1F1530; --sw-card: #2E2046; --sw-ink: #FFF1E6; --sw-ink2: #BBA0B6; --sw-accent: #FF8A5B; }
[data-tone="light"] [data-pick="winter"] { --sw-bg: #D9E1F6; --sw-card: #F6F8FF; --sw-ink: #0F1635; --sw-ink2: #4E5C88; --sw-accent: #3B4FD8; }
[data-tone="dark"] [data-pick="winter"] { --sw-bg: #0E1226; --sw-card: #1B2142; --sw-ink: #EEF0FF; --sw-ink2: #8E99CC; --sw-accent: #AEBBFF; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--fg) 8%, transparent); min-width: 200px; }
.segmented button { border: 0; border-radius: 999px; background: none; padding: 8px 18px; font-size: 15px; font-weight: 600; color: var(--fg2); cursor: pointer; transition: background-color .3s, color .3s; }
.segmented button[aria-checked="true"] { background: var(--raise); color: var(--fg); box-shadow: 0 2px 8px -3px #0003; }

/* === Chapters: pinned phone beside the text === */
.chapters { width: var(--page); margin: 0 auto; padding: 0 0 120px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
.chapters-phone { position: sticky; top: calc(50vh - 340px); height: 680px; display: grid; place-items: center; }
.chapters-phone .phone { --w: 316px; }
.chapter { min-height: 84vh; display: flex; flex-direction: column; justify-content: center; opacity: .25; transition: opacity .7s var(--ease); }
.chapter.on { opacity: 1; }
.chapter p { color: var(--fg2); font-size: 21px; max-width: 24em; margin: 24px 0 0; }
.chapter .phone { display: none; }

/* === Premium === */
.premium { padding: 160px 0 140px; }
.plans {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 30px max(16px, (100% - 1020px) / 2) 34px;
  scrollbar-width: none; justify-content: safe center;
}
.plans::-webkit-scrollbar { display: none; }
.plan {
  flex: 0 0 min(320px, 82vw); scroll-snap-align: center; position: relative; padding: 28px 28px 26px; border-radius: 30px;
  background: var(--raise); box-shadow: 0 1px 0 var(--line), 0 30px 60px -44px #0007; transition: transform .5s var(--ease), background-color .7s var(--ease);
}
.plan:hover { transform: translateY(-6px); }
.plan .doodle { width: 112px; height: 94px; margin: 0 auto 16px; fill: none; stroke: var(--fg); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.plan.featured { box-shadow: 0 0 0 2px var(--accent), 0 30px 60px -40px #0008; }
.plan.featured .doodle { stroke: var(--accent); }
.plan .badge { position: absolute; top: -14px; inset-inline-start: 50%; translate: -50% 0; padding: 6px 16px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font: 600 14px/1.2 var(--text); white-space: nowrap; }
[dir="rtl"] .plan .badge { translate: 50% 0; }
.plan h3 { font: 700 25px/1.2 var(--display); margin: 0; }
.plan-sub { color: var(--fg2); font-size: 15px; margin: 4px 0 0; }
.plan ul { list-style: none; padding: 16px 0; margin: 16px 0; border-block: 1px solid var(--line); display: grid; gap: 10px; }
.plan li { display: flex; gap: 10px; font-size: 16px; line-height: 1.4; }
.plan li::before { content: ""; flex: none; width: 17px; height: 17px; margin-top: 3px; border-radius: 50%; background: var(--fg3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3 7 10.6l4.6-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.price { margin: 0; font-size: 17px; color: var(--fg2); }
.price strong { font: 700 27px/1.25 var(--display); color: var(--fg); margin-inline-end: 4px; }
.doodle path, .doodle circle { stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 2.4s var(--ease); }
.plans.in .doodle path, .plans.in .doodle circle { stroke-dashoffset: 0; }

/* === Status === */
.status { padding: 160px 0 140px; background: var(--sunk); transition: background-color .7s var(--ease); }
.status-card { width: min(720px, 100% - 32px); margin: 0 auto; padding: 22px 26px 24px; border-radius: 28px; background: var(--raise); box-shadow: 0 1px 0 var(--line), 0 30px 60px -48px #0007; }
.status-top { display: flex; align-items: center; gap: 12px; font-weight: 600; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.status-light { width: 11px; height: 11px; border-radius: 50%; background: var(--fg3); }
.status-card[data-state="operational"] .status-light { background: var(--ok); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 20%, transparent); }
.status-card[data-state="degraded"] .status-light { background: var(--warn); }
.status-card[data-state="outage"] .status-light { background: var(--bad); }
.status-time { margin-inline-start: auto; color: var(--fg2); font-weight: 400; font-size: 15px; }
.status-list { list-style: none; margin: 0 0 18px; padding: 4px 0; }
.status-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.status-list .up { color: var(--fg2); font-variant-numeric: tabular-nums; font-size: 15px; }
.status-list .pill { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.status-list .pill[data-s="degraded"] { background: color-mix(in srgb, var(--warn) 22%, transparent); color: #A06A00; }
.status-list .pill[data-s="outage"] { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.status-list .pill[data-s="nodata"] { background: var(--sunk); color: var(--fg2); }

/* === Download === */
.get { width: var(--page); margin: 0 auto; padding: 140px 0 150px; text-align: center; }
.get-icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 30px; box-shadow: 0 20px 40px -20px #0007; }
.get-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; text-align: start; }
.get-tile { display: grid; gap: 8px; align-content: start; padding: 26px; border-radius: 26px; background: var(--raise); text-decoration: none; box-shadow: 0 1px 0 var(--line); transition: transform .4s var(--ease), box-shadow .3s; }
a.get-tile:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--accent); }
.get-kind { font-size: 15px; color: var(--fg2); font-weight: 600; }
.get-title { font: 700 26px/1.2 var(--display); }
.get-note { color: var(--fg2); font-size: 16px; }
.get-tile.soon { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }

/* === Footer === */
.foot { width: var(--page); margin: 0 auto; padding: 32px 0 48px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; color: var(--fg2); font-size: 14px; }
.foot .wordmark { width: 64px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); }
.foot p { margin: 0; margin-inline-start: auto; }

/* === Narrow screens === */
@media (max-width: 900px) {
  .bar { grid-template-columns: 1fr auto; }
  .bar-links { display: none; }
  .hero { padding-top: 56px; }
  .hero .lede, .section-head .lede { font-size: 15px; }
  .hero .fine { font-size: 13px; }
  .downloads { gap: 10px; flex-wrap: nowrap; }
  .downloads .btn { padding: 12px 15px; gap: 7px; font-size: 15.5px; }
  .hero-stage { margin-top: 48px; }
  .hero-stage .left { transform: translateX(-62%) rotate(-6deg); }
  .hero-stage .right { transform: translateX(62%) rotate(6deg); }
  .looks, .premium, .status { padding: 100px 0 90px; }
  .mac { padding: 90px 0 100px; }
  .mac-desk { height: 560px; border-radius: 28px; }
  .mac-window { width: 230px; transform: translateX(-16%); }
  .mac-desk .phone { --w: 160px; top: 170px; left: calc(50% + 10px); }
  .looks-grid { grid-template-columns: 1fr 1fr; gap: 12px 14px; width: min(290px, 100%); }
  .look { gap: 8px; }
  .look-tile { border-radius: 14px; }
  .look-label { font-size: 15px; }
  .look[aria-checked="true"] .look-label::after { width: 15px; height: 15px; }
  .chapters { grid-template-columns: 1fr; gap: 0; padding: 40px 0 60px; }
  .chapters-phone { display: none; }
  .chapter { min-height: 0; opacity: 1; padding: 56px 0; text-align: center; align-items: center; }
  .chapter p { font-size: 15.5px; }
  .chapter .phone { display: block; --w: min(280px, 70vw); margin-top: 44px; }
  .get-grid { grid-template-columns: 1fr; }
  .status-card { padding: 18px 18px 20px; }
  .status-list li { grid-template-columns: 1fr auto; grid-template-areas: "name pill" "up pill"; gap: 2px 12px; }
  .status-list li > span:first-child { grid-area: name; }
  .status-list .up { grid-area: up; font-size: 14px; }
  .status-list .pill { grid-area: pill; }
  .foot p { margin-inline-start: 0; }
}

/* === Reduced motion: no opening, no fades, drawings already drawn === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .doodle path, .doodle circle { stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
}
