/* HRC Ledger — marketing site.
 *
 * The palette and type below are NOT invented for the web: they are the app's own
 * design tokens, lifted from apps/mobile/src/theme/index.ts and theme/typography.ts.
 * Change them there first, then mirror here.
 *
 * The one rule worth restating: Instrument Serif appears on the money figure and
 * NOWHERE else. typography.ts calls it "the only serif, and a deliberate break
 * (it's the emotional center of the screen)". Same rule holds on the web.
 */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("./fonts/HankenGrotesk-Light.ttf") format("truetype");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("./fonts/HankenGrotesk-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("./fonts/HankenGrotesk-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("./fonts/HankenGrotesk-SemiBold.ttf") format("truetype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("./fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg: #FFFFFF;
  --surface: #F7F7F5;
  --surface-2: #EFEFEC;
  --border: #E4E4E1;
  --text: #1A1A1A;
  --muted: #6B6B6B;
  --accent: #FF6E5A;
  --accent-ink: #16181C;
  --positive: #3F7D5A;
  --flag: #8A6D2E;
  --flag-bg: #F3ECD8;

  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;

  --page: 68rem;
  --prose: 40rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 20, .04), 0 12px 32px -12px rgba(16, 18, 20, .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1C1C1C;
    --surface-2: #232323;
    --border: #2E2E2E;
    --text: #ECECEC;
    --muted: #9A9A9A;
    --accent: #FF6E5A;
    --accent-ink: #16181C;
    --positive: #4FB07A;
    --flag: #F4C51D;
    --flag-bg: #2A2416;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px -12px rgba(0, 0, 0, .7);
  }
}

/* viewer toggle must win over the media query, in both directions */
:root[data-theme="dark"] {
  --bg: #111111;
  --surface: #1C1C1C;
  --surface-2: #232323;
  --border: #2E2E2E;
  --text: #ECECEC;
  --muted: #9A9A9A;
  --positive: #4FB07A;
  --flag: #F4C51D;
  --flag-bg: #2A2416;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px -12px rgba(0, 0, 0, .7);
}
:root[data-theme="light"] {
  --bg: #FFFFFF;
  --surface: #F7F7F5;
  --surface-2: #EFEFEC;
  --border: #E4E4E1;
  --text: #1A1A1A;
  --muted: #6B6B6B;
  --positive: #3F7D5A;
  --flag: #8A6D2E;
  --flag-bg: #F3ECD8;
  --shadow: 0 1px 2px rgba(16, 18, 20, .04), 0 12px 32px -12px rgba(16, 18, 20, .12);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.tabular { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -.03em;
  text-decoration: none;
  margin-right: auto;
}
.brand .mark {
  width: .5rem; height: .5rem;
  border-radius: 50%;
  background: var(--accent);
  translate: 0 -.05rem;
}
.navlinks { display: flex; gap: 1.5rem; align-items: center; }
.navlinks a {
  font-size: .875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}
.navlinks a:hover { color: var(--text); }
@media (max-width: 40rem) { .navlinks .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  font-size: .9375rem;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease, background .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: .9; }
.btn-primary:active { transform: translateY(1px); }
.btn-quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-quiet:hover { background: var(--surface); }
.btn .sub { display: block; font-size: .6875rem; opacity: .7; line-height: 1; }

/* ---------- type ---------- */
.eyebrow {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
h1, h2, h3 { text-wrap: balance; margin: 0; }

.display {
  font-weight: 300;
  font-size: clamp(2.4rem, 5.4vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.display strong { font-weight: 500; }

.lede {
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.6;
  color: var(--muted);
}

.h2 {
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -.03em;
}

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 60rem) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-copy { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.assurance {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  color: var(--muted);
}
.assurance .dot {
  width: .375rem; height: .375rem; border-radius: 50%;
  background: var(--positive);
}

/* ---------- phone ---------- */
.phone-stage { display: flex; justify-content: center; }
.phone {
  width: 100%;
  max-width: 19rem;
  aspect-ratio: 393 / 852;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2.4rem;
  box-shadow: var(--shadow);
  padding: .55rem;
  position: relative;
}
.screen {
  height: 100%;
  border-radius: 1.95rem;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .7rem 1.15rem .2rem;
  font-size: .7rem;
  font-weight: 600;
}
.statusbar .glyphs { display: flex; gap: .28rem; align-items: center; opacity: .85; }
.statusbar .bar { width: .95rem; height: .5rem; border: 1px solid currentColor; border-radius: 2px; }
.notch {
  position: absolute;
  top: .55rem; left: 50%; translate: -50% 0;
  width: 5.2rem; height: 1.45rem;
  background: var(--text);
  border-radius: 1rem;
  z-index: 3;
}
.screen-brand {
  text-align: center;
  padding: .7rem 0 .2rem;
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: -.03em;
}
.today {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: 1rem 1.25rem;
  text-align: center;
}
.today .label { font-size: .8125rem; color: var(--muted); }
/* the single serif — see the note at the top of this file */
.today .figure {
  font-family: var(--serif);
  font-size: 3.35rem;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.today .figure .cur { font-size: 1.9rem; vertical-align: .55rem; margin-right: .04em; }
.today .sub { font-size: .8125rem; color: var(--muted); }
.today .note {
  margin-top: .9rem;
  font-size: .75rem;
  line-height: 1.45;
  color: var(--positive);
  max-width: 15rem;
}
.tabbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: .55rem 1.6rem 1.1rem;
  border-top: 1px solid var(--border);
  font-size: .625rem;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: .25rem; color: var(--muted); }
.tab.on { color: var(--accent); }
.tab .ico { width: .95rem; height: .95rem; }
.tab-agent { display: flex; flex-direction: column; align-items: center; gap: .25rem; color: var(--muted); }
.tab-agent .orb {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--text);
  translate: 0 -.55rem;
}
.tab-agent .cap { translate: 0 -.5rem; }

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--border); }
.section-head { display: flex; flex-direction: column; gap: .85rem; max-width: 38rem; margin-bottom: 2.75rem; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.0625rem; }

/* ---------- chat ---------- */
.chat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 60rem) { .chat-grid { grid-template-columns: 1fr; } }

