/* phnxmove.com
 *
 * Every token is the app's: colours from AppPalette (lib/core/constants/
 * app_colors.dart), radii from AppRadii, spacing from AppSpacing, curves and
 * durations from the widgets that move. The type ramp is DESIGN.md's, the
 * sizes it had before the app scaled them down for a phone.
 * test/website_test.dart fails when a colour here drifts from the app.
 */

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* ---- tokens ------------------------------------------------------------ */

:root {
  color-scheme: light;
  /* AppPalette.light: green leads, the blaze red is second. */
  --bg: #FFFFFF;
  --surface-low: #F6FAF7;
  --surface: #F0F7F2;
  --surface-high: #E6F1E9;
  --surface-highest: #DAEADF;
  --stroke: #D3E4D8;
  --outline-variant: #C4D8C9;
  --text: #14261B;
  --muted: #4A6352;
  --action: #248A4E;
  --on-action: #FFFFFF;
  --action-glow: #248A4E26;
  --ember: #D9480F;
  --on-ember: #FFFFFF;
  --gold: #B8860B;
  --on-gold: #FFFFFF;
  --success: #10B981;
  --warning: #EF4444;
  --info: #3B82F6;

  /* The heat under the icon (PhnxShapes.blaze), the same in both themes. */
  --heat: rgb(255 61 0 / 0.08);

  /* AppRadii */
  --r-sm: 4px;
  --r-base: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* AppSpacing: a 4px grid */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --margin: 16px;
  --section: 64px;

  /* Flutter's curves, as cubic-beziers */
  --ease-out: cubic-bezier(0, 0, 0.58, 1);
  --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-out-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);

  /* Neither Latin family has Arabic: the device's Arabic face fills in, as
     in the app. */
  --font-arabic: "Segoe UI", "SF Arabic", "Geeza Pro", "Noto Sans Arabic",
    "Noto Kufi Arabic", Tahoma, system-ui, sans-serif;
  --font-head: "Montserrat", var(--font-arabic);
  --font-body: "Inter", var(--font-arabic);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  /* AppPalette.dark: Fire & Ash. */
  --bg: #121215;
  --surface-low: #17171C;
  --surface: #1C1C22;
  --surface-high: #24242B;
  --surface-highest: #2C2C35;
  --stroke: #2C2C35;
  --outline-variant: #2C2C35;
  --text: #ECECEF;
  --muted: #A1A1AA;
  --action: #FF3D00;
  --on-action: #FFFFFF;
  --action-glow: #FF3D0033;
  --ember: #FF6D00;
  --on-ember: #1F0B00;
  --gold: #FFC107;
  --on-gold: #261A00;
  --success: #10B981;
  --warning: #EF4444;
  --info: #3B82F6;
  --heat: rgb(255 61 0 / 0.16);
}

@media (min-width: 768px) {
  :root {
    --margin: 48px;
    --section: 96px;
  }
}

/* ---- base -------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/24px var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html.i18n-pending body {
  visibility: hidden;
}

/* The theme switch lerps, as the app's does. */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition: background-color 260ms var(--ease-out),
    border-color 260ms var(--ease-out), color 260ms var(--ease-out),
    fill 260ms var(--ease-out), box-shadow 260ms var(--ease-out) !important;
}

img,
svg,
canvas {
  display: block;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection {
  background: color-mix(in srgb, var(--ember) 30%, transparent);
}

/* Joined script: spacing its letters apart breaks the joins. */
html[lang="ar"] body,
html[lang="ar"] body * {
  letter-spacing: 0 !important;
}

html[lang="ar"] p,
html[lang="ar"] li {
  line-height: 1.75;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  inset-inline-start: var(--s-md);
  top: -48px;
  z-index: 100;
  padding: var(--s-sm) var(--s-md);
  border-radius: var(--r-base);
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
  text-decoration: none;
  transition: top 160ms var(--ease-out);
}

.skip:focus {
  top: var(--s-sm);
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--margin);
}

/* RTL turns arrows round. */
[dir="rtl"] .flip {
  transform: scaleX(-1);
}

/* ---- type -------------------------------------------------------------- */

