/* 2mouse's public pages. The tokens are the app's (src/lib/theme.ts): a near
   black canvas, warm greys, and colour only where the app has it: each AI's
   name in its provider's colour, iOS blue for Summarize, and the Pro and
   Elite plan colours. Two voices, like the app: the system font for the UI
   and you, Newsreader for what the AIs say. */
:root {
  --canvas: #0a0a09;
  --surface: #171715;
  --surface-2: #21211e;
  --bubble-in: #1c1c1a;
  --bubble-out: #272724;
  --ink: #f5f4ef;
  --ink-soft: #a9a7a0;
  --ink-faint: #8a8881;
  --hairline: rgba(255, 255, 245, 0.09);
  --hairline-strong: rgba(255, 255, 245, 0.17);
  --glass: rgba(30, 30, 28, 0.62);
  --glass-rim: rgba(255, 255, 245, 0.12);
  --link: #0a84ff;
  --pro: #93b4d6;
  --pro-tint: rgba(147, 180, 214, 0.16);
  --pro-edge: rgba(147, 180, 214, 0.32);
  --elite: #e6c27e;
  --elite-tint: rgba(230, 194, 126, 0.2);
  --elite-edge: rgba(230, 194, 126, 0.36);

  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-read: 'Newsreader', Georgia, serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(1rem, 4.5vw, 4.5rem);
  --maxw: 84rem;
  --bar-h: 3.75rem;
  --tab-h: 4.25rem;
  --r-tile: 29%;

  /* scrollcraft's tokens, pointed at ours (only the home page loads it). */
  --sc-canvas: var(--canvas);
  --sc-surface: var(--surface);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-soft);
  --sc-accent: var(--ink);
  --sc-accent-ink: #0a0a09;
  --sc-font-display: var(--font-display);
  --sc-font-text: var(--font-ui);
  --sc-shadow-color: 40 8% 2%;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 17px/1.6 var(--font-ui);
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--ink);
  color: var(--canvas);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 8px;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--canvas);
  border-radius: 999px;
}

.skip:focus {
  top: 1rem;
}

/* ------------------------------------------------------------ glass -- */
/* Only the layer that floats over content is glass, as in the app. It falls
   back to solid where blur isn't supported or transparency is reduced. */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: inset 0 1px 0 var(--glass-rim), 0 10px 30px -12px rgba(0, 0, 0, 0.7);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--surface);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* -------------------------------------------------------------- bar -- */
.bar {
  position: fixed;
  inset: 0.75rem var(--gutter) auto;
  z-index: 60;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: 0 0.5rem 0 1.1rem;
  border-radius: 999px;
}

.bar__home {
  display: flex;
  align-items: center;
  flex: none;
  border-radius: 999px;
  padding: 0.35rem 0.25rem;
}

.bar__home img {
  height: 22px;
  width: auto;
}

/* A sibling of the bar, not a child: the bar's backdrop blur would make it
   the containing block of the phone's fixed tab bar. */
.tabs {
  position: fixed;
  z-index: 61;
  top: calc(0.75rem + (var(--bar-h) - 2.9rem) / 2);
  left: 50%;
  translate: -50% 0;
  height: 2.9rem;
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 245, 0.06);
}

.tabs a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.tabs a svg {
  display: none;
}

.tabs a[aria-current='page'] {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 1px 0 var(--glass-rim);
}

@media (hover: hover) and (pointer: fine) {
  .tabs a:hover {
    color: var(--ink);
  }
}

.bar .appstore {
  flex: none;
}

/* On a phone the tabs become the app's floating tab bar at the bottom. */
@media (max-width: 760px) {
  .bar {
    inset: 0.5rem 0.75rem auto;
    height: 3.25rem;
  }

  .tabs {
    top: auto;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    height: var(--tab-h);
    width: min(25rem, calc(100% - 1.5rem));
    margin: 0;
    padding: 0.35rem;
    justify-content: space-between;
    background: var(--glass);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    box-shadow: inset 0 1px 0 var(--glass-rim), 0 12px 30px -10px rgba(0, 0, 0, 0.8);
  }

  .tabs a {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.3rem 0;
    font-size: 11px;
  }

  .tabs a svg {
    display: block;
    width: 24px;
    height: 24px;
  }
}

