/* ============================================================================
   Shared styles for every page: tokens, base, nav, buttons, footer.
   Loaded by index.html and by the three legal pages. Page-specific rules live
   in home.css (homepage) and legal.css (privacy, website privacy, terms).

   Design reference: "Payr - Rent Payment Website" by Outcrowd (Dribbble shot
   27168202). Colours sampled from its pixels: panel #020711, step card
   #111727, light card #f9fbfc, nav pill #edeff1, grey headline #9ea4ad. The
   blue is Somatics' own #35c2fd (theirs is #2bc2ea).
   ========================================================================= */

:root {
  /* Theme: LIGHT is the default (changed from dark on 6 Oct 2026 at Daniel's
     request). Ticking the sun/moon switch in the nav (an <input id="theme">)
     flips every colour to the DARK set below. Pure CSS: no JavaScript and
     nothing stored in the browser, which keeps the website privacy policy's
     "stores nothing" statement true and the legal pages script-free. The
     choice therefore resets to light on each page load. */
  color-scheme: light;
  --bg: #ffffff;
  --ink: #050a12;
  --ink-soft: #3a404a;
  --grey: #9ea4ad;
  --body: #5d6470;
  --line: #eceef1;
  --pill: #edeff1;
  --card: #f9fbfc;
  --menu: #ffffff;
  --panel: #020711;
  --panel-line: #020711;
  --step: #111727;
  --dot: #d6dade;
  --dot-on: #8b93a0;
  --link: #0077b6;
  /* Same grey as "all in one place." in the hero, at half a pixel. */
  --pop-ring: #9ea4ad;
  --pop-ring-w: 0.5px;
  --pop-shadow: 0 22px 44px rgba(10, 20, 40, 0.18), 0 6px 14px rgba(10, 20, 40, 0.10);
  /* The app's UI is dark, so on near-white cards it reads as harsh black
     blocks. A soft grey-blue card takes the glare out of that jump. */
  --feature-card: #e9eef3;
  /* Reviews panel, sampled from the reference: #f3f5f7 behind white cards. */
  --soft-panel: #f3f5f7;
  /* Shadow above and below the dark How it works panel, for depth. */
  --panel-shadow: 0 -26px 60px rgba(2, 7, 17, 0.26), 0 26px 60px rgba(2, 7, 17, 0.34);
  --review-card: #ffffff;
  --accent-card: #020711; --accent-card-line: #020711;
  --accent-ink: #ffffff; --accent-body: #9aa3b2;
  --chip: #ffffff;
  --feature-line: #dde3ea;
  --img-shadow: drop-shadow(0 10px 24px rgba(10, 20, 40, 0.18));
  --logo-filter: brightness(0);
  --shadow-float: 0 16px 40px rgba(10, 20, 40, 0.10), 0 2px 6px rgba(10, 20, 40, 0.05);
  --blue: #35c2fd;
  --font: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
  --max: 1204px;
  --pad: 24px;
}
/* DARK (21 Oct: neutral charcoal from the app's own dark UI instead of navy, so it reads less like a template; old navy values in ~/sfn-dev/snapshots/2026-10-21-before-dark-redo) */
/* No white flash (Daniel, 22 Oct): the site opens in the device's own light
   or dark setting through these media queries, with no script, so a page is
   never drawn light first. The switch (#theme) flips whichever mode the device
   uses: on a light device, checked means dark; on a dark device, checked means
   light. Edit the colours in the first block only: make_blog.py copies them
   into the second block on every build. */
