/* ------------------------------------------------------------------
   Triloop — triloop.io
   Shared stylesheet for the marketing site and legal pages.
   ------------------------------------------------------------------ */

:root {
  /* Paper & ink */
  --paper: #faf6f0;
  --paper-raised: #fffdfa;
  --paper-sunken: #f1eae0;
  --ink: #211a13;
  --ink-soft: #5f564b;
  --ink-faint: #8a8073;
  --line: rgba(33, 26, 19, 0.12);
  --line-soft: rgba(33, 26, 19, 0.07);

  /* Brand */
  --orange: #f04e1d;
  --orange-hover: #d8431a;
  --orange-soft: #ffdacc;

  /* Mood green — matches the in-app mood marker */
  --mood: #8bc34a;
  --mood-ink: #33424e;

  --radius-card: 20px;
  --radius-chip: 999px;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-app: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-app-arabic: "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  /* Habit accent (water = blue), from the app's brand blue primaries */
  --habit-water: #0066ff;
  --habit-water-fill: rgba(0, 102, 255, 0.12);

  --on-orange: #ffffff;

  --shadow-card: 0 1px 2px rgba(33, 26, 19, 0.05),
    0 12px 32px -12px rgba(33, 26, 19, 0.18);
  --shadow-pop: 0 2px 6px rgba(33, 26, 19, 0.08),
    0 24px 56px -16px rgba(33, 26, 19, 0.32);

  color-scheme: light;
}

/* Dark theme — tuned to the app's dark palette (near-black warm
   surfaces, light-orange primary, white-on-dark active chips). */
[data-theme="dark"] {
  --paper: #141110;
  --paper-raised: #1e1a17;
  --paper-sunken: #2a2521;
  --ink: #f3eee7;
  --ink-soft: #beb4a8;
  --ink-faint: #8f867a;
  --line: rgba(243, 238, 231, 0.16);
  --line-soft: rgba(243, 238, 231, 0.09);

  --orange: #ffaa55;
  --orange-hover: #ffba74;
  --orange-soft: rgba(255, 170, 85, 0.16);
  --on-orange: #241003;

  --habit-water: #66aaff;
  --habit-water-fill: rgba(102, 170, 255, 0.16);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4),
    0 12px 32px -12px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, 0.45),
    0 24px 56px -16px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

[data-theme="dark"] .hero::before {
  background: radial-gradient(
    640px 480px at 80% 10%,
    rgba(255, 170, 85, 0.06),
    transparent 70%
  );
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  font-feature-settings: "cv05", "cv11";
  -webkit-font-smoothing: antialiased;
}

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

/* Arabic typography — IBM Plex Sans Arabic reads far better than the
   system fallback for both display and body. */
