/*
  Wird web styles. Values mirror docs/design/tokens.json (Dawn light, Dusk dark).
  The page follows the system appearance, like the app; there is no theme switch.
*/

:root {
  color-scheme: light dark;

  --canvas: #f2ebe0;
  --surface: #fbf7f0;
  --surface-raised: #ede5d6;
  --sky: #f3dfcb;
  --hairline: #dcd5c8;
  --ink: #1b2638;
  --ink-secondary: #545d70;
  --ink-tertiary: #596274;
  --action: #1b2638;
  --on-action: #fbf7f0;
  --tint: #1b26380f;
  --accent-text: #2f4c78;
  --gold: #7f5d16;
  --gold-fill: #ad8429;
  --gold-soft: #f5ecd8;
  --leaf: #55704e;
  --leaf-deep: #445c3e;
  --leaf-text: #445c3e; /* leaf as small text: 5.7:1 on sky, where leaf is 4.3:1 */
  --bark: #8a8576;
  --soil: #d9cfbe;
  --water: #6e8bb0;
  --rest-neutral: #d6cfc2;
  --amber: #8f5410;
  --amber-soft: #f6e4c8;
  --leaf-dry: #a08a55;
  --blossom: #e9d3cc;
  --shadow-card: 0 0 0 0.5px #1b263814, 0 1px 3px #1b26380d;
  --shadow-lift: 0 0 0 0.5px #1b263814, 0 14px 28px -18px #1b263840;
  --glass: #fbf7f0b8;
  --glass-edge: #1b26381a;

  --font-display: Futura, "Futura PT", Jost, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --font-quran: "Amiri Quran", Amiri, serif;

  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-screen: 40px;

  --ease-settle: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);

  --gutter: 20px;
  --page: 1120px;
  --measure: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f141c;
    --surface: #161c26;
    --surface-raised: #1d2430;
    --sky: #1c2433;
    --hairline: #2b313a;
    --ink: #eceef1;
    --ink-secondary: #9aa3b0;
    --ink-tertiary: #8c95a3;
    --action: #eceef1;
    --on-action: #0f141c;
    --tint: #ffffff14;
    --accent-text: #9db4d6;
    --gold: #d4b26a;
    --gold-fill: #d4b26a;
    --gold-soft: #2a2720;
    --leaf: #7f9c8e;
    --leaf-deep: #5f7f70;
    --leaf-text: #7f9c8e;
    --bark: #8e9a93;
    --soil: #2a2f36;
    --water: #9db4d6;
    --rest-neutral: #333b47;
    --amber: #e3a857;
    --amber-soft: #3a2e1c;
    --leaf-dry: #bca676;
    --blossom: #eadbd3;
    --shadow-card: none;
    --shadow-lift: 0 0 0 0.5px #ffffff1f;
    --glass: #161c26b8;
    --glass-edge: #ffffff14;
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem; /* 17px, Apple's default reading size */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

[hidden] { display: none !important; }

h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
  text-wrap: balance;
}

p, li, dd { text-wrap: pretty; }

a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

::selection { background: var(--gold-soft); color: var(--ink); }

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-96px);
  transition: transform 200ms var(--ease-out);
}

.skip-link:focus { transform: none; }

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

/* Layout */

.wrap {
  width: 100%;
  max-width: calc(var(--page) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

.section { padding-block: 64px; }
.section--tight { padding-block: 48px; }

@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .section { padding-block: 96px; }
  .section--tight { padding-block: 64px; }
}

.measure { max-width: var(--measure); }

/* Type */

.display {
  font-size: 2.25rem;   /* 36 */
  line-height: 2.5rem;
}

.title {
  font-size: 1.875rem;  /* 30 */
  line-height: 2.25rem;
}

.heading {
  font-size: 1.25rem;   /* 20 */
  line-height: 1.75rem;
}

/* Manual breaks are tuned for wide layouts; on phones, balanced wrapping reads better. */
@media (max-width: 767px) {
  .display br, .title br { display: none; }
}

@media (min-width: 768px) {
  .display { font-size: 3rem; line-height: 1.08; }
  .title { font-size: 2.25rem; line-height: 2.5rem; }
  .heading { font-size: 1.5rem; line-height: 2rem; }
}

@media (min-width: 1440px) {
  .display { font-size: 3.75rem; line-height: 1.05; }
}

.lede {
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--ink-secondary);
}

