/* What every page of the JOV site shares: the colour, type and spacing tokens, the base text
   styles, the header, the footer and the buttons. The landing and content pages add
   web/get/get.css, the account pages add site.css. System fonts only.

   Type scale (px): 13, 15, 17, 21, 28, 40, 56.   Spacing (px): 4, 8, 12, 16, 24, 32, 48, 72, 112.
   Radii: 8 for inputs and buttons, 12 for screenshots and panels; the hero Download button is the
   one pill. web/tests/contrast.test.mjs checks the text contrast of these tokens. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-alt: #f7f5f6;
  /* A band: a section set off from the page, tinted with the app's colour. */
  --band: #fbf1f6;
  --text: #1d1d1f;
  --text-2: #515154;
  --line: #e0e0e5;
  --line-strong: #c7c7cc;
  --accent: #be1265;
  --accent-hover: #a30f56;
  --accent-text: #b0105e;
  --on-accent: #ffffff;
  --focus: #be1265;

  --danger: #b42318;
  --danger-soft: #fef0ee;
  --success: #0f6b3a;
  --success-soft: #e9f7ef;
  --warning: #8a4b00;
  --warning-soft: #fff4e0;

  --radius: 12px;
  --radius-sm: 8px;
  --shot-shadow: 0 0 0 1px var(--line), 0 20px 40px -24px rgb(0 0 0 / 0.3);
  --container: 1080px;
  --prose: 660px;
  --gutter: 24px;
  --header-height: 56px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Motion (the live windows, web/get/live.css, and the one-time reveals). --ease-pop overshoots a
     little: toasts, files landing, the Dock's bounce; never text. */
  --m-fast: 160ms;
  --m-base: 280ms;
  --m-slow: 520ms;
  --m-scene-hold: 1400ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);

  /* The names site.css used before the tokens above (its admin rules still read them). */
  --bg-subtle: var(--bg-alt);
  --surface: var(--bg);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --text-muted: var(--text-2);
  --brand: var(--accent-text);
  --brand-strong: var(--accent-text);
  --brand-soft: var(--bg-alt);
  --brand-contrast: var(--on-accent);
}