.overline {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  color: var(--ember);
  font: 600 13px/18px var(--font-body);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

h2 {
  margin-top: var(--s-md);
  font: 700 clamp(30px, 4.2vw, 48px) / 1.15 var(--font-head);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h3 {
  font: 600 20px/26px var(--font-head);
}

.lead {
  margin-top: var(--s-md);
  max-width: 34em;
  color: var(--muted);
  font-size: 18px;
  line-height: 28px;
  text-wrap: pretty;
}

/* ---- the wordmark ------------------------------------------------------ */

.wordmark {
  height: 100%;
  width: auto;
  overflow: visible;
  color: var(--text);
}

.wordmark path:not([fill]) {
  fill: currentColor;
}

/* The fire takes the gradient that suits the ground under it. */
.fire-d {
  display: none;
}

:root[data-theme="dark"] .fire-d {
  display: inline;
}

:root[data-theme="dark"] .fire-l {
  display: none;
}

/* ---- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  min-height: 48px;
  padding: 12px var(--s-lg);
  border: 1px solid transparent;
  border-radius: var(--r-base);
  font: 600 15px/20px var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), filter 160ms var(--ease-out),
    background-color 160ms var(--ease-out), box-shadow 250ms var(--ease-out);
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn-primary {
  background: var(--action);
  color: var(--on-action);
  box-shadow: 0 4px 20px var(--action-glow);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 28px var(--action-glow);
}

.btn-outline {
  border-color: var(--action);
  color: var(--action);
}

.btn-outline:hover {
  background: color-mix(in srgb, var(--action) 8%, transparent);
}

.btn-ghost {
  border-color: var(--stroke);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: var(--surface-high);
}

.handle {
  unicode-bidi: isolate;
}

/* ---- header ------------------------------------------------------------ */

.header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  height: 64px;
  border-bottom: 1px solid transparent;
  transition: background-color 250ms var(--ease-out),
    border-color 250ms var(--ease-out);
}

.header.scrolled {
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom-color: var(--outline-variant);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.header-row {
  display: flex;
  align-items: center;
  gap: var(--s-lg);
  height: 100%;
}

.brand {
  display: block;
  height: 22px;
  flex: none;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 250ms var(--ease-out),
    transform 250ms var(--ease-out-cubic);
}

.brand-on .brand {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav {
  display: none;
  gap: var(--s-lg);
}

.nav a {
  color: var(--muted);
  font: 600 14px/20px var(--font-body);
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

.nav a:hover {
  color: var(--text);
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }
}

.header-tools {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  margin-inline-start: auto;
}

/* The language picker: a segmented control, the selected one in ember. */
.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-full);
  background: var(--surface);
}

.seg button {
  position: relative;
  z-index: 1;
  min-width: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--r-full);
  background: none;
  color: var(--muted);
  font: 600 13px/18px var(--font-body);
  cursor: pointer;
  transition: color 160ms var(--ease-out);
}

.seg button:hover {
  color: var(--text);
}

.seg button[aria-pressed="true"] {
  color: var(--on-ember);
}

.seg button[lang="ar"] {
  font-family: var(--font-arabic);
}

.seg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  border-radius: var(--r-full);
  background: var(--ember);
}

.seg.ready .seg-thumb {
  transition: left 260ms var(--ease-out-cubic), width 260ms var(--ease-out-cubic);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out);
}

.icon-btn:hover {
  background: var(--surface-high);
}

.icon-btn svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: opacity 250ms var(--ease-out), transform 420ms var(--ease-out-back);
}

.theme-btn .i-moon,
:root[data-theme="dark"] .theme-btn .i-sun {
  opacity: 1;
  transform: none;
}

.theme-btn .i-sun,
:root[data-theme="dark"] .theme-btn .i-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

