/* =============================================================================
   Astro Rocket Global Styles
   =============================================================================
   Vercel-inspired: Clean, minimal, sophisticated
   ============================================================================= */

@import 'tailwindcss';
@import './tokens/colors.css';
@import './tokens/typography.css';
@import './tokens/spacing.css';

/* Self-hosted fonts via Fontsource (CSP-safe, no external requests) */
@import '@fontsource-variable/manrope';
@import '@fontsource-variable/outfit';
@import '@fontsource-variable/jetbrains-mono';

/* Dark mode variant */
@custom-variant dark (&:where(.dark, .dark *));

/* -------------------------------------------------------------------------
   Tailwind Theme Configuration
   ------------------------------------------------------------------------- */
@theme {
  /* Colors */
  --color-background: var(--background);
  --color-background-secondary: var(--background-secondary);
  --color-background-tertiary: var(--background-tertiary);
  --color-foreground: var(--foreground);
  --color-foreground-secondary: var(--foreground-secondary);
  --color-foreground-muted: var(--foreground-muted);
  --color-foreground-subtle: var(--foreground-subtle);

  --color-primary: var(--primary);
  --color-primary-hover: var(--primary-hover);
  --color-primary-foreground: var(--primary-foreground);

  --color-secondary: var(--secondary);
  --color-secondary-hover: var(--secondary-hover);
  --color-secondary-foreground: var(--secondary-foreground);

  --color-accent: var(--accent);
  --color-accent-hover: var(--accent-hover);

  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);

  --color-card: var(--card);
  --color-card-border: var(--card-border);

  --color-border: var(--border);
  --color-border-strong: var(--border-strong);

  --color-ring: var(--ring);

  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-error: var(--error);

  /* Inverted/Contrast Sections */
  --color-surface-invert: var(--surface-invert);
  --color-surface-invert-secondary: var(--surface-invert-secondary);
  --color-surface-invert-tertiary: var(--surface-invert-tertiary);
  --color-on-invert: var(--on-invert);
  --color-on-invert-secondary: var(--on-invert-secondary);
  --color-on-invert-muted: var(--on-invert-muted);
  --color-border-invert: var(--border-invert);
  --color-border-invert-strong: var(--border-invert-strong);

  /* Typography - theme-controlled font stacks */
  --font-sans: var(--theme-font-sans);
  --font-display: var(--theme-font-display);
  --font-mono: var(--theme-font-mono);

  /* Brand Colors in Tailwind theme */
  --color-brand-50: var(--brand-50);
  --color-brand-100: var(--brand-100);
  --color-brand-200: var(--brand-200);
  --color-brand-300: var(--brand-300);
  --color-brand-400: var(--brand-400);
  --color-brand-500: var(--brand-500);
  --color-brand-600: var(--brand-600);
  --color-brand-700: var(--brand-700);
  --color-brand-800: var(--brand-800);
  --color-brand-900: var(--brand-900);

  /* Font Sizes - matches original design scale */
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */
  --font-size-5xl: 3rem;       /* 48px */
  --font-size-6xl: 3.75rem;    /* 60px */
  --font-size-7xl: 4.5rem;     /* 72px */

  /* Border Radius - theme-controlled */
  --radius-sm: var(--theme-radius-sm);
  --radius-md: var(--theme-radius-md);
  --radius-lg: var(--theme-radius-lg);
  --radius-xl: var(--theme-radius-xl);
  --radius-full: var(--theme-radius-full);

  /* Shadows - theme-controlled */
  --shadow-sm: var(--theme-shadow-sm);
  --shadow-md: var(--theme-shadow-md);
  --shadow-lg: var(--theme-shadow-lg);
  --shadow-xl: var(--theme-shadow-xl);

  /* Transitions */
  --transition-fast: 150ms;
  --transition-normal: 200ms;
  --transition-slow: 300ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Container */
  --container-max: 1200px;
}

/* -------------------------------------------------------------------------
   Base Layer
   ------------------------------------------------------------------------- */
@layer base {
  *,
  *::before,
  *::after {
    border-color: var(--color-border);
  }

  html {
    font-family: var(--font-sans);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    background-color: var(--color-background);
    color: var(--color-foreground);
    font-size: var(--font-size-base);
    line-height: var(--theme-body-leading);
    min-height: 100vh;
  }

  /* Typography - headings use explicit foreground color to prevent any
     gradient text effects from showing between heading characters */
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.1;
    letter-spacing: var(--theme-heading-tracking);
    color: var(--color-foreground);
    -webkit-text-fill-color: currentColor;
  }

  h1, h2 { font-weight: 700; }
  h3      { font-weight: 600; }
  h4, h5, h6 { font-weight: 500; }

  /* Paragraphs inherit color for flexibility in dark sections */

  a {
    color: inherit;
    text-decoration: none;
  }

  code, pre {
    font-family: var(--font-mono);
  }

  ::selection {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
  }

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

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

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: var(--radius-full);
  }

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