@media (min-width: 768px) {
  .lede { font-size: 1.25rem; line-height: 1.85rem; }
}

.label {
  font-size: 0.8125rem; /* 13, sentence case, never all caps */
  line-height: 1.125rem;
  color: var(--ink-secondary);
}

.label--gold { color: var(--gold); }
.label--leaf { color: var(--leaf-text); }

.secondary { color: var(--ink-secondary); }

.quran {
  font-family: var(--font-quran);
  direction: rtl;
  font-size: 1.75rem;
  line-height: 2.2;
  color: var(--ink);
}

/* Buttons. One filled button per view; everything else is tint or text. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius-md);
  font: 600 1rem/1.25rem var(--font-text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, opacity 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

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

.btn--action { background: var(--action); color: var(--on-action); }
.btn--tint { background: var(--tint); color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .btn--action:hover { opacity: 0.9; }
  .btn--tint:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
}

.btn--small { min-height: 44px; padding: 8px 16px; font-size: 0.875rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

.text-link svg { transition: transform 200ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .text-link:hover svg { transform: translateX(2px); }
}

/* App Store call to action.
   Until the App Store link is set in wird.js, a quiet "coming soon" note shows instead of the badge.
   The badge itself must be Apple's official artwork, unaltered (see website/README.md). */

.store {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.store__badge {
  display: inline-block;
  border-radius: 8px;
  line-height: 0;
  transition: transform 160ms var(--ease-out);
}

.store__badge:active { transform: scale(0.97); }

.store__badge img { height: 48px; width: auto; }

.store__soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--tint);
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
}

.store__note {
  font-size: 0.9375rem;
  color: var(--ink-secondary);
}

/* Navigation: a floating material bar, the one translucent layer on the page */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px var(--gutter) 0;
  pointer-events: none;
}

.nav__bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: var(--page);
  margin-inline: auto;
  padding: 6px 6px 6px 12px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 0 0 0.5px var(--glass-edge);
  view-transition-name: nav;
}

/* Scroll edge: the bar reads as floating only once content passes beneath it. */
@supports (animation-timeline: scroll()) {
  .nav__bar {
    animation: nav-edge linear both;
    animation-timeline: scroll(root);
    animation-range: 0 160px;
  }
}

@keyframes nav-edge {
  to { box-shadow: inset 0 0 0 0.5px var(--glass-edge), 0 10px 28px -14px #0f141c59; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav__bar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
}

.app-icon {
  border-radius: 22.37%;
  box-shadow: 0 0 0 0.5px var(--glass-edge);
  flex: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
}

.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-secondary);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease;
}

.nav__links a[aria-current="page"] { color: var(--ink); background: var(--tint); }

@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover { color: var(--ink); }
}

.nav__cta { display: none; }

@media (min-width: 720px) {
  .nav__cta { display: inline-flex; }
}

@media (max-width: 420px) {
  .brand__word { display: none; }
  .nav__links a { padding: 0 10px; }
}

/* Cards and lists */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card--pad { padding: 24px; }

.grouped {
  list-style: none;
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.grouped > li { padding: 16px 20px; }
.grouped > li + li { border-top: 0.5px solid var(--hairline); }

/* App screen, drawn from the redesign files in docs/design/screens.
   Shown without a device frame: Apple asks that device imagery come only from its own artwork. */

.screen {
  width: 100%;
  max-width: 360px;
  margin-inline: auto;
  padding: 24px 16px 16px;
  border-radius: var(--radius-screen);
  background: var(--canvas);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 0 0 0.5px var(--glass-edge), 0 24px 48px -24px #0f141c40;
  user-select: none;
}

.screen--raised { background: var(--canvas); }

.screen__greeting { font-family: var(--font-display); font-weight: 500; font-size: 1.75rem; line-height: 2rem; }

.screen .meta { font-size: 0.8125rem; color: var(--ink-secondary); }

.tree-card {
  background: linear-gradient(180deg, var(--sky) 0%, var(--surface) 58%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 16px 16px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tree-card__row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.tree-card__line {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1875rem;
  line-height: 1.5rem;
  margin-top: 4px;
}

.growth {
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: var(--hairline);
  margin-top: 16px;
  overflow: hidden;
}

.growth > span {
  display: block;
  height: 100%;
  width: 62%;
  background: var(--leaf);
  border-radius: 1px;
}

.prayer-bar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 12px 12px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prayer-bar p { font-size: 1rem; }

.dots { display: flex; gap: 12px; margin-top: 10px; }

.dots span {
  width: 12px; height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--gold-fill);
}

.dots span.is-prayed { background: var(--gold-fill); box-shadow: none; }

.roots {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.roots__next { padding: 16px; }

.roots__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.5rem;
  margin: 2px 0;
}

.roots__actions { display: flex; gap: 8px; margin-top: 12px; }

.mini-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
}

.mini-btn--action { background: var(--action); color: var(--on-action); }
.mini-btn--plain { color: var(--ink-secondary); font-weight: 400; }

.roots__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 0.5px solid var(--hairline);
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 4px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-secondary);
  text-align: center;
}

