/* ===================================================================
   ColdCallable — Design Tokens & Global Styles
   Strictly follows DESIGN.md
   =================================================================== */

:root {
  /* Core palette */
  --color-primary: #4DA8FF;
  --color-primary-dark: #2B7FD9;
  --color-accent: #FF7A3C;
  --color-accent-dark: #E35E1F;
  --color-midnight: #0E1116;
  --color-midnight-soft: #1A2340;
  --color-frost: #F6F9FC;
  --color-white: #FFFFFF;
  --color-success: #3ECF8E;
  --color-warning: #FFB547;
  --color-danger: #FF5A5A;

  /* Grays */
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(14,17,22,0.06);
  --shadow-md:  0 8px 24px rgba(14,17,22,0.08);
  --shadow-lg:  0 24px 48px rgba(14,17,22,0.12);
  --shadow-xl:  0 40px 80px rgba(14,17,22,0.16);
  --shadow-glow-orange: 0 0 64px rgba(255,122,60,0.35);
  --shadow-glow-blue:   0 0 64px rgba(77,168,255,0.30);

  /* Easings */
  --ease-out:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Safe area (notch/home-bar on mobile) */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent font scaling in landscape on iOS */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-midnight);
  background: var(--color-white);
  overflow-x: hidden;
  font-feature-settings: 'ss01', 'cv11';
}

a  { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }
img, svg { display: block; max-width: 100%; }

/* Tap highlight — remove on iOS */
* { -webkit-tap-highlight-color: transparent; }

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

/* ─── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;   /* mobile: 20px sides */
}
@media (min-width: 640px)  { .container { padding: 0 40px; } }
@media (min-width: 1024px) { .container { padding: 0 80px; } }

.section { padding: 64px 0; }
@media (min-width: 768px)  { .section { padding: 96px 0; } }
@media (min-width: 1024px) { .section { padding: 120px 0; } }

/* ─── Typography ──────────────────────────────────────────────── */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--color-primary);
  animation: pulse-dot 2s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.4); }
}

.display-xl {
  font-size: clamp(36px, 8vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.display-lg {
  font-size: clamp(28px, 5.5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 700; line-height: 1.2;  letter-spacing: -0.005em; }
.h3 { font-size: 22px; font-weight: 600; line-height: 1.3; }
.h4 { font-size: 18px; font-weight: 600; line-height: 1.4; }

.body-lg { font-size: 17px; line-height: 1.6; color: var(--gray-600); }
.body-sm { font-size: 14px; line-height: 1.5; color: var(--gray-500); }
.mono     { font-family: var(--font-mono); font-feature-settings: 'ss01'; }

.text-accent   { color: var(--color-accent); }
.text-primary  { color: var(--color-primary); }
.text-frost    { color: var(--color-frost); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;  /* WCAG 2.5.5 touch target */
  padding: 0 20px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
  transition: all 150ms var(--ease-out);
  white-space: nowrap;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; border-radius: var(--radius-xl); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 4px 14px rgba(255,122,60,0.35);
}
.btn-primary:hover  { background: var(--color-accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-glow-orange); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-secondary {
  background: transparent;
  color: var(--color-midnight);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { border-color: var(--color-midnight); background: var(--color-frost); }

.btn-secondary-dark {
  background: rgba(255,255,255,0.06);
  color: var(--color-frost);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
}
.btn-secondary-dark:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.24); }

.btn-ghost { background: transparent; color: var(--color-midnight); }
.btn-ghost:hover { background: var(--gray-100); }

/* ─── Pill / Badge ────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  background: rgba(77,168,255,0.10);
  color: var(--color-primary);
  border: 1px solid rgba(77,168,255,0.20);
}
.pill-dark {
  background: rgba(255,255,255,0.06);
  color: var(--color-frost);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
}

/* ─── Email capture ───────────────────────────────────────────── */
.email-capture {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 480px;
  height: 56px;
  padding: 5px;
  background: var(--color-white);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 32px rgba(14,17,22,0.18), 0 0 0 1px rgba(14,17,22,0.08);
  transition: box-shadow 200ms var(--ease-out);
  position: relative;
}
.email-capture-dark {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.email-capture:focus-within {
  box-shadow: 0 0 0 3px rgba(77,168,255,0.30), 0 8px 32px rgba(14,17,22,0.18);
}
.email-capture-dark:focus-within { border-color: var(--color-primary); }
.email-capture input {
  flex: 1;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 16px 0 20px;
  font-size: 16px;
  color: var(--color-midnight);
  outline: none;
  min-width: 0; /* prevent overflow */
}
.email-capture-dark input         { color: var(--color-frost); }
.email-capture-dark input::placeholder { color: rgba(246,249,252,0.5); }
.email-capture input::placeholder { color: var(--gray-400); }
.email-capture button {
  flex-shrink: 0;
  height: 100%;
  padding: 0 20px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-white);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 150ms var(--ease-out);
}
.email-capture button:hover { background: var(--color-accent-dark); }
.email-capture .success-state {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-success);
  font-weight: 600;
  font-size: 15px;
}

/* Mobile: full-width stacked layout */
@media (max-width: 479px) {
  .email-capture {
    max-width: 100%;
    height: auto;
    flex-direction: column;
    border-radius: var(--radius-xl);
    padding: 8px;
    gap: 6px;
    align-items: stretch;
  }
  .email-capture input {
    height: 48px;
    padding: 0 16px;
    border-radius: var(--radius-lg);
  }
  .email-capture button {
    height: 48px;
    width: 100%;
    border-radius: var(--radius-lg);
    justify-content: center;
    font-size: 16px;
  }
}

/* ─── Scroll-reveal ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
.reveal.in       { opacity: 1; transform: translateY(0); }
.reveal-delay-1  { transition-delay: 80ms; }
.reveal-delay-2  { transition-delay: 160ms; }
.reveal-delay-3  { transition-delay: 240ms; }
.reveal-delay-4  { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── sr-only ─────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}
