/*
 * Merchmint site styles.
 *
 * Zero dependencies, zero build step — same posture as the extension itself.
 * No webfonts: the type personality comes from weight, tracking and the
 * sans/mono pairing, not from a downloaded face. That keeps the pages fast,
 * offline-friendly, and free of a third-party request on a privacy policy
 * page, which would be a poor look.
 *
 * Design concept: "contact sheet". The product turns a list of prompts into a
 * numbered set of files you review as a grid — which is what a contact sheet
 * is. Monospace is used wherever the content is genuinely machine output:
 * filenames, counts, quotas, section markers. Light theme is "paper"; the
 * dark theme is "darkroom", which is where contact sheets are actually made.
 */

/* ---------------------------------------------------------------- tokens */

:root {
  /* paper */
  --paper: #f1f2ee;
  --paper-2: #e7e9e2;
  --frame: #dcdfd6;
  --ink: #10231a;
  --ink-2: #4a574f;
  --rule: #cfd4c9;
  --emerald: #056b4e;
  --emerald-lit: #34d399;
  /* Text that sits ON emerald. Dark mode brightens the emerald for contrast
     against a dark page, which then makes white text on it unreadable — so the
     foreground has to flip too, not just the background. */
  --on-emerald: #ffffff;
  --shadow: 0 1px 2px rgba(16, 35, 26, 0.06);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --read: 68ch;
  --gap: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1512;
    --paper-2: #141d19;
    --frame: #1c2723;
    --ink: #e8ede9;
    --ink-2: #9aa79f;
    --rule: rgba(255, 255, 255, 0.11);
    --emerald: #10b981;
    --emerald-lit: #34d399;
    --on-emerald: #04231a;
    --shadow: none;
  }
}

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

html {
  scroll-behavior: smooth;
  /* Anchored §-links land below the sticky masthead instead of under it. */
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------ primitives */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

a {
  color: var(--emerald);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

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

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

/* Every eyebrow, marker and machine value on the site. */
.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 1rem;
}

h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 6vw, 4.1rem);
  letter-spacing: -0.038em;
}

h2 {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
}

h3 {
  font-size: 1.1rem;
  letter-spacing: -0.012em;
}

p {
  margin: 0 0 1.1rem;
}

.lede {
  font-size: clamp(1.05rem, 1.9vw, 1.2rem);
  color: var(--ink-2);
  max-width: 54ch;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- header */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Solid first: where color-mix is unsupported the bar stays opaque and
     readable rather than falling back to transparent over scrolling text. */
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.masthead-in {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: block;
}

.nav {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.nav a {
  color: var(--ink-2);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

@media (max-width: 640px) {
  .nav .nav-wide {
    display: none;
  }
}

/* ------------------------------------------------------------------ hero */

.hero {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}

.hero h1 em {
  font-style: normal;
  color: var(--emerald);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  border-radius: 3px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--emerald);
  color: var(--on-emerald);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  border-color: var(--rule);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--ink-2);
}

.cta-note {
  margin: 0.85rem 0 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-2);
}

/* ------------------------------------------------- signature: the sheet */

.sheet {
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper-2);
  padding: 0.9rem;
  box-shadow: var(--shadow);
}

.sheet-head,
.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  text-transform: uppercase;
}

.sheet-head {
  padding-bottom: 0.7rem;
}

.sheet-foot {
  padding-top: 0.7rem;
  border-top: 1px dashed var(--rule);
  margin-top: 0.7rem;
}

.frames {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

@media (max-width: 460px) {
  .frames {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.frame {
  position: relative;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--frame);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--ink-2);
  overflow: hidden;
}

/* The exposed state: emerald wash + the frame index, as on a real sheet. */
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--emerald) 0%, color-mix(in srgb, var(--emerald) 62%, var(--frame)) 100%);
  opacity: 1;
}

.frame span {
  position: relative;
  z-index: 1;
  color: var(--on-emerald);
  font-variant-numeric: tabular-nums;
  opacity: 0.92;
}

/* Static, no-JS and reduced-motion default is the completed sheet.
   .is-live is added by script only when motion is welcome. */
.sheet.is-live .frame::after {
  opacity: 0;
  animation: expose 0.42s ease-out forwards;
  animation-delay: calc(var(--i) * 0.115s);
}

.sheet.is-live .frame span {
  opacity: 0;
  animation: ink 0.42s ease-out forwards;
  animation-delay: calc(var(--i) * 0.115s);
}