/* ---- hero: the welcome screen ----------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 112px 72px;
  overflow: hidden;
  text-align: center;
}

/* The X behind everything, its fire rising corner to corner, dimmed. */
.hero-x {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-x svg {
  height: 115%;
  width: auto;
  max-width: none;
  overflow: visible;
}

.x-fall {
  fill: var(--text);
  opacity: 0.098; /* 0.28 × 0.35, as the app paints it */
}

.x-rise {
  opacity: 0.28;
}

.x-glow {
  opacity: 0.85;
}

/* Darker where the words are, so they read over the strokes. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 62%, var(--heat), transparent 70%),
    linear-gradient(to bottom,
      color-mix(in srgb, var(--bg) 0%, transparent) 0%,
      color-mix(in srgb, var(--bg) 15%, transparent) 35%,
      color-mix(in srgb, var(--bg) 55%, transparent) 75%,
      var(--bg) 100%);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* The name over the slogan. The slogan spans the wordmark exactly: its first
   letter under the P, its last under the X (PhnxSlogan in the app). */
.lockup {
  --wm-h: clamp(76px, 13vw, 168px);
  width: calc(var(--wm-h) * 335 / 122);
  margin: 0;
  direction: ltr;
  font-size: inherit;
}

.lockup .wordmark {
  width: 100%;
  height: auto;
}

.slogan {
  display: block;
  width: calc(var(--wm-h) * 333 / 122);
  margin-top: calc(var(--wm-h) * 16 / 61);
  overflow: visible;
  color: color-mix(in srgb, var(--text) 75%, transparent);
  font: 600 calc(var(--wm-h) * 0.19) / 1.2 var(--font-body);
  text-align: start;
  text-shadow: 0 0 16px var(--bg);
  text-transform: uppercase;
  white-space: nowrap;
}

html[lang="ar"] .slogan {
  font-size: calc(var(--wm-h) * 0.22);
}

.hero-lead {
  max-width: 30em;
  margin-top: clamp(40px, 6vw, 64px);
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: var(--s-xl);
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--s-lg);
  color: var(--muted);
  font: 400 14px/20px var(--font-body);
}

/* Ember is what is live: something still on its way. */
.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--ember);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ember);
  animation: pulse 1400ms var(--ease-out) infinite;
}

@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 0.6;
  }
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* ---- sections ---------------------------------------------------------- */

.section {
  padding-block: var(--section);
}

.section-head {
  max-width: 760px;
  margin-bottom: var(--s-xl);
}

@media (min-width: 768px) {
  .section-head {
    margin-bottom: 48px;
  }
}

.split {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }

  .split-rev .split-media {
    order: -1;
  }
}

.ticks {
  display: grid;
  gap: 12px;
  margin-top: var(--s-xl);
  padding: 0;
  list-style: none;
}

.ticks li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.tick {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
}

.tick-gold {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold);
}

.tick svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ---- the phone --------------------------------------------------------- */

.phone {
  position: relative;
  width: min(320px, 84vw);
  aspect-ratio: 9 / 18.5;
  margin-inline: auto;
  padding: 10px;
  border-radius: 46px;
  background: #0C0C0F;
  box-shadow: 0 0 0 1px var(--stroke),
    0 40px 80px -24px color-mix(in srgb, var(--action) 40%, transparent),
    0 24px 48px -24px rgb(0 0 0 / 0.35);
  font-size: 13px;
  line-height: 18px;
}

.phone::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--heat), transparent);
}

.ph-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 36px;
  background: var(--bg);
  color: var(--text);
}

.ph-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding-inline: 26px;
  font: 600 13px/1 var(--font-body);
}

.ph-island {
  position: absolute;
  left: 50%;
  top: 10px;
  width: 84px;
  height: 22px;
  border-radius: var(--r-full);
  background: #0C0C0F;
  transform: translateX(-50%);
}

.ph-icons {
  display: flex;
  gap: 4px;
}

.ph-icons i {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.85;
}

.ph-icons i:first-child {
  width: 10px;
}

.ph-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 12px;
  border-bottom: 1px solid var(--outline-variant);
}

.ph-bar > svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: currentColor;
}

.ph-title {
  display: grid;
  flex: 1;
  min-width: 0;
}

