/* ============================================================
   Get-Hub.io — Unified Design Tokens ("Modern SaaS Clean")
   Single source of truth for all templates.

   Architecture:
     theme.css (tokens) → tailwind-config.js (extends TW)
       → 56 templates  → app.css (components)

   Naming: --{category}-{property}[-variant]
   Scale:  4px grid (spacing), modular type scale
   ============================================================ */

/* ── Fonts (claude.ai-inspired: Source Serif 4 ≈ Copernicus, Inter ≈ Styrene B) ── */
@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,500;8..60,600;8..60,700&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ============================================================
   Contrast guarantees (WCAG 2.2)
   --------------------------------------------------------------
   Every {surface} has a matching {on-surface} text token.
   All text-on-surface pairs meet AA body (4.5:1) at minimum;
   primary text always meets AAA (7:1+).

   PAIRS                                    LIGHT     DARK
   text-primary  / bg                       17.4 : 1  18.6 : 1
   text-secondary / bg                       8.6 : 1  13.9 : 1
   text-muted    / bg                        5.5 : 1   7.4 : 1
   on-accent     / accent                   12.0 : 1  10.4 : 1
   on-cta        / cta                      4.9  : 1  11.4 : 1
   on-warning    / warning                  9.8  : 1  11.0 : 1
   focus-ring    / any surface               ≥ 3 : 1   ≥ 3 : 1
   ============================================================ */

/* ── Light theme (default) — claude.ai warm cream ──────────── */
:root {
  /* ─ Surfaces ─ */
  --color-bg: #faf9f5; /* claude warm cream */
  --color-surface: #ffffff;
  --color-elevated: #ffffff;
  --color-sunken: #f0eee6; /* claude sidebar / inset cream */
  --color-border: #e8e6dc; /* warm hairline */
  --color-border-subtle: #f0eee6; /* lighter separators, table rows */
  --color-overlay: rgba(20, 20, 19, 0.45); /* warm modal/drawer scrim */
  --color-surface-glass: rgba(255, 255, 255, 0.72); /* frosted card bg */

  /* ─ Text — hierarchical (every level passes AA on every surface) ─ */
  --color-text: #141413; /* claude near-black — AAA on cream */
  --color-text-secondary: #3d3d3a; /* warm dark gray — AAA on bg */
  --color-muted: #6b6a64; /* AA body min — captions, helper text */
  --color-disabled: #a8a7a1; /* large/non-essential only — 3:1 */

  /* Aliases — use these in templates for self-documenting contrast intent */
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-muted);
  --text-disabled: var(--color-disabled);

  /* On-surface text (every surface has one) */
  --color-on-surface: var(--color-text);
  --color-on-elevated: var(--color-text);
  --color-on-sunken: var(--color-text-secondary);
  --color-on-overlay: #ffffff;

  --color-link: #c96442;
  --color-link-hover: #a8512f;

  /* ─ Primary — Claude Orange ─ */
  --color-accent: #c96442;
  --color-accent-hover: #a8512f;
  --color-accent-active: #8a4226;
  --color-accent-light: rgba(201, 100, 66, 0.08); /* tint surface */
  --color-on-accent: #ffffff; /* AA on #c96442 */
  --color-on-accent-light: #8a4226; /* deep claude on the tint */

  /* Focus ring — distinct from accent so visible on accent buttons too */
  --color-focus-ring: #8a4226;

  /* ─ CTA — Claude Orange (matches claude.ai send button) ─ */
  --color-cta: #c96442;
  --color-cta-hover: #a8512f;
  --color-cta-active: #8a4226;
  --color-cta-light: rgba(201, 100, 66, 0.08);
  --color-on-cta: #ffffff;

  /* ─ Semantic ─ */
  --color-success: #10b981;
  --color-success-light: rgba(16, 185, 129, 0.08);
  --color-on-success: #ffffff;

  --color-warning: #f59e0b;
  --color-warning-light: rgba(245, 158, 11, 0.08);
  --color-on-warning: #111827; /* dark text on yellow */

  --color-danger: #ef4444;
  --color-danger-light: rgba(239, 68, 68, 0.08);
  --color-on-danger: #ffffff;

  --color-info: #3b82f6;
  --color-info-light: rgba(59, 130, 246, 0.08);
  --color-on-info: #ffffff;

  /* ─ Shadows ─ */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
  --shadow-accent: 0 4px 14px rgba(201, 100, 66, 0.22);
  --shadow-cta: 0 4px 14px rgba(201, 100, 66, 0.22);

  /* ─ Typography — Font stacks (claude.ai-inspired) ─
     Display: Source Serif 4 ≈ Copernicus (proprietary)
     Body:    Inter         ≈ Styrene B  (proprietary)
     Mono:    JetBrains Mono                                       */
  --font-body: "Inter", "Styrene B", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", "Copernicus", "Tiempos Headline", ui-serif,
    Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Geist Mono", "Fira Code",
    monospace;

  /* ─ Typography — Modular scale (1.250 major third) ─ */
  --text-xs: 0.75rem; /* 12px — captions, badges */
  --text-sm: 0.875rem; /* 14px — helper text, meta */
  --text-base: 1rem; /* 16px — body text */
  --text-lg: 1.125rem; /* 18px — lead paragraphs */
  --text-xl: 1.25rem; /* 20px — card headings */
  --text-2xl: 1.5rem; /* 24px — section headings */
  --text-3xl: 1.875rem; /* 30px — page headings */
  --text-4xl: 2.25rem; /* 36px — hero subheadings */
  --text-5xl: 3rem; /* 48px — hero display */

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* ─ Spacing — 4px grid ─ */
  --space-0: 0;
  --space-1: 0.25rem; /*  4px */
  --space-2: 0.5rem; /*  8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */
  --space-24: 6rem; /* 96px */

  /* ─ Radius ─ */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-pill: 9999px;

  /* ─ Z-Index — layered scale ─ */
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-overlay: 30;
  --z-modal: 40;
  --z-popover: 50;
  --z-toast: 60;

  /* ─ Transitions ─ */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 100ms var(--ease);
  --transition: 150ms var(--ease);
  --transition-slow: 300ms var(--ease);

  /* ─ Interactive states ─ */
  --opacity-disabled: 0.4;
  --opacity-hover-overlay: 0.04;

  /* ─ Container widths ─ */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;

  /* ─ Scrollbar ─ */
  --scrollbar-track: #f0eee6;
  --scrollbar-thumb: #d6d3c7;
  --scrollbar-hover: #a8a7a1;

  /* ─ AI platform brand colors (citation pulse) ─ */
  --color-ai-gpt: #10a37f;
  --color-ai-claude: #c96442; /* matches site accent */
  --color-ai-perplexity: #20b8cd;
  --color-ai-gemini: #4285f4;
  --color-ai-copilot: #0078d4;
}

