/* PostureUp website. Colours, type and spacing come from the app's Posture/Design/DesignSystem.swift. */

@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree.ttf") format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Colour tokens: DS.Palette, light ---------- */
:root {
  color-scheme: light dark;

  --brand: #1C58F6;                         /* DS.Palette.brand (Hex.brandLight) */
  --brand-fill: #1C58F6;                    /* DS.Palette.brandFill (Hex.brandLight) */
  --brand-on-tint: #1C58F6;                 /* DS.Palette.brandOnTint (Hex.brandLight) */
  --brand-tint: rgba(28, 88, 246, 0.08);    /* DS.Palette.brandTint (Hex.brandLight at 0.08) */
  --on-brand: #FFFFFF;                      /* DS.Palette.onBrand (Color.white) */

  --slouch: #E07A00;                        /* DS.Palette.slouch (Hex.slouchLight) */
  --slouch-text: #B35F00;                   /* DS.Palette.slouchText */

  --background: #FFFFFF;                    /* DS.Palette.background */
  --surface: #F5F6F8;                       /* DS.Palette.surface */
  --track: #E8EBF0;                         /* DS.Palette.track */
  --mark: #CDD3DD;                          /* DS.Palette.mark */
  --hairline: rgba(0, 0, 0, 0.06);          /* DS.Palette.hairline */
  --edge-lit: rgba(0, 0, 0, 0.1);           /* DS.Palette.edgeLit */
  --wash: rgba(255, 255, 255, 0.75);        /* DS.Palette.wash */
  --wash-clear: rgba(255, 255, 255, 0);     /* DS.Palette.wash faded to clear, as in CardFill */

  --text-primary: #0B0D12;                  /* DS.Palette.textPrimary */
  --text-secondary: #565C68;                /* DS.Palette.textSecondary */
  --text-tertiary: #6F7683;                 /* DS.Palette.textTertiary */
  --sheen-foot: rgba(11, 13, 18, 0.8);      /* DS.sheen: textPrimary at 0.8 */

  --button-light: rgba(255, 255, 255, 0.14); /* ButtonLight.strength */

  /* DS.Space */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-s: 12px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-hero: 64px;
  --side: 16px;                             /* DS.Space.side */
  --radius: 20px;                           /* DS.cornerRadius */
}

/* ---------- Colour tokens: DS.Palette, dark ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #3D74FA;                       /* DS.Palette.brand (Hex.brandDark) */
    --brand-fill: #2C66FF;                  /* DS.Palette.brandFill (Hex.brandFillDark) */
    --brand-on-tint: #6E97FB;               /* DS.Palette.brandOnTint (Hex.brandOnTintDark) */
    --brand-tint: rgba(44, 102, 255, 0.14); /* DS.Palette.brandTint (Hex.brandFillDark at 0.14) */

    --slouch: #F2AC4B;                      /* DS.Palette.slouch (Hex.slouchDark) */
    --slouch-text: #F2AC4B;                 /* DS.Palette.slouchText (Hex.slouchDark) */

    --background: #0A0A0B;                  /* DS.Palette.background */
    --surface: #151517;                     /* DS.Palette.surface */
    --track: #232327;                       /* DS.Palette.track */
    --mark: #3A3B42;                        /* DS.Palette.mark */
    --hairline: rgba(255, 255, 255, 0.08);  /* DS.Palette.hairline */
    --edge-lit: rgba(255, 255, 255, 0.16);  /* DS.Palette.edgeLit */
    --wash: rgba(255, 255, 255, 0.035);     /* DS.Palette.wash */

    --text-primary: #FFFFFF;                /* DS.Palette.textPrimary */
    --text-secondary: #A3A7B0;              /* DS.Palette.textSecondary */
    --text-tertiary: #7F848E;               /* DS.Palette.textTertiary */
    --sheen-foot: rgba(255, 255, 255, 0.8); /* DS.sheen: textPrimary at 0.8 */
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  /* DS.TextStyle.body: 17, medium, -0.1 tracking */
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.006em;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

h1, h2, h3, p { margin: 0; }
p, li, figcaption { text-wrap: pretty; }

.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;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--side);
}

/* ---------- Header ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-m);
  padding-bottom: var(--space-m);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  /* DS.TextStyle.headline: 17, semibold, -0.3 */
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px; /* the iOS icon mask, at this size */
  box-shadow: 0 0 0 1px var(--hairline);
}