[lang="ar"],
[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3 {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

[lang="ar"] h1 {
  letter-spacing: 0;
  line-height: 1.18;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2.5px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 44px);
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .shell {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand svg {
  height: 22px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 13px;
  border-radius: var(--radius-chip);
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--paper-sunken);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang:hover,
.lang:focus-within {
  color: var(--ink);
  border-color: var(--ink);
}

.lang svg {
  width: 15px;
  height: 15px;
}

.lang select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  border: 0;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (max-width: 760px) {
  .site-header .shell {
    gap: 10px;
  }

  .site-nav {
    display: none;
  }

  .header-tools {
    margin-inline-start: auto;
    gap: 6px;
  }

  .header-cta {
    padding: 10px 15px;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: 17px;
  }

  .lang {
    padding: 0 10px;
    gap: 5px;
  }

  .header-cta {
    padding: 9px 13px;
    font-size: 14px;
  }
}

/* ---------- Buttons & badges ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-chip);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

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

.btn-primary {
  background: var(--orange);
  color: var(--on-orange);
}

.btn-primary:hover {
  background: var(--orange-hover);
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 14px;
  padding: 10px 18px 10px 15px;
  min-width: 172px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.store-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.store-badge svg {
  width: 24px;
  height: 24px;
  flex: none;
}

.store-badge .lines {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
  text-align: left;
}

.store-badge .small {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.72;
}

.store-badge .big {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vh, 58px) 0 clamp(30px, 4vh, 52px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 130%;
  background: radial-gradient(
    640px 480px at 80% 10%,
    rgba(240, 78, 29, 0.06),
    transparent 70%
  );
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}

.hero-copy {
  align-self: start;
  padding-top: clamp(20px, 4vh, 40px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 22px;
}

.eyebrow svg {
  height: 12px;
  width: auto;
}

.hero h1 {
  font-size: clamp(44px, 6.4vw, 76px);
  font-weight: 640;
}

.hero h1 .stop {
  color: var(--orange);
}

.hero .lede {
  margin-top: 22px;
  max-width: 30em;
  font-size: clamp(17px, 2vw, 19.5px);
  line-height: 1.62;
  color: var(--ink-soft);
}

.hero .store-badges {
  margin-top: 34px;
}

.hero-note {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--ink-faint);
}

/* ---------- Phone mockup ---------- */

.hero-phone {
  --phone-scale: 0.79;
  --phone-layout-width: 324px;
  --phone-layout-height: 657px;
  position: relative;
  justify-self: center;
  width: var(--phone-layout-width);
  height: var(--phone-layout-height);
  translate: 0 clamp(-28px, -3vh, -18px);
}

.phone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 390px;
  margin-top: -411px;
  margin-left: -195px;
  border-radius: 51px;
  background: #17120d;
  padding: 11px;
  box-shadow: var(--shadow-pop);
  transform: scale(var(--phone-scale)) rotate(1.4deg);
  transform-origin: center;
}

/* The phone renders the app's own neutral palette (white / pure black),
   independent of the website's warm paper theme, but follows the toggle. */
.phone-screen {
  --ph-bg: #ffffff;
  --ph-elevated: #ffffff;
  --ph-tile: #f7f7f6;
  --ph-ink: #0f141a;
  --ph-soft: #5d6673;
  --ph-faint: #a4a4a4;
  --ph-line: rgba(0, 0, 0, 0.08);
  --ph-chip: #efefef;
  --ph-accent: #ff4a1c;
  --ph-due: var(--ph-accent);

  position: relative;
  background: var(--ph-bg);
  color: var(--ph-ink);
  border-radius: 42px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  aspect-ratio: 402 / 874;
  font-family: var(--font-app);
  font-size: 16px;
}

[lang="ar"] .phone-screen {
  font-family: var(--font-app-arabic);
}

[data-theme="dark"] .phone-screen {
  --ph-bg: #000000;
  --ph-elevated: #2a2a2c;
  --ph-tile: #1a1a1c;
  --ph-ink: #f3f1ee;
  --ph-soft: #9c9a96;
  --ph-faint: #6d6b68;
  --ph-line: rgba(255, 255, 255, 0.09);
  --ph-chip: #1f1f22;
  --ph-accent: #ffaa55;
  --ph-due: #ff9c73;
}

.ph-status {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 59px;
  padding: 19px 22px 0 50px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  color: var(--ph-ink);
}

.ph-time {
  position: relative;
  z-index: 1;
}

.ph-island {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 126px;
  height: 37px;
  border-radius: 999px;
  background: #000000;
  transform: translateX(-50%);
}

.ph-status-icons {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000000;
}

.ph-cell-dots {
  display: flex;
  gap: 2.5px;
  opacity: 0.22;
}

.ph-cell-dots i {
  width: 3.2px;
  height: 3.2px;
  border-radius: 50%;
  background: currentColor;
}

.ph-wifi {
  width: 18px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.1px;
  fill: none;
}

.ph-battery {
  position: relative;
  width: 22px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
  display: block;
}

.ph-battery::after {
  content: "";
  position: absolute;
  top: 3px;
  right: -4px;
  width: 2.5px;
  height: 4px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}

.ph-battery i {
  position: absolute;
  inset: 2.4px;
  border-radius: 2px;
  background: currentColor;
}

.ph-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 13px 16px 0;
}

.ph-topbar .ph-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
  color: var(--ph-ink);
}

