/* ---------------------------------------------------------------------------
   JAI LAB LLP — shared design system.

   Self-sufficient plain CSS: the site looks correct even if the Tailwind CDN
   fails to load. Tailwind is layered on top only for one-off utility layout.
   Palette and type mirror the mobile app (mobile/tailwind.config.js).
--------------------------------------------------------------------------- */

:root {
  --paper: #ece9e4;
  --paper-raised: #f4f2ee;
  --ink: #2a2825;
  --ink-soft: #38342f;
  --body: #4a463f;
  --muted: #8e8b84;
  --faint: #b7b4ad;
  --rule: #ddd8d0;
  --rule-soft: #e5e1da;

  --emotional: #e0894f;
  --physical: #6e9b7a;
  --focus: #6e86c4;
  --highlight: rgba(232, 191, 90, 0.28);

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 32px);

  color-scheme: light;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Typography ---------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(34px, 6vw, 52px);
}
h2 {
  font-size: clamp(26px, 4vw, 34px);
}
h3 {
  font-size: 20px;
  line-height: 1.35;
}
h4 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Small caps section label, e.g. "PRIVACY" above a heading. */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.55;
  color: var(--ink-soft);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.mark {
  background: var(--highlight);
  padding: 1px 5px;
  border-radius: 3px;
}

/* --- Layout -------------------------------------------------------------- */

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

.wrap--narrow {
  max-width: 760px;
}

.section {
  padding-block: clamp(56px, 9vw, 96px);
}

.section--tight {
  padding-block: clamp(40px, 6vw, 64px);
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.grid {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
}

@media (min-width: 720px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(236, 233, 228, 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: block;
}

.brand__suffix {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  align-self: center;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
}

.nav a {
  font-size: 15px;
  text-decoration: none;
  color: var(--body);
  white-space: nowrap;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--ink);
}

.nav a[aria-current='page'] {
  font-weight: 600;
}

@media (max-width: 640px) {
  .nav {
    gap: 14px;
    font-size: 14px;
  }
  .nav a {
    font-size: 14px;
  }
  .nav .nav--hide-sm {
    display: none;
  }
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: #191714;
  color: var(--paper);
}

.btn--ghost {
  border-color: var(--rule);
  color: var(--ink);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* --- Cards --------------------------------------------------------------- */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  padding: clamp(22px, 3vw, 28px);
}

.card h3 {
  margin-bottom: 8px;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Accent hairline along the top of a card. */
.card--emotional {
  border-top: 2px solid var(--emotional);
}
.card--physical {
  border-top: 2px solid var(--physical);
}
.card--focus {
  border-top: 2px solid var(--focus);
}

.callout {
  background: var(--highlight);
  border: 1px solid #e2d4a8;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 24px 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout--plain {
  background: var(--paper-raised);
  border-color: var(--rule-soft);
}

/* --- Legal / long-form prose --------------------------------------------- */

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

.prose h2 {
  font-size: 24px;
  margin: 44px 0 12px;
  padding-top: 4px;
}

.prose h3 {
  font-size: 18px;
  margin: 28px 0 8px;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 8px;
}

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

.prose > :first-child {
  margin-top: 0;
}

/* --- Tables -------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.4em;
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
  background: var(--paper-raised);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

thead th {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* --- Numbered step list -------------------------------------------------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 1.4em;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 18px;
  min-height: 30px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

/* --- Screenshot / device frames ------------------------------------------ */

.shots {
  display: grid;
  gap: clamp(16px, 2.6vw, 26px);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: start;
}

.shot {
  margin: 0;
}

/* Single-column stacking makes each 9:19.5 frame ~700px tall, so a row of
   three turns into an endless scroll. Cap the width on narrow screens. */
@media (max-width: 560px) {
  .shot {
    max-width: 244px;
    margin-inline: auto;
  }
}

.shot__frame {
  position: relative;
  aspect-ratio: 9 / 19.5;
  border-radius: 30px;
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(42, 40, 37, 0.05), 0 12px 28px -14px rgba(42, 40, 37, 0.22);
}

.shot__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Shown only when the real screenshot file is absent. */
.shot__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 22px;
  color: var(--faint);
}

.shot__placeholder span {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shot figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* --- Mascot -------------------------------------------------------------- */

/* The mascot is cream-coloured and vanishes against --paper on its own, so it
   sits on a slightly raised disc to give it an edge to read against. */
.mascot {
  display: block;
  margin: 0 auto 26px;
  width: 108px;
  height: 108px;
  padding: 13px;
  background: var(--paper-raised);
  border: 1px solid var(--rule-soft);
  border-radius: 50%;
  object-fit: contain;
}

/* --- App Store badge ----------------------------------------------------- */

.appstore {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px 11px 17px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transition: background 0.15s ease;
}

.appstore:hover {
  background: #191714;
  color: var(--paper);
}

.appstore svg {
  width: 24px;
  height: 24px;
  flex: none;
}

.appstore__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.appstore__text small {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}

.appstore__text strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--paper);
}

.appstore[aria-disabled='true'] {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--rule);
  cursor: default;
  pointer-events: none;
}

.appstore[aria-disabled='true'] .appstore__text strong {
  color: var(--ink-soft);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(40px, 6vw, 60px) 40px;
  font-size: 14.5px;
}

.site-footer__grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .site-footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
  }
}

.site-footer h4 {
  color: var(--ink);
  margin: 0 0 12px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 8px;
}

.site-footer a {
  text-decoration: none;
  color: var(--body);
}

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

.site-footer address {
  font-style: normal;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer__legal {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-soft);
  color: var(--muted);
  font-size: 13.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* --- Accessibility ------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

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

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