.ph-title b {
  overflow: hidden;
  font: 600 15px/20px var(--font-head);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-title small {
  color: var(--muted);
  font-size: 11px;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
}

.ph-finish {
  padding: 7px 12px;
  border-radius: var(--r-base);
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
  font-size: 12px;
}

.ph-body {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.ph-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 12px 6px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
}

.ph-stats b {
  display: block;
  font: 800 20px/1 var(--font-head);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.ph-stats b em {
  margin-inline-start: 2px;
  color: var(--muted);
  font: 600 10px/1 var(--font-body);
  font-style: normal;
  letter-spacing: 0;
}

.ph-stats small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ph-card {
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.ph-ex {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ph-ex-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: var(--r-base);
  background: color-mix(in srgb, var(--ember) 16%, transparent);
  color: var(--ember);
}

.ph-ex-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ph-next {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ph-next small {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ph-ex b,
.ph-next b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 600 14px/18px var(--font-head);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Gold is what was earned. */
.ph-pr {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 250ms var(--ease-out), transform 420ms var(--ease-out-back);
}

.ph-pr svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.phone.pr .ph-pr {
  opacity: 1;
  transform: none;
}

.ph-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 32px;
  align-items: center;
  min-height: 34px;
  margin-top: 4px;
  padding-inline: 8px;
  border: 1.5px solid transparent;
  border-radius: var(--r-base);
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: background-color 250ms var(--ease-out),
    border-color 250ms var(--ease-out), opacity 250ms var(--ease-out);
}

.ph-head {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ph-row.is-next {
  opacity: 0.45;
}

.ph-row.is-live {
  border-color: var(--ember);
  background: color-mix(in srgb, var(--ember) 8%, transparent);
}

.ph-check {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--r-full);
  color: #FFFFFF;
  transition: background-color 250ms var(--ease-out), border-color 250ms var(--ease-out);
}

.ph-check svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 160ms var(--ease-out), transform 420ms var(--ease-out-back);
}

/* Emerald: a set done. */
.ph-row.is-done .ph-check {
  border-color: var(--success);
  background: var(--success);
}

.ph-row.is-done .ph-check svg {
  opacity: 1;
  transform: none;
}

.ph-rest {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--info) 12%, transparent);
  color: var(--info);
  font-weight: 600;
}

[dir="rtl"] .ph-rest {
  padding: 6px 6px 6px 14px;
}

.ph-rest b {
  min-width: 3ch;
  font-variant-numeric: tabular-nums;
}

.ring {
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke-width: 4;
}

.ring .track {
  stroke: color-mix(in srgb, currentColor 22%, transparent);
}

.ring .fill {
  stroke: currentColor;
  stroke-dasharray: 100;
  stroke-linecap: round;
}

.ph-ring {
  width: 26px;
  height: 26px;
}

.ph-ring .fill {
  stroke-dashoffset: 0;
}

.ph-foot {
  padding: 12px;
}

.ph-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border: 1px solid var(--action);
  border-radius: var(--r-base);
  color: var(--action);
  font-weight: 600;
}

.ph-add svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ---- bento ------------------------------------------------------------- */

.bento {
  display: grid;
  gap: var(--s-md);
}

@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(6, 1fr);
  }

  .c-scan,
  .c-ai {
    grid-column: span 3;
  }

  .c-food,
  .c-coach,
  .c-health {
    grid-column: span 2;
  }

  .c-privacy {
    grid-column: span 6;
  }
}

@media (min-width: 1100px) {
  .c-scan {
    grid-column: span 4;
  }

  .c-ai {
    grid-column: span 2;
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
  padding: var(--s-lg);
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: background-color 250ms var(--ease-out);
}

/* Lift by brightening, like a backlit console, not by casting a shadow. */
.card:hover {
  background: var(--surface-high);
}

.card p {
  color: var(--muted);
}

.card > h3 + p {
  margin-top: calc(var(--s-sm) - var(--s-md));
}

.card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--r-base);
  background: color-mix(in srgb, var(--ember) 16%, transparent);
  color: var(--ember);
}

.card-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.viz {
  position: relative;
  min-height: 200px;
  margin: calc(var(--s-lg) * -1) calc(var(--s-lg) * -1) 0;
  overflow: hidden;
  border-bottom: 1px solid var(--stroke);
  background: var(--surface-low);
}

/* Phoenix Sense: a plate under the reticle, its foods found one by one. */
.scan-viz {
  display: grid;
  place-items: center;
  min-height: 240px;
}

.plate {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 10px var(--surface-high), 0 18px 40px -16px rgb(0 0 0 / 0.35);
}

.food {
  position: absolute;
  border-radius: 50%;
}

.food-1 {
  left: 18%;
  top: 22%;
  width: 46%;
  height: 40%;
  background: radial-gradient(circle at 40% 35%, #F7F3E8, #E9E1CC);
}

.food-2 {
  right: 14%;
  top: 30%;
  width: 40%;
  height: 34%;
  border-radius: 46% 54% 40% 60%;
  background: radial-gradient(circle at 35% 30%, #D9944A, #A85F22);
}

.food-3 {
  left: 30%;
  bottom: 12%;
  width: 34%;
  height: 28%;
  background: radial-gradient(circle at 40% 35%, #EBD9A6, #CDB16D);
}

.reticle {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 200px;
  height: 200px;
  translate: -50% -50%;
}

.reticle i {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--ember);
}

.reticle i:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-top-left-radius: var(--r-md);
}

.reticle i:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-top-right-radius: var(--r-md);
}