.tabbar span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabbar .is-current { color: var(--ink); }

/* The living tree */

.tree-art .trunk { stroke: var(--gold-fill); }
.tree-art .stem { stroke: var(--bark); }
.tree-art .leaves { fill: var(--leaf); }
.tree-art .leaves-deep { fill: var(--leaf-deep); }
.tree-art .ground { stroke: var(--hairline); }
.tree-art .roots-line { stroke: var(--leaf); }
.tree-art .soil { fill: var(--soil); }

/* ------------------------------------------------------------------------
   Motion. Calm motion settles, it never bounces (docs/DESIGN-SYSTEM.md › Motion).
   Entrances fade up 14px over 800ms; repeating motion breathes at 4.5s;
   state changes take 250 to 600ms. Only transform, opacity and SVG paint
   are animated, scroll-linked motion is CSS scroll-driven (no scroll
   listeners), and Reduce Motion shows every end state at once.
   ------------------------------------------------------------------------ */

/* Page to page: a short settle instead of a hard cut. The nav bar keeps its place. */

@view-transition { navigation: auto; }

::view-transition-old(root) { animation: 240ms var(--ease-settle) both vt-out; }
::view-transition-new(root) { animation: 420ms var(--ease-settle) both vt-in; }

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* Reading hairline: the app's growth line, here showing how far down the page you are. */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--leaf);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 60;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
}

@keyframes progress { to { transform: scaleX(1); } }

/* Entrances */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 800ms var(--ease-settle), transform 800ms var(--ease-settle);
  transition-delay: var(--delay, 0ms);
}

.reveal--blur {
  filter: blur(10px);
  transition: opacity 800ms var(--ease-settle), transform 800ms var(--ease-settle), filter 800ms var(--ease-settle);
  transition-delay: var(--delay, 0ms);
}

.reveal.is-in { opacity: 1; transform: none; filter: none; }

.no-js .reveal { opacity: 1; transform: none; filter: none; }

/* Pointer feedback. Cards lift a touch; the reveal transition hands over once the card is in. */

@media (hover: hover) and (pointer: fine) {
  .lift { position: relative; }
  .lift.is-in, .lift .card, .lift.card { transition: transform 250ms var(--ease-out); }
  .lift::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    transition: opacity 250ms var(--ease-out);
    pointer-events: none;
  }
  .lift:hover { transform: translateY(-2px); }
  .lift:hover::after { opacity: 1; }
}

/* Tagline: words light in reading order as they cross a line on screen. */

.tagline .word {
  display: inline-block;
  color: color-mix(in srgb, var(--ink) 28%, transparent);
  transform: translateY(4px);
  transition: color 700ms var(--ease-sheet), transform 700ms var(--ease-sheet);
}

.tagline .word.is-lit { color: var(--ink); transform: none; }
.tagline .word.is-gold.is-lit { color: var(--gold); }
.tagline .word.is-leaf.is-lit { color: var(--leaf); }

/* Drawings: strokes draw, leaves unfold, once, when first seen. */

.draw {
  stroke-dasharray: var(--len, 300);
  stroke-dashoffset: var(--len, 300);
  transition: stroke-dashoffset 1400ms var(--ease-settle);
  transition-delay: var(--delay, 0ms);
}

.is-grown .draw { stroke-dashoffset: 0; }