.top-link {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ---------- Type ---------- */
.label {
  /* DS.TextStyle.footnote: 13, regular */
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.display {
  /* DS.TextStyle.display: bold, -1 at 34, with DS.sheen */
  font-size: 36px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  text-wrap: balance;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .display {
    background: linear-gradient(to bottom, var(--text-primary), var(--sheen-foot));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.title {
  /* DS.TextStyle.title: 28, bold, -0.8 */
  font-size: 28px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.029em;
  text-wrap: balance;
}

.lede {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.5;
  max-width: 34em;
}

.amber { color: var(--slouch-text); }
.blue { color: var(--brand); }

/* ---------- Hero ---------- */
.hero {
  padding-top: var(--space-l);
  padding-bottom: var(--space-xxl);
}

.hero .label { margin-bottom: var(--space-s); }
.hero .display { margin-bottom: var(--space-m); }
.hero .lede { margin-bottom: var(--space-l); }

.works-with {
  margin-top: var(--space-m);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  max-width: 34em;
}

/* ---------- Waitlist form ---------- */
.join { max-width: 520px; }

.join-row {
  display: grid;
  gap: var(--space-xs);
}

.join input[type="email"] {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  /* CardFill + cardEdge: surface, a wash across the top half, an edge lit from above */
  background:
    linear-gradient(to bottom, var(--wash), var(--wash-clear) 50%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(to bottom, var(--edge-lit), var(--hairline)) border-box;
  color: var(--text-primary);
  font: inherit;
  font-size: 17px;
  letter-spacing: -0.006em;
  -webkit-appearance: none;
  appearance: none;
}
.join input[type="email"]::placeholder { color: var(--text-tertiary); opacity: 1; }
.join input[type="email"]:focus { outline: none; }
.join input[type="email"]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* PrimaryButtonStyle: headline type, 16 / 24 padding, brandFill with ButtonLight */
.button {
  min-height: 56px;
  padding: var(--space-m) var(--space-l);
  border: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(to bottom, var(--button-light), rgba(255, 255, 255, 0) 50%),
    var(--brand-fill);
  color: var(--on-brand);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease;
}
/* softPress: settles to 0.98 and dims to 0.86 */
.button:active { transform: scale(0.98); opacity: 0.86; }
.button:disabled {
  background: var(--surface);
  color: var(--text-tertiary);
  cursor: default;
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: opacity 0.3s ease; }
  .button:active { transform: none; }
}

.join-note {
  margin-top: var(--space-s);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.join-msg:empty { display: none; }
.join-msg {
  margin-top: var(--space-s);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary); /* not amber: in the app, amber only ever means slouching */
}

/* After joining: brandOnTint on brandTint, like the app's tinted notes */
.join.is-done .join-row,
.join.is-done .join-note { display: none; }
.join.is-done .join-msg {
  margin-top: 0;
  padding: var(--space-m) 18px;
  border-radius: var(--radius);
  background: var(--brand-tint);
  color: var(--brand-on-tint);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Real app screens ---------- */
.screen {
  margin: 0;
  border: 1px solid transparent;
  border-radius: 26px;
  /* cardEdge around the screenshot, lit from above */
  background: linear-gradient(to bottom, var(--edge-lit), var(--hairline)) border-box;
  overflow: hidden;
}
.screen img {
  width: 100%;
  border-radius: 25px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-s);
  align-items: start;
  max-width: 440px;
  margin-top: var(--space-xl);
}

.pair-caption {
  grid-column: 1 / -1;
  margin-top: var(--space-xs);
  font-size: 15px;
  color: var(--text-secondary);
}

/* ---------- Sections ---------- */
.section {
  padding-top: var(--space-xxl);
  padding-bottom: var(--space-xxl);
  border-top: 1px solid var(--hairline);
}

.section-head .title { margin-bottom: var(--space-s); }
.section-head .lede { margin-bottom: var(--space-l); }

/* How it works: rows like the app's Settings list, hairlines between */
.steps {
  list-style: none;
  margin: var(--space-l) 0 0;
  padding: 0;
}
.steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0 var(--space-s);
  padding: var(--space-l) 0;
  border-bottom: 1px solid var(--hairline);
}
.steps li:first-child { padding-top: 0; }
.steps .num {
  /* DS.Numeral.medium: 30, semibold, tabular, -0.5 */
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.017em;
  font-variant-numeric: tabular-nums;
  color: var(--brand-fill); /* big blue, as DS.Palette.brandFill: figures at this size */
}
.steps h3 {
  /* DS.TextStyle.section: 20, semibold, -0.4 */
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xxs);
}
.steps p { color: var(--text-secondary); }

.aside {
  margin-top: var(--space-l);
  color: var(--text-secondary);
  max-width: 34em;
}

/* Tune: two screens with captions */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-m) var(--space-s);
  align-items: start;
  max-width: 440px;
}
.duo figcaption {
  margin-top: var(--space-s);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-secondary);
}
.duo figure { margin: 0; }