.ph-topbar .ph-actions {
  margin-inline-start: auto;
  display: flex;
  gap: 26px;
  color: var(--ph-ink);
}

.ph-topbar .ph-actions svg {
  width: 28px;
  height: 28px;
}

.ph-listtabs {
  display: flex;
  align-items: flex-end;
  height: 42px;
  padding: 0;
  border-bottom: 1px solid var(--ph-line);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  color: var(--ph-faint);
}

.ph-listtabs-scroll {
  display: flex;
  align-items: baseline;
  gap: 22px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  padding-inline-start: 16px;
}

.ph-listtabs-scroll span {
  padding-bottom: 11px;
}

.ph-listtabs .on {
  color: var(--ph-ink);
  font-weight: 700;
  position: relative;
}

.ph-listtabs .on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--ph-accent);
}

.ph-listtabs-manage {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  padding-bottom: 9px;
  color: var(--ph-ink);
}

.ph-listtabs-manage svg {
  width: 24px;
  height: 24px;
}

.ph-chips {
  position: relative;
  display: flex;
  gap: 8px;
  height: 64px;
  padding-block-start: 14px;
  padding-inline-start: 12px;
  padding-inline-end: 0;
  overflow: hidden;
}

.ph-chips::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  inset-inline-end: 0;
  bottom: 0;
  width: 112px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--ph-bg) 0%, transparent),
    var(--ph-bg) 74%
  );
  pointer-events: none;
}

[dir="rtl"] .ph-chips::after {
  background: linear-gradient(
    270deg,
    color-mix(in srgb, var(--ph-bg) 0%, transparent),
    var(--ph-bg) 74%
  );
}

.ph-chip {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 0 17px;
  border-radius: 8px;
  background: var(--ph-chip);
  color: var(--ph-soft);
  white-space: nowrap;
  flex: none;
}

.ph-chip.on {
  min-width: 122px;
}

.ph-chip.on {
  background: var(--ph-ink);
  color: var(--ph-bg);
  font-weight: 600;
}

.ph-chip:nth-of-type(2) {
  min-width: 136px;
}

.ph-filter-more {
  position: absolute;
  z-index: 2;
  top: 28px;
  inset-inline-end: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 86px;
  min-width: 0;
  height: 10px;
  padding-inline: 0 2px;
  color: var(--ph-ink);
  pointer-events: none;
}

.ph-filter-more i {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: currentColor;
}

.ph-section {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 12px 122px;
  display: grid;
  grid-auto-rows: max-content;
  gap: 8px;
  align-content: start;
}

.ph-task {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 70px;
  column-gap: 8px;
  align-items: stretch;
  background: var(--ph-tile);
  border: 1px solid rgba(0, 0, 0, 0.035);
  border-radius: 18px;
  min-height: 75px;
  padding: 12px 0 8px 12px;
}

.ph-task.tall {
  min-height: 95px;
}

.ph-check {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--ph-faint);
  background: transparent;
  margin: 8px auto 0;
}

.ph-task-body {
  min-width: 0;
  padding-top: 2px;
}

.ph-task-title {
  display: block;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.28;
  letter-spacing: 0;
  color: var(--ph-ink);
}

.ph-task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  line-height: 1.2;
  color: var(--ph-soft);
  margin-top: 10px;
}

.ph-task-meta .due {
  color: var(--ph-due);
  font-weight: 600;
}

.ph-task-meta .flag {
  color: var(--ph-accent);
}

.ph-task-meta .flag svg {
  width: 14px;
  height: 14px;
}