@keyframes expose {
  from {
    opacity: 0;
    transform: translateY(18%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ink {
  to {
    opacity: 0.92;
  }
}

.sheet-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-lit);
}

.sheet.is-live .dot {
  animation: pulse 1.1s ease-in-out infinite;
}

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

/* ------------------------------------------------------------- sections */

.section {
  padding: clamp(3rem, 6vw, 4.75rem) 0;
  border-bottom: 1px solid var(--rule);
}

.section-head {
  max-width: 60ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head p {
  color: var(--ink-2);
  margin-top: 0.9rem;
  margin-bottom: 0;
}

/* ------------------------------------------------------- ordered process */

/* Numbered because this genuinely is a sequence — the order is the content. */
.steps {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.step {
  background: var(--paper);
  padding: 1.4rem 1.25rem 1.6rem;
}

.step-n {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--emerald);
  display: block;
  margin-bottom: 0.85rem;
}

.step h3 {
  margin-bottom: 0.5rem;
}

.step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- cards */

.cards {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

@media (min-width: 700px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  background: var(--paper);
  padding: 1.5rem 1.35rem;
}

.card h3 {
  margin-bottom: 0.55rem;
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.card .tag {
  display: inline-block;
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.15rem 0.45rem;
}

/* -------------------------------------------------------------- pricing */

.plans {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 760px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 760px;
  }
}

.plan {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.75rem 1.5rem;
  background: var(--paper);
}

.plan-pro {
  border-color: var(--emerald);
}

.plan-name {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 0.75rem;
}

.plan-price {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.plan-price small {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-2);
}

.plan-alt {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-2);
  margin: 0.6rem 0 0;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 1.35rem 0 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.plan li {
  padding-left: 1.35rem;
  position: relative;
  color: var(--ink-2);
}

.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--emerald);
}

/* ------------------------------------------------------------------ faq */

.faq {
  border-top: 1px solid var(--rule);
  max-width: var(--read);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  cursor: pointer;
  padding: 1.15rem 2rem 1.15rem 0;
  font-weight: 650;
  letter-spacing: -0.012em;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 1.05rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--ink-2);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  margin: 0 0 1.15rem;
  color: var(--ink-2);
  max-width: 62ch;
}

/* -------------------------------------------------------- policy layout */

.doc {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding: clamp(2.5rem, 5vw, 4rem) 0 5rem;
  align-items: start;
}

@media (min-width: 960px) {
  .doc {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}

.toc {
  font-size: 0.86rem;
}

@media (min-width: 960px) {
  .toc {
    position: sticky;
    top: 5rem;
  }
}

.toc p {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 0.75rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  counter-reset: toc;
}

.toc a {
  color: var(--ink-2);
  text-decoration: none;
  display: block;
}

.toc a::before {
  counter-increment: toc;
  content: "§" counter(toc) "  ";
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--emerald);
}

.toc a:hover {
  color: var(--ink);
}

.prose {
  max-width: var(--read);
}

.prose h2 {
  font-size: 1.35rem;
  margin: 2.75rem 0 0.9rem;
  scroll-margin-top: 5rem;
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose h2 .sec {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--emerald);
  display: block;
  margin-bottom: 0.35rem;
}

.prose h3 {
  margin: 1.9rem 0 0.6rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.15rem;
  padding-left: 1.15rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose strong {
  font-weight: 700;
}

.doc-meta {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--emerald);
  border-radius: 3px;
  background: var(--paper-2);
  padding: 1rem 1.15rem;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
}

.doc-meta p {
  margin: 0 0 0.35rem;
}

.doc-meta p:last-child {
  margin-bottom: 0;
}

/* Tables carry real data on the policy pages; they must stay readable. */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin: 0 0 1.5rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
  min-width: 460px;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper-2);
  font-weight: 500;
}

tbody tr:last-child td {
  border-bottom: none;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.08em 0.32em;
}

/* A claim we want the reader to actually stop on. */
.callout {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--emerald);
  border-radius: 3px;
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.5rem;
  background: var(--paper-2);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--emerald);
  margin: 0 0 0.5rem;
}

/* --------------------------------------------------------------- footer */

.footer {
  padding: 3rem 0 4rem;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(2, minmax(0, 1fr));
  }
}

.footer h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 0.9rem;
  font-weight: 500;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.footer a {
  color: var(--ink-2);
  text-decoration: none;
}

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

.footer-note {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.82rem;
  max-width: 70ch;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 0.6rem;
  z-index: 50;
  background: var(--emerald);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 3px;
}