.chat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--muted);
}
.chat-head .orb {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--text);
  flex: none;
}
.chat-head .who { color: var(--text); font-weight: 500; }
.chat-log {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.1rem;
}
.msg {
  max-width: 88%;
  padding: .7rem .9rem;
  border-radius: 14px;
  font-size: .9375rem;
  line-height: 1.5;
}
.msg.them {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.msg.you {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 5px;
}
.msg .fig {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.msg .why {
  display: block;
  margin-top: .45rem;
  padding-top: .45rem;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--muted);
}
.chat-foot {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .8125rem;
}
.chat-foot .field {
  flex: 1;
  padding: .5rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* staggered arrival — messages land the way they do in the product */
@media (prefers-reduced-motion: no-preference) {
  .chat-log .msg { opacity: 0; animation: rise .5s ease forwards; }
  .chat-log .msg:nth-child(1) { animation-delay: .05s; }
  .chat-log .msg:nth-child(2) { animation-delay: .35s; }
  .chat-log .msg:nth-child(3) { animation-delay: .65s; }
  .chat-log .msg:nth-child(4) { animation-delay: .95s; }
  @keyframes rise {
    from { opacity: 0; translate: 0 .5rem; }
    to   { opacity: 1; translate: 0 0; }
  }
}

.notes { display: flex; flex-direction: column; gap: 1.6rem; }
.note-item { display: flex; flex-direction: column; gap: .4rem; }
.note-item h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.02em; }
.note-item p { margin: 0; color: var(--muted); font-size: .9375rem; }

/* ---------- promise ---------- */
.promise {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
}
.promise .item { display: flex; flex-direction: column; gap: .5rem; }
.promise .item .k {
  font-size: .75rem; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}
.promise .item p { margin: 0; font-size: .9375rem; color: var(--muted); }
.promise .item strong { color: var(--text); font-weight: 500; }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3.5rem;
  color: var(--muted);
  font-size: .875rem;
}
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: flex-start; }
.foot .col { display: flex; flex-direction: column; gap: .5rem; }
.foot .col:first-child { margin-right: auto; max-width: 22rem; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.foot .legalname { color: var(--text); font-weight: 500; }

/* ---------- legal pages ---------- */
.doc { padding: clamp(2.5rem, 6vw, 4rem) 0 5rem; }
.doc-inner { max-width: var(--prose); margin-inline: auto; }
.doc-inner > * + * { margin-top: 1.15rem; }

.doc-inner h1 {
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -.035em;
  line-height: 1.1;
}
.doc-inner h2 {
  margin-top: 2.75rem;
  font-weight: 600;
  font-size: 1.3125rem;
  letter-spacing: -.02em;
  line-height: 1.25;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.doc-inner h3 {
  margin-top: 2rem;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -.015em;
}

/* part divider — "SECTION A / SECTION B". Carries the precedence split, so it has
   to read as a break in the document, not another heading. */
.doc-inner h2.part {
  margin-top: 3.5rem;
  padding: 1.1rem 0 0;
  border-top: 2px solid var(--accent);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.toc .part > a { color: var(--text); font-weight: 500; }
.toc li.part { margin-top: .5rem; list-style: none; margin-left: -1.1rem; }
.doc-inner p { margin-block: 0; }
.doc-inner ul, .doc-inner ol { margin-block: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.doc-inner li { line-height: 1.6; }
.doc-inner strong { font-weight: 600; }
.doc-inner hr { border: 0; border-top: 1px solid var(--border); margin-block: 2.5rem; }
.doc-inner a { color: var(--text); text-underline-offset: 2px; }

/* the annotations under each heading in the ToS */
.doc-inner blockquote {
  margin: 0;
  padding: .9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .9375rem;
}
.doc-inner blockquote p { margin: 0; }
.doc-inner blockquote + blockquote { margin-top: .6rem; }

.doc-inner .annot {
  color: var(--muted);
  font-size: .9375rem;
  font-style: italic;
  line-height: 1.55;
}

.table-scroll { overflow-x: auto; }
.doc-inner table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.doc-inner th, .doc-inner td {
  text-align: left;
  vertical-align: top;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
}
.doc-inner th { font-weight: 600; background: var(--surface); }

.doc-inner code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .875em;
  background: var(--surface-2);
  padding: .1em .35em;
  border-radius: 4px;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: .875rem;
}

.banner {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--flag-bg);
  border: 1px solid color-mix(in srgb, var(--flag) 35%, transparent);
  color: var(--flag);
  font-size: .9375rem;
  line-height: 1.55;
}
.banner strong { color: var(--flag); font-weight: 600; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
}
.toc p { margin: 0 0 .6rem; font-size: .75rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; font-size: .875rem; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); text-decoration: underline; }
