/* Plan #449: the public site's shared look. The bar at the top of every
   public page (the homepage, Pricing, Get early access and its follow-on
   pages, Terms and Privacy), its phone Menu, the light/dark switch, and the
   colours those pages share. Dark is the default (html.dark, set by
   _theme_init.html); a saved "light" gives html:not(.dark).

   The homepage is dark only and never gets the .dark class, so everything
   under .pub-bar--home uses fixed dark colours, never the variables below. */

/* ---- colours ---- */
.ct-public {
  --pub-bg: #F7F5F1;
  --pub-surface: #ffffff;
  --pub-surface-2: #F1EEE8;
  --pub-text: #1C1917;
  --pub-dim: #57534E;
  --pub-faint: #78716C;
  --pub-line: #E7E5E4;
  --pub-line-strong: #D6D3D1;
  --pub-accent: #1F7A74;
  --pub-accent-ink: #ffffff;
  --pub-accent-soft: rgba(31,122,116,.10);
  --pub-bar-bg: rgba(247,245,241,.86);
  --pub-shadow: 0 1px 2px rgba(28,25,23,.04), 0 12px 32px -16px rgba(28,25,23,.18);
}
html.dark .ct-public {
  --pub-bg: #070B10;
  --pub-surface: #0E141C;
  --pub-surface-2: #121A24;
  --pub-text: #F4F6F8;
  --pub-dim: rgba(244,246,248,.66);
  --pub-faint: rgba(244,246,248,.44);
  --pub-line: rgba(244,246,248,.13);
  --pub-line-strong: rgba(244,246,248,.22);
  --pub-accent: #2BB8A0;
  --pub-accent-ink: #06110d;
  --pub-accent-soft: rgba(43,184,160,.12);
  --pub-bar-bg: rgba(7,11,16,.80);
  --pub-shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -20px rgba(0,0,0,.7);
}
body.ct-public, html.dark body.ct-public { background: var(--pub-bg); color: var(--pub-text); }
.ct-public .pub-main { min-height: 60vh; }
.ct-public .pub-footer { color: var(--pub-dim); padding: 0 16px 28px; }
.ct-public .pub-footer .ct-site-footer { margin-top: 48px; opacity: 1; }

