/* ---------------------------------------------------------------
   Retainer — shared stylesheet

   The Retainer identity: the R1 mark (two ticks, one ink and one
   vermilion, overlapping) on warm cream. Every colour below is the
   same value the app's Retainer theme uses (Theme/Palette.swift,
   `.retainer`), so the site and the product cannot drift apart.

   Vermilion is the one accent and it means what it means in the app:
   a check-in. Links are underlined in it; nothing is decorated with it.
   --------------------------------------------------------------- */

:root {
  --paper:      #F3EEE2;   /* cream — the icon's ground */
  --paper-sunk: #E9E2D2;   /* creamDeep */
  --card:       #FAF7F2;   /* surface */
  --ink:        #1C1A17;
  --muted:      #696660;   /* 4.9:1 on cream — the lightest grey allowed for body text */
  --line:       #D3C8B3;   /* faint */

  /* Never set body text in vermilion on cream: 3.1:1. Fills,
     underlines and large type only. */
  --accent:        #FC3D21;
  --accent-subtle: #F4D9CB;
  --miss:          #B8AF9E;  /* a day not checked in, as in the app's activity strip */

  /* The mark keeps its vermilion in both modes; only the first tick
     and the crossing change, per the handoff's Ink colourway. */
  --mark-accent:   #FC3D21;
  --mark-crossing: #8C2C1C;  /* exactly 50/50 ink + vermilion — keep it derived */

  --radius-card: 15px;   /* Theme.Layout.cardCornerRadius */
  --radius-sq:   3px;    /* Theme.Layout.squareCornerRadius */

  /* Apple's rounded system face — the app's own. It is read from the
     visitor's device, so no font is downloaded from anyone: a privacy
     policy page should not hand its readers' addresses to a font CDN.
     Off Apple platforms it falls back to the system sans. */
  --font-body: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);
  --font-data: var(--font-body);

  --measure: 63ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #1C1A17;
    --paper-sunk: #121110;
    --card:       #2C2A27;
    --ink:        #F4EFE3;
    --muted:      #A29E95;
    --line:       #3B3730;
    --accent:        #FC5840;
    --accent-subtle: #442019;
    --miss:          #5E5A53;
    --mark-crossing: #F89682;
  }
}

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

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

/* ---- Type ---------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); line-height: 1.2; }
h3 { font-size: 1.12rem; line-height: 1.35; }
/* The heavier face sits a heading hard against its paragraph; a
   section's heading gets a little air before what it introduces. */
section > h2 { margin-bottom: .7rem; }

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 1px; }
a:hover { border-bottom-width: 4px; padding-bottom: 0; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.lede { font-size: 1.2rem; color: var(--muted); max-width: var(--measure); }

/* A label above a section. Only used where it says something true
   about what follows, never as ornament. */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .6rem;
}

