/* HighlightBot site. Colors and shapes mirror the iOS app (AppPalette, PaywallScreen, RootView). */

:root {
  --brand: #da0004;           /* AppIcon red */
  --tint: #f13b3b;            /* AccentColor */
  --accent: #337af5;          /* AppPalette.accent */
  --violet: #734df2;          /* Paywall button gradient end */
  --confirm: #2eab63;
  --danger: #e6383d;
  --yellow: #ffd60a;          /* SwiftUI .yellow, dark */
  --green: #30d158;           /* SwiftUI .green, dark */
  /* White on --accent is 4.0:1, under AA for small text; the badge uses a deeper blue. */
  --badge: #2b6ce0;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --radius-card: 20px;
  --radius-button: 16px;
  --radius-tile: 12px;
  --page-x: 20px;             /* ScreenMetrics.horizontal */

  /* Light (legal pages, light mode) */
  --bg: #ffffff;
  --text: #1d1d1f;
  --text-2: #59595f;
  --text-3: #6e6e73;
  --link: #1f63d6;
  --rule: rgb(0 0 0 / 0.1);
  --surface: rgb(0 0 0 / 0.04);
  --surface-border: rgb(0 0 0 / 0.08);
  --nav-bg: rgb(255 255 255 / 0.72);
  --nav-border: rgb(0 0 0 / 0.1);
  --nav-item: rgb(0 0 0 / 0.06);
  --nav-text: #1d1d1f;
  --nav-selected-bg: #1d1d1f;
  --nav-selected-text: #ffffff;
  --focus: #1f63d6;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #242321;            /* LaunchBackground, dark */
    --text: #ffffff;
    --text-2: rgb(235 235 245 / 0.7);
    --text-3: rgb(235 235 245 / 0.6);
    --link: #7faefa;
    --rule: rgb(255 255 255 / 0.12);
    --surface: rgb(255 255 255 / 0.06);
    --surface-border: rgb(255 255 255 / 0.08);
    --nav-bg: rgb(44 43 41 / 0.72);
    --nav-border: rgb(255 255 255 / 0.12);
    --nav-item: rgb(255 255 255 / 0.1);
    --nav-text: #ffffff;
    --nav-selected-bg: #ffffff;
    --nav-selected-text: #000000;
    --focus: #7faefa;
  }
}

/* The splash is dark in both color schemes, like the Pro paywall. */
.theme-dark {
  --bg: #000000;
  --text: #ffffff;
  --text-2: rgb(255 255 255 / 0.7);
  --text-3: rgb(255 255 255 / 0.5);
  --link: #337af5;
  --rule: rgb(255 255 255 / 0.12);
  --surface: rgb(255 255 255 / 0.06);
  --surface-border: rgb(255 255 255 / 0.08);
  --nav-bg: rgb(28 28 30 / 0.6);
  --nav-border: rgb(255 255 255 / 0.12);
  --nav-item: rgb(255 255 255 / 0.1);
  --nav-text: #ffffff;
  --nav-selected-bg: #ffffff;
  --nav-selected-text: #000000;
  --focus: #337af5;
  color-scheme: dark;
}

/* Base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.theme-dark {
  background:
    radial-gradient(ellipse 760px 420px at 50% 0, rgb(51 122 245 / 0.55), rgb(51 122 245 / 0) 100%),
    #000;
  background-repeat: no-repeat;
}

main {
  flex: 1;
}

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

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--nav-selected-bg);
  color: var(--nav-selected-text);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

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

/* Floating capsule nav (RootView.topTabBar) */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 12px 12px 0;
  pointer-events: none;
}

.nav-pill {
  pointer-events: auto;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid var(--nav-border);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.2);
}

.nav-pill a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--nav-item);
  color: var(--nav-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-pill a:hover {
  background: var(--surface-border);
  background: color-mix(in srgb, var(--nav-text) 18%, transparent);
}

.nav-pill a[aria-current="page"] {
  background: var(--nav-selected-bg);
  color: var(--nav-selected-text);
}

.nav-pill a:focus-visible {
  border-radius: 999px;
}

@media (max-width: 374px) {
  .nav-pill {
    gap: 2px;
  }

  .nav-pill a {
    padding: 8px 10px;
    font-size: 14px;
  }
}

/* Layout */

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--page-x);
}