/* JOV Cleaner and JOV Control keep their own colour on their landing pages only. */
body[data-app="cleaner"] { --accent: #0b5fc5; --accent-hover: #0a52aa; --accent-text: #0a58b8; --focus: #0b5fc5; --band: #eef4fc; --bg-alt: #f4f6f9; }
body[data-app="control"] { --accent: #9a552d; --accent-hover: #844826; --accent-text: #8e4e29; --focus: #9a552d; --band: #fbf3ec; --bg-alt: #f8f5f2; }

/* Dark: not black. A deep graphite warmed with the app's colour, sections a step lighter. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f191d;
    --bg-alt: #2a2227;
    --band: #33282f;
    --text: #f5f0f3;
    --text-2: #c4b9bf;
    --line: #40353b;
    --line-strong: #5e5058;
    --accent-hover: #d6197a;
    --accent-text: #ff8ac0;
    --focus: #ff8ac0;

    --danger: #ff9b8f;
    --danger-soft: #3b1714;
    --success: #74d6a0;
    --success-soft: #0f2a1c;
    --warning: #f5c46b;
    --warning-soft: #33250c;
  }
  body[data-app="cleaner"] { --accent: #1765c8; --accent-hover: #1f74de; --accent-text: #8cbcff; --focus: #8cbcff;
    --bg: #161c25; --bg-alt: #1e2632; --band: #253142; --line: #334051; --line-strong: #4e5c6e; --text-2: #b9c2ce; }
  body[data-app="control"] { --accent-hover: #ad6236; --accent-text: #e3ad84; --focus: #e3ad84;
    --bg: #201b17; --bg-alt: #2a241f; --band: #342b24; --line: #42382f; --line-strong: #605349; --text-2: #c7bbb0; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
main:focus { outline: none; }

h1, h2, h3, h4 { margin: 0 0 12px; font-family: var(--display); color: var(--text); }
h1 { font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
h3 { font-size: 21px; font-weight: 600; line-height: 1.3; }
h4 { font-size: 17px; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-inline-start: 1.4em; }
img { max-width: 100%; height: auto; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

code, .mono { font-family: var(--font-mono); font-size: 15px; overflow-wrap: anywhere; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: calc(var(--prose) + 2 * var(--gutter)); }
.muted { color: var(--text-2); }
.small { font-size: 15px; }
.meta { color: var(--text-2); font-size: 13px; }
.center { text-align: center; }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -80px; z-index: 100;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--on-accent); font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* On phones: even heading lines, and no word left alone on a paragraph's last line. */
@media (max-width: 720px) {
  h1, h2, h3 { text-wrap: balance; }
  p, li { text-wrap: pretty; }
}

/* ---------- Header: the logo and JOV at the left, the pages and Download at the right ---------- */
.site-header { position: relative; z-index: 50; background: var(--bg); border-block-end: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 8px 24px; min-height: var(--header-height); }
.brand { display: inline-flex; align-items: center; gap: 8px; margin-inline-end: auto; color: var(--text); font-family: var(--display); font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
/* The logo: the app icon's mark (assets/img/logo.svg, also the favicon). */
.logo-mark { display: inline-block; flex: none; inline-size: 24px; block-size: 24px; background: url("../img/logo.svg") center / contain no-repeat; }
/* On JOV Cleaner's and JOV Control's own pages the mark is that app's icon. */
body[data-app="cleaner"] .logo-mark { background-image: url("../../family/img/cleaner-128.png"); }
body[data-app="control"] .logo-mark { background-image: url("../../family/img/control-128.png"); }
.wordmark { letter-spacing: 0.02em; }
.brand-app { font-weight: 400; margin-inline-start: -3px; }

.site-nav .nav-links { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--text); font-size: 15px; white-space: nowrap; }
.site-nav a:hover { color: var(--accent-text); text-decoration: none; }
.site-nav a[aria-current="page"] { font-weight: 600; }
.site-header .header-cta { min-height: 32px; padding: 0 14px; font-size: 15px; }

/* The phone menu (assets/js/menu.js): wider than 720 px the panel is only a wrapper and the button
   is hidden. Without JavaScript the links simply wrap under the logo. */
.header-panel { display: contents; }
.menu-button { display: none; }

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 0 8px; }
  .brand { min-height: var(--header-height); }
  .site-header .header-cta { min-height: 36px; }
  .header-panel { display: block; order: 5; flex-basis: 100%; padding-block-end: 8px; }

  .has-menu .header-inner { position: relative; flex-wrap: nowrap; }
  .has-menu .menu-button {
    display: inline-grid; place-items: center; flex: none;
    inline-size: 44px; block-size: 44px; margin-inline-end: -10px; padding: 0;
    border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); cursor: pointer;
  }
  /* Three bars, a cross while the menu is open. */
  .menu-icon, .menu-icon::before, .menu-icon::after {
    display: block; inline-size: 18px; block-size: 2px; border-radius: 2px; background: currentColor;
    transition: transform 0.15s ease, background-color 0.15s ease;
  }
  .menu-icon { position: relative; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; inset-inline-start: 0; }
  .menu-icon::before { top: -6px; }
  .menu-icon::after { top: 6px; }
  .menu-open .menu-icon { background: transparent; }
  .menu-open .menu-icon::before { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

  .has-menu .header-panel {
    display: none; position: absolute; top: 100%; inset-inline: 0;
    max-block-size: calc(100dvh - 57px); overflow-y: auto;
    padding: 8px var(--gutter) 16px;
    border-block-end: 1px solid var(--line); background: var(--bg);
  }
  .has-menu.menu-open .header-panel { display: block; }
  .has-menu .site-nav .nav-links { flex-direction: column; gap: 0; }
  .has-menu .site-nav a { display: flex; min-height: 48px; font-size: 17px; }
  .has-menu .site-nav li + li { border-block-start: 1px solid var(--line); }
}