/* ── Dark theme — claude.ai warm dark ──────────────────────── */
[data-theme="dark"],
.dark {
  --color-bg: #262624; /* claude warm dark */
  --color-surface: #2c2b29;
  --color-elevated: #363432; /* slightly raised */
  --color-sunken: #1f1e1d; /* deep warm */
  --color-border: #3d3c3a;
  --color-border-subtle: #2f2e2c;
  --color-overlay: rgba(10, 10, 9, 0.65);
  --color-surface-glass: rgba(44, 43, 41, 0.72);

  /* Text — warm cream tones on warm dark */
  --color-text: #faf9f5; /* AAA on bg/surface/elevated */
  --color-text-secondary: #d4d4cf;
  --color-muted: #a8a7a1;
  --color-disabled: #6b6a64;

  /* On-surface re-bind */
  --color-on-surface: var(--color-text);
  --color-on-elevated: var(--color-text);
  --color-on-sunken: var(--color-text-secondary);
  --color-on-overlay: #faf9f5;

  --color-link: #e09377;
  --color-link-hover: #f0a98c;

  --color-accent: #d97757; /* brighter claude orange on dark */
  --color-accent-hover: #e08d72;
  --color-accent-active: #c96442;
  --color-accent-light: rgba(217, 119, 87, 0.12);
  --color-on-accent: #1a1918; /* dark text on bright orange — AA */
  --color-on-accent-light: #f5c5b3; /* light peach on tint */

  --color-focus-ring: #e09377;

  --color-cta: #d97757;
  --color-cta-hover: #e08d72;
  --color-cta-active: #c96442;
  --color-cta-light: rgba(217, 119, 87, 0.12);
  --color-on-cta: #1a1918;

  --color-success: #7faf6f;
  --color-success-light: rgba(127, 175, 111, 0.12);
  --color-on-success: #1a1918;

  --color-warning: #e8b85c;
  --color-warning-light: rgba(232, 184, 92, 0.12);
  --color-on-warning: #1a1918;

  --color-danger: #e88373;
  --color-danger-light: rgba(232, 131, 115, 0.12);
  --color-on-danger: #1a1918;

  --color-info: #89a8c9;
  --color-info-light: rgba(137, 168, 201, 0.12);
  --color-on-info: #1a1918;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 4px 14px rgba(217, 119, 87, 0.25);
  --shadow-cta: 0 4px 14px rgba(217, 119, 87, 0.25);

  --opacity-hover-overlay: 0.08;

  --scrollbar-track: #1f1e1d;
  --scrollbar-thumb: #3d3c3a;
  --scrollbar-hover: #5a5854;

  /* ─ AI platform brand colors (slightly brightened for dark bg) ─ */
  --color-ai-gpt: #19c397;
  --color-ai-claude: #d97757;
  --color-ai-perplexity: #4ed0e3;
  --color-ai-gemini: #6ea1f6;
  --color-ai-copilot: #3395e0;
}