.reticle i:nth-child(3) {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: var(--r-md);
}

.reticle i:nth-child(4) {
  right: 0;
  bottom: 0;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: var(--r-md);
}

.scanline {
  position: absolute;
  inset-inline: calc(50% - 90px);
  top: calc(50% - 100px);
  height: 2px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
  box-shadow: 0 0 12px var(--ember);
  opacity: 0;
}

.is-live .reticle {
  animation: breathe 1400ms var(--ease-in-out) infinite alternate;
}

.is-live .scanline {
  animation: sweep 2800ms var(--ease-in-out) infinite;
}

@keyframes breathe {
  to {
    scale: 0.94;
  }
}

@keyframes sweep {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(200px);
    opacity: 0;
  }
}

.found {
  position: absolute;
  inset-inline-end: var(--s-md);
  bottom: var(--s-md);
  display: grid;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.found li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition: opacity 250ms var(--ease-out) calc(600ms + var(--i) * 260ms),
    transform 420ms var(--ease-out-back) calc(600ms + var(--i) * 260ms);
}

.found li b {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.found li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.in .found li {
  opacity: 1;
  transform: none;
}

/* Melqart: the question, a pause, the answer. */
.chat-viz {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: var(--s-lg);
}

.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  font-size: 14px;
  line-height: 20px;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 250ms var(--ease-out), transform 420ms var(--ease-out-back);
}

.bubble.me {
  align-self: flex-end;
  border-end-end-radius: var(--r-sm);
  background: var(--action);
  color: var(--on-action);
  transition-delay: 300ms;
}

.bubble.ai {
  display: flex;
  gap: 8px;
  align-self: flex-start;
  border: 1px solid var(--stroke);
  border-end-start-radius: var(--r-sm);
  background: var(--bg);
  transition-delay: 1700ms;
}

.bubble.ai svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  fill: var(--ember);
}

.in .bubble {
  opacity: 1;
  transform: none;
}

.typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  height: 0;
  padding: 0 14px;
  overflow: hidden;
  opacity: 0;
}

.in .typing {
  animation: typing 1000ms 700ms both;
}

@keyframes typing {
  0%,
  100% {
    height: 0;
    padding-block: 0;
    opacity: 0;
  }
  15%,
  85% {
    height: 36px;
    padding-block: 14px;
    opacity: 1;
  }
}

.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot 900ms var(--ease-in-out) infinite;
}

.typing i:nth-child(2) {
  animation-delay: 150ms;
}

.typing i:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes dot {
  50% {
    transform: translateY(-4px);
    opacity: 0.5;
  }
}

/* The library's size, counted up. */
.stat {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-sm);
  margin-block: var(--s-sm);
}

.stat b {
  font: 800 clamp(48px, 6vw, 64px) / 1 var(--font-head);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--muted);
  font-weight: 600;
}

/* What each coach sees: switches, ember when on, as in the app. */
.toggles {
  display: grid;
  gap: 2px;
  margin-bottom: var(--s-sm);
  padding: 0;
  list-style: none;
}

.toggles li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  padding-block: 8px;
  border-bottom: 1px solid var(--stroke);
  font-weight: 500;
}

.toggles li:last-child {
  border-bottom: 0;
}

.switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--surface-highest);
  transition: background-color 250ms var(--ease-out);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 250ms var(--ease-out-cubic);
}

.switch.on {
  background: var(--ember);
}

.switch.on::after {
  background: var(--on-ember);
  transform: translateX(16px);
}

[dir="rtl"] .switch::after {
  left: auto;
  right: 3px;
}

[dir="rtl"] .switch.on::after {
  transform: translateX(-16px);
}

/* Turned off as the card comes in: the member's choice. */
.in .switch.turns-off {
  background: var(--surface-highest);
  transition-delay: 900ms;
}

.in .switch.turns-off::after {
  background: var(--bg);
  transform: none;
  transition-delay: 900ms;
}

.rings {
  display: flex;
  gap: var(--s-lg);
  margin-bottom: var(--s-sm);
}

