/* Folio API — Design System
   ========================================================================
   Premium, content-focused design. Stripe-caliber polish with Postmark
   substance. Built for developers and IP professionals.
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------------------------------------------------------------------------
   Custom Properties
   --------------------------------------------------------------------------- */

:root {
  /* ---- Typography ---- */
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Libre Baskerville', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;

  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.5rem;

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-caps: 0.08em;

  /* ---- Color — Navy + Warm Gold ---- */
  --navy-950: #0a0e1a;
  --navy-900: #0f1629;
  --navy-800: #161d38;
  --navy-700: #1e2a4a;
  --navy-600: #2a3a62;
  --navy-500: #3d5286;
  --navy-400: #5a73a7;
  --navy-300: #8498c4;
  --navy-200: #b3c0dc;
  --navy-100: #dde3f0;
  --navy-50: #f0f2f8;

  --gold-500: #d4952a;
  --gold-400: #e5a93d;
  --gold-300: #f0c05e;
  --amber-500: #d97706;

  --slate-950: #0c0f19;
  --slate-900: #141821;
  --slate-800: #1e2231;
  --slate-700: #2d3348;
  --slate-600: #424b63;
  --slate-500: #64708d;
  --slate-400: #8d96ae;
  --slate-300: #b0b7ca;
  --slate-200: #d2d7e2;
  --slate-100: #eceef3;
  --slate-50: #f7f8fa;

  --white: #ffffff;
  --black: #000000;

  /* Semantic */
  --color-bg: var(--white);
  --color-bg-alt: var(--slate-50);
  --color-bg-dark: var(--navy-900);
  --color-bg-code: var(--navy-950);
  --color-text: var(--slate-900);
  --color-text-secondary: var(--slate-500);
  --color-text-muted: var(--slate-400);
  --color-text-inverse: var(--slate-100);
  --color-border: var(--slate-200);
  --color-border-subtle: var(--slate-100);

  --color-accent: var(--navy-700);
  --color-accent-hover: var(--navy-600);
  --color-link: var(--navy-600);
  --color-link-hover: var(--navy-500);

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-800) 45%, #2a2550 100%);
  --gradient-accent: linear-gradient(135deg, var(--navy-600) 0%, var(--gold-500) 100%);
  --gradient-btn: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-500) 100%);
  --gradient-btn-hover: linear-gradient(135deg, var(--navy-600) 0%, var(--navy-400) 100%);
  --gradient-gold: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-300) 100%);
  --gradient-subtle: linear-gradient(180deg, var(--slate-50) 0%, var(--white) 100%);

  /* Status */
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-info: var(--navy-500);
  --color-info-bg: var(--navy-50);

  /* ---- Spacing ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ---- Layout ---- */
  --container-max: 1100px;
  --container-padding: var(--space-6);
  --nav-height: 64px;
  --border-radius: 8px;
  --border-radius-sm: 4px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(10, 14, 26, 0.05);
  --shadow-md: 0 4px 12px rgba(10, 14, 26, 0.08);
  --shadow-lg: 0 8px 30px rgba(10, 14, 26, 0.12);
  --shadow-xl: 0 20px 60px rgba(10, 14, 26, 0.15);
  --shadow-card: 0 1px 3px rgba(10, 14, 26, 0.04), 0 6px 16px rgba(10, 14, 26, 0.06);
  --shadow-card-hover: 0 4px 8px rgba(10, 14, 26, 0.06), 0 12px 40px rgba(10, 14, 26, 0.1);

  /* ---- Transitions ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Code syntax — cool tones on dark navy */
  --code-bg: var(--navy-950);
  --code-text: #c9d1d9;
  --code-comment: #5a6a8a;
  --code-keyword: #7aa2f7;
  --code-string: #9ece6a;
  --code-function: #e0af68;
  --code-number: #ff9e64;
  --code-operator: #89ddff;
  --code-property: #bb9af7;
}


/* ---------------------------------------------------------------------------
   Reset & Base
   --------------------------------------------------------------------------- */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--space-8));
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
}

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

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

::selection {
  background: var(--navy-200);
  color: var(--navy-900);
}

[hidden] {
  display: none !important;
}


/* ---------------------------------------------------------------------------
   Typography
   --------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-5xl);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-4xl);
  letter-spacing: -0.025em;
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

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

strong {
  font-weight: 600;
  color: var(--color-text);
}

small {
  font-size: var(--text-sm);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-ligatures: none;
}

/* Inline code */
p code,
li code,
td code {
  background: var(--slate-100);
  color: var(--navy-700);
  padding: 0.15em 0.4em;
  border-radius: var(--border-radius-sm);
  font-size: 0.85em;
}