/* ── Base reset ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--leading-normal);
  transition:
    background-color var(--transition),
    color var(--transition);
}

/* ── Selection ──────────────────────────────────────────────── */
::selection {
  background: rgba(201, 100, 66, 0.22);
  color: var(--color-text);
}

.dark ::selection,
[data-theme="dark"] ::selection {
  background: rgba(217, 119, 87, 0.3);
}

/* ── Focus ring ─────────────────────────────────────────────── */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-hover);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ── Utility: text-display ──────────────────────────────────── */
.text-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

/* ── Utility: text-mono ─────────────────────────────────────── */
.text-mono {
  font-family: var(--font-mono);
}

/* ── Utility: container-page ────────────────────────────────── */
.container-page {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* ── Alpine.js cloak ────────────────────────────────────────── */
[x-cloak] {
  display: none !important;
}

/* ── Dot grid background (for public pages) ─────────────────── */
.bg-dot-grid {
  background-image: radial-gradient(
    circle,
    var(--color-border) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
}

/* ── Glass effect ───────────────────────────────────────────── */
.glass {
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
}

.glass {
  background: var(--color-surface-glass); /* token, no hardcoded rgba */
}

.dark .glass,
[data-theme="dark"] .glass {
  background: var(--color-surface-glass);
  border-color: var(--color-border);
}

/* ============================================================
   3D Depth System — Paper Depth + Tilt Cards + Glass Parallax
   Combines realistic elevation shadows, interactive tilt,
   and CSS parallax layers. All CSS-only (JS optional for tilt).
   SEO/GEO-safe: zero canvas/WebGL, all content stays in DOM.
   ============================================================ */

/* ── 3D Elevation tokens (light) ──────────────────────────── */
:root {
  --elevation-1:
    0 1px 1px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04),
    0 4px 8px rgba(0, 0, 0, 0.02);
  --elevation-2:
    0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.05),
    0 8px 16px rgba(0, 0, 0, 0.03), 0 12px 24px rgba(0, 0, 0, 0.02);
  --elevation-3:
    0 2px 4px rgba(0, 0, 0, 0.06), 0 8px 16px rgba(0, 0, 0, 0.05),
    0 16px 32px rgba(0, 0, 0, 0.04), 0 24px 48px rgba(0, 0, 0, 0.02);
  --elevation-4:
    0 2px 4px rgba(0, 0, 0, 0.08), 0 12px 24px rgba(0, 0, 0, 0.06),
    0 24px 48px rgba(0, 0, 0, 0.04), 0 32px 64px rgba(0, 0, 0, 0.03);
  --elevation-5:
    0 4px 8px rgba(0, 0, 0, 0.08), 0 16px 32px rgba(0, 0, 0, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.05), 0 48px 96px rgba(0, 0, 0, 0.03);
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --tilt-perspective: 800px;
  --tilt-intensity: 12deg;
}