.ph-task-extra {
  border-inline-start: 1px solid var(--ph-line);
  color: var(--ph-faint);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  margin-block: 2px;
}

.ph-task-extra svg {
  width: 24px;
  height: 24px;
}

.ph-task.done {
  min-height: 56px;
}

.ph-task.done .ph-check {
  position: relative;
  align-self: center;
  margin: 0 auto;
  background: color-mix(in srgb, var(--ph-accent) 18%, var(--ph-bg));
  border-width: 3px;
  border-color: var(--ph-accent);
}

.ph-task.done .ph-check::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 7px;
  height: 12px;
  border: solid var(--ph-accent);
  border-width: 0 3px 3px 0;
  rotate: 45deg;
}

.ph-task.done .ph-task-body {
  display: flex;
  align-items: center;
  padding-top: 0;
}

.ph-task.done .ph-task-title {
  color: var(--ph-faint);
  text-decoration: line-through;
}

.ph-subtasks {
  color: var(--ph-ink);
}

.ph-fabs {
  position: absolute;
  z-index: 6;
  inset-inline-end: 12px;
  bottom: 120px;
  display: grid;
  gap: 12px;
  justify-items: end;
}

.ph-voice {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--ph-elevated);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  color: var(--ph-accent);
}

.ph-voice svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}

.ph-fab {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--ph-accent);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
  color: var(--on-orange);
}

[data-theme="dark"] .ph-fab {
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.42);
}

.ph-fab svg {
  width: 31px;
  height: 31px;
}

.ph-tabbar {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  height: 104px;
  display: flex;
  border-top: 1px solid var(--ph-line);
  padding: 14px 10px 22px;
  background: color-mix(in srgb, var(--ph-bg) 92%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.ph-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--ph-faint);
}

.ph-tab svg {
  width: 30px;
  height: 30px;
}

.ph-tab.active {
  color: var(--ph-accent);
}

.ph-home {
  display: none;
}

@media (max-width: 880px) {
  .hero {
    padding: clamp(38px, 7vh, 64px) 0 clamp(42px, 7vh, 72px);
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero-phone {
    --phone-scale: 0.82;
    --phone-layout-width: 336px;
    --phone-layout-height: 674px;
    margin-top: 8px;
    translate: 0;
  }

  .phone {
    transform: scale(var(--phone-scale));
  }
}

/* ---------- The loop ---------- */

.loop {
  padding: clamp(48px, 7vw, 92px) 0;
  border-top: 1px solid var(--line-soft);
}

.section-head {
  max-width: 620px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-head .kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(30px, 4vw, 44px);
}

.section-head .sub {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 17px;
}

.loop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
}

.loop-step {
  background: var(--paper-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 26px 26px 28px;
  box-shadow: var(--shadow-card);
}

.loop-step .ring {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2.5px solid var(--orange);
  color: var(--orange);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 18px;
}

.loop-step h3 {
  font-size: 21px;
  margin-bottom: 9px;
}

.loop-step p {
  color: var(--ink-soft);
  font-size: 15.5px;
}

@media (max-width: 760px) {
  .loop-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Feature rows ---------- */

.features {
  padding: clamp(24px, 4vw, 48px) 0 clamp(48px, 7vw, 88px);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding: clamp(36px, 5vw, 64px) 0;
}

.feature + .feature {
  border-top: 1px solid var(--line-soft);
}

.feature.flip .feature-copy {
  order: 2;
}

.feature .kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 13px;
}

.feature h3 {
  font-size: clamp(26px, 3.2vw, 36px);
}

.feature .body {
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 16.5px;
  max-width: 30em;
}

.feature .note {
  margin-top: 15px;
  font-size: 14px;
  color: var(--ink-faint);
  display: flex;
  gap: 9px;
  align-items: baseline;
}

.feature .note::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--orange);
  opacity: 0.55;
  translate: 0 -1px;
}