/* -------------------------------------------------------------------------
   Utilities
   ------------------------------------------------------------------------- */
@layer utilities {
  /* Invert section - remaps Tailwind theme tokens for dark/contrast sections.

     Architecture: All CSS property declarations in this file reference --color-*
     tokens (the Tailwind namespace). @theme sets --color-* defaults on :root via
     raw tokens; .invert-section overrides --color-* directly for section theming.

     The `color` property is set explicitly so that unstyled child elements
     (e.g. headings with no text-* class) inherit the correct inverted text color
     rather than the body's root-level color. */
  .invert-section {
    color: var(--color-foreground);

    --color-background: var(--surface-invert);
    --color-foreground: var(--on-invert);
    --color-foreground-secondary: var(--on-invert-secondary);
    --color-foreground-muted: var(--on-invert-muted);
    --color-foreground-subtle: var(--on-invert-muted);
    --color-border: var(--border-invert);
    --color-border-strong: var(--border-invert-strong);
    --color-secondary: var(--surface-invert-secondary);
    --color-secondary-foreground: var(--on-invert);
    --color-secondary-hover: var(--surface-invert-tertiary);
    --color-card: var(--surface-invert-secondary);
    --color-card-border: var(--border-invert);
    --color-muted: var(--surface-invert-secondary);
    --color-muted-foreground: var(--on-invert-muted);
    --color-ring: var(--on-invert);
    --color-primary: var(--on-invert);
    --color-primary-foreground: var(--surface-invert);
  }

  .dark .invert-section {
    color: var(--color-foreground);

    --color-background: var(--surface-invert);
    --color-foreground: var(--on-invert);
    --color-foreground-secondary: var(--on-invert-secondary);
    --color-foreground-muted: var(--on-invert-muted);
    --color-foreground-subtle: var(--on-invert-muted);
    --color-border: var(--border-invert);
    --color-border-strong: var(--border-invert-strong);
    --color-secondary: var(--surface-invert-secondary);
    --color-secondary-foreground: var(--on-invert);
    --color-secondary-hover: var(--surface-invert-tertiary);
    --color-card: var(--surface-invert-secondary);
    --color-card-border: var(--border-invert);
    --color-muted: var(--surface-invert-secondary);
    --color-muted-foreground: var(--on-invert-muted);
    --color-ring: var(--on-invert);
    --color-primary: var(--on-invert);
    --color-primary-foreground: var(--surface-invert);
  }

  /* Container */
  .container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.5rem;
  }

  @media (min-width: 768px) {
    .container {
      padding-inline: 2rem;
    }
  }

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

  /* Subtle gradient background */
  .bg-gradient-subtle {
    background: linear-gradient(
      to bottom,
      var(--gradient-start) 0%,
      var(--gradient-end) 100%
    );
  }

  /* Dark mode hero gradient: brand to black */
  .dark .hero-dark-gradient {
    background: linear-gradient(
      to bottom,
      var(--brand-600) 0%,
      oklch(0% 0 0) 100%
    ) !important;
  }

  /* Gradient border */
  .border-gradient {
    position: relative;
    background: var(--color-card);
    border-radius: var(--radius-lg);
  }

  .border-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(
      135deg,
      var(--color-border-strong) 0%,
      var(--color-border) 50%,
      var(--color-border-strong) 100%
    );
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
  }

  /* Grid pattern */
  .bg-grid {
    background-size: 24px 24px;
    background-image: linear-gradient(
      to right,
      var(--color-border) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      var(--color-border) 1px,
      transparent 1px
    );
  }

  /* Dot pattern */
  .bg-dots {
    background-image: radial-gradient(
      var(--color-border-strong) 1px,
      transparent 1px
    );
    background-size: 16px 16px;
  }

  /* Grid pattern - for hero sections (matches the React design) */
  .bg-grid-pattern {
    background-image:
      linear-gradient(to right, var(--gray-200) 1px, transparent 1px),
      linear-gradient(to bottom, var(--gray-200) 1px, transparent 1px);
    background-size: 40px 40px;
  }

  .dark .bg-grid-pattern {
    background-image:
      linear-gradient(to right, var(--gray-800) 1px, transparent 1px),
      linear-gradient(to bottom, var(--gray-800) 1px, transparent 1px);
  }

  /* Animations */
  .animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
  }

  .animate-slide-up {
    animation: slide-up 0.5s ease-out forwards;
  }

  .animate-slide-down {
    animation: slide-down 0.5s ease-out forwards;
  }

  @keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes slide-up {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes slide-down {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Sheet slide up from bottom */
  .animate-sheet-up {
    animation: sheet-up 0.25s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  }

  @keyframes sheet-up {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Backdrop fade */
  .animate-backdrop {
    animation: backdrop-fade 0.2s ease-out forwards;
  }

  @keyframes backdrop-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* Dropdown animations */
  .animate-dropdown-in {
    animation: dropdown-in 0.2s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  }

  .animate-dropdown-out {
    animation: dropdown-out 0.15s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  }

  @keyframes dropdown-in {
    from {
      opacity: 0;
      transform: translateY(-8px) scale(0.96);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes dropdown-out {
    from {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
    to {
      opacity: 0;
      transform: translateY(-8px) scale(0.96);
    }
  }

  /* Mobile menu slide down */
  .animate-menu-down {
    transform-origin: top;
    animation: menu-down 0.25s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  }

  .animate-menu-up {
    transform-origin: top;
    animation: menu-up 0.2s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  }

  @keyframes menu-down {
    from {
      opacity: 0;
      transform: scaleY(0);
    }
    to {
      opacity: 1;
      transform: scaleY(1);
    }
  }

  @keyframes menu-up {
    from {
      opacity: 1;
      transform: scaleY(1);
    }
    to {
      opacity: 0;
      transform: scaleY(0);
    }
  }

  /* Sheet exit animation */
  .animate-sheet-down {
    animation: sheet-down 0.2s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  }

  @keyframes sheet-down {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(100%);
    }
  }

  /* Backdrop fade out */
  .animate-backdrop-out {
    animation: backdrop-fade-out 0.2s ease-out forwards;
  }

  @keyframes backdrop-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
  }

  /* Stagger delays */
  .delay-0 { animation-delay: 0ms; }
  .delay-1 { animation-delay: 50ms; }
  .delay-2 { animation-delay: 100ms; }
  .delay-3 { animation-delay: 150ms; }
  .delay-4 { animation-delay: 200ms; }
  .delay-5 { animation-delay: 250ms; }

  /* Hover transitions */
  .hover-lift {
    transition: transform var(--transition-fast) var(--ease-out),
                box-shadow var(--transition-fast) var(--ease-out);
  }

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

  /* Link underline */
  .link-subtle {
    color: var(--color-foreground-secondary);
    transition: color var(--transition-fast);
  }

  .link-subtle:hover {
    color: var(--color-foreground);
  }

  /* Spin animation */
  .animate-spin {
    animation: spin 1s linear infinite;
  }

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

  /* Pulse */
  .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }

  /* Input error shake */
  .animate-shake {
    animation: shake 400ms var(--ease-default);
  }

  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
  }

  /* Tab content crossfade */
  .animate-tab-enter {
    animation: tab-enter var(--transition-normal) var(--ease-out);
  }

  @keyframes tab-enter {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Toast slide-in */
  .animate-toast-in {
    animation: toast-in 350ms var(--ease-spring);
  }

  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    60% { transform: translateX(-4px); }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* Tooltip scale-in */
  .animate-tooltip-in {
    animation: tooltip-in var(--transition-fast) var(--ease-out);
  }

  @keyframes tooltip-in {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* Reduced motion: disable micro-animations */
  @media (prefers-reduced-motion: reduce) {
    .animate-shake,
    .animate-tab-enter,
    .animate-toast-in,
    .animate-tooltip-in {
      animation: none;
    }
  }
}

/* -------------------------------------------------------------------------
   Components
   ------------------------------------------------------------------------- */
@layer components {
  /* -------------------------------------------------------------------------
     Navigation Component Tokens
     Customize header navigation via these CSS custom properties
     ------------------------------------------------------------------------- */
  :root {
    /* Nav link - inactive state */
    --nav-link-color: var(--color-foreground-muted);
    --nav-link-bg: transparent;
    --nav-link-font-weight: 500;

    /* Nav link - hover state */
    --nav-link-hover-color: var(--color-foreground);
    --nav-link-hover-bg: var(--color-secondary);

    /* Nav link - active state (current page) */
    --nav-link-active-color: var(--color-foreground);
    --nav-link-active-bg: var(--color-secondary);
    --nav-link-active-font-weight: 600;

    /* Nav link - focus state */
    --nav-link-focus-ring: var(--color-ring);
  }

  .nav-link {
    color: var(--nav-link-color);
    background-color: var(--nav-link-bg);
  }

  .nav-link-inactive {
    font-weight: var(--nav-link-font-weight);
  }

  .nav-link-inactive:hover {
    color: var(--nav-link-hover-color);
    background-color: var(--nav-link-hover-bg);
  }

  .nav-link-active {
    color: var(--nav-link-active-color);
    background-color: var(--nav-link-active-bg);
    font-weight: var(--nav-link-active-font-weight);
  }

  .nav-link:focus-visible {
    outline: 2px solid var(--nav-link-focus-ring);
    outline-offset: 2px;
  }

  /* Mobile nav links */
  .mobile-nav-link {
    color: var(--nav-link-color);
    background-color: var(--nav-link-bg);
  }

  .mobile-nav-link-inactive {
    font-weight: var(--nav-link-font-weight);
  }

  .mobile-nav-link-inactive:hover {
    color: var(--nav-link-hover-color);
    background-color: var(--nav-link-hover-bg);
  }

  .mobile-nav-link-active {
    color: var(--nav-link-active-color);
    background-color: var(--nav-link-active-bg);
    font-weight: var(--nav-link-active-font-weight);
  }

  /* Prose */
  .prose {
    max-width: 65ch;
    color: var(--color-foreground-secondary);
    font-size: var(--font-size-base);
    line-height: 1.75;
  }

  .prose h1, .prose h2, .prose h3, .prose h4 {
    color: var(--color-foreground);
    margin-top: 2em;
    margin-bottom: 0.75em;
  }

  .prose h1 { font-size: 2.25em; line-height: 1.2; }
  .prose h2 { font-size: 1.75em; line-height: 1.3; }
  .prose h3 { font-size: 1.375em; line-height: 1.4; }
  .prose h4 { font-size: 1.15em; line-height: 1.5; }

  .prose h1:first-child,
  .prose h2:first-child,
  .prose h3:first-child {
    margin-top: 0;
  }

  .prose p {
    margin-bottom: 1.25em;
    color: var(--color-foreground-secondary);
  }

  .prose a {
    color: var(--color-foreground);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--color-brand-500);
    transition: text-decoration-color var(--transition-fast);
  }

  .prose a:hover {
    text-decoration-color: var(--color-foreground);
  }

  .prose strong {
    color: var(--color-foreground);
    font-weight: 600;
  }

  .prose code {
    background: var(--color-background-tertiary);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
  }

  .prose pre {
    background: var(--color-background-secondary);
    border: 1px solid var(--color-border);
    padding: 1rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 1.5em 0;
  }

  .prose pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
  }

  .prose ul, .prose ol {
    margin: 1.25em 0;
    padding-left: 1.5em;
  }

  .prose li {
    margin: 0.5em 0;
  }

  .prose blockquote {
    border-left: 2px solid var(--color-border-strong);
    padding-left: 1rem;
    font-style: italic;
    margin: 1.5em 0;
    color: var(--color-foreground-muted);
  }

  .prose img {
    border-radius: var(--radius-lg);
    margin: 2em 0;
  }

  .prose hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 3em 0;
  }

  .prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 0.9em;
    overflow-x: auto;
    display: block;
  }

  .prose thead {
    border-bottom: 2px solid var(--color-border-strong);
  }

  .prose th {
    color: var(--color-foreground);
    font-weight: 600;
    text-align: left;
    padding: 0.625em 0.875em;
    background: var(--color-background-secondary);
  }

  .prose td {
    padding: 0.625em 0.875em;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-foreground-secondary);
    vertical-align: top;
  }

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

  .prose tbody tr:hover td {
    background: var(--color-background-secondary);
  }

  /* -------------------------------------------------------------------------
     Tooltip Component
     ------------------------------------------------------------------------- */
  .tooltip-wrapper {
    position: relative;
    display: inline-flex;
  }

  .tooltip-bubble {
    /* Base styles */
    position: absolute;
    z-index: 9999;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    color: white;
    background-color: var(--gray-900);
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
    white-space: nowrap;
    pointer-events: none;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96);
    transition:
      opacity var(--transition-fast) var(--ease-out),
      transform var(--transition-fast) var(--ease-out),
      visibility var(--transition-fast) var(--ease-out);
  }

  .dark .tooltip-bubble {
    background-color: var(--gray-100);
    color: var(--gray-900);
  }

  /* Position: Top (default) */
  [data-tooltip-position="top"] .tooltip-bubble {
    bottom: calc(100% + 8px);
    top: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%) scale(0.96);
  }
  [data-tooltip-position="top"] .tooltip-bubble.visible {
    transform: translateX(-50%) scale(1);
  }

  /* Position: Bottom */
  [data-tooltip-position="bottom"] .tooltip-bubble {
    top: calc(100% + 8px);
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%) scale(0.96);
  }
  [data-tooltip-position="bottom"] .tooltip-bubble.visible {
    transform: translateX(-50%) scale(1);
  }

  /* Position: Left */
  [data-tooltip-position="left"] .tooltip-bubble {
    right: calc(100% + 8px);
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) scale(0.96);
  }
  [data-tooltip-position="left"] .tooltip-bubble.visible {
    transform: translateY(-50%) scale(1);
  }

  /* Position: Right */
  [data-tooltip-position="right"] .tooltip-bubble {
    left: calc(100% + 8px);
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) scale(0.96);
  }
  [data-tooltip-position="right"] .tooltip-bubble.visible {
    transform: translateY(-50%) scale(1);
  }

  /* Visible state */
  .tooltip-bubble.visible {
    opacity: 1;
    visibility: visible;
  }
}