.unfold {
  opacity: 0;
  transform: scale(0.82);
  transform-box: fill-box;
  transform-origin: var(--origin, bottom center);
  transition: opacity 900ms var(--ease-settle), transform 900ms var(--ease-settle);
  transition-delay: var(--delay, 0ms);
}

.is-grown .unfold { opacity: 1; transform: none; }

.breathe { animation: breathe 4.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* The landing tree's slow season: leaves dry and droop, a drop reaches the soil, and the
   leaves lift again from the top down (90ms apart, as in the app). One 14s cycle, after the
   drawing has finished. It is the sentence "waits when you can't", drawn. */

.season .leaves .unfold { --droop: -9deg; }
.season .leaves .unfold.is-left { --droop: 9deg; }

.is-grown.season .leaves .unfold {
  animation: season-leaf 14s var(--ease-settle) calc(4000ms + var(--i, 0) * 90ms) infinite;
}

@keyframes season-leaf {
  0%, 24% { fill: var(--leaf); transform: none; }
  44%, 58% { fill: var(--leaf-dry); transform: translateY(2px) rotate(var(--droop)); }
  66%, 100% { fill: var(--leaf); transform: none; }
}

.season .season-drop, .season .season-ripple { opacity: 0; }

.is-grown.season .season-drop {
  animation: season-drop 14s linear 4000ms infinite;
}

.is-grown.season .season-ripple {
  transform-box: fill-box;
  transform-origin: center;
  animation: season-ripple 14s linear 4000ms infinite;
}

@keyframes season-drop {
  0%, 54.5% { opacity: 0; transform: translateY(0); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }
  55% { opacity: 1; }
  58.3% { opacity: 1; transform: translateY(176px); }
  58.6%, 100% { opacity: 0; transform: translateY(176px); }
}

@keyframes season-ripple {
  0%, 58.3% { opacity: 0; transform: scale(0.3); animation-timing-function: var(--ease-out); }
  58.6% { opacity: 0.9; }
  64% { opacity: 0; transform: scale(1.9, 1.5); }
  100% { opacity: 0; transform: scale(1.9, 1.5); }
}

/* The Today screen's moment: prayers log one by one, Begin is pressed, a drop falls to the
   soil, the tree lifts and the growth line extends, and the roots card says what happened. */

.moment .dots span { position: relative; }

.moment .dots span.is-prayed { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gold-fill); }

.moment .dots span.is-prayed::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--gold-fill);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 300ms var(--ease-settle), transform 300ms var(--ease-settle);
  transition-delay: calc(600ms + var(--i, 0) * 250ms);
}

.moment.is-in .dots span.is-prayed::after { opacity: 1; transform: scale(1); }

.moment .drop, .moment .ripple { opacity: 0; }

.moment.is-in .drop { animation: drop-fall 560ms cubic-bezier(0.5, 0, 0.9, 0.6) 1900ms both; }

.moment.is-in .ripple {
  transform-box: fill-box;
  transform-origin: center;
  animation: ripple 900ms var(--ease-out) 2420ms both;
}

@keyframes drop-fall {
  0% { opacity: 0; transform: translateY(0); }
  12% { opacity: 1; }
  94% { opacity: 1; }
  100% { opacity: 0; transform: translateY(101px); }
}

@keyframes ripple {
  0% { opacity: 0.9; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(1.9, 1.5); }
}

.moment .leaves path { transform-box: fill-box; transform-origin: bottom center; }

.moment.is-in .leaves path {
  animation: leaf-lift 700ms var(--ease-settle) calc(2500ms + var(--i, 0) * 90ms) both;
}

@keyframes leaf-lift {
  from { transform: translateY(1.5px) scale(0.96); }
  to { transform: none; }
}

.moment .growth__fill { transform-origin: 0 50%; transform: scaleX(0.8); }

.moment.is-in .growth__fill { transform: none; transition: transform 800ms var(--ease-settle) 2500ms; }

.moment.is-in .roots__actions .mini-btn--action { animation: press 320ms var(--ease-out) 1700ms both; }

@keyframes press { 50% { transform: scale(0.96); } }

.roots__act { display: grid; margin-top: 12px; }
.roots__act > * { grid-area: 1 / 1; }
.roots__act .roots__actions { margin-top: 0; }

.roots__done {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  opacity: 0;
  filter: blur(4px);
  color: var(--leaf-text);
  font-size: 0.9375rem;
}

