/* ─── impeccable.style design foundation for AuthShore ──────────────── */

:root {
  /* Typography: Geist Sans */
  --font-body: 'Geist Sans', 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-heading: 'Geist Sans', 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;

  /* Type scale: 1.333x perfect fourth with clamp() fluid sizing */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: clamp(1.125rem, 1.5vw + 0.5rem, 1.333rem);
  --text-xl: clamp(1.333rem, 2vw + 0.5rem, 1.777rem);
  --text-2xl: clamp(1.777rem, 3vw + 0.5rem, 2.369rem);
  --text-3xl: clamp(2rem, 3.5vw + 0.5rem, 3.157rem);
  --text-4xl: clamp(2.25rem, 5vw + 0.5rem, 4.209rem);

  /* Color: AuthShore brand — tinted neutrals (never pure #000/#fff) */
  --brand: #693668;
  --brand-hover: #552B54;
  --brand-light: #8a4e89;
  --brand-subtle: rgba(105, 54, 104, 0.08);

  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --blue: #3b82f6;
  --blue-bg: #eff6ff;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;

  /* Dark theme (default) */
  --bg: #0c0a12;
  --bg-secondary: #16131e;
  --bg-tertiary: #241e30;
  --surface: #1a1625;
  --surface-hover: #221d2e;
  --border: #2d2838;
  --border-subtle: #1f1a2a;

  --text: #ededf0;
  --text-secondary: #9c96a8;
  --text-muted: #6b6578;
  --text-on-brand: #faf9f7;

  --card-bg: #1a1625;
  --card-radius: 14px;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.25);

  --input-bg: #16131e;
  --input-border: #2d2838;
  --input-focus: var(--brand);

  --code-bg: #0f0c18;

  --nav-bg: rgba(12, 10, 18, 0.92);
  --nav-blur: saturate(180%) blur(20px);

  --gradient-hero: linear-gradient(135deg, #1a0e2e 0%, #2d1b4e 50%, #1a1040 100%);
  --gradient-cta: linear-gradient(135deg, #2d1b4e 0%, #4a2060 100%);

  /* Motion: ease-out-quart (no bounce/elastic) */
  --ease-default: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-leave: cubic-bezier(0.7, 0, 0.84, 0);
  --duration-micro: 150ms;
  --duration-state: 250ms;
  --duration-layout: 400ms;
  --duration-entrance: 600ms;

  --max-width: 1200px;
}

/* ─── Light mode ─────────────────────────────────────────────────────── */
/* Supports both html.imp-light (flash prevention) and .imp-light (toggle) */
:is(html, body).imp-light {
  --bg: #f9f8fb;
  --bg-secondary: #f3f1f6;
  --bg-tertiary: #e5e2ea;
  --surface: #ffffff;
  --surface-hover: #f3f1f6;
  --border: #e5e2ea;
  --border-subtle: #f0eef3;

  --text: #131018;
  --text-secondary: #4a4456;
  --text-muted: #6b6578;

  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.08);

  --input-bg: #f9f8fb;
  --input-border: #e5e2ea;

  --code-bg: #1e1a26;

  --nav-bg: rgba(249, 248, 251, 0.92);

  --gradient-hero: linear-gradient(135deg, #f3f1f6 0%, #e5e2ea 100%);
  --gradient-cta: linear-gradient(135deg, #2d1b4e 0%, #4a2060 100%);
}

/* Buttons/badges with brand bg always keep light text */
:is(html, body).imp-light .btn-primary,
:is(html, body).imp-light .btn-gradient,
:is(html, body).imp-light .pricing-badge,
:is(html, body).imp-light .step-num,
:is(html, body).imp-light .nav-cta { color: #faf9f7 !important; }

/* Light mode nav overrides */
.imp-light .nav { border-bottom-color: var(--border); }
.imp-light .nav-logo-img { filter: none; }
.imp-light .hero { color: var(--text); }
.imp-light .hero-sub { color: var(--text-secondary); }
.imp-light .hero-badge { color: var(--brand); background: var(--brand-subtle); border-color: rgba(105, 54, 104, 0.2); }
.imp-light .cta-banner { color: #faf9f7; }
.imp-light .cta-banner p { color: rgba(250, 249, 247, 0.7); }

/* ─── Base resets ────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

/* Dark bg typography compensation */
body:not(.imp-light) { letter-spacing: 0.01em; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-top: 0;
  color: var(--text);
  line-height: 1.2;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

a {
  color: var(--brand-light);
  text-decoration: none;
  transition: color var(--duration-state) var(--ease-default);
}

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

/* Focus: :focus-visible (never outline:none without replacement) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Touch targets: min 44px */
a, button { min-height: 44px; }

/* Button states */
button, [role="button"] {
  transition: all var(--duration-state) var(--ease-default);
}

button:active, [role="button"]:active {
  transform: scale(0.97);
  transition-duration: var(--duration-micro);
}

button:disabled, [role="button"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Text measure */
.imp-measure p, .imp-measure li { max-width: 65ch; }

/* Hero/section entrance animation */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Shared components ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Mode toggle button */
.mode-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  transition: all var(--duration-state) var(--ease-default);
}

.mode-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