/* -------------------------------------------------------------------------
   Hero entrance & scroll-reveal animations
   Outside every @layer so these rules are unlayered CSS — highest cascade
   precedence — and never overridden by Tailwind-generated utilities.
   Explicit cubic-bezier values replace var() references to guarantee the
   transition shorthand is always valid.
   ------------------------------------------------------------------------- */

@keyframes hero-slide-up {
  from { transform: translateY(28px); }
  to   { transform: translateY(0); }
}

.animate-hero-slide-up {
  animation: hero-slide-up 0.7s cubic-bezier(0, 0, 0.2, 1) both;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity  0.6s cubic-bezier(0, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0, 0, 0.2, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal][data-reveal-delay="1"] { transition-delay: 100ms; }
[data-reveal][data-reveal-delay="2"] { transition-delay: 200ms; }
[data-reveal][data-reveal-delay="3"] { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .animate-hero-slide-up { animation: none; }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Hero / CTA button styles ───────────────────────────────────────────────
   Shared across all pages. Re-enable by applying these classes to buttons.
   hero-btn-brand : brand-coloured primary action
   hero-btn-learn : secondary action (outline in light, white pill in dark)   */

.hero-btn-brand {
  background-color: var(--color-brand-700) !important;
  background-image: none !important;
  color: white !important;
  border-color: transparent !important;
}
.hero-btn-brand:hover {
  background-color: var(--color-brand-700) !important;
  background-image: none !important;
  opacity: 0.85;
}

/* Header CTA — brand colour in light mode */
:root:not(.dark) .hdr-cta-brand {
  background-color: var(--color-brand-500) !important;
  background-image: none !important;
  color: white !important;
  border-color: transparent !important;
}
:root:not(.dark) .hdr-cta-brand:hover {
  background-color: var(--color-brand-600) !important;
  opacity: 1 !important;
}

.hero-btn-learn {
  background-color: transparent !important;
  background-image: none !important;
  color: var(--color-foreground) !important;
  border: 1px solid var(--color-border-strong) !important;
}
.hero-btn-learn:hover {
  background-color: var(--color-secondary) !important;
  background-image: none !important;
  opacity: 1;
}
.dark .hero-btn-learn {
  background-color: white !important;
  background-image: none !important;
  color: #111 !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}
.dark .hero-btn-learn:hover {
  background-color: rgba(255, 255, 255, 0.9) !important;
}

/* Hero register button — brand colour in both light and dark mode */
.btn-brand-hero {
  background-color: var(--color-brand-500) !important;
  background-image: none !important;
  color: white !important;
  border-color: transparent !important;
}
.btn-brand-hero:hover {
  background-color: color-mix(in srgb, var(--color-brand-500) 85%, black) !important;
  opacity: 1 !important;
}
.btn-brand-hero svg {
  transition: transform 200ms ease;
}
.btn-brand-hero:hover svg {
  transform: translateX(4px);
}