/* ---- the bar ---- */
.pub-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .9rem 1.5rem;
  background: var(--pub-bar-bg);
  border-bottom: 1px solid var(--pub-line);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.pub-brand {
  display: inline-flex; align-items: center; gap: .55rem; min-width: 0;
  font-weight: 700; font-size: .95rem; letter-spacing: -0.01em;
  color: var(--pub-text); text-decoration: none;
}
.pub-brand .brand-name { white-space: nowrap; }
.pub-nav { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.pub-nav a { white-space: nowrap; }
.pub-link { font-size: .8125rem; font-weight: 500; color: var(--pub-dim); text-decoration: none; }
.pub-link:hover, .pub-link[aria-current="page"] { color: var(--pub-text); }
.pub-link[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--pub-accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
/* Plan #496: the explainer's button in the bar looks like the links beside it. */
.pub-video { padding: 0; border: 0; background: none; font-family: inherit; white-space: nowrap; cursor: pointer; }
.pub-video .pub-video-short { display: none; }
.pub-video:focus-visible, .pub-menu .pub-menu-video:focus-visible { outline: 2px solid var(--pub-accent); outline-offset: 2px; border-radius: 4px; }
@media (min-width: 768px) and (max-width: 1023px) {
  .pub-video .pub-video-full { display: none; }
  .pub-video .pub-video-short { display: inline; }
}
.pub-cta {
  font-size: .8125rem; font-weight: 600; color: var(--pub-text); text-decoration: none;
  padding: .375rem .75rem; border-radius: 9999px; border: 1px solid var(--pub-line-strong);
  transition: border-color .2s ease, background-color .2s ease;
}
.pub-cta:hover { border-color: var(--pub-accent); background: var(--pub-accent-soft); }
.pub-cta .cta-short { display: none; }
.pub-menu-btn { display: none; }

/* Plan #450: the news badge. A star in a ring, still until you point at it,
   tab to it or tap it; then its words slide open to the left (the badge is
   anchored on its right edge). Nothing on it moves by itself. */
.pub-news {
  display: inline-flex; align-items: center; flex-shrink: 0; height: 2rem;
  border-radius: 9999px; border: 1px solid var(--pub-line-strong);
  color: var(--pub-accent); text-decoration: none; white-space: nowrap;
}
.pub-news svg { width: 2rem; height: 2rem; padding: .42rem; flex: none; }
.pub-news-text {
  display: inline-block; max-width: 0; overflow: hidden; opacity: 0;
  font-size: .8125rem; font-weight: 600; color: var(--pub-text);
}
.pub-news:hover, .pub-news:focus-visible, .pub-news[data-open] { background: var(--pub-accent-soft); border-color: var(--pub-accent); }
.pub-news:hover .pub-news-text, .pub-news:focus-visible .pub-news-text, .pub-news[data-open] .pub-news-text {
  max-width: 24rem; opacity: 1; padding-left: .85rem;
}
.pub-news:focus-visible { outline: 2px solid var(--pub-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .pub-news-text { transition: max-width .2s ease, opacity .2s ease, padding .2s ease; }
}
.pub-menu .pub-menu-news { color: var(--pub-accent); font-weight: 600; border-bottom: 1px solid var(--pub-line); border-radius: 10px 10px 0 0; margin-bottom: .25rem; }
.pub-bar--home .pub-news { color: #2BB8A0; border-color: rgba(244,246,248,0.22); }
.pub-bar--home .pub-news-text { color: #F4F6F8; }
.pub-bar--home .pub-news:hover, .pub-bar--home .pub-news:focus-visible, .pub-bar--home .pub-news[data-open] { background: rgba(43,184,160,.12); border-color: #2BB8A0; }
.pub-bar--home .pub-news:focus-visible { outline-color: #2BB8A0; }
.pub-bar--home .pub-menu .pub-menu-news { color: #2BB8A0; border-bottom-color: rgba(244,246,248,.13); }

/* The one light/dark switch outside the app: the sun shows in dark (it
   switches to light), the moon in light. */
.ct-theme-switch {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2rem; height: 2rem; border-radius: 9999px; border: 1px solid transparent;
  background: transparent; color: #78716C; cursor: pointer;
}
.ct-theme-switch:hover { color: #1C1917; background: rgba(28,25,23,.06); }
html.dark .ct-theme-switch { color: #9aa3b5; }
html.dark .ct-theme-switch:hover { color: #F4F6F8; background: rgba(244,246,248,.08); }
.ct-theme-switch svg { width: 15px; height: 15px; }
html.dark .ct-theme-switch .ct-theme-moon, html:not(.dark) .ct-theme-switch .ct-theme-sun { display: none; }
.pub-bar .ct-theme-switch { color: var(--pub-dim); }

/* ---- the phone Menu ---- */
.pub-menu {
  position: absolute; top: calc(100% + 6px); right: 1rem; z-index: 60;
  min-width: 14rem; max-width: calc(100vw - 2rem);
  padding: .4rem; border-radius: 16px;
  background: var(--pub-surface); color: var(--pub-text);
  border: 1px solid var(--pub-line); box-shadow: var(--pub-shadow);
}
.pub-menu[hidden] { display: none; }
.pub-menu a, .pub-menu .pub-menu-row, .pub-menu .pub-menu-video {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  min-height: 44px; padding: 0 .85rem; border-radius: 10px;
  font-size: .95rem; font-weight: 500; color: var(--pub-text); text-decoration: none;
}
.pub-menu .pub-menu-video { width: 100%; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.pub-menu a:hover, .pub-menu .pub-menu-video:hover { background: var(--pub-accent-soft); }
.pub-menu a[aria-current="page"] { color: var(--pub-accent); }
.pub-menu .pub-menu-row { color: var(--pub-dim); }
.pub-menu .pub-menu-row .ct-theme-switch { width: 44px; height: 44px; margin-right: -.6rem; }

@media (max-width: 767px) {
  .pub-bar { padding: 1rem 1rem; }
  .pub-nav { gap: .5rem; }
  .pub-nav > .pub-link, .pub-nav > .ct-theme-switch, .pub-nav > .pub-news { display: none; }
  /* Plan #198's 44px tap area, without making the pill itself taller. */
  .pub-nav .pub-cta { position: relative; padding: .45rem .8rem; }
  .pub-nav .pub-cta::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 44px; transform: translateY(-50%); }
  .pub-cta .cta-full { display: none; }
  .pub-cta .cta-short { display: inline; }
  .pub-menu-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    min-height: 44px; margin-block: -8px; padding: 0 .35rem 0 .5rem;
    background: transparent; border: 0; cursor: pointer;
    font: inherit; font-size: .8125rem; font-weight: 600; color: var(--pub-text);
  }
  .pub-menu-btn svg { width: 18px; height: 18px; }
}
@media (min-width: 768px) { .pub-menu { display: none !important; } }
/* Very narrow phones: only the logo mark shows; the name stays for screen readers. */
@media (max-width: 399px) {
  .pub-brand { gap: .45rem; }
  .pub-brand .brand-name { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
}

/* ---- the homepage's bar: fixed over the story, fixed dark colours ---- */
.pub-bar--home {
  position: fixed; left: 0; right: 0;
  padding: 1.1rem 1.5rem;
  background: linear-gradient(to bottom, rgba(7,11,16,0.75), rgba(7,11,16,0));
  border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.pub-bar--home .pub-brand { color: rgba(244,246,248,0.52); transition: color 0.6s ease; cursor: pointer; }
.pub-bar--home.prominent .pub-brand { color: #F4F6F8; }
.pub-bar--home .pub-link { color: rgba(244,246,248,0.52); }
.pub-bar--home .pub-link:hover { color: #F4F6F8; }
.pub-bar--home .pub-cta { color: #F4F6F8; border-color: rgba(244,246,248,0.16); }
.pub-bar--home .pub-cta:hover { border-color: #2BB8A0; background: rgba(43,184,160,.12); }
.pub-bar--home .pub-menu-btn { color: #F4F6F8; }
.pub-bar--home .pub-menu { background: #0E141C; color: #F4F6F8; border-color: rgba(244,246,248,.13);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.7); }
.pub-bar--home .pub-menu a { color: #F4F6F8; }
.pub-bar--home .pub-menu a:hover { background: rgba(43,184,160,.12); }
@media (max-width: 767px) { .pub-bar--home { padding: 1rem 1rem; } }
@media (max-width: 380px) { .pub-bar--home .pub-brand { font-size: .85rem; } }

/* Shared by the redesigned public pages (plans #452, #453): sections fade in
   once as they scroll into view (public.js), and not at all with less motion.
   Hidden only once the script is running, so nothing stays hidden without it. */
@media (prefers-reduced-motion: no-preference) {
  html.pub-js .pub-fade { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
  html.pub-js .pub-fade.pub-in { opacity: 1; transform: none; }
}

/* Plan PL-517: our social media pictures on Get early access, the Pioneer Wall
   and Pricing. Each sits in a wide, borderless window (the same 1254:760 shape on
   every page: the full 1040 px column on a computer, edge to edge on a phone) that
   fades into the page over a faint teal glow. The picture is taller than the
   window and glides through it as you scroll (public.js: is-moving), so every part
   of it is seen; the fades sit on the window, so they stay put while it moves.
   With "reduce motion" on, the window grows to show the whole picture, still.
   The next block on the page (.pub-rise) sits over the faded lower edge and stays
   readable and clickable. Browsers without mask support show plain edges. */
.ct-public { --pub-glow: rgba(31,122,116,.10); }
html.dark .ct-public { --pub-glow: rgba(43,184,160,.16); }
.pub-band { position: relative; margin: -8px 0 0; }
.pub-band-glow { position: absolute; z-index: 0; top: 18%; bottom: -10%; pointer-events: none;
  /* Up to 90px past the column, but never past the screen's edge (no sideways scroll). */
  left: calc(-1 * clamp(0px, (100vw - 1040px) / 2, 90px)); right: calc(-1 * clamp(0px, (100vw - 1040px) / 2, 90px));
  background: radial-gradient(ellipse at 50% 45%, var(--pub-glow), transparent 70%); }
/* The fades ease in and out through extra stops, so no line shows where one ends. */
.pub-band-window { position: relative; z-index: 1; overflow: hidden; aspect-ratio: 1254 / 760; max-width: 100%;
  --pub-mask-v: linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 4%, #000 12%, #000 88%, rgba(0,0,0,.35) 96%, transparent 100%);
  --pub-mask-h: linear-gradient(to right, transparent 0, rgba(0,0,0,.4) 3%, #000 9%, #000 91%, rgba(0,0,0,.4) 97%, transparent 100%);
  -webkit-mask-image: var(--pub-mask-v), var(--pub-mask-h);
  -webkit-mask-composite: source-in;
  mask-image: var(--pub-mask-v), var(--pub-mask-h);
  mask-composite: intersect; }
.pub-band-window picture { display: block; }
/* Without the script, the middle of the picture shows; with it, the script moves it from the top. */
.pub-band-window img { display: block; position: absolute; left: 0; top: 50%; width: 100%; height: auto; max-width: none; transform: translateY(-50%); }
.pub-band.is-moving .pub-band-window img { top: 0; will-change: transform; }
html.dark .pub-band--bright img { filter: brightness(.88) saturate(1.06) contrast(1.03); }   /* the two daytime scenes don't glare */
.pub-rise { position: relative; z-index: 1; margin-top: -96px; }
.pub-thread { position: relative; width: 2px; height: 88px; margin: -40px auto 8px; z-index: 1;
  background: linear-gradient(to bottom, transparent, var(--pub-accent)); }
.pub-thread::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; border-radius: 999px;
  background: var(--pub-accent); box-shadow: 0 0 0 4px var(--pub-accent-soft), 0 0 16px 2px var(--pub-accent); }
@media (max-width: 767px) {
  .pub-band { margin: -6px -16px 0; }
  .pub-band-glow { left: 0; right: 0; }
  /* Edge to edge at the picture's full width (nothing cut at the sides): top and bottom fades only. */
  .pub-band-window { --pub-mask-v: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
    -webkit-mask-image: var(--pub-mask-v); mask-image: var(--pub-mask-v); }
  .pub-rise { margin-top: -44px; }
  .pub-thread { height: 56px; margin-top: -24px; }
  .pub-thread::after { width: 10px; height: 10px; margin-left: -5px; bottom: -5px; }
}
@media (prefers-reduced-motion: reduce) {
  .pub-band-window { aspect-ratio: 1254 / 1054; }   /* the whole picture, still */
  .pub-band-window img, .pub-band.is-moving .pub-band-window img { position: static; transform: none !important; will-change: auto; }
}
/* Plan #555: the account pages (sign in, sign up, password reset, ...) never slide sideways on a phone. */
@media (max-width: 767px) {
  body.ct-acct { overflow-x: clip; overflow-wrap: break-word; }
  body.ct-acct img { max-width: 100%; height: auto; }
}
/* Plan #557: on a phone or touch screen the account pages follow the app's phone rules: no text under
   12px, primary buttons full width and at least 44px, 20px tick boxes in a 44px label, text buttons
   (such as "Sign out") a 44px tap. */
@media (max-width: 767px), (pointer: coarse) {
  body.ct-acct .t-label { font-size: .75rem; }
  body.ct-acct form .btn-primary { width: 100%; min-height: 44px; justify-content: center; }
  body.ct-acct input[type="checkbox"], body.ct-acct input[type="radio"] { width: 20px; height: 20px; flex-shrink: 0; }
  body.ct-acct label:has(> input[type="checkbox"], > input[type="radio"]) { min-height: 44px; padding-inline-start: 4px; }
  body.ct-acct button.ct-link { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
}