.data { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* ---- Shell --------------------------------------------------- */

.wrap { width: 100%; max-width: 61rem; margin: 0 auto; padding: 0 1.35rem; }
.wrap--prose { max-width: 44rem; }

header.site {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  border-bottom: none;
  display: inline-flex; align-items: center; gap: .55rem;
}
.wordmark:hover { border-bottom: none; }
/* The R1 mark, inline so it follows the colour scheme. The viewBox is
   cropped to the ink (caps included), so the mark sits on the text's
   line with no dead space around it. */
.wordmark .mark { height: 1.15em; width: auto; aspect-ratio: 830 / 464; display: block; }
.mark .first  { stroke: var(--ink); }
.mark .second { stroke: var(--mark-accent); }
.mark .cross  { stroke: var(--mark-crossing); }
nav.site { margin-left: auto; display: flex; gap: 1.25rem; font-size: .93rem; }
nav.site a { border-bottom: 2px solid transparent; color: var(--muted); }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

main { padding: 3.5rem 0 5rem; }
section { margin-bottom: 4rem; }
section:last-child { margin-bottom: 0; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 3.5rem;
  color: var(--muted);
  font-size: .9rem;
}
footer.site .wrap { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: baseline; }
footer.site nav { margin-left: auto; display: flex; gap: 1.2rem; flex-wrap: wrap; }
/* Instagram and Threads wrap as a pair, so neither sits alone on a
   line of its own on a phone. */
footer.site nav .follow { display: flex; gap: 1.2rem; }

/* ---- The action card ----------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.25rem 1.2rem;
}

.action {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0 .9rem;
  align-items: center;
}
.action .emoji {
  width: 48px; height: 48px;            /* Theme.Layout.emojiCircleSize */
  border-radius: 50%;
  background: var(--paper-sunk);
  display: grid; place-items: center;
  font-size: 23px;
}
.action .name { font-weight: 600; font-size: 1.02rem; }
.action .since { font-family: var(--font-data); font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
/* A date wants the mono face. A sentence does not. */
.action .tagline { font-size: .92rem; color: var(--muted); }
.action .count {
  font-family: var(--font-data); font-variant-numeric: tabular-nums;
  font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em;
  text-align: center; line-height: 1;
}
/* The unit beneath the figure, as the app's Prominent time-since sets it. */
.action .count .unit {
  display: block; margin-top: .25em;
  font-size: .3em; font-weight: 800; letter-spacing: .08em;
}

/* The app icon wherever the app is named: the R1 tiles, corners and
   rim already drawn, swapped for the dark tile in dark mode as iOS
   would. The dark tile has no rim of its own and is the same colour as
   the dark page, so there it gets a hairline to keep its shape. */
.appicon { display: block; width: 48px; height: 48px; border-radius: 22.5%; }
@media (prefers-color-scheme: dark) {
  .appicon { box-shadow: 0 0 0 1px var(--line); }
}
.appicon--hero { width: 88px; height: 88px; margin-bottom: 1.4rem; }
.action .grid { grid-column: 2 / -1; margin-top: .65rem; }

.action--hero { grid-template-columns: 64px 1fr auto; }
.action--hero .emoji { width: 64px; height: 64px; font-size: 31px; }
.action--hero .name { font-size: 1.25rem; }
.action--hero .count { font-size: 2.1rem; }

/* ---- The square grid ----------------------------------------- */

.grid { display: flex; flex-wrap: wrap; gap: 3px; }
.grid i {
  width: 11px; height: 11px;            /* Theme.Layout.weeklySquareSize */
  border-radius: var(--radius-sq);
  background: var(--miss);
  display: block;
}
.grid i.on { background: var(--accent); }

/* ---- A whole card that is a link ------------------------------ */

/* The global rule gives links a vermilion underline that thickens on
   hover. A card is a box, not a word, so it opts out of both — left
   in, the hover would eat the card's own bottom padding. */
a.card { border-bottom: 1px solid var(--line); padding-bottom: 1.2rem; }
a.card:hover {
  border-bottom-width: 1px;
  padding-bottom: 1.2rem;
  border-color: color-mix(in srgb, var(--ink) 30%, var(--line));
}

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

.stack { display: flex; flex-direction: column; gap: 1rem; }
.cols {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.feature h3 { margin-bottom: .35rem; }
.feature p { color: var(--muted); font-size: .96rem; margin: 0; }

.hero { margin-bottom: 3.2rem; }
.hero h1 { margin-bottom: .9rem; }
.hero .lede { margin-bottom: 2rem; }

/* ---- Home page: a screenshot beside each idea ---------------- */

.pair { display: grid; gap: 1.6rem 3rem; align-items: center; }
.pair p { max-width: var(--measure); }
.shot { margin: 0; justify-self: center; width: 100%; max-width: 17rem; }
.shot img {
  display: block; width: 100%; height: auto;
  border-radius: 2.1rem;   /* the iPhone screen's own corners, at this size */
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -20px rgba(28, 26, 23, .45);
}
@media (min-width: 48rem) {
  .pair { grid-template-columns: 1fr 17rem; }
  .pair--flip { grid-template-columns: 17rem 1fr; }
  .pair--flip .shot { order: -1; }
}
.points { padding-left: 1.2rem; margin: 0 0 1.1rem; max-width: var(--measure); }
.points li { margin: .38rem 0; }

/* ---- Prose pages (privacy, support) -------------------------- */

.prose h2 {
  margin: 2.9rem 0 .8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.prose h3 { margin: 1.7rem 0 .4rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.1rem; }
.prose li { margin: .38rem 0; }
.prose strong { font-weight: 600; }

.callout {
  background: var(--accent-subtle);
  border-left: 3px solid var(--accent);
  padding: .95rem 1.15rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}
.callout p:last-child { margin-bottom: 0; }

.todo {
  background: #FFE9E9; border-left: 3px solid #D94040; color: #5C1B1B;
  padding: .9rem 1.1rem; margin: 1.5rem 0; border-radius: 0 8px 8px 0;
  font-size: .94rem;
}
.todo code { background: rgba(0,0,0,.07); padding: .1em .35em; border-radius: 3px; }
@media (prefers-color-scheme: dark) {
  .todo { background: #3A1D1D; color: #FFD7D7; border-left-color: #E06060; }
  .todo code { background: rgba(255,255,255,.1); }
}

.updated { color: var(--muted); font-size: .9rem; margin: 0 0 2.2rem; }

/* Wide things scroll inside themselves; the page never does. */
table, pre { display: block; overflow-x: auto; max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Narrow screens ------------------------------------------- */

/* At phone width the hero card's three columns fight each other:
   a 64px circle plus a large counter leaves too little for a name
   like "Air purifier filter", which then wraps mid-phrase. Below
   30rem the hero simply uses the ordinary card's proportions. */
@media (max-width: 30rem) {
  .action--hero .emoji { width: 48px; height: 48px; font-size: 23px; }
  .action--hero { grid-template-columns: 48px 1fr auto; }
  .action--hero .name { font-size: 1.05rem; }
  .action--hero .count { font-size: 1.6rem; }
  .action .grid { grid-column: 1 / -1; }
  main { padding: 2.5rem 0 3.5rem; }
  section { margin-bottom: 3rem; }
}

/* The App Store badge: Apple's artwork, untouched, at least 40px tall,
   with clear space around it. Black on cream, white in dark mode. */
.store { margin: 0 0 .9rem; }
.store-badge, .store-badge:hover { display: inline-block; line-height: 0; border-bottom: 0; }
.store-badge img { height: 50px; width: auto; }