@media (max-width: 820px) {
  .feature,
  .feature.flip {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .feature.flip .feature-copy {
    order: 0;
  }
}

/* ---------- Feature visuals ---------- */

.visual {
  background: var(--paper-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 10px;
  position: relative;
}

.visual .v-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 13px 15px;
}

[data-theme="dark"] .visual .v-row,
[data-theme="dark"] .v-habit-tile {
  background: var(--paper-sunken);
}

.visual .v-check {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 2px solid var(--ink-faint);
  background: var(--paper-raised);
  flex: none;
}

.visual .v-row.done .v-check {
  background: var(--orange);
  border-color: var(--orange);
  position: relative;
}

.visual .v-row.done .v-check::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 3.5px;
  width: 5px;
  height: 9px;
  border: solid var(--on-orange);
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

.visual .v-row.done .v-title {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.visual .v-title {
  font-weight: 500;
  font-size: 14.5px;
}

.visual .v-meta {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 1px;
}

.visual .v-meta .due {
  color: var(--orange);
  font-weight: 600;
}

.visual .v-extra {
  margin-inline-start: auto;
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
  flex: none;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.visual .v-extra svg {
  width: 17px;
  height: 17px;
}

.visual .v-tag {
  margin-inline-start: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
  background: var(--orange-soft);
  color: var(--orange-hover);
  white-space: nowrap;
}

/* Voice visual */

.v-wave {
  display: flex;
  align-items: center;
  gap: 3.5px;
  height: 44px;
  padding: 0 15px;
}

.v-wave i {
  width: 4px;
  border-radius: 3px;
  background: var(--orange);
  height: calc(8px + var(--h, 10) * 1px);
}

.v-send {
  margin-inline-start: auto;
  position: relative;
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
}

.v-send-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.v-send-ring .track {
  stroke: var(--orange);
  opacity: 0.16;
}

.v-send-ring .arc {
  stroke: var(--orange);
}

.v-send-btn {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--on-orange);
  display: grid;
  place-items: center;
}

.v-send-btn svg {
  width: 17px;
  height: 17px;
}

.v-arrow {
  justify-self: center;
  color: var(--ink-faint);
  font-size: 17px;
  line-height: 1;
  padding: 2px 0;
}

.v-add {
  margin-inline-start: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}

/* Voice draft tiles — mirror the in-app "Review Tasks" rows. */
.v-draft {
  align-items: flex-start;
}

.v-draft-check {
  width: 23px;
  height: 23px;
  flex: none;
  color: var(--orange);
  translate: 0 -1px;
}

.v-draft-check svg {
  width: 100%;
  height: 100%;
}

.v-draft-body {
  display: grid;
  gap: 4px;
}

.v-draft-title {
  font-weight: 500;
  font-size: 14.5px;
  color: var(--ink);
}

.v-draft-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-faint);
}

.v-draft-meta .flag {
  color: var(--orange);
  display: inline-flex;
}

.v-draft-meta .flag svg {
  width: 11px;
  height: 11px;
}

.v-draft-meta .due {
  color: var(--orange);
  font-weight: 600;
}

.v-draft-edit {
  margin-inline-start: auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--paper-sunken);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  flex: none;
}

.v-draft-edit svg {
  width: 15px;
  height: 15px;
}

/* Habit visual — mirrors the in-app habit card */

.v-habit-tile {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 16px;
}

.v-habit-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.v-habit-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--habit-water-fill);
  color: var(--habit-water);
  display: grid;
  place-items: center;
  flex: none;
}

.v-habit-icon svg {
  width: 20px;
  height: 20px;
}

.v-habit-name {
  font-weight: 600;
  font-size: 15.5px;
}

.v-habit-sub {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 1px;
}

.v-habit-pill {
  margin-inline-start: auto;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: var(--radius-chip);
  background: var(--paper-raised);
  border: 1px solid var(--line-soft);
}

