@import url('assets/fonts.css');

/* Palette: the MagicPatterns structure (paper / surface / dim / dark) carried
   over to Rewordly's indigo, so the site matches the extension and the store
   artwork rather than the generated red. */
:root {
  --paper: #f8f8fb;
  --paper-dim: #f0f0f6;
  --surface: #ffffff;
  --ink: #17171a;
  --muted: #62626f;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --border: #e4e4ea;
  --dark: #17171a;
  --dark-text: #f2f2f5;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --wrap: 1200px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

h1,
h2,
h3,
.serif {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
}

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

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
}

/* The wordmark's dashed underline is the product's own marking. */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}

.logo img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-outline {
  border-color: rgba(23, 23, 26, 0.15);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: rgba(23, 23, 26, 0.32);
}

.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
}

.btn-block {
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn[aria-disabled='true'] {
  pointer-events: none;
  opacity: 0.55;
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
}

/* Nav ---------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  color: rgba(23, 23, 26, 0.7);
  text-decoration: none;
  transition: color 0.15s;
}

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

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

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

.section-dim {
  background: color-mix(in srgb, var(--paper-dim) 60%, var(--paper));
}

.section-dark {
  background: var(--dark);
  color: var(--dark-text);
  border-top-color: var(--dark);
}

.section-head {
  max-width: 640px;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
}

.section-head p {
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(23, 23, 26, 0.7);
}

.section-dark .section-head p {
  color: rgba(242, 242, 245, 0.65);
}

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

.hero {
  border-top: 0;
  padding: 64px 0 88px;
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: center;
  gap: 48px;
}

/* A grid item's automatic minimum size is its content, so the browser mock -
   with its nowrap URL and pill row - would hold the column wider than a phone
   viewport and clip. */
.hero .wrap > * {
  min-width: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.1;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-lede {
  margin: 24px 0 0;
  max-width: 32em;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(23, 23, 26, 0.7);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}

.hero-actions .link {
  font-size: 14px;
  font-weight: 500;
  color: rgba(23, 23, 26, 0.7);
  text-decoration: none;
}

.hero-actions .link:hover {
  color: var(--ink);
}

.hero-note {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Browser demo ------------------------------------------------------------- */

.demo-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  font: 500 14px var(--sans);
  color: rgba(23, 23, 26, 0.7);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.mode-pill:hover {
  border-color: rgba(23, 23, 26, 0.3);
  color: var(--ink);
}

.mode-pill[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.browser {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 23, 26, 0.04), 0 20px 44px -16px rgba(23, 23, 26, 0.2);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--paper-dim);
  border-radius: 16px 16px 0 0;
}

.dots {
  display: flex;
  gap: 6px;
}

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.omnibox {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.omnibox span {
  font: 400 11px var(--mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: 500 12px var(--sans);
  color: var(--ink);
  cursor: pointer;
}

.demo-toggle .track {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: rgba(23, 23, 26, 0.15);
  transition: background-color 0.15s;
}

.demo-toggle .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.demo-toggle[aria-pressed='true'] .track {
  background: var(--accent);
}

.demo-toggle[aria-pressed='true'] .track::after {
  transform: translateX(12px);
}

.demo-page {
  padding: 32px 28px;
  min-height: 240px;
}

.demo-title {
  margin: 0 0 16px;
  font: 400 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.demo-body p {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.75;
  color: rgba(23, 23, 26, 0.9);
}

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

.demo-body.swapping {
  opacity: 0;
  transform: translateY(6px);
}

.demo-body {
  opacity: 1;
  transform: none;
  transition: opacity 0.2s, transform 0.2s;
}

/* A replaced word, marked the way the extension marks it. */
.swap {
  position: relative;
  display: inline-block;
}

.demo-on .swap > .word {
  text-decoration: underline dashed var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: default;
}

.swap .tip {
  position: absolute;
  left: 50%;
  top: 100%;
  z-index: 10;
  margin-top: 8px;
  transform: translate(-50%, 4px) scale(0.96);
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font: 400 12px var(--mono);
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.demo-on .swap:hover .tip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.demo-caption {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Cards -------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 24px;
  margin-top: 48px;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

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

.card h3 {
  margin: 0;
  font-size: 18px;
}

.card p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(23, 23, 26, 0.7);
}

.card .icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  margin-bottom: 16px;
}

.card h4 {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
}

/* before -> after chip pair on the mode cards */
.swap-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font: 400 12px var(--mono);
  color: var(--muted);
}

.swap-demo .before {
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--paper-dim);
  color: rgba(23, 23, 26, 0.6);
  text-decoration: line-through;
}

.swap-demo .after {
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: underline dashed var(--accent);
  text-underline-offset: 3px;
}

/* Regex feature panel ------------------------------------------------------ */

.feature-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 28px;
  margin-top: 48px;
  padding: 40px;
  border-radius: 16px;
  background: var(--dark);
  color: var(--dark-text);
}

.feature-hero .icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.feature-hero h3 {
  margin: 16px 0 0;
  font-size: 26px;
  line-height: 1.25;
}

.feature-hero p {
  margin: 12px 0 0;
  max-width: 30em;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(242, 242, 245, 0.7);
}

.code {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  font: 400 14px var(--mono);
}

.code p {
  margin: 0;
}

.code .comment {
  color: rgba(242, 242, 245, 0.5);
}

.code .ok {
  color: #a5a0ff;
}

.code .line {
  margin-top: 4px;
  color: var(--dark-text);
}

.code .line + .comment {
  margin-top: 16px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(23, 23, 26, 0.06);
  font: 500 11px var(--mono);
  color: var(--ink);
}

.kbd-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
}

/* Boundaries --------------------------------------------------------------- */

.boundaries {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
  margin-top: 56px;
}

.boundaries p.lead {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.3;
}

.boundaries p.body {
  margin: 16px 0 0;
  max-width: 26em;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(242, 242, 245, 0.65);
}

/* Privacy list ------------------------------------------------------------- */

.checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(23, 23, 26, 0.8);
}