.roots__done svg { color: var(--water); }

.moment.is-in .roots__actions { animation: fade-blur-out 450ms var(--ease-settle) 2500ms both; }
.moment.is-in .roots__done { animation: fade-blur-in 450ms var(--ease-settle) 2560ms both; }

@keyframes fade-blur-out { to { opacity: 0; filter: blur(4px); } }
@keyframes fade-blur-in { to { opacity: 1; filter: blur(0); } }

/* The Rhythm arc: the day draws from Fajr to now, the sun travels it, prayers fill as it passes. */

.arc .sun {
  offset-path: path("M16 112 Q171 -28 326 112");
  offset-distance: 0%;
  offset-rotate: 0deg;
  transition: offset-distance 2400ms linear 300ms;
}

.arc.is-grown .sun { offset-distance: 79%; }

.arc .draw { transition: stroke-dashoffset 2400ms linear 300ms; }

.arc .pd.is-prayed { fill: var(--canvas); transition: fill 300ms ease; transition-delay: var(--delay, 0ms); }
.arc.is-grown .pd.is-prayed { fill: var(--gold-fill); }

/* Follow along: the whole verse lights while it is recited, then rests,
   the way the app's Follow mode highlights one ayah at a time. 4.5s cycle. */

.follow {
  border-radius: 8px;
  padding: 0 6px;
  margin: 0 -6px;
  animation: follow 4.5s linear infinite;
}

@keyframes follow {
  0%, 4% { background-color: transparent; color: var(--ink); }
  10%, 66% { background-color: color-mix(in srgb, var(--gold-fill) 26%, transparent); color: var(--gold); }
  74%, 100% { background-color: transparent; color: var(--ink); }
}

/* Hero screens drift apart a little as the page starts to scroll (wide screens only). */

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 1140px) {
    .stage > figure { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 120vh; }
    .stage > figure:nth-child(1), .stage > figure:nth-child(3) { --drift: -32px; }
    .stage > figure:nth-child(2) { --drift: -72px; }
  }
}

@keyframes drift { to { transform: translateY(var(--drift, -40px)); } }

/* The growing tree: a scroll-driven scrub through the nine stages (product page).
   Default styles are the finished, static tree; the scrub only applies where the browser
   supports scroll-driven animations and the person has not asked for reduced motion. */

.grow__track { position: relative; }

.grow__stage { display: grid; gap: 32px; align-items: center; }

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

.grow__art { width: 100%; max-width: 420px; margin-inline: auto; }
.grow__art svg { width: 100%; height: auto; }

.grow__lines { position: relative; min-height: 3.5rem; }
.grow__line { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; line-height: 1.75rem; color: var(--ink); }
.grow__line:not(:last-child) { display: none; }

.sc-draw { stroke-dasharray: 100; stroke-dashoffset: 0; }
.sc-appear, .sc-fade { transform-box: fill-box; transform-origin: var(--origin, bottom center); }
.sc-vanish { opacity: 0; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .grow__track { height: 240svh; view-timeline-name: --tree; view-timeline-axis: block; }

    .grow__stage {
      position: sticky;
      top: 0;
      height: 100svh;
      align-content: center;
      padding-top: 72px;
      padding-bottom: 24px;
    }

    .grow__line { position: absolute; inset: 0 0 auto 0; opacity: 0; display: block; }
    .grow__line:not(:last-child) { display: block; }

    .grow__track .sc-draw, .grow__track .sc-appear, .grow__track .sc-fade, .grow__track .sc-vanish,
    .grow__track .stages li, .grow__track .grow__line {
      animation-timeline: --tree;
      animation-range: contain var(--in, 0%) contain var(--out, 100%);
      animation-timing-function: linear;
    }

    /* Opacity starts at 0: a round line cap would otherwise show as a dot before the stroke draws. */
    .grow__track .sc-draw { stroke-dashoffset: 100; opacity: 0; animation-name: sc-draw; animation-fill-mode: forwards; }
    .grow__track .sc-appear { opacity: 0; animation-name: sc-appear; animation-fill-mode: forwards; }
    .grow__track .sc-fade { opacity: 0; animation-name: sc-fade; animation-fill-mode: forwards; }
    .grow__track .sc-vanish { opacity: 1; animation-name: sc-vanish; animation-fill-mode: forwards; }

    .grow__track .stages li, .grow__track .stages li.is-here {
      background: var(--tint); color: var(--ink-secondary); box-shadow: none; font-weight: 400;
      animation-name: chip-on; animation-fill-mode: none;
    }
    .grow__track .stages li.stages__more { animation: none; background: transparent; box-shadow: inset 0 0 0 1px var(--hairline); color: var(--ink-tertiary); }

    .grow__track .grow__line { animation-name: line-show; animation-fill-mode: none; }
    .grow__track .grow__line:last-child { animation-name: line-show-hold; animation-fill-mode: forwards; }
  }
}

