/* CollectionsDock marketing site - shared styles.
   Design language: deep teal primary, system font stack, light + dark
   via prefers-color-scheme, mobile-first responsive. */

:root {
  /* Brand colours. --primary is the deep teal used as a background
     (white-on-teal buttons, pills, step numbers). --accent is for
     foreground accents (links, icons, accent text) - it stays the same
     deep teal in light mode but switches to the lighter mint in dark
     mode so we don't end up with dark-teal-on-dark-navy contrast bugs.
     --primary-dark is for hover. --primary-light is the brighter mint. */
  --primary: #0f766e;
  --primary-dark: #0c5d56;
  --primary-light: #14b8a6;
  --primary-fade: rgba(15, 118, 110, 0.08);
  --accent: #0f766e;

  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 24px rgba(15, 23, 42, 0.04);

  --radius: 12px;
  --radius-sm: 6px;
  --container: 1080px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f12;
    --surface: #131a1f;
    --surface-2: #1c252b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #24313a;
    --primary-fade: rgba(20, 184, 166, 0.12);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 24px rgba(0, 0, 0, 0.18);
    /* Brighter accent for foreground use on dark backgrounds; the dark
       teal --primary stays available for backgrounds where we pair it
       with white text. */
    --accent: #2dd4bf;
  }
}

* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); line-height: 1.2; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; }
p.lead { font-size: 1.25rem; color: var(--text-muted); max-width: 60ch; }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }

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

/* ─── Header ─────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand img { width: 32px; height: 32px; }

.site-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

/* Plain nav links - not the Install button (which is a .btn). The
   :not(.btn) keeps the button's own color rules from being overridden
   by the more-specific .site-nav a selector. */
.site-nav a:not(.btn) {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* Mobile hamburger menu (CSS-only <details> disclosure). Hidden on desktop,
   where the inline .site-nav links are shown instead. */
.nav-menu { display: none; }

@media (max-width: 640px) {
  .site-nav { gap: 12px; }
  /* Hide only the DIRECT inline links; the links inside .nav-menu-panel are
     not direct children of .site-nav, so they stay available in the menu. */
  .site-nav > a:not(.nav-primary) { display: none; }

  .nav-menu { display: block; position: relative; }
  .nav-menu > summary {
    list-style: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text);
    border-radius: var(--radius-sm);
  }
  .nav-menu > summary::-webkit-details-marker { display: none; }
  .nav-menu > summary:hover,
  .nav-menu[open] > summary { background: var(--surface); }
  .nav-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 20;
  }
  .site-nav .nav-menu-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
  }
  .site-nav .nav-menu-panel a:hover { background: var(--surface); text-decoration: none; }

  /* Stack call-to-action buttons full-width so multiple CTAs (Install for
     Edge / Install for Chrome / Try Pro) form a tidy, equal-width column
     instead of wrapping into ragged centred rows of differing widths. */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .install-cta { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .hero-cta .btn,
  .install-cta .btn { width: 100%; }
}

/* ─── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
  font-family: inherit;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover { background: var(--primary-dark); color: #ffffff; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 8px 14px;
}
.btn-ghost:hover { background: var(--primary-fade); }

.btn-block { width: 100%; }
.btn-large { padding: 14px 28px; font-size: 1.05rem; }

/* ─── Hero ───────────────────────────────────────────────────── */

.hero {
  padding: 80px 0 64px;
  background:
    radial-gradient(ellipse at 50% -20%, var(--primary-fade), transparent 60%);
}

.hero .container {
  text-align: center;
}