@media not all and (prefers-color-scheme: dark) {
/* DARK TOKENS START */
:root:has(#theme:checked) {
  color-scheme: dark;
  --bg: #131417;
  --ink: #ededee;
  --ink-soft: #c8c8cc;
  --grey: #74757b;
  --body: #a3a3a8;
  --line: #2a2c31;
  --pill: #1e2024;
  --card: #202226;
  --menu: #1f2126;
  --panel: #202226;
  --panel-line: #2a2c31;
  --step: #24272d;
  --dot: #34363d;
  --dot-on: #8e9097;
  --link: #4fbdf0;
  --pop-ring: rgba(255, 255, 255, 0.18);
  --pop-ring-w: 1px;
  --pop-shadow: 0 18px 40px rgba(0, 0, 0, 0.50), 0 4px 10px rgba(0, 0, 0, 0.30);
  --feature-card: #202226;
  --soft-panel: #202226;
  /* A dark shadow on a near-black page reads as a dirty band, so the How it
     works panel relies on its lighter fill and edge here instead. */
  --panel-shadow: none;
  --review-card: #24272d;
  /* The progression card matches the other feature cards in dark mode
     (Daniel, 21 Oct). It used to flip to a light card here, which made it
     the one bright block in the section. */
  --accent-card: #202226; --accent-card-line: #24262b;
  --accent-ink: #ededee; --accent-body: #a3a3a8;
  /* Lighter than the page so TikTok's official black circle still shows. */
  --chip: #2e3136;
  --feature-line: #24262b;
  --img-shadow: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
  --logo-filter: none;
  --shadow-float: 0 16px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.30);
}
/* DARK TOKENS END */
}
@media (prefers-color-scheme: dark) {
/* DARK TOKENS COPY: written by make_blog.py from the block above. Do not edit. */
:root:not(:has(#theme:checked)) {
  color-scheme: dark;
  --bg: #131417;
  --ink: #ededee;
  --ink-soft: #c8c8cc;
  --grey: #74757b;
  --body: #a3a3a8;
  --line: #2a2c31;
  --pill: #1e2024;
  --card: #202226;
  --menu: #1f2126;
  --panel: #202226;
  --panel-line: #2a2c31;
  --step: #24272d;
  --dot: #34363d;
  --dot-on: #8e9097;
  --link: #4fbdf0;
  --pop-ring: rgba(255, 255, 255, 0.18);
  --pop-ring-w: 1px;
  --pop-shadow: 0 18px 40px rgba(0, 0, 0, 0.50), 0 4px 10px rgba(0, 0, 0, 0.30);
  --feature-card: #202226;
  --soft-panel: #202226;
  /* A dark shadow on a near-black page reads as a dirty band, so the How it
     works panel relies on its lighter fill and edge here instead. */
  --panel-shadow: none;
  --review-card: #24272d;
  /* The progression card matches the other feature cards in dark mode
     (Daniel, 21 Oct). It used to flip to a light card here, which made it
     the one bright block in the section. */
  --accent-card: #202226; --accent-card-line: #24262b;
  --accent-ink: #ededee; --accent-body: #a3a3a8;
  /* Lighter than the page so TikTok's official black circle still shows. */
  --chip: #2e3136;
  --feature-line: #24262b;
  --img-shadow: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
  --logo-filter: none;
  --shadow-float: 0 16px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.30);
}
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }

