/* ==========================================================================
   Convert Amazon Data to Excel — Spectra design system
   Palette, type, spacing, and component language mirror spectramsia.com:
   cream surface, near-black ink, Bricolage Grotesque display type on
   Hanken Grotesk body copy, pill controls, 22px card radii, and a five-stop
   rainbow gradient used sparingly as an accent. Sidebar/drawer behavior
   uses a fully JS-managed open state (see script.js) so the "Contents"
   drawer closes on link click, outside click, and Escape.
   ========================================================================== */

:root {
  --cream: #f7f4ef;
  --ink: #15141a;
  --ink-soft: #2b2933;
  --muted: #6b6874;
  --muted-2: #8a8692;
  --line: #ede7de;
  --line-soft: #f3efe7;
  --white: #ffffff;

  /* Blue stays this tool's own accent inside Spectra's system, matching
     its --hover-color:#4C82F7 tag on the Projects index card. */
  --accent: #4c82f7;
  --accent-dark: #2e5fcc;
  --accent-tint: rgba(76, 130, 247, 0.13);
  --green: #35c79a;
  --green-tint: rgba(53, 199, 154, 0.16);
  --orange: #ffb443;
  --orange-tint: rgba(255, 180, 67, 0.16);
  --purple: #a667f5;

  --gradient: linear-gradient(120deg, #ff5d6c, #ffb443, #35c79a, #4c82f7, #a667f5);

  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --shadow-card: 0 22px 60px rgba(21, 20, 26, 0.08);
  --content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; max-width: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Hanken Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
::selection { background: var(--purple); color: #fff; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(76, 130, 247, 0.38);
  outline-offset: 4px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 18px; top: -80px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: white; border-radius: 8px;
}
.skip-link:focus { top: 18px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Type ---------- */
h1, h2, h3 {
  margin-top: 0;
  color: var(--ink);
  font-family: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
h1 { max-width: 780px; margin-bottom: 26px; font-weight: 800; font-size: clamp(2.4rem, 4.6vw, 3.9rem); letter-spacing: -0.04em; }
h2 { margin-bottom: 18px; font-weight: 700; font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
h3 { margin-bottom: 12px; font-weight: 700; font-size: clamp(1.25rem, 2vw, 1.45rem); letter-spacing: -0.02em; }
p { margin-top: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); margin-bottom: 22px;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex-shrink: 0; }

/* ---------- Buttons ---------- */
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button-row.centered { justify-content: center; }
.button {
  display: inline-flex; min-height: 52px; align-items: center; justify-content: center;
  padding: 13px 26px; border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: white; font-size: 15px; font-weight: 700; line-height: 1.2;
  text-decoration: none; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.button:hover { transform: translateY(-2px); background: var(--ink-soft); border-color: var(--ink-soft); color: white; }
.button-secondary { background: var(--white); border-color: var(--line); color: var(--ink); }
.button-secondary:hover { background: var(--white); border-color: var(--ink); color: var(--ink); }
.button-small { min-height: 42px; padding: 9px 18px; font-size: 13px; }
.download-note { margin-top: 18px; color: var(--muted); font-size: 13px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  align-items: center; gap: clamp(36px, 5vw, 72px);
  padding: 52px 0 40px;
}
.hero-lede { max-width: 560px; color: var(--muted); font-size: clamp(1.02rem, 1.3vw, 1.15rem); line-height: 1.6; }
.media-frame {
  display: block; width: 100%; margin: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white);
  box-shadow: var(--shadow-card); cursor: zoom-in;
}
.media-frame img { width: 100%; height: auto; transition: transform 320ms ease; }
.media-frame:hover img { transform: scale(1.012); }

/* ---------- Section shells ---------- */
.section-heading { max-width: 680px; margin: 0 0 44px; }
.section-heading p { color: var(--muted); font-size: 1.05rem; }
.section-heading.center { margin-left: auto; margin-right: auto; text-align: center; }

.workflow, .install-section, .faq-section, .problem-section, .control-section, .trust-section {
  padding: 76px 0;
}
.problem-section, .install-section { border-top: 1px solid var(--line); }

/* ---------- Problem grid ---------- */
.problem-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.problem-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 30px; transition: border-color 160ms ease;
}
.problem-card:hover { border-color: var(--card-accent, var(--ink)); }
.icon-box {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 17px;
}
.problem-card p { color: var(--muted); font-size: 15px; }

/* ---------- Workflow rows ---------- */
.workflow-row {
  display: grid; grid-template-columns: minmax(240px, 0.66fr) minmax(0, 1.34fr);
  align-items: center; gap: 56px; padding: 48px 0; border-top: 1px solid var(--line);
}
.workflow-row:first-of-type { border-top: 0; }
.workflow-row-reverse { grid-template-columns: minmax(0, 1.34fr) minmax(240px, 0.66fr); }
.workflow-row-reverse .workflow-copy { order: 2; }
.workflow-copy p { color: var(--muted); }
.step-label {
  display: inline-block; margin-bottom: 14px; color: var(--accent-dark);
  font-family: "Space Mono", ui-monospace, monospace; font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}

/* ---------- Privacy band ---------- */
.privacy-band {
  display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 56px;
  padding: 56px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white);
  margin: 0 0 76px;
}
.privacy-band p { color: var(--muted); }
.privacy-band > div > a { display: inline-block; margin-top: 8px; font-weight: 700; }
.trust-list { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; }
.trust-list li { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-left: 1px solid var(--line); }
.trust-list li:first-child { padding-left: 0; border-left: 0; }
.trust-list strong { color: var(--ink); font-size: 15px; }
.trust-list span { color: var(--muted); font-size: 13.5px; }

/* ---------- Control section ---------- */
.control-section { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
.control-section p { color: var(--muted); }
.check-list { padding: 0; margin: 22px 0 0; list-style: none; }
.check-list li { position: relative; margin: 12px 0; padding-left: 30px; color: var(--ink); font-weight: 600; font-size: 15px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }

/* ---------- Install steps ---------- */
.install-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.install-steps li { position: relative; padding: 52px 22px 18px; border-left: 1px solid var(--line); }
.install-steps li:first-child { padding-left: 0; border-left: 0; }
.install-number {
  position: absolute; top: 0; display: grid !important; width: 36px; height: 36px; margin: 0 !important;
  place-items: center; border-radius: 50%; background: var(--ink); color: white !important;
  font-size: 13px !important; font-weight: 800; font-family: "Bricolage Grotesque", sans-serif;
}
.install-steps strong, .install-steps span { display: block; }
.install-steps strong { color: var(--ink); font-size: 15px; }
.install-steps span { margin-top: 8px; color: var(--muted); font-size: 14px; }
code { padding: 2px 7px; border-radius: 6px; background: var(--line-soft); color: var(--ink); font-size: 0.9em; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.install-help { margin-top: 36px; color: var(--muted); }

/* ---------- Trust / facts ---------- */
.trust-section { grid-template-columns: 0.85fr 1.15fr; }
.trust-section p { color: var(--muted); }
.facts { margin: 30px 0 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 150px 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 13.5px; }
.facts dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.facts dd code { overflow-wrap: anywhere; }

/* ---------- FAQ ---------- */
.faq-section { padding-top: 20px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  position: relative; padding: 24px 52px 24px 0; color: var(--ink);
  font-family: "Bricolage Grotesque", sans-serif; font-size: 18px; font-weight: 700;
  letter-spacing: -0.015em; cursor: pointer; list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 6px; top: 19px; color: var(--accent); font-size: 26px; font-weight: 400; }
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { max-width: 800px; padding: 0 0 24px; color: var(--muted); }

/* ---------- Final CTA ---------- */
.final-cta-wrap { margin: 36px 0 0; }
.final-cta {
  position: relative; overflow: hidden; background: var(--ink); border-radius: 32px;
  padding: 72px 52px; text-align: center;
}
.final-cta::before {
  content: ""; position: absolute; top: -60px; right: 0; width: 300px; height: 300px;
  border-radius: 50%; background: var(--gradient); opacity: 0.35; filter: blur(70px);
  pointer-events: none;
}
.final-cta h2 { position: relative; max-width: 640px; margin: 0 auto 16px; color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.final-cta p { position: relative; max-width: 500px; margin: 0 auto; color: #b4afbc; font-size: 16px; }
.final-cta .button-row { position: relative; }
.final-cta .button-secondary { background: transparent; border-color: #4b4956; color: white; }
.final-cta .button-secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: white; }

/* ---------- In-page footer (product facts row, sits above the site footer) ---------- */
.product-footer { padding: 44px 0 8px; border-top: 1px solid var(--line); }
.product-footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; }
.product-footer-brand { font-size: 15px; }
.product-footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.product-footer-links a { font-size: 14px; font-weight: 600; }
.product-footer-note { margin-top: 20px; color: var(--muted-2); font-size: 13px; }

/* ---------- Lightbox ---------- */
.lightbox { width: min(1240px, calc(100% - 32px)); max-width: none; padding: 12px; border: 0; border-radius: 20px; background: white; box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35); }
.lightbox::backdrop { background: rgba(8, 16, 27, 0.78); }
.lightbox img { width: 100%; height: auto; border-radius: 12px; }
.lightbox-close {
  position: absolute; right: 20px; top: 20px; z-index: 2; display: grid; width: 42px; height: 42px;
  place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: white;
  font-size: 26px; line-height: 1; cursor: pointer;
}

/* ==========================================================================
   Spectra brand mark, top navigation bar, and mobile menu
   (unchanged from the rest of spectramsia.com — no second competing bar).
   ========================================================================== */
.nav-bar-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.nav-bar-brand span:last-child { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.nav-bar-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(from 210deg, #ff5d6c, #ffb443, #35c79a, #4c82f7, #a667f5, #ff5d6c);
  display: flex; align-items: center; justify-content: center;
}
.nav-bar-dot::after { content: ""; width: 13px; height: 13px; border-radius: 50%; background: var(--cream); }

.nav-toggle-input { display: none; }
.nav-bar {
  position: sticky; top: 0; z-index: 80;
  background: rgba(247, 244, 239, 0.94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-bar-inner {
  max-width: 1180px; margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a:not(.button) { font-size: 15px; font-weight: 500; color: var(--ink-soft); text-decoration: none; }
.nav-links a:not(.button):hover, .nav-links a:not(.button).is-active { color: var(--ink); }
.nav-toggle-label {
  display: none; width: 36px; height: 36px; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 8px; flex-shrink: 0;
}
.nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px;
  position: relative; transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-label span::before { position: absolute; top: -6px; }
.nav-toggle-label span::after { position: absolute; top: 6px; }
.mobile-menu { display: none; }

@media (max-width: 860px) {
  .nav-links { display: none !important; }
  .nav-toggle-label { display: flex !important; }
  .mobile-menu {
    display: block; max-height: 0; overflow: hidden; list-style: none;
    background: var(--white); border-top: 1px solid var(--line); transition: max-height 0.25s ease;
  }
  .mobile-menu li { border-bottom: 1px solid var(--line-soft); }
  .mobile-menu a { display: block; padding: 14px 32px; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; }
  .mobile-menu .mm-cta { font-weight: 600; color: var(--purple); }
  .nav-toggle-input:checked ~ .mobile-menu { max-height: 280px; }
  .nav-toggle-input:checked ~ .nav-bar .nav-toggle-label span { background: transparent; }
  .nav-toggle-input:checked ~ .nav-bar .nav-toggle-label span::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle-input:checked ~ .nav-bar .nav-toggle-label span::after { transform: translateY(-6px) rotate(-45deg); }
}

/* ==========================================================================
   Product page shell: sticky left sidebar (desktop) / off-canvas drawer
   (tablet & mobile). Open state is JS-driven (script.js) — not CSS-checkbox —
   so the drawer can close on outside click and Escape, per spec.
   ========================================================================== */
.page-shell { width: min(var(--content), calc(100% - 40px)); margin: 0 auto; display: flex; align-items: flex-start; }
.page-content { flex: 1; min-width: 0; }

.spectra-sidebar {
  position: sticky;
  top: 75px;
  z-index: 40;
  flex-shrink: 0;
  width: 216px;
  height: calc(100vh - 75px);
  padding: 26px 20px 20px;
  margin-right: 48px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}
.spectra-sidebar-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-bottom: 22px; }
.spectra-sidebar-brand img { border-radius: 9px; flex-shrink: 0; }
.spectra-sidebar-brand span:last-child { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 14px; line-height: 1.25; letter-spacing: -0.01em; }
.spectra-sidebar-label {
  margin: 0 0 8px; color: var(--muted-2); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.spectra-sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.spectra-sidebar-nav a {
  padding: 9px 10px;
  margin: 0 -10px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.spectra-sidebar-nav a:hover, .spectra-sidebar-nav a:focus-visible, .spectra-sidebar-nav a.is-active {
  border-left-color: var(--accent); color: var(--ink); background: var(--cream);
}
.spectra-sidebar-actions { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--line); }
.spectra-sidebar-actions .button { width: 100%; }
.spectra-sidebar-source { display: block; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; text-align: center; }
.spectra-sidebar-source:hover { color: var(--accent-dark); }

.spectra-menu-button, .spectra-sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  html { overflow-x: hidden; }
  .page-shell { display: block; width: 100%; }
  .page-content { width: min(var(--content), calc(100% - 40px)); margin: 0 auto; }

  .spectra-sidebar {
    position: fixed;
    left: 0; top: 69px;
    z-index: 70;
    width: min(300px, 84vw);
    height: calc(100dvh - 69px);
    margin-right: 0;
    background: var(--white);
    transform: translateX(-102%);
    box-shadow: 18px 0 50px rgba(20, 16, 12, 0.18);
    transition: transform 220ms ease;
  }
  .spectra-sidebar.open { transform: translateX(0); }

  .spectra-sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 60;
    border: 0; margin: 0; padding: 0; cursor: default;
    background: rgba(21, 20, 26, 0.45);
  }
  .spectra-sidebar-backdrop.open { display: block; }

  .spectra-menu-button {
    position: sticky;
    top: 60px;
    z-index: 50;
    width: fit-content;
    margin: 16px auto 0;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(247, 244, 239, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 20px rgba(20, 16, 12, 0.08);
    color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer;
  }
  .spectra-menu-button .menu-icon { color: var(--muted-2); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .problem-list { gap: 16px; }
  .workflow-row, .workflow-row-reverse { grid-template-columns: 1fr; gap: 32px; }
  .workflow-row-reverse .workflow-copy { order: initial; }
  .control-section, .trust-section { grid-template-columns: 1fr; gap: 36px; }
  .privacy-band { grid-template-columns: 1fr; gap: 32px; padding: 44px; }
  .install-steps { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
  .install-steps li:nth-child(4) { border-left: 0; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { margin-bottom: 44px; }
  .button-row { flex-direction: column; }
  .button { width: 100%; }
  .problem-section, .install-section { padding: 56px 0; }
  .problem-list { grid-template-columns: 1fr; }
  .workflow, .faq-section, .control-section, .trust-section { padding: 56px 0; }
  .section-heading { margin-bottom: 34px; }
  .privacy-band { padding: 28px 20px; margin-bottom: 56px; }
  .trust-list { grid-template-columns: 1fr; }
  .trust-list li { padding: 16px 0; border-top: 1px solid var(--line); border-left: 0; }
  .trust-list li:first-child { border-top: 0; }
  .install-steps { grid-template-columns: 1fr; }
  .install-steps li, .install-steps li:first-child { min-height: 0; padding: 12px 0 24px 60px; border-top: 1px solid var(--line); border-left: 0; }
  .install-steps li:first-child { border-top: 0; }
  .install-number { left: 0; top: 12px; }
  .facts > div { grid-template-columns: 120px 1fr; }
  .final-cta { padding: 48px 24px; border-radius: 24px; }
  .final-cta::before { top: -40px; width: 180px; height: 180px; }
  .product-footer-inner { flex-direction: column; align-items: flex-start; }
}