.hero h1 {
  max-width: 720px;
  margin: 0 auto 24px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero p.lead {
  margin: 0 auto 32px;
  text-align: center;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hero-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Section ────────────────────────────────────────────────── */

.section {
  padding: 64px 0;
}
.section + .section {
  border-top: 1px solid var(--border);
}

.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-head p.lead {
  margin: 0 auto;
  text-align: center;
}

/* ─── Feature cards ──────────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

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

.feature .icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-fade);
  color: var(--accent);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 700;
}

.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text-muted); margin: 0; }

/* ─── Pricing ────────────────────────────────────────────────── */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  position: relative;
}

.price-card.featured::before {
  content: "Recommended";
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--primary);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.price-card h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.price-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.price-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.price-amount .num {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.price-amount .per {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.price-savings {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  min-height: 1.2em;
}

.price-trial {
  display: inline-block;
  background: var(--primary);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}

.price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  flex-grow: 1;
}

.price-features li {
  padding: 6px 0 6px 24px;
  position: relative;
  font-size: 0.95rem;
}

.price-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 6px;
  color: var(--accent);
  font-weight: 800;
}

.price-features li.no::before {
  content: "-";
  color: var(--text-muted);
}

/* ─── Install steps ──────────────────────────────────────────── */

.steps {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.step .num {
  background: var(--primary);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.step h4 { margin: 0 0 4px; }
.step p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.step code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.85em;
}

/* ─── Footer ─────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 48px 0 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-brand {
  max-width: 320px;
}
.footer-brand p { margin: 8px 0 0; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-links section h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 12px;
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.footer-links a:hover { color: var(--text); text-decoration: none; }

.copyright {
  width: 100%;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
}

/* ─── Legal pages (privacy / terms / support) ────────────────── */

.legal {
  padding: 48px 0 80px;
}

.legal .container {
  max-width: 760px;
}

.legal h1 { margin-bottom: 8px; }
.legal .updated { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }

.legal h2 {
  font-size: 1.4rem;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.legal h3 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal ul, .legal ol {
  padding-left: 24px;
}
.legal li { margin-bottom: 6px; }

.legal p, .legal li { color: var(--text); }

.callout {
  background: var(--primary-fade);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: 6px;
  margin: 20px 0;
}

.callout p { margin: 0; }

/* ─── Buy / Pro placeholder page ─────────────────────────────── */

.buy-hero {
  padding: 96px 0;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, var(--primary-fade), transparent 60%);
}

.buy-hero h1 { margin-bottom: 12px; }

.buy-card {
  max-width: 480px;
  margin: 32px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: left;
}

.buy-card .price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.buy-card .price-row:last-of-type { border-bottom: none; }
.buy-card .price-row strong { font-size: 1.25rem; }
.buy-card .price-row span { color: var(--text-muted); }

/* Plan picker on /buy.html and /account.html.
   Two-card radio group followed by a "Continue to Stripe" button.
   Native <input type=radio> inputs are visually hidden but stay
   focusable for keyboard navigation; the styled <label>s next to
   them act as the clickable cards. The :checked + label selector
   gives the chosen card its accent border + tint.

   The radios sit BEFORE each label in source order, so the
   adjacent-sibling combinator (+) just works. */
.plan-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
@media (max-width: 540px) {
  .plan-picker { grid-template-columns: 1fr; }
}
.plan-picker input[type="radio"] {
  /* Visually hidden but still focusable (accessible). */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}
.plan-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.plan-option:hover { border-color: var(--primary-light); }
.plan-picker input[type="radio"]:checked + .plan-option {
  border-color: var(--primary);
  background: var(--primary-fade);
}
/* Show focus on the label when the (hidden) radio is keyboard-focused. */
.plan-picker input[type="radio"]:focus-visible + .plan-option {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.plan-option-name { font-weight: 600; font-size: 1rem; color: var(--text); }
.plan-option-price { font-size: 0.85rem; color: var(--text-muted); }

/* Inline error messages on /buy.html and /account.html. Previously
   used .error class with no actual style — error text rendered but
   looked like normal copy and was easy to miss. --danger isn't a
   theme variable, so use the literal red from elsewhere in this file. */
.error {
  color: var(--danger, #c53030);
  background: color-mix(in srgb, #c53030 8%, transparent);
  border-left: 3px solid var(--danger, #c53030);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 0 4px 4px 0;
}
.error.small { font-size: 0.875rem; }

/* ─── Account page ─────────────────────────────────────────────── */
/* Each section of the account page is a .account-card, mirroring
   the buy-card / pricing-card pattern used elsewhere. The card with
   the "danger" red border is the delete-my-account section. */
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 16px 0;
}
.account-card-danger {
  border-color: var(--danger, #c53030);
}
.account-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.account-card-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.account-card-head h2.danger,
.account-card .danger {
  color: var(--danger, #c53030);
}
.account-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 6px;
  margin: 0;
}
.account-meta dt {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.account-meta dd {
  margin: 0;
  font-weight: 500;
}
.signin-btn-wrap {
  display: inline-block;
  margin: 8px 0;
  min-height: 44px;
}
.btn-small {
  padding: 6px 14px;
  font-size: 0.85rem;
}
.btn-danger {
  background: transparent;
  color: var(--danger, #c53030);
  border: 1px solid var(--danger, #c53030);
}
.btn-danger:hover {
  background: var(--danger, #c53030);
  color: #ffffff;
}