.section {
  padding: 56px 0 0;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Hero (PaywallScreen.hero) */

.hero {
  padding: 72px 0 8px;
  text-align: center;
}

.hero-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 8px 24px rgb(0 0 0 / 0.4));
}

.hero h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lede {
  max-width: 30em;
  margin: 10px auto 0;
  color: var(--text-2);
}

.hero-meta {
  margin-top: 14px;
  color: var(--text-3);
  font-size: 13px;
}

/* App Store button and its coming-soon state */

.cta {
  margin: 32px auto 0;
  max-width: 360px;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border-radius: var(--radius-button);
  background: linear-gradient(to right, var(--accent), var(--violet));
  color: #fff;
  /* 19px bold is "large text" in WCAG, so white on the gradient clears AA (4.0:1). */
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

a.button:hover {
  filter: brightness(1.08);
}

a.button:active {
  transform: scale(0.98);
}

.button.is-coming-soon {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  cursor: default;
}

.rec-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgb(218 0 4 / 0.25);
}

/* Cards (PaywallScreen.features) */

.card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
}

/* How it works */

.steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.step h3,
.feature h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.step p,
.feature p {
  color: rgb(255 255 255 / 0.65);
  font-size: 15px;
  line-height: 1.45;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .step {
    flex-direction: column;
  }
}

/* Triggers */

.trigger-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.trigger-list li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}

.trigger-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.trigger-list li:last-child {
  padding-bottom: 0;
}

.trigger-list strong {
  font-weight: 600;
}

.trigger-list .rec-dot {
  position: relative;
  top: -1px;
  width: 8px;
  height: 8px;
  box-shadow: none;
}

.trigger-list span {
  color: var(--text-2);
}

.note {
  margin-top: 14px;
  color: var(--text-3);
  font-size: 13px;
}

/* Pro */

.pro-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.pro-head h2 {
  font-size: 28px;
  font-weight: 700;
}

.pro-lede {
  color: var(--text-2);
  margin-bottom: 20px;
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--badge);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.3;
  vertical-align: middle;
}

.features {
  display: grid;
  gap: 20px;
}

.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.icon-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-tile);
}

.icon-tile svg {
  width: 24px;
  height: 24px;
}

.icon-tile.yellow {
  color: var(--yellow);
  background: rgb(255 214 10 / 0.15);
}

.icon-tile.green {
  color: var(--green);
  background: rgb(48 209 88 / 0.15);
}

.fine-print {
  margin-top: 16px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}

/* Legal and support pages */

.doc {
  padding: 64px 0 24px;
}

.doc h1 {
  font-size: 34px;
  font-weight: 700;
}

.doc .meta {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 15px;
}

.doc .summary {
  margin-top: 24px;
}

.doc .summary p {
  font-size: 17px;
}

.doc h2 {
  margin-top: 40px;
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 700;
}

.doc h3 {
  margin-top: 20px;
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 600;
}

.doc p + p,
.doc p + ul,
.doc ul + p {
  margin-top: 12px;
}

.doc ul {
  margin: 0;
  padding-left: 1.25em;
}

.doc li + li {
  margin-top: 8px;
}

.doc code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--surface);
}

.permissions {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.permissions div {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
}

.permissions dt {
  font-weight: 600;
}

.permissions dd {
  margin: 4px 0 0;
  color: var(--text-2);
}

/* 404 */

.not-found {
  padding: 96px 0 24px;
  text-align: center;
}

.not-found h1 {
  font-size: 34px;
  font-weight: 700;
}

.not-found p {
  margin-top: 10px;
  color: var(--text-2);
}

.not-found .cta {
  max-width: 280px;
}

/* Footer */

.site-footer {
  margin-top: 72px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--text-3);
  font-size: 13px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text-2);
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero > :nth-child(2) { animation-delay: 0.05s; }
  .hero > :nth-child(3) { animation-delay: 0.1s; }
  .hero > :nth-child(4) { animation-delay: 0.15s; }
  .hero > :nth-child(5) { animation-delay: 0.2s; }

  .button.is-coming-soon .rec-dot {
    animation: pulse 2.4s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}