/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */

.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

section {
  padding: var(--space-24) 0;
}


/* ---------------------------------------------------------------------------
   Navigation
   --------------------------------------------------------------------------- */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

nav.scrolled {
  box-shadow: var(--shadow-sm);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--color-text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: var(--tracking-wide);
  transition: color var(--duration-fast) var(--ease-out);
}

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

.nav-links .btn-primary {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-5);
}

/* Mobile hamburger — hidden by default */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  border-radius: 1px;
  transition: all var(--duration-fast) var(--ease-out);
}


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

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--border-radius);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out),
    opacity var(--duration-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-btn);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(10, 14, 26, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: var(--gradient-btn-hover);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 14, 26, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(10, 14, 26, 0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  box-shadow: none;
}

.btn-secondary:hover {
  color: var(--color-text);
  border-color: var(--slate-300);
  background: var(--slate-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Large buttons (hero CTA) */
.btn-primary.btn-lg,
.btn-secondary.btn-lg {
  font-size: var(--text-lg);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--border-radius-lg);
}


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

.hero {
  position: relative;
  background: var(--gradient-hero);
  padding: var(--space-32) 0 var(--space-24);
  overflow: hidden;
  text-align: center;
}

/* Subtle noise texture via radial dots */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(122, 162, 247, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(212, 149, 42, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(122, 162, 247, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* Faint grid overlay for depth */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--white);
  font-size: var(--text-5xl);
  margin-bottom: var(--space-6);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero .subtitle {
  color: var(--slate-300);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  max-width: 580px;
  margin: 0 auto var(--space-10);
  font-weight: 300;
}

.hero .btn-primary {
  background: var(--white);
  color: var(--navy-900);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.hero .btn-primary:hover {
  background: var(--slate-100);
  color: var(--navy-900);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.hero .btn-secondary {
  color: var(--slate-300);
  border-color: rgba(255, 255, 255, 0.2);
}

.hero .btn-secondary:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}


/* ---------------------------------------------------------------------------
   Features
   --------------------------------------------------------------------------- */

.features {
  background: var(--color-bg-alt);
}

.features .container > h2,
.features .container > p {
  text-align: center;
}

.features .container > h2 {
  margin-bottom: var(--space-4);
}

.features .container > p {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-16);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--border-radius-lg);
  padding: var(--space-8);
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border);
}

.feature-card .icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  background: var(--navy-50);
  color: var(--navy-600);
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}

.feature-card h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
  letter-spacing: var(--tracking-normal);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}


/* ---------------------------------------------------------------------------
   Code Example
   --------------------------------------------------------------------------- */

.code-example {
  background: var(--code-bg);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6) var(--space-8);
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg);
}

.code-example code,
.code-example pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--code-text);
  line-height: var(--leading-relaxed);
  background: none;
  padding: 0;
}

.code-example pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Syntax classes — applied in HTML for "syntax-ish" coloring */
.code-example .token-keyword { color: var(--code-keyword); }
.code-example .token-string { color: var(--code-string); }
.code-example .token-function { color: var(--code-function); }
.code-example .token-number { color: var(--code-number); }
.code-example .token-comment { color: var(--code-comment); font-style: italic; }
.code-example .token-operator { color: var(--code-operator); }
.code-example .token-property { color: var(--code-property); }

/* Label bar above code (e.g. "curl" or "Response") */
.code-example-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--code-comment);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Code example tabs (role selector) */
.code-tabs {
  max-width: 760px;
  margin: 0 auto;
}

.code-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-6);
}

.code-tab-btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: var(--space-2) var(--space-5);
  cursor: pointer;
  transition: all 0.15s ease;
}

.code-tab-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-secondary);
}

.code-tab-btn.active {
  color: var(--white);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.code-tab-panel {
  display: none;
}

.code-tab-panel.active {
  display: block;
}

.code-example-caption {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}


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

.pricing {
  text-align: center;
}

.pricing .container > h2 {
  margin-bottom: var(--space-4);
}

.pricing .container > p {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-16);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
  max-width: 700px;
  margin: 0 auto;
}

/* When there are 3 pricing cards, use 3 columns */
.pricing-grid.pricing-grid--wide {
  grid-template-columns: repeat(3, 1fr);
  max-width: 960px;
}