.wrap { max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: #050a12; color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- Buttons ----------
   Download buttons stay disabled until there is an App Store link. WCAG
   exempts disabled controls from contrast; once live, white on #35c2fd
   (about 2:1) needs revisiting. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 28px; border-radius: 999px; border: 1px solid transparent;
  font-size: 1rem; font-weight: 400; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-blue { background: var(--blue); color: #ffffff; }
.btn-white { background: #ffffff; color: #050a12; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-small { height: 36px; padding: 0 18px; font-size: 0.88rem; }
.btn:disabled { cursor: default; }

/* ---------- Nav: grey pill ----------
   Built from <details> elements so the dropdown and the mobile menu work with
   no JavaScript at all. The legal pages load none, on purpose. */
/* Sticky: the pill stays pinned at the top of the screen on every page.
   The strip around it is transparent, so the page shows past its edges. */
.nav { position: sticky; top: 0; z-index: 50; padding: 16px var(--pad) 0; }
/* nav.js moves the nav up out of view while scrolling down, in step with
   the scroll, by setting its transform (not translate: the homepage's
   load-in animation holds the nav's translate). */
/* Anything a link jumps to stops below the pinned nav, not behind it. */
[id] { scroll-margin-top: 96px; }
.nav-pill {
  max-width: var(--max); margin: 0 auto; height: 54px;
  padding: 0 9px 0 20px; display: flex; align-items: center; gap: 12px;
  background: var(--pill); border-radius: 16px; position: relative;
  box-shadow: 0 6px 20px rgba(10, 20, 40, 0.08);
}
.nav-logo { display: inline-flex; align-items: center; }
.nav-logo img { width: 30px; height: 30px; }
/* Centred in the space between the logo and the buttons, not on the page:
   page-centred links collided with the buttons below about 1150px wide. */
.nav-links { display: flex; align-items: center; gap: 30px; margin: 0 auto; }
/* With room to spare, centre on the page as the reference does. Measured:
   the links only clear the buttons on the right from about 1280px up. */
@media (min-width: 1300px) {
  .nav-links { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; }
}
.nav-links > a, .nav-drop > summary { text-decoration: none; font-size: 0.88rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.nav-links > a:hover, .nav-drop > summary:hover { color: var(--ink); }
.nav-drop { position: relative; }
.nav-drop > summary svg { width: 12px; height: 12px; }
/* Only the arrow flips when the menu opens, not the menu icons. */
.nav-drop[open] > summary svg { transform: rotate(180deg); }
.nav-drop-menu {
  position: absolute; left: 50%; top: calc(100% + 14px); transform: translateX(-50%);
  min-width: 230px; width: max-content; background: var(--menu); border-radius: 14px; padding: 8px; box-shadow: var(--shadow-float);
}
.nav-drop-menu a { display: flex; align-items: center; gap: 12px; white-space: nowrap; padding: 9px 12px; border-radius: 9px; text-decoration: none; font-size: 0.9rem; color: var(--ink-soft); }
.nav-drop-menu a:hover { background: var(--card); color: var(--ink); }
/* Roll-out: the menu unrolls downward from under "Features" and the options
   drop in one after another; closing rolls it back up. CSS only, so it also
   runs on the legal pages, which load no JavaScript. Browsers without
   ::details-content (older Safari, Firefox) still roll it out but close it
   instantly. The clip ends past the shadow's reach, so nothing pops. */
.nav-drop::details-content { transition: content-visibility 0.28s allow-discrete; }
.nav-drop-menu {
  clip-path: inset(0 -50px 100% -50px round 14px);
  transition: clip-path 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-drop[open] .nav-drop-menu {
  clip-path: inset(-30px -50px -70px -50px round 14px);
  transition: clip-path 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-drop-menu a { opacity: 0; translate: 0 -8px; transition: opacity 0.18s ease, translate 0.18s ease; }
.nav-drop[open] .nav-drop-menu a { opacity: 1; translate: 0 0; transition: opacity 0.32s ease var(--item-delay, 0s), translate 0.32s ease var(--item-delay, 0s); }
.nav-drop-menu a:nth-child(1) { --item-delay: 0.05s; }
.nav-drop-menu a:nth-child(2) { --item-delay: 0.09s; }
.nav-drop-menu a:nth-child(3) { --item-delay: 0.13s; }
.nav-drop-menu a:nth-child(4) { --item-delay: 0.17s; }
.nav-drop-menu a:nth-child(5) { --item-delay: 0.21s; }
@starting-style {
  .nav-drop[open] .nav-drop-menu { clip-path: inset(0 -50px 100% -50px round 14px); }
  .nav-drop[open] .nav-drop-menu a { opacity: 0; translate: 0 -8px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-drop::details-content, .nav-drop-menu, .nav-drop-menu a,
  .nav-drop[open] .nav-drop-menu, .nav-drop[open] .nav-drop-menu a { transition: none; }
}
/* Line icons drawn for this menu (no icon set, no downloads): white on the
   app's light blue (#62bff8, sampled from the app's calorie bar). */
.drop-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #62bff8; color: #ffffff; }
.drop-ico svg { width: 17px; height: 17px; }
/* Nav menus (Features, Resources): a color emoji on a soft tile instead of the blue icon (Daniel, 21 Oct). */
.drop-emoji { background: var(--card); border: 1px solid var(--line); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 17px; line-height: 1; }

/* Light/dark switch: a round button with a moon in dark mode and a sun in
   light mode. The checkbox is visually hidden but still focusable, so it works
   from the keyboard and reads as a switch to screen readers. */
/* Thin line between Pro and Blogs: the homepage sections on the left, the
   separate Blogs page on the right. */
.nav-divider { width: 1px; height: 16px; background: var(--grey); opacity: 0.5; margin: 0 -12px; }
/* Search: a round button beside the light/dark switch, same size and look.
   It is a plain link to /search/, so it works on pages with no JavaScript. */
.nav-search {
  flex: none; width: 36px; height: 36px; border-radius: 50%; margin-left: auto;
  display: grid; place-items: center; text-decoration: none;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.nav-search:hover { border-color: var(--grey); }
.nav-search svg { width: 17px; height: 17px; }
.nav-search + .theme-toggle { margin-left: 0; }
.theme-toggle {
  position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; margin-left: auto;
  display: grid; place-items: center; cursor: pointer;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.theme-toggle:hover { border-color: var(--grey); }
.theme-toggle:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.theme-input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; grid-area: 1 / 1; pointer-events: none; }
.theme-moon { display: none; }
@media not all and (prefers-color-scheme: dark) {
  :root:has(#theme:checked) .theme-moon { display: block; }
  :root:has(#theme:checked) .theme-sun { display: none; }
}
@media (prefers-color-scheme: dark) {
  :root:not(:has(#theme:checked)) .theme-moon { display: block; }
  :root:not(:has(#theme:checked)) .theme-sun { display: none; }
}
.nav-mobile { display: none; }

/* ---------- Footer ----------
   Same markup on every page. Desktop: logo, tagline and store badges on the
   left, four link columns on the right, then a bottom row (copyright left,
   FatSecret credit right) under a thin line. The wordmark SVG is white, so
   it is turned ink here rather than editing the shared file. */
.footer { border-top: 1px solid var(--line); padding: 64px 0 36px; font-size: 0.92rem; color: var(--body); }
.footer-inner { max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }
.footer-top { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 48px; }
.footer-logo { width: 90px; height: auto; filter: var(--logo-filter); }
.footer-tagline { margin-top: 14px; max-width: 260px; color: var(--body); }
.footer-badges { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.footer-badges .store-badge { display: inline-flex; }
.footer-badges .store-badge img { height: 40px; width: auto; }
.footer-cols { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 32px; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-head { margin-bottom: 4px; font-size: 0.76rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grey); }
.footer a { text-decoration: none; color: var(--body); }
.footer a:hover { color: var(--ink); }
.footer-mail { overflow-wrap: anywhere; }
.footer-bottom {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  font-size: 0.82rem;
}
@media (max-width: 900px) {
  /* Phone: logo, tagline and badges centred on top, the link columns two
     by two, then the bottom row stacked and centred. */
  .footer { padding: 48px 0 32px; }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .footer-badges { justify-content: center; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-bottom { margin-top: 36px; flex-direction: column; text-align: center; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-mobile { display: block; }
  .nav-mobile > summary { width: 40px; height: 40px; display: grid; place-items: center; }
  .nav-mobile > summary span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink); }
  .nav-mobile-panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px);
    background: var(--menu); border-radius: 16px; padding: 10px; box-shadow: var(--shadow-float);
    display: grid; gap: 2px;
  }
  .nav-mobile-panel a { padding: 12px 14px; text-decoration: none; font-size: 1rem; border-radius: 10px; }
  .nav-mobile-panel .btn { margin-top: 8px; width: 100%; }
  /* Menu drawer: drops down and fades in, links following one after
     another; closing fades it back up. CSS only, so it works on the legal
     and blog pages too. Browsers without ::details-content close it
     instantly. */
  .nav-mobile::details-content { transition: content-visibility 0.24s allow-discrete; }
  .nav-mobile-panel { opacity: 0; translate: 0 -10px; transition: opacity 0.2s ease, translate 0.24s ease; }
  .nav-mobile[open] .nav-mobile-panel { opacity: 1; translate: 0 0; transition: opacity 0.28s ease, translate 0.34s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .nav-mobile-panel > * { opacity: 0; translate: 0 -6px; transition: opacity 0.15s ease, translate 0.15s ease; }
  .nav-mobile[open] .nav-mobile-panel > * { opacity: 1; translate: 0 0; transition: opacity 0.3s ease var(--item-delay, 0s), translate 0.3s ease var(--item-delay, 0s); }
  .nav-mobile-panel > :nth-child(1) { --item-delay: 0.04s; }
  .nav-mobile-panel > :nth-child(2) { --item-delay: 0.07s; }
  .nav-mobile-panel > :nth-child(3) { --item-delay: 0.10s; }
  .nav-mobile-panel > :nth-child(4) { --item-delay: 0.13s; }
  .nav-mobile-panel > :nth-child(5) { --item-delay: 0.16s; }
  .nav-mobile-panel > :nth-child(6) { --item-delay: 0.19s; }
  .nav-mobile-panel > :nth-child(7) { --item-delay: 0.22s; }
  .nav-mobile-panel > :nth-child(8) { --item-delay: 0.25s; }
  @starting-style {
    .nav-mobile[open] .nav-mobile-panel { opacity: 0; translate: 0 -10px; }
    .nav-mobile[open] .nav-mobile-panel > * { opacity: 0; translate: 0 -6px; }
  }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .nav-mobile::details-content, .nav-mobile-panel, .nav-mobile-panel > *,
  .nav-mobile[open] .nav-mobile-panel, .nav-mobile[open] .nav-mobile-panel > * { transition: none; }
}

/* Resources dropdown: small group headings between the links, and drop-in
   delays for longer menus. */
.nav-drop-menu .drop-head { display: block; padding: 10px 12px 4px; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--body); }
.nav-drop-menu a:nth-child(6) { --item-delay: 0.25s; }
.nav-drop-menu a:nth-child(7) { --item-delay: 0.29s; }
.nav-drop-menu a:nth-child(8) { --item-delay: 0.33s; }
.nav-drop-menu a:nth-child(9) { --item-delay: 0.37s; }
.nav-drop-menu a:nth-child(10) { --item-delay: 0.41s; }
.nav-drop-menu a:nth-child(11) { --item-delay: 0.45s; }
.nav-drop-menu a:nth-child(12) { --item-delay: 0.49s; }
.nav-drop-menu a:nth-child(13), .nav-drop-menu a:nth-child(14) { --item-delay: 0.53s; }
/* "View all resources" at the foot of the Resources menu (Daniel, 22 Oct):
   opens the full /resources/ page. A line above sets it apart from the list. */
.nav-drop-menu a.drop-all { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; justify-content: space-between; color: var(--link); font-weight: 500; }
.nav-drop-menu a.drop-all:hover { color: var(--link); }
.drop-all svg { width: 16px; height: 16px; flex: none; transition: translate 0.2s ease; }
.drop-all:hover svg { translate: 3px 0; }

/* Menu entrance only on the first page of a visit: navfx.js adds nav-still
   when the visitor came from another page on this site (Daniel, 22 Oct). */
html.nav-still .nav { animation: none; }