@keyframes sc-draw {
  0% { stroke-dashoffset: 100; opacity: 0; }
  4% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes sc-appear { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: none; } }
@keyframes sc-fade { to { opacity: 1; } }
@keyframes sc-vanish { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.4); } }
@keyframes chip-on { from, to { background: var(--surface); color: var(--leaf-text); box-shadow: inset 0 0 0 1px var(--leaf); } }
@keyframes line-show {
  0% { opacity: 0; transform: translateY(8px); }
  14%, 86% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-8px); }
}
@keyframes line-show-hold {
  0% { opacity: 0; transform: translateY(8px); }
  14%, 100% { opacity: 1; transform: none; }
}

/* Looping motion pauses while its element is off screen (toggled by an observer in wird.js),
   so the page spends nothing on leaves drying or words lighting that nobody can see. */

.is-offscreen, .is-offscreen * { animation-play-state: paused !important; }

/* Reduce Motion: every end state, at once. */

@media (prefers-reduced-motion: reduce) {
  .reveal, .unfold { opacity: 1; transform: none; filter: none; transition: none; }
  .draw { stroke-dashoffset: 0; transition: none; }
  .tagline .word { color: var(--ink); transform: none; transition: none; }
  .tagline .word.is-gold { color: var(--gold); }
  .tagline .word.is-leaf { color: var(--leaf); }
  .breathe, .follow, .season .leaves .unfold, .season .season-drop, .season .season-ripple { animation: none; }
  .follow { background-color: color-mix(in srgb, var(--gold-fill) 26%, transparent); color: var(--gold); }
  .moment.is-in .drop, .moment.is-in .ripple, .moment.is-in .leaves path, .moment.is-in .mini-btn--action,
  .moment.is-in .roots__actions, .moment.is-in .roots__done { animation: none; }
  .moment .dots span.is-prayed::after { opacity: 1; transform: scale(1); transition: none; }
  .moment .growth__fill { transform: none; transition: none; }
  .arc .sun { offset-distance: 79%; transition: none; }
  .arc .draw { transition: none; }
  .arc .pd.is-prayed { fill: var(--gold-fill); transition: none; }
  .lift:hover { transform: none; }
  .btn, .store__badge, .skip-link, .nav__bar, .text-link svg { transition: none; animation: none; }
  .progress { animation: none; transform: scaleX(0); }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Without JavaScript nothing waits for an observer: screens show their resting state. */

.no-js .moment .dots span.is-prayed::after { transform: scale(1); transition: none; }
.no-js .moment .growth__fill { transform: none; }
.no-js .arc .sun { offset-distance: 79%; }
.no-js .arc .pd.is-prayed { fill: var(--gold-fill); }

/* Footer */

.footer {
  padding-block: 48px 64px;
  border-top: 0.5px solid var(--hairline);
  color: var(--ink-secondary);
  font-size: 0.9375rem;
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  list-style: none;
  padding: 0;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-secondary);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .footer__links a:hover { color: var(--ink); }
}

.footer__legal {
  margin-top: 24px;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--ink-tertiary);
  max-width: 760px;
}

/* FAQ */

.faq { display: flex; flex-direction: column; }

.faq details { border-top: 0.5px solid var(--hairline); }
.faq details:last-child { border-bottom: 0.5px solid var(--hairline); }

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 16px 0;
  font-weight: 600;
  font-size: 1.0625rem;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary svg {
  flex: none;
  color: var(--ink-secondary);
  transition: transform 250ms var(--ease-out);
}

.faq details[open] summary svg { transform: rotate(180deg); }