.rings figure {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.rings .ring {
  width: 76px;
  height: 76px;
}

.rings .ring circle {
  stroke-width: 3.4;
}

.rings .fill {
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1100ms var(--ease-out-cubic) 200ms;
}

.in .rings .fill {
  stroke-dashoffset: calc(100 - var(--v));
}

.rings b {
  position: absolute;
  top: 0;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  color: var(--text);
  font: 800 22px/1 var(--font-head);
  letter-spacing: -0.04em;
}

.rings figcaption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.ring-sleep {
  color: var(--info);
}

.ring-energy {
  color: var(--ember);
}

.c-privacy {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-md) var(--s-lg);
}

.c-privacy > div {
  flex: 1 1 320px;
}

.c-privacy p {
  margin-top: var(--s-sm);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--action);
  font-weight: 600;
  text-decoration: none;
}

.link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: translate 160ms var(--ease-out);
}

.link:hover svg {
  translate: 3px 0;
}

[dir="rtl"] .link:hover svg {
  translate: -3px 0;
}

/* ---- coaches ----------------------------------------------------------- */

.coach-grid {
  display: grid;
  gap: var(--s-lg);
  margin-top: var(--s-xl);
}

@media (min-width: 560px) {
  .coach-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.coach-item h3 {
  margin-top: 12px;
  font-size: 17px;
  line-height: 24px;
}

.coach-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 22px;
}

.dash {
  width: min(420px, 100%);
  margin-inline: auto;
  padding: var(--s-lg);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--action) 40%, transparent);
}

.dash:hover {
  background: var(--surface);
}

.dash-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-md);
}

.dash-head b {
  font: 700 22px/28px var(--font-head);
}

.dash-head span {
  color: var(--ember);
  font-size: 13px;
  font-weight: 600;
}

.dash-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dash-stats div {
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--bg);
}

.dash-stats b {
  display: block;
  font: 800 32px/1 var(--font-head);
  letter-spacing: -0.04em;
}

.dash-stats small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dash-list {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.dash-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--bg);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 250ms var(--ease-out) calc(300ms + var(--i) * 120ms),
    transform 420ms var(--ease-out-cubic) calc(300ms + var(--i) * 120ms);
}

[dir="rtl"] .dash-list li {
  transform: translateX(12px);
}

.in .dash-list li {
  opacity: 1;
  transform: none;
}

.dash-list div {
  display: grid;
  flex: 1;
  min-width: 0;
}

.dash-list b {
  font-weight: 600;
}

.dash-list small {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-highest);
  color: var(--text);
  font: 700 15px/1 var(--font-head);
}

.dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
}

.dot-live {
  background: var(--ember);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ember) 20%, transparent);
}

.dot-warn {
  background: var(--warning);
}

.dot-done {
  background: var(--success);
}

/* ---- closing call ------------------------------------------------------ */

.cta {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(48px, 8vw, 96px) var(--s-lg);
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  background: var(--surface);
  text-align: center;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(70% 60% at 50% 100%, var(--heat), transparent 70%);
}

.flame {
  width: 84px;
  height: 120px;
}

.cta h2 {
  margin-top: var(--s-lg);
  font-size: clamp(36px, 6vw, 64px);
}

.cta .lead {
  margin-inline: auto;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: var(--s-xl);
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--bg);
  font: 600 16px/20px var(--font-body);
}

[dir="rtl"] .store {
  padding: 8px 18px 8px 10px;
}

.store small {
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--ember) 14%, transparent);
  color: var(--ember);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.cta .btn {
  margin-top: var(--s-lg);
}

/* ---- footer ------------------------------------------------------------ */

.footer {
  padding-block: 48px;
  border-top: 1px solid var(--outline-variant);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-lg) 48px;
}

.footer .wordmark {
  height: 22px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm) var(--s-lg);
}

.footer-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

.footer-links a:hover {
  color: var(--text);
}

.copy {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 13px;
}

/* ---- legal pages ------------------------------------------------------- */

.legal-main {
  padding-block: 112px var(--section);
}

.legal {
  display: grid;
  gap: 48px;
}

@media (min-width: 1024px) {
  .legal {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 64px;
  }
}

.toc {
  display: none;
}

@media (min-width: 1024px) {
  .toc {
    position: sticky;
    top: 96px;
    display: block;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow: auto;
  }
}

.toc ol {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
  border-inline-start: 1px solid var(--outline-variant);
}