/* When there are 4 pricing cards, use 4 columns */
.pricing-grid.pricing-grid--4col {
  grid-template-columns: repeat(4, 1fr);
  max-width: 1200px;
}

.pricing-card {
  background: var(--white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--border-radius-xl);
  padding: var(--space-10) var(--space-8);
  text-align: left;
  position: relative;
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.pricing-card.featured {
  border-color: var(--navy-600);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--navy-600);
}

.pricing-card.featured::before {
  content: 'Popular';
  position: absolute;
  top: calc(-1 * var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-btn);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  padding: var(--space-1) var(--space-4);
  border-radius: 100px;
}

.pricing-card .tier-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.pricing-card .price {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--color-text);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.pricing-card .price-period {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.pricing-card .price-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  line-height: var(--leading-normal);
}

.pricing-card ul {
  list-style: none;
  margin-bottom: var(--space-8);
}

.pricing-card li {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-2) 0;
  padding-left: var(--space-6);
  position: relative;
}

.pricing-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2316a34a'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  background-size: contain;
}

.pricing-card .btn-primary,
.pricing-card .btn-secondary {
  width: 100%;
}

/* Stripe embed spacing */
stripe-pricing-table {
  margin-top: var(--space-8);
}


/* ---------------------------------------------------------------------------
   Forms & Inputs
   --------------------------------------------------------------------------- */

form {
  width: 100%;
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea,
select {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-3) var(--space-4);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(90, 115, 167, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--space-1);
}


/* ---------------------------------------------------------------------------
   Key Display (API key reveal)
   --------------------------------------------------------------------------- */

.key-display {
  background: var(--code-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.key-display code {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--code-text);
  word-break: break-all;
  line-height: var(--leading-normal);
}

.key-display .copy-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--slate-300);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.key-display .copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.key-display .copy-btn:active {
  background: rgba(255, 255, 255, 0.06);
}


/* ---------------------------------------------------------------------------
   Status States
   --------------------------------------------------------------------------- */

.status-loading,
.status-pending,
.status-error,
.status-success {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--border-radius);
  font-size: var(--text-sm);
  font-weight: 500;
}

.status-loading {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--navy-200);
}

.status-pending {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid #fde68a;
}

.status-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid #fecaca;
}

.status-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid #bbf7d0;
}

/* Spinner for loading state */
.status-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--navy-200);
  border-top-color: var(--navy-500);
  border-radius: 50%;
  margin-right: var(--space-2);
  vertical-align: middle;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ---------------------------------------------------------------------------
   Docs Page
   --------------------------------------------------------------------------- */

.docs-content {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-12) var(--container-padding);
}

.docs-content h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

.docs-content h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-16);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.docs-content h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.docs-content > p {
  margin-bottom: var(--space-5);
}

/* Endpoint blocks */
.endpoint {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6) var(--space-8);
  margin: var(--space-6) 0;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.method-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--border-radius-sm);
}

.method-badge.get {
  background: #dbeafe;
  color: #1d4ed8;
}

.method-badge.post {
  background: #dcfce7;
  color: #15803d;
}

.method-badge.put {
  background: #fef3c7;
  color: #a16207;
}

.method-badge.delete {
  background: #fee2e2;
  color: #b91c1c;
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
}

/* Parameter tables */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
}

.params-table th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-border);
}

.params-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: top;
}

.params-table tr:last-child td {
  border-bottom: none;
}

.param-name {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

.param-type {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.param-required {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-error);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.param-optional {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Code blocks in docs */
pre {
  background: var(--code-bg);
  border-radius: var(--border-radius);
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  margin: var(--space-5) 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

pre code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--code-text);
  line-height: var(--leading-relaxed);
  background: none;
  padding: 0;
}


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

footer {
  background: var(--navy-950);
  color: var(--slate-400);
  padding: var(--space-16) 0 var(--space-8);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.footer-brand {
  max-width: 280px;
}

.footer-brand .nav-logo {
  color: var(--white);
  display: inline-block;
  margin-bottom: var(--space-4);
}

.footer-brand p {
  color: var(--slate-500);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.footer-links {
  display: flex;
  gap: var(--space-16);
}

.footer-column h4 {
  color: var(--slate-200);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  margin-bottom: var(--space-4);
}

.footer-column ul {
  list-style: none;
}

.footer-column li {
  margin-bottom: var(--space-2);
}

.footer-column a {
  color: var(--slate-400);
  font-size: var(--text-sm);
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-column a:hover {
  color: var(--slate-200);
}

.footer-bottom {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  width: 100%;
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--slate-600);
}


/* ---------------------------------------------------------------------------
   Utility Classes
   --------------------------------------------------------------------------- */

.text-center { text-align: center; }
.text-left { text-align: left; }

.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }

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

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.mx-auto { margin-left: auto; margin-right: auto; }

.max-w-narrow { max-width: 560px; }
.max-w-medium { max-width: 720px; }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-12) 0;
}

/* Section label (e.g. above section headings) */
.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--navy-500);
  margin-bottom: var(--space-4);
}