.faq details > div {
  padding: 0 0 24px;
  color: var(--ink-secondary);
  max-width: var(--measure);
}

.faq details > div p + p { margin-top: 12px; }

/* Answers settle open instead of snapping, where the browser can animate to auto height. */
.faq details { interpolate-size: allow-keywords; }

.faq details::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 300ms var(--ease-out), content-visibility 300ms allow-discrete;
}

.faq details[open]::details-content { block-size: auto; }

@media (prefers-reduced-motion: reduce) {
  .faq summary svg { transition: none; }
  .faq details::details-content { transition: none; }
}

/* Long-form text pages (privacy, support, terms) */

.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.5rem; line-height: 2rem; margin: 48px 0 12px; }
.prose h3 { font-family: var(--font-text); font-weight: 600; font-size: 1.0625rem; margin: 24px 0 8px; }
.prose p, .prose ul, .prose ol { margin-bottom: 16px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose .card { margin: 24px 0; }

/* Learn pages and plans: tables, figures, quotes, dates. */
.updated { color: var(--ink-tertiary); font-size: 0.9375rem; margin: 8px 0 24px; }
.prose blockquote { margin: 0 0 16px; padding-left: 16px; border-left: 2px solid var(--gold-fill); color: var(--ink-secondary); }
.table-scroll { overflow-x: auto; margin: 16px 0 24px; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.4; }
.prose th, .prose td { text-align: left; padding: 10px 10px 10px 0; border-bottom: 0.5px solid var(--hairline); vertical-align: top; }
.prose th { font-weight: 600; }
.prose figure.chart { margin: 24px 0; background: #fbf7f0; color: #1b2638; }
.prose figure.chart svg { display: block; width: 100%; height: auto; }
.prose figcaption { font-size: 0.8125rem; color: #596274; margin-top: 12px; }
.learn-list { list-style: none; padding: 0; margin: 0; }
.learn-list li { border-top: 0.5px solid var(--hairline); }
.learn-list li:last-child { border-bottom: 0.5px solid var(--hairline); }
.learn-list a { display: block; padding: 14px 0; text-decoration: none; }
.learn-list a[aria-current="page"] { color: var(--ink-secondary); }
.plans { display: grid; gap: 12px; margin-top: 8px; }
.plans li { list-style: none; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--canvas); display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.plans strong { font-family: var(--font-display); font-weight: 500; font-size: 1.0625rem; }
.plans span { color: var(--ink-secondary); text-align: right; font-size: 0.9375rem; }

/* ------------------------------------------------------------------------
   Inner pages and small responses (2026-10-30). Same rules as above: settle,
   never bounce; transform and opacity only; nothing moves under Reduce Motion.
   ------------------------------------------------------------------------ */

/* A page's opening lines settle in one after another; wird.js adds .reveal and the
   delay to each child of [data-stagger], so without JavaScript nothing is hidden. */
[data-stagger] > .reveal { transition-duration: 700ms; }

/* The verse on the guide: set apart, quiet, its source beneath it. */
.prose figure.ayah { margin: 32px 0 8px; padding: 24px; border-radius: var(--radius-lg); background: var(--gold-soft); }
.prose figure.ayah blockquote { margin: 0; padding: 0; border: 0; color: var(--ink); }
.prose figure.ayah blockquote p { font-size: 1.125rem; line-height: 1.6; margin: 0; }
.prose figure.ayah figcaption { font-size: 0.875rem; color: var(--ink-secondary); margin-top: 12px; }

/* Responses: links and rows answer the pointer, buttons answer the press. */
.nav__links a:active, .footer__links a:active { transform: scale(0.97); }
.nav__links a { transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out), transform 160ms var(--ease-out); }
.text-link:active svg { transform: translateX(4px); }

@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover { background: var(--tint); }
  .faq summary:hover svg { color: var(--ink); }
}

.plans li { transition: background-color 200ms var(--ease-out); }
.plans strong { white-space: nowrap; }

/* On a phone, the plan name sits above its price instead of squeezing beside it. */
@media (max-width: 520px) {
  .plans li { flex-direction: column; align-items: flex-start; gap: 2px; }
  .plans span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  [data-stagger] > .reveal { transition: none; }
  .nav__links a, .plans li, .lift::after { transition: none; }
  .nav__links a:active, .footer__links a:active { transform: none; }
}