.toc a {
  display: block;
  margin-inline-start: -1px;
  padding: 6px 12px;
  border-inline-start: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.toc a:hover {
  color: var(--text);
}

.toc a.on {
  border-inline-start-color: var(--ember);
  color: var(--text);
}

.prose {
  max-width: 72ch;
  font-size: 16px;
  line-height: 27px;
}

.prose h1 {
  margin-top: var(--s-lg);
  font: 700 clamp(34px, 5vw, 48px) / 1.15 var(--font-head);
  letter-spacing: -0.02em;
}

.prose h2 {
  margin-top: 48px;
  scroll-margin-top: 96px;
  font-size: 24px;
  line-height: 32px;
}

.prose p,
.prose ul {
  margin-top: var(--s-md);
}

.prose h1 + p {
  color: var(--muted);
  font-size: 18px;
  line-height: 28px;
}

.prose ul {
  display: grid;
  gap: 10px;
  padding-inline-start: 22px;
}

.prose li::marker {
  color: var(--ember);
}

.prose strong {
  font-weight: 600;
}

.prose a {
  color: var(--action);
  font-weight: 600;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font: 600 14px/20px var(--font-body);
  text-decoration: none;
}

.back:hover {
  color: var(--text);
}

.back svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.legal-note {
  margin-top: var(--s-lg);
  padding: 12px var(--s-md);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.legal-note:empty {
  display: none;
}

/* ---- not found --------------------------------------------------------- */

.lost {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--s-md);
  min-height: 100vh;
  min-height: 100svh;
  padding: 112px var(--margin) 72px;
  text-align: center;
}

.lost h1 {
  font: 700 clamp(30px, 4.2vw, 48px) / 1.15 var(--font-head);
  letter-spacing: -0.02em;
}

.lost p {
  color: var(--muted);
}

.lost .btn {
  margin-top: var(--s-md);
}

/* ---- motion ------------------------------------------------------------ */

/* Sections come in as they scroll into view: 420 ms, ease-out-cubic, a
   little apart. Without JavaScript everything is simply there. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms var(--ease-out-cubic) calc(var(--i, 0) * 70ms),
    transform 420ms var(--ease-out-cubic) calc(var(--i, 0) * 70ms);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* The welcome, played on load: the ash leg settles, the fire leg rises from
   its foot to its tip, then the name, letter by letter, and the slogan. */
.js .x-fall {
  animation: fade-in 600ms var(--ease-out) both;
}

.js .x-rise {
  animation: rise 1100ms var(--ease-out-cubic) 150ms both;
}

.js .x-glow {
  animation: flicker 1400ms var(--ease-in-out) 1300ms infinite alternate;
}

.js .wordmark-hero .wm-p,
.js .wordmark-hero .wm-h,
.js .wordmark-hero .wm-n {
  animation: letter 420ms var(--ease-out-cubic) both;
}

.js .wordmark-hero .wm-p {
  animation-delay: 350ms;
}

.js .wordmark-hero .wm-h {
  animation-delay: 430ms;
}

.js .wordmark-hero .wm-n {
  animation-delay: 510ms;
}

.js .wordmark-hero .wm-fire {
  animation: rise 900ms var(--ease-out-cubic) 600ms both;
}

.js .wordmark-hero .wm-shard {
  animation: fade-in 420ms var(--ease-out) 800ms both;
}

.js .wordmark-hero .wm-spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: spark 420ms var(--ease-out-back) 1150ms both;
}

.js .hero .slogan {
  animation: lift 420ms var(--ease-out-cubic) 1250ms both;
}

.js .hero-lead {
  animation: lift 420ms var(--ease-out-cubic) 1400ms both;
}

.js .hero-actions {
  animation: lift 420ms var(--ease-out-cubic) 1500ms both;
}

.js .hero .soon {
  animation: lift 420ms var(--ease-out-cubic) 1600ms both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(-20% -20% 0 -20%);
  }
}

@keyframes flicker {
  to {
    opacity: 0.55;
  }
}

@keyframes letter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes spark {
  from {
    opacity: 0;
    transform: scale(0);
  }
}

@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.lang-swap main,
.lang-swap .footer {
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
}

main,
.footer {
  transition: opacity 160ms var(--ease-out);
}

/* Wherever the device asks for less motion, everything is still. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .found li,
  .bubble,
  .dash-list li {
    opacity: 1;
    transform: none;
  }

  .typing {
    display: none;
  }
}