.checks .tick {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.checks .tick svg {
  width: 12px;
  height: 12px;
}

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

.price-card {
  max-width: 448px;
  margin: 48px auto 0;
  padding: 30px 32px 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 23, 26, 0.04), 0 18px 40px -20px rgba(23, 23, 26, 0.22);
}

.price-badge {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.price-card h3 {
  margin: 20px 0 0;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 650;
}

.price-amount {
  margin: 10px 0 0;
  font-size: 46px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.price-amount span {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.price-was {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.price-was s {
  color: rgba(98, 98, 111, 0.8);
}

.price-rule {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

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

.price-list li {
  position: relative;
  padding: 7px 0 7px 28px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(23, 23, 26, 0.85);
}

/* A green tick reads as "included" faster than a brand-coloured one, and keeps
   the indigo reserved for things you can click. */
.price-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 12px;
  width: 11px;
  height: 6px;
  border-left: 2.2px solid #16a34a;
  border-bottom: 2.2px solid #16a34a;
  transform: rotate(-45deg);
}

.price-card .btn {
  margin-top: 26px;
}

.price-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.price-note code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 12px var(--mono);
}

.price-note a {
  color: var(--accent);
}

/* Closing CTA -------------------------------------------------------------- */

.cta {
  text-align: center;
}

.cta .wrap {
  max-width: 680px;
}

.cta .badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.cta .badge {
  background: none;
}

.cta .badge img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.cta h2 {
  margin-top: 24px;
}

.cta p {
  margin: 16px 0 0;
  font-size: 18px;
  color: rgba(23, 23, 26, 0.7);
}

.cta .btn {
  margin-top: 32px;
}

.cta .fine {
  font-size: 14px;
  color: var(--muted);
}

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

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

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

.footer .tagline {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer nav a {
  font-size: 14px;
  color: rgba(23, 23, 26, 0.7);
  text-decoration: none;
}

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

.footer .meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* Prose pages -------------------------------------------------------------- */

.prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 88px;
}

.prose h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 44px);
}

.prose .updated {
  margin: 0 0 36px;
  font-size: 14px;
  color: var(--muted);
}

.prose h2 {
  margin: 38px 0 10px;
  font-size: 22px;
}

.prose p,
.prose li {
  font-size: 16px;
  line-height: 1.75;
  color: #34343d;
}

.prose ul {
  padding-left: 22px;
}

.prose li {
  margin: 7px 0;
}

.callout {
  margin: 26px 0;
  padding: 18px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--paper-dim);
}

.callout p {
  margin: 0;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1000px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-hero {
    grid-template-columns: 1fr;
  }

  .checks {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  section {
    padding: 60px 0;
  }

  .nav-links {
    display: none;
  }

  .boundaries,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .boundaries {
    gap: 36px;
  }

  .feature-hero {
    padding: 28px;
  }

  .footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer .meta {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .grid-4,
  .checks {
    grid-template-columns: 1fr;
  }

  .demo-page {
    padding: 24px 20px;
  }

  .price-card {
    padding: 24px 22px;
  }

  /* The browser bar runs out of room first; drop the toggle's label rather
     than letting the URL field collapse. */
  #demo-toggle-label {
    display: none;
  }

  .browser-bar {
    gap: 8px;
    padding: 10px 12px;
  }

  .hero-actions {
    gap: 12px;
  }
}

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

  * {
    transition-duration: 0.01ms !important;
  }
}