.v-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  background: var(--paper-raised);
  border-radius: 14px;
  padding: 9px;
}

[data-theme="dark"] .v-habit-pill,
[data-theme="dark"] .v-bar-row {
  background: color-mix(in srgb, var(--paper-sunken) 94%, var(--ink) 6%);
}

.v-sq {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
}

.v-sq svg {
  width: 16px;
  height: 16px;
}

.v-sq.light {
  background: var(--paper-sunken);
  color: var(--ink-soft);
}

[data-theme="dark"] .v-sq.light {
  background: color-mix(in srgb, var(--paper-sunken) 88%, var(--ink) 12%);
}

.v-sq.dark {
  background: var(--ink);
  color: var(--paper);
}

.v-bar {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: var(--paper-sunken);
  overflow: hidden;
}

.v-bar i {
  display: block;
  height: 100%;
  width: 66%;
  border-radius: 6px;
  background: var(--ink);
}

/* Journal visual — mirrors the in-app entry card */

.v-photo {
  margin: 2px 15px 0;
  height: 110px;
  border-radius: 14px;
  background: var(--paper);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}

[data-theme="dark"] .v-photo {
  background: var(--paper-sunken);
}

.v-photo svg {
  width: 26px;
  height: 26px;
  opacity: 0.7;
}

.v-entry-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px 0;
}

.v-mood-face svg {
  width: 36px;
  height: 36px;
}

.v-date-pill {
  margin-inline-start: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: var(--radius-chip);
  background: var(--paper-raised);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  white-space: nowrap;
}

.v-entry-stats {
  padding: 9px 15px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-faint);
}

.v-entry-title {
  padding: 5px 15px 0;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.v-entry-body {
  padding: 3px 15px 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* Insights visual — the mood calendar share card */

.cal {
  padding: 4px 15px 8px;
  min-width: 0;
}

.cal-month {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.cal-title {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.cal-dow,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 8px);
}

.cal-dow {
  margin-top: 14px;
}

.cal-dow span {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-faint);
}

.cal-grid {
  margin-top: 8px;
}

.cal-day {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 50%;
  background: var(--paper-sunken);
  display: grid;
  place-items: center;
  font-size: clamp(10px, 1.3vw, 12.5px);
  font-weight: 600;
  color: var(--ink-soft);
}

.cal-day.future {
  color: var(--ink-faint);
}

.cal-day.mood {
  background: transparent;
  border: 0;
  padding: 0;
}

.cal-day.mood svg {
  width: 100%;
  height: 100%;
}

.v-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 4px 15px 2px;
}

.v-stat {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.v-stat strong {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Everything-else grid ---------- */

.more {
  padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--line-soft);
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 22px);
}

.mini-card {
  background: var(--paper-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 24px 24px 26px;
  box-shadow: var(--shadow-card);
}

.mini-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--paper-sunken);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.mini-card .icon svg {
  width: 21px;
  height: 21px;
  stroke: var(--ink);
}

.mini-card h3 {
  font-family: var(--font-body);
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
}

.mini-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .more-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .more-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Download CTA ---------- */

.download {
  padding: clamp(64px, 9vw, 120px) 0;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}

.download .mark {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
  color: var(--ink);
}

.download .mark svg {
  height: 34px;
  width: auto;
}

.download h2 {
  font-size: clamp(32px, 4.6vw, 52px);
}

.download .sub {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 17.5px;
}

.download .store-badges {
  justify-content: center;
  margin-top: 34px;
}