/* Private */
.private {
  padding: var(--space-l);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(to bottom, var(--wash), var(--wash-clear) 50%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(to bottom, var(--edge-lit), var(--hairline)) border-box;
}
.private .title { margin-bottom: var(--space-s); }
.private p { color: var(--text-secondary); max-width: 36em; }

/* FAQ */
.faq { margin-top: var(--space-l); border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-m);
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s ease;
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p {
  padding: 0 0 var(--space-m);
  color: var(--text-secondary);
  max-width: 36em;
}

/* Bottom call to action */
.closing .title { margin-bottom: var(--space-s); }
.closing .lede { margin-bottom: var(--space-l); }

/* ---------- Footer ---------- */
.foot {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xxl);
  border-top: 1px solid var(--hairline);
  font-size: 15px;
  color: var(--text-secondary);
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-l);
  margin: var(--space-l) 0;
}
.foot nav a { color: var(--text-secondary); }
.foot nav a:hover { color: var(--text-primary); }
.foot .contact { margin-top: var(--space-m); }
.foot .contact a { color: var(--brand); }
.foot .social { margin-top: var(--space-xs); }
.foot .social a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--mark); }
.foot .fine {
  margin-top: var(--space-l);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-tertiary);
  max-width: 48em;
}

/* ---------- Text pages: privacy, terms, support ---------- */
.prose {
  max-width: 680px;
  padding-top: var(--space-l);
  padding-bottom: var(--space-xxl);
}
.prose h1 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-s);
}
.prose h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: var(--space-xl) 0 var(--space-s);
}
.prose p, .prose ul { margin: 0 0 var(--space-m); color: var(--text-secondary); }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: var(--space-xs); }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose a { overflow-wrap: anywhere; }
.prose .updated { font-size: 15px; color: var(--text-tertiary); }
.prose .updated strong { color: var(--text-tertiary); font-weight: 500; }
.prose .callout {
  padding: var(--space-m) 18px;
  border-radius: var(--radius);
  background: var(--brand-tint);
  color: var(--text-primary);
}
.prose .callout a { color: var(--brand-on-tint); font-weight: 600; }

/* No-JavaScript answer page and 404 */
.note-page {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-l) var(--side) var(--space-hero);
}
.note-page .brand { margin-bottom: var(--space-hero); }
.note-page h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-s);
}
.note-page p { color: var(--text-secondary); margin-bottom: var(--space-m); }

/* ---------- Wider screens ---------- */
@media (min-width: 560px) {
  .join-row { grid-template-columns: 1fr auto; }
  .display { font-size: 44px; }
  .title { font-size: 32px; }
}

@media (min-width: 960px) {
  .top { padding-top: var(--space-l); padding-bottom: var(--space-l); }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--space-hero);
    align-items: center;
    padding-top: var(--space-xxl);
    padding-bottom: 96px;
  }
  .display { font-size: 60px; letter-spacing: -0.035em; }
  .hero .lede { font-size: 19px; }
  .pair { margin-top: 0; max-width: 480px; justify-self: end; gap: var(--space-m); }

  .section { padding-top: 96px; padding-bottom: 96px; }
  .title { font-size: 40px; letter-spacing: -0.03em; }

  .split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--space-hero);
    align-items: start;
  }
  .split .steps, .split .faq { margin-top: 0; }
  .split .section-head { position: sticky; top: var(--space-xl); }

  .tune {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-hero);
    align-items: center;
  }
  .tune .duo { order: -1; max-width: 480px; gap: var(--space-m); }

  .private { padding: var(--space-xxl); }

  .closing { text-align: left; }

  .foot-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-xl);
  }
  .foot nav { margin: 0; }
}