/* Card base — generic reusable */
.card {
  background: var(--white);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--border-radius-lg);
  padding: var(--space-8);
}


/* ---------------------------------------------------------------------------
   Animations
   --------------------------------------------------------------------------- */

/* Gentle fade-up for elements entering viewport (add .fade-in via JS) */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children — apply to parent, children get delay */
.stagger-children > .fade-in:nth-child(1) { transition-delay: 0ms; }
.stagger-children > .fade-in:nth-child(2) { transition-delay: 80ms; }
.stagger-children > .fade-in:nth-child(3) { transition-delay: 160ms; }
.stagger-children > .fade-in:nth-child(4) { transition-delay: 240ms; }
.stagger-children > .fade-in:nth-child(5) { transition-delay: 320ms; }
.stagger-children > .fade-in:nth-child(6) { transition-delay: 400ms; }

/* Pulse for attention (e.g. copy button confirmation) */
@keyframes pulse-success {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.3); }
  70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.pulse-success {
  animation: pulse-success 0.6s ease-out;
}


/* ---------------------------------------------------------------------------
   Responsive — Tablet (< 900px)
   --------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .pricing-grid.pricing-grid--wide,
  .pricing-grid.pricing-grid--4col {
    grid-template-columns: repeat(2, 1fr);
    max-width: 700px;
  }
}


/* ---------------------------------------------------------------------------
   Responsive — Mobile (< 768px)
   --------------------------------------------------------------------------- */

@media (max-width: 768px) {
  :root {
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --container-padding: var(--space-5);
  }

  /* Navigation */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-6);
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform var(--duration-normal) var(--ease-out),
      opacity var(--duration-normal) var(--ease-out);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    border-bottom: 1px solid var(--color-border-subtle);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: var(--space-4) 0;
    font-size: var(--text-base);
  }

  .nav-links .btn-primary {
    margin-top: var(--space-4);
    text-align: center;
    padding: var(--space-3) var(--space-6);
  }

  /* Hero */
  .hero {
    padding: var(--space-20) 0 var(--space-16);
  }

  .hero h1 {
    font-size: var(--text-4xl);
  }

  .hero .subtitle {
    font-size: var(--text-lg);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin: 0 auto;
  }

  /* Sections */
  section {
    padding: var(--space-16) 0;
  }

  /* Features */
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .feature-card {
    padding: var(--space-6);
  }

  /* Pricing */
  .pricing-grid,
  .pricing-grid.pricing-grid--wide,
  .pricing-grid.pricing-grid--4col {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .pricing-card {
    padding: var(--space-8) var(--space-6);
  }

  /* Key display */
  .key-display {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-5);
  }

  .key-display code {
    font-size: var(--text-base);
  }

  .key-display .copy-btn {
    text-align: center;
  }

  /* Footer */
  footer .container {
    flex-direction: column;
    gap: var(--space-8);
  }

  .footer-links {
    flex-direction: column;
    gap: var(--space-8);
  }

  .footer-brand {
    max-width: none;
  }

  /* Docs */
  .docs-content {
    padding: var(--space-8) var(--container-padding);
  }

  .endpoint {
    padding: var(--space-5);
  }

  .endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .params-table {
    display: block;
    overflow-x: auto;
  }

  pre {
    padding: var(--space-4);
    font-size: var(--text-xs);
  }
}


/* ---------------------------------------------------------------------------
   Responsive — Small Mobile (< 480px)
   --------------------------------------------------------------------------- */

@media (max-width: 480px) {
  :root {
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --container-padding: var(--space-4);
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }
}


/* ---------------------------------------------------------------------------
   Print
   --------------------------------------------------------------------------- */

@media print {
  nav, footer, .btn-primary, .btn-secondary {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  .hero {
    background: none;
    color: #000;
    padding: 2rem 0;
  }

  .hero h1, .hero .subtitle {
    color: #000;
  }

  pre, .code-example {
    border: 1px solid #ccc;
    background: #f5f5f5;
  }

  pre code, .code-example code {
    color: #333;
  }
}