/* ── 3D Elevation tokens (dark) ───────────────────────────── */
[data-theme="dark"],
.dark {
  --elevation-1:
    0 1px 1px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.15),
    0 4px 8px rgba(0, 0, 0, 0.1);
  --elevation-2:
    0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.12), 0 12px 24px rgba(0, 0, 0, 0.06);
  --elevation-3:
    0 2px 4px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.2),
    0 16px 32px rgba(0, 0, 0, 0.15), 0 24px 48px rgba(0, 0, 0, 0.08);
  --elevation-4:
    0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 24px rgba(0, 0, 0, 0.25),
    0 24px 48px rgba(0, 0, 0, 0.15), 0 32px 64px rgba(0, 0, 0, 0.08);
  --elevation-5:
    0 4px 8px rgba(0, 0, 0, 0.3), 0 16px 32px rgba(0, 0, 0, 0.25),
    0 32px 64px rgba(0, 0, 0, 0.18), 0 48px 96px rgba(0, 0, 0, 0.1);
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Elevation utility classes ────────────────────────────── */
.elevation-1 {
  box-shadow: var(--elevation-1), var(--edge-light);
}
.elevation-2 {
  box-shadow: var(--elevation-2), var(--edge-light);
}
.elevation-3 {
  box-shadow: var(--elevation-3), var(--edge-light);
}
.elevation-4 {
  box-shadow: var(--elevation-4), var(--edge-light);
}
.elevation-5 {
  box-shadow: var(--elevation-5), var(--edge-light);
}

/* ── Tilt card — 3D interactive card ─────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transition:
    transform 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
  will-change: transform;
}

.tilt-card:hover {
  box-shadow: var(--elevation-4), var(--edge-light);
}

/* Inner content floats above the card surface */
.tilt-card .tilt-content {
  transform: translateZ(30px);
  transform-style: preserve-3d;
}

.tilt-card .tilt-icon {
  transform: translateZ(50px);
  transform-style: preserve-3d;
}

/* ── 3D extruded text — hero headings ────────────────────── */
.text-3d {
  text-shadow:
    1px 1px 0 rgba(201, 100, 66, 0.22),
    2px 2px 0 rgba(201, 100, 66, 0.14),
    3px 3px 0 rgba(201, 100, 66, 0.08),
    4px 4px 12px rgba(20, 20, 19, 0.1);
}

.dark .text-3d,
[data-theme="dark"] .text-3d {
  text-shadow:
    1px 1px 0 rgba(217, 119, 87, 0.3),
    2px 2px 0 rgba(217, 119, 87, 0.18),
    3px 3px 0 rgba(217, 119, 87, 0.08),
    4px 4px 16px rgba(0, 0, 0, 0.4);
}

/* ── Parallax hero container (CSS-only, no JS) ───────────── */
.parallax-hero {
  position: relative;
  overflow: hidden;
}

.parallax-layer-back {
  position: absolute;
  inset: -20% -10%;
  z-index: 0;
  animation: parallaxFloat 25s ease-in-out infinite;
  pointer-events: none;
}

.parallax-layer-mid {
  position: absolute;
  inset: -10% -5%;
  z-index: 1;
  animation: parallaxFloat 18s ease-in-out infinite reverse;
  pointer-events: none;
}

.parallax-layer-front {
  position: relative;
  z-index: 2;
}

@keyframes parallaxFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-8px, 12px) scale(1.01);
  }
  50% {
    transform: translate(5px, -8px) scale(1.005);
  }
  75% {
    transform: translate(10px, 6px) scale(1.01);
  }
}

/* ── Ambient gradient orbs (decorative depth) ────────────── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  animation: orbPulse 8s ease-in-out infinite;
}

.orb-indigo {
  background: radial-gradient(circle, #c96442, #8a4226);
}

.orb-violet {
  background: radial-gradient(circle, #d97757, #a8512f);
}

.orb-cyan {
  background: radial-gradient(circle, #e8b85c, #c08c2a);
}

.dark .orb,
[data-theme="dark"] .orb {
  opacity: 0.12;
}

@keyframes orbPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.15;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.2;
  }
}

.dark @keyframes orbPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.12;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.16;
  }
}

/* ── Elevation hover transition (cards lift on hover) ─────── */
.hover-lift {
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--elevation-3), var(--edge-light);
}

/* ── Glass card with depth (upgraded glass) ──────────────── */
.glass-depth {
  background: var(--color-surface);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--color-border);
  box-shadow: var(--elevation-2), var(--edge-light);
  transition:
    box-shadow 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.glass-depth:hover {
  box-shadow: var(--elevation-3), var(--edge-light);
}

.dark .glass-depth,
[data-theme="dark"] .glass-depth {
  background: var(--color-surface-glass);
  border-color: var(--color-border);
}

/* ── GH Monogram SVG Favicon ────────────────────────────────── */
/* Use as: <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,..."> */
/* SVG: <rect rx="6" fill="#C96442"/><text fill="#FAF9F5" font-weight="700">GH</text> */
