/* ========================================
   Capital 40 — Design System & Base
   ======================================== */

/* --- CSS Variables --- */
:root {
  /* Surfaces — refined for editorial darkness */
  --color-bg-primary:    #07091B;
  --color-bg-secondary:  #0E1330;
  --color-bg-elevated:   #161E45;
  --color-bg-deep:       #04050F;

  /* Single accent gradient (blue → teal). Purple reserved for final CTA only. */
  --color-primary:       #4A7FE8;
  --color-accent:        #00D4B5;
  --color-accent-purple: #8B5CF6;

  /* Text */
  --color-text-primary:  #F5F6FA;
  --color-text-secondary:#B8C1E0;
  --color-text-muted:    #6B7299;
  --color-text-faint:    #3D4470;

  /* Hairlines */
  --color-border:        rgba(74, 127, 232, 0.15);
  --color-hairline:      rgba(184, 193, 224, 0.08);
  --color-hairline-strong: rgba(184, 193, 224, 0.18);

  --color-error:         #EF4444;
  --color-success:       #10B981;

  /* Gradients */
  --gradient-hero:       radial-gradient(ellipse at top right, rgba(74, 127, 232, 0.18) 0%, transparent 55%),
                         radial-gradient(ellipse at bottom left, rgba(0, 212, 181, 0.14) 0%, transparent 50%),
                         linear-gradient(180deg, #07091B 0%, #0A0E27 100%);
  --gradient-accent:     linear-gradient(90deg, #4A7FE8 0%, #00D4B5 100%);
  --gradient-cta:        linear-gradient(135deg, #1A2350 0%, #2D1B69 50%, #07091B 100%);
  --gradient-text:       linear-gradient(135deg, #F5F6FA 0%, #B8C1E0 100%);

  /* Glass */
  --glass-bg:            rgba(22, 30, 69, 0.45);
  --glass-bg-strong:     rgba(22, 30, 69, 0.7);
  --glass-border:        rgba(74, 127, 232, 0.18);
  --glass-blur:          24px;

  /* Typography */
  --font-heading:        'Playfair Display', 'Times New Roman', Georgia, serif;
  --font-body:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-numeric:        'Space Grotesk', 'Inter', monospace;
  --font-brand:          'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Motion */
  --ease-out:            cubic-bezier(0.4, 0, 0.2, 1);
  --ease-editorial:      cubic-bezier(0.16, 1, 0.3, 1);
  --transition:          300ms var(--ease-out);
  --transition-slow:     600ms var(--ease-editorial);

  /* Spacing & shape */
  --container-max:       1280px;
  --container-narrow:    960px;
  --section-padding:     8rem 0;
  --section-padding-sm:  5rem 0;
  --radius:              12px;
  --radius-sm:           8px;
  --radius-lg:           16px;
  --radius-xl:           24px;
  --radius-2xl:          32px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 16px;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 32px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.05;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.75rem, 7vw, 5.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.75rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

.text-italic {
  font-style: italic;
  font-weight: 400;
}

.text-display-sans {
  font-family: var(--font-numeric);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-style: normal;
}

.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-mono {
  font-family: var(--font-numeric);
  letter-spacing: 0;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 100px;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  isolation: isolate;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #07091B;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(74, 127, 232, 0.35), 0 0 60px rgba(0, 212, 181, 0.2);
  color: #07091B;
}

.btn-outline {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-hairline-strong);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  background: rgba(0, 212, 181, 0.06);
  color: var(--color-text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
  padding: 14px 4px;
  border-radius: 0;
  position: relative;
}

.btn-ghost::after {
  content: '';
  position: absolute;
  left: 4px; right: 4px;
  bottom: 8px;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transition: transform var(--transition);
}

.btn-ghost:hover::after {
  transform: scaleX(1.05);
}

.btn-lg {
  padding: 18px 36px;
  font-size: 1rem;
}

.btn-xl {
  padding: 22px 48px;
  font-size: 1.0625rem;
}

/* --- Section Base --- */
.section {
  padding: var(--section-padding);
  position: relative;
}

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

.section--deep {
  background-color: var(--color-bg-deep);
}

.section-header {
  text-align: center;
  margin-bottom: 5rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-header--left {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
  position: relative;
  padding-left: 28px;
}

.section-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 1px;
  background: var(--color-accent);
}

.section-header--left .section-tag {
  margin-left: 0;
}

.section-title {
  margin-bottom: 1.25rem;
}

.section-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.65;
}

.section-header--left .section-subtitle {
  margin-left: 0;
  margin-right: 0;
}

/* --- Hairline divider --- */
.hairline {
  height: 1px;
  background: var(--color-hairline);
  border: 0;
  margin: 0;
}

/* --- Grain overlay (reusable) --- */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  z-index: 1;
}

/* --- Focus visible global --- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Selection --- */
::selection {
  background: rgba(0, 212, 181, 0.35);
  color: #fff;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-elevated);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* --- Custom cursor blob (desktop only, opt-in) --- */
@media (hover: hover) and (pointer: fine) {
  body.cursor-blob-active {
    cursor: none;
  }
  body.cursor-blob-active a,
  body.cursor-blob-active button,
  body.cursor-blob-active label,
  body.cursor-blob-active input,
  body.cursor-blob-active select,
  body.cursor-blob-active textarea,
  body.cursor-blob-active summary {
    cursor: none;
  }
}

.cursor-blob {
  position: fixed;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 212, 181, 0.12);
  border: 1px solid rgba(0, 212, 181, 0.5);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 200ms var(--ease-out), height 200ms var(--ease-out), background 200ms var(--ease-out);
  mix-blend-mode: screen;
}

.cursor-blob.is-hover {
  width: 56px;
  height: 56px;
  background: rgba(0, 212, 181, 0.18);
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-blob { display: none; }
}