.download-qr {
  margin: 44px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  background: var(--paper-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 18px 26px 18px 18px;
  box-shadow: var(--shadow-card);
}

.download-qr .qr-img {
  width: 104px;
  height: 104px;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
}

.download-qr .qr-img svg {
  width: 100%;
  height: 100%;
}

.download-qr strong {
  display: block;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.download-qr span {
  font-size: 13.5px;
  color: var(--ink-faint);
}

@media (max-width: 700px) {
  .download-qr {
    display: none;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: clamp(40px, 6vw, 64px) 0 36px;
  font-size: 14.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
}

.footer-brand p {
  margin-top: 14px;
  color: var(--ink-soft);
  max-width: 22em;
}

.footer-col h3 {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.footer-col a {
  text-decoration: none;
  color: var(--ink-soft);
}

.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 13px;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Sticky QR overlay ---------- */

.qr-pop {
  position: fixed;
  inset-inline-end: 22px;
  bottom: 22px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 18px 14px 14px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  translate: 0 14px;
  visibility: hidden;
  transition: opacity 0.4s ease, translate 0.4s ease, visibility 0.4s;
}

.qr-pop.show {
  opacity: 1;
  translate: 0 0;
  visibility: visible;
}

.qr-pop .qr-img {
  width: 86px;
  height: 86px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  flex: none;
}

.qr-pop .qr-img svg {
  width: 100%;
  height: 100%;
}

.qr-pop strong {
  display: block;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.qr-pop span {
  font-size: 12.5px;
  color: var(--ink-faint);
  max-width: 15em;
  display: block;
  margin-top: 2px;
}

.qr-close {
  position: absolute;
  top: -9px;
  inset-inline-end: -9px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(33, 26, 19, 0.14);
}

.qr-close:hover {
  color: var(--ink);
  border-color: var(--ink);
}

@media (max-width: 1000px), (max-height: 900px), (hover: none) and (pointer: coarse) {
  .qr-pop {
    display: none;
  }
}

/* ---------- Custom "Get the app" banner (mobile) ---------- */

.app-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom, 0px));
  background: var(--paper-raised);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px -14px rgba(0, 0, 0, 0.3);
  translate: 0 110%;
  transition: translate 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-banner.show {
  translate: 0 0;
}

.app-banner[hidden] {
  display: none;
}

.app-banner-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  opacity: 0.6;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.app-banner-close:hover {
  opacity: 1;
  background: var(--paper-sunken);
}

.app-banner-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--paper-sunken);
  color: var(--ink);
  display: grid;
  place-items: center;
}

.app-banner-text {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.25;
}

.app-banner-text strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.app-banner-text span {
  font-size: 12.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-banner-cta {
  flex: none;
  background: var(--orange);
  color: var(--on-orange);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: var(--radius-chip);
  white-space: nowrap;
}

/* ---------- Scroll reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    translate: 0 22px;
    transition: opacity 0.7s ease, translate 0.7s ease;
  }

  .reveal.in {
    opacity: 1;
    translate: 0 0;
  }
}

/* ------------------------------------------------------------------
   Legal / document pages
   ------------------------------------------------------------------ */

.doc {
  max-width: 740px;
  margin-inline: auto;
  padding: clamp(40px, 7vw, 72px) clamp(20px, 5vw, 44px)
    clamp(56px, 8vw, 96px);
}

.doc h1 {
  font-size: clamp(32px, 4.5vw, 44px);
  margin-bottom: 10px;
}

.doc .doc-meta {
  color: var(--ink-faint);
  font-size: 14px;
  margin-bottom: 36px;
}

.doc h2 {
  font-size: 21px;
  margin: 38px 0 12px;
}

.doc p {
  margin: 0 0 16px;
  color: var(--ink-soft);
}

.doc ol,
.doc ul {
  color: var(--ink-soft);
  margin: 0 0 16px;
  padding-left: 24px;
}

.doc li {
  margin-bottom: 6px;
}

.doc a {
  color: var(--orange-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.doc a:hover {
  color: var(--orange);
}

/* ---------- Embedded mode (in-app browser) ---------- */

.embedded .site-header,
.embedded .site-footer {
  display: none;
}

.embedded .doc {
  padding-top: clamp(24px, 6vw, 44px);
}
