:root {
  color-scheme: light;
  --fg: #0f172a;
  --fg-muted: #51607a;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eef2fb;
  --border: #e2e7f1;
  --accent: #4f46e5;
  --accent-2: #0ea5e9;
  --accent-contrast: #ffffff;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(79, 70, 229, 0.10), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(14, 165, 233, 0.10), transparent),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.5rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
code {
  background: var(--surface-alt);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

/* --- Header / nav --- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
nav {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}
nav .brand {
  font-weight: 800;
  margin-right: auto;
  display: flex;
  align-items: center;
  text-decoration: none;
}
nav .brand img {
  height: 32px;
  width: auto;
  display: block;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  align-items: center;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
}
nav a:not(.brand) {
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.3rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
nav a:not(.brand):hover { color: var(--fg); border-color: var(--accent-2); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1rem;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  nav a:not(.brand) { padding: 0.5rem 0.1rem; }
}


main { max-width: 1040px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; }

footer {
  max-width: 1040px;
  margin: 2rem auto 0;
  padding: 1.5rem;
  color: var(--fg-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
footer .footer-links { margin-top: 0.5rem; }
footer .footer-links a { color: var(--fg-muted); }

/* --- Hero --- */
.hero { padding: 1.5rem 0 2.5rem; }
.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 760px;
}
.hero .lede { font-size: 1.15rem; color: var(--fg-muted); max-width: 640px; }
.cta-row { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* --- Buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  background: var(--gradient);
  color: var(--accent-contrast);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: var(--shadow); filter: brightness(1.04); }
.button.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: none;
}
.button.secondary:hover { border-color: var(--accent); background: var(--surface-alt); }

/* --- Cards / grid --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #c7d0e6; }
.card h3 { margin-top: 0; }
.card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12), var(--shadow);
}
.card .price {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0.2rem 0 0.6rem;
}
.card .price small { font-size: 0.95rem; font-weight: 600; color: var(--fg-muted); }
.badge {
  display: inline-block;
  position: absolute;
  top: -11px;
  right: 1.2rem;
  background: var(--gradient);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.eyebrow {
  display: inline-block;
  background: var(--surface-alt);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

/* --- Forms --- */
form { display: flex; flex-direction: column; gap: 0.55rem; max-width: 460px; }

/* --- Centered auth pages (e.g. signup) --- */
.auth-page {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}
.auth-page form { text-align: left; }
label { font-weight: 650; margin-top: 0.5rem; font-size: 0.9rem; color: var(--fg-muted); }
input, select, textarea {
  padding: 0.65rem 0.8rem;
  font-size: 0.98rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 5.5rem; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.checkbox-label input[type="checkbox"] {
  width: auto;
  margin-top: 0.15rem;
  flex-shrink: 0;
}
button {
  cursor: pointer;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 650;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
button:hover { transform: translateY(-1px); box-shadow: var(--shadow); filter: brightness(1.04); }
button.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: none;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
}
.key-box { font-size: 1rem; font-weight: 700; }
.flow-diagram {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.error { color: #b91c1c; font-weight: 600; }
.success { color: #0f8a4b; font-weight: 600; }
.warning { color: #b45309; }

table { border-collapse: collapse; width: 100%; margin-top: 0.5rem; font-size: 0.85rem; }
th, td { border: 1px solid var(--border); padding: 0.45rem 0.65rem; text-align: left; }
th { background: var(--surface-alt); font-weight: 650; }
tbody tr:hover { background: var(--surface-alt); }

section { margin-top: 2.5rem; }
section > h2 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