.notice-banner { padding-block: 8px; border-block-end: 1px solid var(--line); background: var(--warning-soft); color: var(--warning); font-size: 15px; text-align: center; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 600 17px/1.2 var(--font); text-align: center; text-decoration: none;
  cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease;
}
.button:hover { text-decoration: none; }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.button-secondary { background: var(--bg); border-color: var(--line-strong); color: var(--text); }
.button-secondary:hover { background: var(--bg-alt); color: var(--text); }
.button-block { display: flex; width: 100%; }
.button:disabled, .button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.button[aria-busy="true"] { cursor: progress; }

/* The one large button on a page: Download, at the top of an app's page and of the Download page. */
.button-download {
  display: inline-block; min-width: 260px; padding: 16px 48px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font: 600 21px/1.3 var(--display); text-align: center;
  transition: background-color 0.15s ease;
}
.button-download:hover { background: var(--accent-hover); color: var(--on-accent); text-decoration: none; }
.button-download[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Footer: slim. On a computer, one line of links in three groups (each group's heading
   is kept for screen readers), then the copyright and the support address. On a phone, three
   short columns with their headings. ---------- */
.site-footer { margin-block-start: auto; padding-block: 24px max(20px, env(safe-area-inset-bottom)); border-block-start: 1px solid var(--line); background: var(--bg-alt); color: var(--text-2); font-size: 14px; }
.footer-columns { display: flex; flex-wrap: wrap; align-items: center; gap: 0 44px; margin: 0 0 8px; }
/* Groups are set apart by space, not rules, so a group that wraps starts flush left. */
.footer-columns > div { display: flex; align-items: center; }
.footer-columns h2 { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 0; padding: 0; list-style: none; }
.footer-links a { display: inline-flex; align-items: center; min-height: 32px; color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.footer-fine { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; font-size: 13px; }
.footer-fine a { color: var(--text-2); text-decoration: underline; text-underline-offset: 0.18em; }
.footer-fine a:hover { color: var(--text); }

@media (max-width: 720px) {
  .footer-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 0 12px; margin-block-end: 12px; }
  .footer-columns > div { display: block; }
  .footer-columns h2 { position: static; inline-size: auto; block-size: auto; overflow: visible; clip-path: none; margin: 0; color: var(--text); font: 600 13px/1.5 var(--font); letter-spacing: 0; }
  .footer-links { display: block; }
  /* Comfortable taps. */
  .footer-links a { display: flex; align-items: center; min-height: 44px; padding-block: 0; }
}
@media (max-width: 480px) {
  :root { --gutter: 16px; }
}
/* ---------- The trial: seven days that fill once as they come into view, then the price ---------- */
.trial { max-width: 30em; margin: 0 0 16px; }
.trial-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.trial-days i { position: relative; display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--line); }
.trial-days i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; }
.trial-days small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.trial-days::after { content: "Day 1 to Day 7: free"; grid-column: 1 / -1; color: var(--text-2); font-size: 13px; }
.trial-then { margin: 4px 0 0; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  html.js .trial:not(.is-now) .trial-days i::after { transition: transform 240ms linear; }
  html.js .trial:not(.is-in) .trial-days i::after { transform: scaleX(0); }
  html.js .trial:not(.is-now) .trial-then { transition: opacity var(--m-base) 1.7s; }
  html.js .trial:not(.is-in) .trial-then { opacity: 0; }
  .trial-days i:nth-child(2)::after { transition-delay: 240ms; } .trial-days i:nth-child(3)::after { transition-delay: 480ms; }
  .trial-days i:nth-child(4)::after { transition-delay: 720ms; } .trial-days i:nth-child(5)::after { transition-delay: 960ms; }
  .trial-days i:nth-child(6)::after { transition-delay: 1200ms; } .trial-days i:nth-child(7)::after { transition-delay: 1440ms; }
}

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