/* The site's look (Nov 2026 redesign): the app's own, on the website.

   Loaded AFTER marketing.css, by every server-rendered marketing page
   (layout.ts) and by the home page (home.html, through src/homeLook.css),
   so the header, footer, prose and components keep marketing.css's layout
   and this file changes how they look. Most of that is the tokens below:
   marketing.css takes its colours from them, so its pages turn over without
   a second copy of their styles. What a token can't reach (the header's
   shape, the band, the font) is restyled here.

   Light only, as the site always was (owner, 7 Nov 2026: the website has no dark
   mode, for now). The app's tokens: the iOS grouped grey ground, white
   cards, the blue accent, and the red-green-blue band under the status bar
   that the editor and the store screenshots carry. */

:root {
  --bg: #ffffff;
  --page: #f2f2f7;
  --text: #111114;
  --text-secondary: #55555e;
  --text-muted: #6b6b75;
  --accent: #1f6fc5;
  --accent-hover: #1a5fa9;
  --on-accent: #fff;
  --border: #e6e6ec;
  --footer: #111114;
  /* A pale wash of the accent, for chips and icon tiles. */
  --tint: #e8f0fb;
  /* An outline that reads as the accent's, for a secondary button. */
  --accent-line: #c9d9ef;
  /* The band's three colours, the logo's. */
  --band-red: #ff5a5a;
  --band-green: #2fbf63;
  --band-blue: #4fa3ff;
}

/* The app's type: the phone's own font everywhere (SF on Apple, Segoe on
   Windows, Roboto on Android), over marketing.css's old Familjen Grotesk. */
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The red-green-blue band across the very top of every page. */
body::before {
  content: "";
  display: block;
  flex: none;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--band-red) 0 33.33%,
    var(--band-green) 33.33% 66.67%,
    var(--band-blue) 66.67% 100%
  );
}

/* ---------------------------------------------------------------- Header */
/* No bar of its own: the page's ground runs up to the band. */
.marketing-header {
  padding-top: 4px;
  padding-bottom: 4px;
  background: transparent;
  border-bottom: none;
}

.site-nav {
  gap: 24px;
}

.site-nav a:not(.site-nav__cta) {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
}

.site-nav a:not(.site-nav__cta):hover {
  color: var(--accent);
}

.site-nav__books {
  padding-left: 24px;
}

/* A returning visitor's books are known before the first frame (<html
   data-books>, set from the hint: src/editor/storage/booksHint.ts), so
   "Your books" is there from the start, rather than appearing once the
   page's script has read them (src/siteNav.ts corrects it then). */
html[data-books] .site-nav__books[hidden] {
  display: block;
}

.site-nav__cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 16px;
}

/* A phone has room for the logo and one button: "Make a book", or with books
   "Your books" (marketing.css hides the pill then). The other links are in
   the footer. */
/* The site's phone gutter is 24px (marketing.css), and the logo's ink starts
   about a sixth of its height in, which the negative margin hands back, so
   the mark lines up with the page's text and the footer's logo. */
@media (max-width: 760px) {
  .marketing-header {
    flex-wrap: nowrap;
    padding: 0 24px;
  }

  .marketing-logo__img {
    height: 56px;
    margin-left: -9px;
  }

  .site-nav {
    width: auto;
    justify-content: flex-end;
    gap: 12px;
    padding: 0;
  }

  .site-nav a:not(.site-nav__cta, .site-nav__books) {
    display: none;
  }

  .site-nav a.site-nav__books {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1.5px solid var(--accent-line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
  }

  .site-nav .site-nav__books[hidden] {
    display: none;
  }

  html[data-books] .site-nav .site-nav__books[hidden] {
    display: inline-flex;
  }

  html[data-books] .site-nav__cta {
    display: none;
  }

  .site-nav__cta {
    padding: 0 18px;
  }
}

/* ---------------------------------------------------------------- Footer */
/* marketing.css lays it out; the ground is the app's near-black (--footer). */
.marketing-footer {
  border-top: none;
}

/* ------------------------------------------------- Panels and components */
/* What marketing.css and the page stylesheets painted cream or brown rather
   than from a token. The page stylesheets (testimonial.css, reviews.css)
   load after this one, so their overrides here carry `body` for the
   specificity to win. */

/* "Make yours." at the foot of most pages (layout.ts renderCta), and the
   £10 on /prices: white cards on the grey ground, as the app's are. */
.marketing-cta,
.prices-figure {
  background: var(--bg);
  border-color: transparent;
  border-radius: 20px;
}

/* "Make yours", the home page's and the marketing pages' (home.html,
   layout.ts renderCta): the button, then "or get the app" and the badges. */
.marketing-cta h2 {
  font-size: 32px;
  letter-spacing: -0.02em;
}

.hl-close__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
}

.hl-close__row .hl-badges {
  justify-content: center;
  margin: -10px 0;
}

.hl-close__or {
  color: var(--text-muted);
  font-size: 16px;
}

/* The stores' rules (appMention.ts): Apple's badge 40px tall with 10px
   clear round it; Google's PNG carries its clear space, so 60px tall shows
   the same 40px badge. */
.hl-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 4px 0 -10px -10px;
}

.hl-badge {
  display: block;
  line-height: 0;
}

.hl-badge[hidden] {
  display: none;
}

.hl-badge--apple {
  padding: 10px;
}

.hl-badge--apple img {
  width: auto;
  height: 40px;
}

.hl-badge--google img {
  width: auto;
  height: 60px;
}

/* A page whose "Make yours" carries the badges leaves the footer's out. */
body:has(.hl-close__row .hl-badges) .marketing-footer__apps {
  display: none;
}

@media (max-width: 760px) {
  .hl-close__row {
    flex-direction: column;
  }
}

/* A drop shadow in the page's own grey, not the old warm brown. */
body .testimonial--card {
  box-shadow: 0 18px 40px -30px rgb(17 17 20 / 35%);
}

body .testimonial__photo {
  box-shadow: 0 24px 48px -28px rgb(17 17 20 / 35%);
}

body .testimonial__draft,
.blog-draft-banner {
  color: var(--text);
}

/* /reviews and /rate: the form's fields and the "free book" pill. */
body .rate-field :is(input, textarea),
body .rate-button,
body .review-card__free {
  border-color: var(--border);
}

/* The smallest phones (a Unihertz Jelly Star is 320px wide): a smaller logo
   and button keep the two on the one row. */
@media (max-width: 380px) {
  .marketing-logo__img {
    height: 40px;
    margin-left: -7px;
  }

  .site-nav__cta,
  .site-nav a.site-nav__books {
    padding: 0 12px;
  }
}
