/* Gramai site — editorial manuscript layout with a proofreading-mark motif.
   Palette: cool paper + ink, brand blue→violet gradient reserved for actions,
   editorial red for corrections, green for insertions. System fonts only. */

:root {
  --paper: #f7f8fb;
  --paper-raised: #ffffff;
  --ink: #1b2233;
  --ink-soft: #4a5268;
  --ink-faint: #5b6275;
  --rule: #dde1ea;
  --rule-strong: #c3c9d8;
  --brand-blue: #2563eb;
  --brand-violet: #7c3aed;
  /* Fixed (not re-themed in dark mode) so white text on the gradient/buttons/badges always
     stays >= 4.5:1. --brand-blue/--brand-violet above remain free to lighten for dark-mode
     link/text contrast without dragging button and badge backgrounds down with them. */
  --brand-blue-strong: #2563eb;
  --brand-violet-strong: #7c3aed;
  --link-hover: var(--brand-violet);
  --brand-gradient: linear-gradient(135deg, var(--brand-blue-strong), var(--brand-violet-strong));
  --mark-red: #b8382a;
  --mark-red-bg: #fbe9e6;
  --mark-green: #187a54;
  --mark-green-bg: #e6f5ee;
  --focus: var(--brand-blue);
  --muted-bg: #4b5263;
  --shadow-panel: 0 1px 2px rgba(27, 34, 51, 0.06);

  --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --content-width: 880px;
  --prose-width: 680px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10131f;
    --paper-raised: #171b2b;
    --ink: #e8eaf2;
    --ink-soft: #a6acc2;
    --ink-faint: #828aa4;
    --rule: #2a2f47;
    --rule-strong: #3a4162;
    --brand-blue: #8ab4f8;
    --link-hover: #c4a5f9;
    --mark-red: #ff8a75;
    --mark-red-bg: #3a1f1c;
    --mark-green: #5bd9a2;
    --mark-green-bg: #133428;
    --shadow-panel: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

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

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

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

a {
  color: var(--brand-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
}

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

.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;
}

.wrap {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

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

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

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

.brand-mark {
  border-radius: 6px;
}

.brand-name {
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9375rem;
}

.site-nav a:hover {
  color: var(--brand-blue);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-block: 2rem;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.footer-inner nav {
  display: flex;
  gap: 1.25rem;
}

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

.footer-inner nav a:hover {
  color: var(--brand-blue);
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Sections ---------- */

section {
  padding-block: 3rem;
}

section + section {
  border-top: 1px solid var(--rule);
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}

.section-lede {
  color: var(--ink-soft);
  max-width: var(--prose-width);
  margin: -0.75rem 0 1.75rem;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: 3rem 2.5rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.25rem, 1.7rem + 2.4vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  max-width: 14ch;
}

.hero-sub {
  font-size: 1.1875rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 2.25rem;
}

/* Proofreading-mark demo: the product's own move, shown live */

.correction-demo {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.5rem 1.5rem 1.25rem;
  max-width: 34rem;
  margin: 0 0 2.5rem;
  box-shadow: var(--shadow-panel);
}

.correction-demo p {
  margin: 0;
  font-size: 1.0625rem;
}

.correction-demo .out {
  color: var(--mark-red);
  background: var(--mark-red-bg);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  padding: 0.05em 0.3em;
  border-radius: 3px;
}

.correction-demo .in {
  color: var(--mark-green);
  background: var(--mark-green-bg);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1px;
  padding: 0.05em 0.3em;
  border-radius: 3px;
}

.correction-demo .caption {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* ---------- Buttons ---------- */

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.button-primary {
  background: var(--brand-gradient);
  color: #fff;
}

.button-primary:hover {
  filter: brightness(1.06);
  color: #fff;
}

.button-soon {
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--rule-strong);
  cursor: default;
}

.store-note {
  color: var(--ink-faint);
  font-size: 0.875rem;
  margin: 0.85rem 0 0;
}

/* ---------- How it works ---------- */

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

.steps li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.9rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--brand-blue);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps h3 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
  /* Three columns: the number sits above the text so the text keeps the whole column width. */
  .steps li {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .steps h3 {
    margin-top: 0;
  }
}

/* ---------- Lists / chips ---------- */

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip-list li {
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.provider-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem 1.5rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.provider-list li {
  border-top: 1px solid var(--rule);
  padding-top: 0.65rem;
}

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

/* ---------- Privacy promise ---------- */

.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.promise-list li {
  padding-left: 1.4rem;
  border-left: 2px solid var(--brand-blue);
}

.promise-list h3 {
  margin: 0 0 0.35rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.promise-list p {
  margin: 0;
  color: var(--ink-soft);
}

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

/* ---------- Pricing ---------- */

.plans {
  display: grid;
  gap: 1.5rem;
}

.plan {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.75rem;
  position: relative;
}

.plan-pro {
  border-color: var(--brand-violet);
  border-width: 2px;
  padding-top: calc(1.75rem - 1px);
}

.plan-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.plan-name {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 500;
  margin: 0;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand-gradient);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
}

.badge-quiet {
  background: var(--muted-bg);
}

.plan-price {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.plan-price small {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.plan-price-alt {
  margin: -1rem 0 1.25rem;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.plan-features {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.plan-features li {
  padding-left: 1.3rem;
  position: relative;
}

.plan-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--brand-blue);
}

.plan-note {
  color: var(--ink-faint);
  font-size: 0.8125rem;
  margin: 0.75rem 0 0;
}

@media (min-width: 860px) {
  .plans {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }
}

/* Four packages need more room than the 880px prose measure: two up from 620px, four from 1000px.
   These rules follow the three-column one above and have the same specificity, so they win. */

.wrap-wide {
  max-width: 1120px;
}

@media (min-width: 620px) {
  .plans-four {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }
}

@media (min-width: 1000px) {
  .plans-four {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .plans-four .plan {
    padding: 1.5rem 1.25rem;
  }
}

.plans-note {
  margin-top: 1.25rem;
}

/* Monthly | Yearly switch. Hidden (the `hidden` attribute) until site.js enables it, so a
   no-JS visitor sees the monthly prices with the yearly ones spelled out under each. The
   `[hidden]` rule below is required: an author `display` declaration beats the user agent's
   `[hidden] { display: none }`, so without it the attribute does nothing and a dead switch
   ships. The row reserves the height either way, so un-hiding cannot shift the card grid. */

.billing-row {
  min-height: 2.5rem;
  margin-bottom: 1.5rem;
}

.billing-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.billing-switch[hidden] {
  display: none;
}

.billing-label {
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 2px;
  background: var(--paper-raised);
}

.segmented-option {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.segmented-option.is-active {
  background: var(--brand-gradient);
  color: #fff;
}

.billing-save {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mark-green);
  background: var(--mark-green-bg);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.included {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.included h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: 0.1rem;
  max-width: var(--prose-width);
}

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

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

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

.faq summary::after {
  content: '+';
  color: var(--brand-blue);
  font-weight: 400;
  font-size: 1.25rem;
  flex-shrink: 0;
}

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

.faq p {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
}

.faq a {
  color: inherit;
  text-decoration-color: var(--rule-strong);
}

/* ---------- Support ---------- */

.support-email {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.provider-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.provider-links li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
}

.provider-links strong {
  font-weight: 600;
}

.provider-links a {
  font-size: 0.9375rem;
  white-space: nowrap;
}

/* ---------- Legal / prose pages ---------- */

.legal h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.875rem, 1.6rem + 1vw, 2.5rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.legal .updated {
  color: var(--ink-faint);
  font-size: 0.875rem;
  margin: 0 0 2.5rem;
}

.legal h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.375rem;
  margin: 2rem 0 0.75rem;
}

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

.legal ul {
  padding-left: 1.25rem;
}

.legal li + li {
  margin-top: 0.4rem;
}