/* ---------------------------------------------------------- app store -- */
/* A stand-in for Apple's "Download on the App Store" badge until the app is
   live. Swap in Apple's official badge artwork when it is. */
.appstore {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 3.25rem;
  padding: 0 1.25rem 0 1rem;
  border-radius: 0.8rem;
  background: var(--ink);
  color: #0a0a09;
  text-decoration: none;
  line-height: 1.05;
  white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out);
}

.appstore img {
  width: 1.45rem;
  height: auto;
  margin-top: -0.2rem;
}

.appstore span {
  display: flex;
  flex-direction: column;
}

.appstore small {
  font-size: 0.72rem;
  font-weight: 500;
}

.appstore strong {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.appstore:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .appstore:hover {
    background: #ffffff;
  }
}

.appstore--small {
  height: 2.6rem;
  padding: 0 0.95rem 0 0.75rem;
  border-radius: 999px;
  gap: 0.45rem;
}

.appstore--small img {
  width: 1.05rem;
}

.appstore--small small {
  font-size: 0.6rem;
}

.appstore--small strong {
  font-size: 1rem;
}

@media (max-width: 760px) {
  .bar .appstore--small {
    height: 2.3rem;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100% - 2rem);
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  text-align: center;
  opacity: 0;
  translate: -50% 0.75rem;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out), translate 240ms var(--ease-out);
}

.toast.is-on {
  opacity: 1;
  translate: -50% 0;
}

@media (max-width: 760px) {
  .toast {
    bottom: calc(var(--tab-h) + 1.5rem + env(safe-area-inset-bottom));
  }
}

/* ----------------------------------------------------------- avatars -- */
/* A logo tile: the app's Avatar, corners 29% of the side at every size. */
.av {
  --size: 2.75rem;
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: var(--r-tile);
  overflow: hidden;
  background: #ffffff;
}

.av--dark {
  background: #000000;
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
}

.av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.av[data-inset] img {
  padding: calc(var(--size) * 0.16);
  object-fit: contain;
}

/* ----------------------------------------------------------- footer -- */
.foot {
  position: relative;
  padding: 4rem var(--gutter) calc(3rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-size: 15px;
}

.foot__in {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
}

.foot__brand img {
  height: 26px;
  width: auto;
  margin-bottom: 1rem;
}

.foot__brand p {
  max-width: 34ch;
  margin: 0;
}

.foot nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 2rem;
  align-content: start;
}

.foot nav a {
  color: var(--ink-soft);
  text-decoration: none;
  width: fit-content;
}

@media (hover: hover) and (pointer: fine) {
  .foot nav a:hover {
    color: var(--ink);
  }
}

.foot__legal {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--ink-faint);
  font-size: 13px;
}

@media (max-width: 760px) {
  .foot {
    padding-bottom: calc(var(--tab-h) + 3rem + env(safe-area-inset-bottom));
  }

  .foot__in {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------- text pages -- */
/* Privacy, Terms and Help: a reading column under the bar. */
.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: calc(var(--bar-h) + 5rem) 1.25rem 5rem;
}

.doc h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.doc h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 3rem 0 0.5rem;
}

.doc p,
.doc li {
  color: var(--ink-soft);
  text-wrap: pretty;
}

.doc strong {
  color: var(--ink);
}

.doc ul {
  padding-left: 22px;
}

.updated {
  margin-top: 0;
  font-size: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 4px 20px;
  margin: 24px 0;
}

@media (max-width: 760px) {
  .doc {
    padding-top: 6rem;
  }
}

@supports (corner-shape: squircle) {
  .card,
  .appstore {
    corner-shape: squircle;
  }
}
