@import "tailwindcss";
/* Drives the `animate-in` / `data-[state=open]:…` classes that every Radix-based
   shadcn primitive (Dialog, Sheet, Popover, DropdownMenu, Select) relies on.
   The package was already a dependency but had never been imported, so those
   enter/exit transitions had always been no-ops. */
@import "tw-animate-css";

/**
 * Bind the `dark:` variant to the `.dark` class.
 *
 * This was missing, and it decoupled two halves of the theme: the token layer
 * switches on `.dark` (set by next-themes), while every `dark:` utility inside
 * the shadcn primitives fell back to Tailwind v4's default of
 * `prefers-color-scheme: dark`. So on a machine set to dark, a light-themed
 * page still applied rules like `dark:bg-destructive/60` — which is why the
 * destructive button rendered at 60% opacity (washed-out salmon instead of
 * red) regardless of the app's own theme.
 */
@custom-variant dark (&:is(.dark *));

/* ============================================================================
   OXYFINZ DESIGN SYSTEM
   ----------------------------------------------------------------------------
   Single source of truth for colour, radius, elevation and motion.
   Fonts are loaded via next/font in app/layout.tsx (no render-blocking @import).

   Conventions
   - All colour is expressed as HSL channel triplets so Tailwind's `/opacity`
     modifier keeps working: hsl(var(--primary) / 0.1)
   - Surfaces climb: background < surface < card < elevated
   - Never hardcode a hex in a component. Use a token or a `.oxy-*` class.
   ========================================================================== */

@theme {
  /* Semantic colours -> Tailwind utilities (bg-card, text-muted-foreground, …) */
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));
  --color-surface: hsl(var(--surface));
  --color-card: hsl(var(--card));
  --color-card-foreground: hsl(var(--card-foreground));
  --color-popover: hsl(var(--popover));
  --color-popover-foreground: hsl(var(--popover-foreground));

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

  --color-secondary: hsl(var(--secondary));
  --color-secondary-foreground: hsl(var(--secondary-foreground));
  --color-muted: hsl(var(--muted));
  --color-muted-foreground: hsl(var(--muted-foreground));
  --color-accent: hsl(var(--accent));
  --color-accent-foreground: hsl(var(--accent-foreground));

  --color-success: hsl(var(--success));
  --color-success-foreground: hsl(var(--success-foreground));
  --color-success-soft: hsl(var(--success-soft));
  --color-warning: hsl(var(--warning));
  --color-warning-foreground: hsl(var(--warning-foreground));
  --color-warning-soft: hsl(var(--warning-soft));
  --color-destructive: hsl(var(--destructive));
  --color-destructive-foreground: hsl(var(--destructive-foreground));
  --color-destructive-soft: hsl(var(--destructive-soft));
  --color-info: hsl(var(--info));
  --color-info-foreground: hsl(var(--info-foreground));
  --color-info-soft: hsl(var(--info-soft));

  --color-border: hsl(var(--border));
  --color-border-strong: hsl(var(--border-strong));
  --color-input: hsl(var(--input));
  --color-ring: hsl(var(--ring));

  /* Sidebar surface — required by components/ui/sidebar.tsx. These were never
     defined (not before this migration either), so every `bg-sidebar` /
     `text-sidebar-foreground` class in that primitive resolved to nothing. */
  --color-sidebar: hsl(var(--sidebar));
  --color-sidebar-foreground: hsl(var(--sidebar-foreground));
  --color-sidebar-primary: hsl(var(--sidebar-primary));
  --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
  --color-sidebar-accent: hsl(var(--sidebar-accent));
  --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
  --color-sidebar-border: hsl(var(--sidebar-border));
  --color-sidebar-ring: hsl(var(--sidebar-ring));

  /* Chart series — required by components/ui/chart.tsx, likewise undefined.
     Values are the app's existing COLOR_PALETTE (lib/common/constants.ts) so
     charts keep the colours they already render with. */
  --color-chart-1: hsl(var(--chart-1));
  --color-chart-2: hsl(var(--chart-2));
  --color-chart-3: hsl(var(--chart-3));
  --color-chart-4: hsl(var(--chart-4));
  --color-chart-5: hsl(var(--chart-5));

  /* Marketing dark band — Security / Pricing sit on this, not on --background.
     Mapping .bg-navy to the light canvas made those sections render white type
     on an off-white ground. */
  --color-navy: hsl(var(--navy));
  --color-navy-foreground: hsl(var(--navy-foreground));
  --color-navy-muted: hsl(var(--navy-muted));
  --color-navy-card: hsl(var(--navy-card));

  /* Display face used as `font-heading` across marketing sections. */
  --font-heading: var(--font-display), "Space Grotesk", ui-sans-serif, system-ui, sans-serif;

  /* Radius scale — 4 steps, no more. Everything maps onto these. */
  --radius-sm: 0.375rem; /* 6px  — chips, tight controls */
  --radius-md: 0.5rem; /* 8px  — inputs, buttons */
  --radius-lg: 0.75rem; /* 12px — cards, popovers */
  --radius-xl: 1rem; /* 16px — modals, page panels */

  /* Elevation — soft, neutral, never coloured */
  --shadow-xs: 0 1px 2px 0 rgb(16 24 40 / 0.04);
  --shadow-sm: 0 1px 3px 0 rgb(16 24 40 / 0.06), 0 1px 2px -1px rgb(16 24 40 / 0.04);
  --shadow-md: 0 4px 12px -2px rgb(16 24 40 / 0.08), 0 2px 4px -2px rgb(16 24 40 / 0.04);
  --shadow-lg: 0 12px 28px -8px rgb(16 24 40 / 0.12), 0 4px 10px -4px rgb(16 24 40 / 0.06);
  --shadow-xl: 0 24px 48px -12px rgb(16 24 40 / 0.18);

  /* Motion — fast and subtle, one easing curve */
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);

  --animate-checkbox-pop: checkbox-pop 200ms cubic-bezier(0.18, 0.89, 0.32, 1.28);
  --animate-fade-in: fade-in 160ms var(--ease-out-soft) both;
  --animate-fade-up: fade-up 220ms var(--ease-out-soft) both;
  --animate-scale-in: scale-in 160ms var(--ease-out-soft) both;
  --animate-slide-in-left: slide-in-left 220ms var(--ease-out-soft) both;
  --animate-shimmer: shimmer 1.6s linear infinite;
}

/* ---------------------------------------------------------------------------
   Tokens
   The product surface is a light application. Dark tokens are kept coherent for
   the marketing pages, but the app shell is deliberately light — every product
   screen is authored light, so a system-driven dark flip only ever broke it.
   ------------------------------------------------------------------------- */
@layer base {
  /* --------------------------------------------------------------------
     LIGHT PALETTE — derived from the colours the app already ships.
     Every value below traces to something that was already on screen; none
     of it is a shadcn default. Source column names the origin.
     -------------------------------------------------------------------- */
  :root {
    /* Surfaces                                    source                */
    --background: 210 20% 98%; /* main's bg-gray-50   #f9fafb */
    --surface: 210 40% 96%; /* slate-100           #f1f5f9 */
    --card: 0 0% 100%; /* card bg-white       #ffffff */
    --card-foreground: 217 33% 17%;
    --popover: 0 0% 100%;
    --popover-foreground: 217 33% 17%;

    /* Text                                                              */
    --foreground: 217 33% 17%; /* text-slate-800      #1e293b */
    --muted-foreground: 215 16% 47%; /* text-slate-500      #64748b */
    --muted: 210 40% 96%; /* slate-100           #f1f5f9 */

    /* Brand — the app's existing green, unchanged.
       NOTE: the old token said `140 38% 40%` while 800 literals across the
       codebase said #428B4D (= 129 36% 40%). Those were two different greens.
       The token now matches the literal, so `bg-primary` and `bg-[#428B4D]`
       finally render the same colour. */
    --primary: 129 36% 40%; /* #428B4D */
    --primary-foreground: 0 0% 100%;
    --primary-hover: 129 39% 34%; /* #357A3F — existing PRIMARY_COLOR_HOVER */
    --primary-soft: 129 33% 95%; /* the app's bg-[#428B4D]/10 hover tint */

    --secondary: 210 40% 96%;
    --secondary-foreground: 217 33% 17%;

    /* `accent` is shadcn's subtle hover surface for menus and command items.
       The old token set it to the solid brand green, which would paint every
       dropdown hover fully green. The app's real hover was `bg-[#428B4D]/10`,
       so accent maps to that tint — same look, correct semantics. */
    --accent: 129 33% 95%;
    --accent-foreground: 129 39% 30%;

    /* Status — taken from the classes already used across the app */
    --success: 142 71% 29%; /* emerald-700         #047857 */
    --success-foreground: 0 0% 100%;
    --success-soft: 152 81% 96%; /* emerald-50          #ecfdf5 */
    --warning: 26 90% 37%; /* amber-700           #b45309 */
    --warning-foreground: 0 0% 100%;
    --warning-soft: 48 100% 96%; /* amber-50            #fffbeb */
    --destructive: 0 84% 60%; /* red-500 — unchanged #ef4444 */
    --destructive-foreground: 0 0% 100%;
    --destructive-soft: 0 86% 97%; /* red-50              #fef2f2 */
    --info: 221 83% 45%; /* blue-600            #2563eb */
    --info-foreground: 0 0% 100%;
    --info-soft: 214 100% 97%; /* blue-50             #eff6ff */

    --border: 214 32% 91%; /* border-slate-200    #e2e8f0 */
    --border-strong: 213 27% 84%; /* slate-300           #cbd5e1 */
    --input: 214 32% 91%;
    --ring: 129 36% 40%;

    /* Sidebar — the nav panel is a white surface with brand-tinted active
       rows, matching how the existing slide-over already looked. */
    --sidebar: 0 0% 100%;
    --sidebar-foreground: 217 33% 17%;
    --sidebar-primary: 129 36% 40%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 129 33% 95%;
    --sidebar-accent-foreground: 129 39% 30%;
    --sidebar-border: 214 32% 91%;
    --sidebar-ring: 129 36% 40%;

    /* Charts — the first five entries of the existing COLOR_PALETTE */
    --chart-1: 225 73% 57%; /* #4169E1 */
    --chart-2: 120 61% 50%; /* #32CD32 */
    --chart-3: 9 100% 64%; /* #FF6347 */
    --chart-4: 51 100% 50%; /* #FFD700 */
    --chart-5: 260 60% 65%; /* #9370DB */

    --radius: 0.5rem;

    /* App chrome metrics — shared by header, sidebar and sticky footers so the
       three stay in sync without JS measurement. */
    --header-height: 64px;
    --footer-bar-height: 60px;

    /* Dedicated navy for marketing dark bands. Independent of --background so
       light-themed product screens never bleach Security / Pricing. */
    --navy: 222 28% 8%;
    --navy-foreground: 0 0% 98%;
    --navy-muted: 215 14% 72%;
    --navy-card: 222 22% 12%;
  }

  /* --------------------------------------------------------------------
     DARK PALETTE — keeps the original dark neutrals (220 15% 5% ground,
     220 12% 8% card, 220 10% 18% border) and lifts only the brand, which
     needs more luminance to stay legible on a dark ground.
     -------------------------------------------------------------------- */
  .dark {
    --background: 220 15% 5%; /* original --background */
    --surface: 220 12% 8%;
    --card: 220 12% 8%; /* original --card */
    --card-foreground: 0 0% 100%;
    --popover: 220 12% 8%;
    --popover-foreground: 0 0% 100%;

    --foreground: 0 0% 100%; /* original --foreground */
    --muted-foreground: 220 10% 60%; /* original */
    --muted: 220 10% 15%; /* original */

    /* Same hue as the light brand, lightened so it clears contrast on the
       dark ground. The identity is unchanged; only the value moves. */
    --primary: 129 40% 52%;
    --primary-foreground: 220 15% 5%;
    --primary-hover: 129 42% 60%;
    --primary-soft: 129 28% 14%;

    --secondary: 220 10% 12%; /* original */
    --secondary-foreground: 0 0% 100%;
    --accent: 129 28% 14%;
    --accent-foreground: 129 45% 72%;

    --success: 142 60% 48%;
    --success-foreground: 220 15% 5%;
    --success-soft: 142 30% 12%;
    --warning: 38 85% 58%;
    --warning-foreground: 220 15% 5%;
    --warning-soft: 38 40% 13%;
    --destructive: 0 84% 62%; /* original hue preserved */
    --destructive-foreground: 0 0% 100%;
    --destructive-soft: 0 40% 14%;
    --info: 217 85% 62%;
    --info-foreground: 220 15% 5%;
    --info-soft: 217 40% 14%;

    --border: 220 10% 18%; /* original */
    --border-strong: 220 10% 26%;
    --input: 220 10% 18%; /* original */
    --ring: 129 40% 52%;

    --sidebar: 220 12% 8%;
    --sidebar-foreground: 0 0% 100%;
    --sidebar-primary: 129 40% 52%;
    --sidebar-primary-foreground: 220 15% 5%;
    --sidebar-accent: 129 28% 14%;
    --sidebar-accent-foreground: 129 45% 72%;
    --sidebar-border: 220 10% 18%;
    --sidebar-ring: 129 40% 52%;

    /* Chart hues held; lightness lifted for the dark ground. */
    --chart-1: 225 78% 66%;
    --chart-2: 120 55% 58%;
    --chart-3: 9 90% 68%;
    --chart-4: 51 90% 58%;
    --chart-5: 260 65% 72%;
  }

  * {
    border-color: hsl(var(--border));
  }

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

  body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: var(--font-sans, "Inter"), system-ui, -apple-system, sans-serif;
    font-size: 0.9375rem; /* 15px */
    line-height: 1.6;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  }

  /* Type scale. Sizes are set by utilities at call sites; this establishes the
     family, weight, tracking and rhythm so headings are consistent by default. */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-display, "Space Grotesk"), system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.018em;
    line-height: 1.25;
    color: hsl(var(--foreground));
    text-wrap: balance;
  }

  h1 {
    letter-spacing: -0.025em;
  }

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

  button {
    font-family: inherit;
    cursor: pointer;
  }

  input,
  textarea,
  select {
    font-family: inherit;
    color: hsl(var(--foreground));
  }

  /* Placeholder must stay clearly weaker than a real value, but readable. */
  ::placeholder {
    color: hsl(var(--muted-foreground) / 0.7);
    opacity: 1;
  }

  /* One focus treatment for the entire product. Visible on every control,
     never on mouse click (":focus-visible" only). */
  :focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }

  /* Numeric data must never jitter while it updates. */
  .tabular-nums,
  td,
  th {
    font-variant-numeric: tabular-nums;
  }

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

  section {
    position: relative;
    width: 100%;
  }
}

/* ============================================================================
   COMPONENT CLASSES
   Shared, semantic building blocks. Prefer these over re-declaring long utility
   strings — they were the main source of drift across the 26 *Actions files.
   ========================================================================== */
@layer components {
  /* Touch targets: shadcn's Button sizes are tuned for a mouse (h-8 / h-9).
     On a coarse pointer they are lifted to the 44px minimum without changing
     the desktop rhythm. Applied via the primitive's data-slot so it covers
     every Button in the app, including ones added later. */
  @media (pointer: coarse) {
    [data-slot="button"],
    [data-slot="select-trigger"] {
      min-height: 2.75rem;
    }
    [data-slot="dropdown-menu-item"],
    [data-slot="select-item"] {
      min-height: 2.5rem;
    }
  }

  /* --- Surfaces --------------------------------------------------------- */
  .oxy-card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  .oxy-panel {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  /* Interactive card: lifts a little, but only on devices with a real pointer */
  .oxy-card-interactive {
    transition:
      box-shadow 160ms var(--ease-out-soft),
      border-color 160ms var(--ease-out-soft),
      transform 160ms var(--ease-out-soft);
  }
  @media (hover: hover) {
    .oxy-card-interactive:hover {
      box-shadow: var(--shadow-md);
      border-color: hsl(var(--border-strong));
      transform: translateY(-2px);
    }
  }

  /* --- Buttons ---------------------------------------------------------- */
  .oxy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    /* 36px desktop; bumped to 44px on touch below for accessible targets */
    min-height: 2.25rem;
    padding-inline: 0.875rem;
    transition:
      background-color 140ms var(--ease-out-soft),
      border-color 140ms var(--ease-out-soft),
      color 140ms var(--ease-out-soft),
      box-shadow 140ms var(--ease-out-soft);
  }

  .oxy-btn:disabled,
  .oxy-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .oxy-btn:not(:disabled):active {
    transform: translateY(0.5px);
  }

  .oxy-btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: var(--shadow-xs);
  }
  .oxy-btn-primary:not(:disabled):hover {
    background-color: hsl(var(--primary-hover));
  }

  .oxy-btn-secondary {
    background-color: hsl(var(--card));
    border-color: hsl(var(--border-strong));
    color: hsl(var(--foreground));
    box-shadow: var(--shadow-xs);
  }
  .oxy-btn-secondary:not(:disabled):hover {
    background-color: hsl(var(--muted));
    border-color: hsl(var(--border-strong));
  }

  .oxy-btn-ghost {
    background-color: transparent;
    color: hsl(var(--muted-foreground));
  }
  .oxy-btn-ghost:not(:disabled):hover {
    background-color: hsl(var(--muted));
    color: hsl(var(--foreground));
  }

  .oxy-btn-danger {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    box-shadow: var(--shadow-xs);
  }
  .oxy-btn-danger:not(:disabled):hover {
    background-color: hsl(var(--destructive) / 0.88);
  }

  .oxy-btn-sm {
    min-height: 2rem;
    padding-inline: 0.625rem;
    font-size: 0.75rem;
    gap: 0.375rem;
  }

  .oxy-btn-lg {
    min-height: 2.75rem;
    padding-inline: 1.25rem;
    font-size: 0.875rem;
  }

  /* Touch devices: every button clears the 44px target minimum. */
  @media (pointer: coarse) {
    .oxy-btn {
      min-height: 2.75rem;
    }
    .oxy-btn-sm {
      min-height: 2.5rem;
    }
  }

  /* --- Form controls ---------------------------------------------------- */
  .oxy-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: hsl(var(--muted-foreground));
  }

  .oxy-input {
    width: 100%;
    min-height: 2.25rem;
    border-radius: var(--radius-md);
    border: 1px solid hsl(var(--input));
    background-color: hsl(var(--card));
    padding-inline: 0.625rem;
    /* 16px on small screens stops iOS Safari zooming on focus. */
    font-size: 1rem;
    color: hsl(var(--foreground));
    transition:
      border-color 140ms var(--ease-out-soft),
      box-shadow 140ms var(--ease-out-soft),
      background-color 140ms var(--ease-out-soft);
  }

  @media (min-width: 640px) {
    .oxy-input {
      font-size: 0.8125rem;
    }
  }

  @media (pointer: coarse) {
    .oxy-input {
      min-height: 2.75rem;
    }
  }

  .oxy-input:hover:not(:disabled):not(:focus) {
    border-color: hsl(var(--border-strong));
  }

  .oxy-input:focus,
  .oxy-input:focus-visible {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.16);
  }

  .oxy-input:disabled {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    cursor: not-allowed;
  }

  .oxy-input[aria-invalid="true"] {
    border-color: hsl(var(--destructive));
  }
  .oxy-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.16);
  }

  .oxy-field-error {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: hsl(var(--destructive));
  }

  /* --- Badges / chips --------------------------------------------------- */
  .oxy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
  }

  .oxy-badge-neutral {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border-color: hsl(var(--border));
  }
  .oxy-badge-brand {
    background-color: hsl(var(--primary-soft));
    color: hsl(var(--primary-hover));
    border-color: hsl(var(--primary) / 0.25);
  }
  .oxy-badge-success {
    background-color: hsl(var(--success-soft));
    color: hsl(var(--success));
    border-color: hsl(var(--success) / 0.25);
  }
  .oxy-badge-warning {
    background-color: hsl(var(--warning-soft));
    color: hsl(var(--warning));
    border-color: hsl(var(--warning) / 0.25);
  }
  .oxy-badge-danger {
    background-color: hsl(var(--destructive-soft));
    color: hsl(var(--destructive));
    border-color: hsl(var(--destructive) / 0.25);
  }
  .oxy-badge-info {
    background-color: hsl(var(--info-soft));
    color: hsl(var(--info));
    border-color: hsl(var(--info) / 0.25);
  }

  /* --- Section labels --------------------------------------------------- */
  /* The old code used text-[10px] uppercase tracking-widest in ~200 places at
     four different sizes. This is that pattern, once. */
  .oxy-eyebrow {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
  }

  /* --- Loading ---------------------------------------------------------- */
  .oxy-skeleton {
    position: relative;
    overflow: hidden;
    background-color: hsl(var(--muted));
    border-radius: var(--radius-sm);
  }
  .oxy-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
      90deg,
      transparent,
      hsl(var(--card) / 0.7),
      transparent
    );
    animation: shimmer 1.6s infinite;
  }

  /* --- Table ------------------------------------------------------------ */
  .oxy-table-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes checkbox-pop {
  from {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

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

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

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

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Legacy names still referenced by marketing sections */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideDown {
  from {
    transform: translateY(-8px);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes pulse-slow {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
@keyframes float-blob {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-18px) scale(1.04);
  }
}
@keyframes float-blob-slow {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  33% {
    transform: translateY(-12px) scale(1.02) rotate(120deg);
  }
  66% {
    transform: translateY(-8px) scale(1.01) rotate(240deg);
  }
}

/* ============================================================================
   ANIMATION UTILITIES
   ========================================================================== */
.animate-spin {
  animation: spin 1s linear infinite;
}
.animate-fadeIn {
  animation: fade-in 200ms var(--ease-out-soft);
}
.animate-fade-up {
  animation: fade-up 220ms var(--ease-out-soft) both;
}
.animate-scale-in {
  animation: scale-in 160ms var(--ease-out-soft) both;
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}
.animate-pulse-slow {
  animation: pulse-slow 4s ease-in-out infinite;
}
.animate-float-blob-slow {
  animation: float-blob-slow 8s ease-in-out infinite;
}

.touch-manipulation {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.text-balance {
  text-wrap: balance;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.decorative {
  user-select: none;
  pointer-events: none;
}

/* ============================================================================
   SCROLLBARS
   ========================================================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: hsl(var(--border-strong));
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.5);
  background-clip: content-box;
}

.scrollbar-light,
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border-strong)) transparent;
}

.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

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

/* ============================================================================
   DASHBOARD WIDGET GRID
   ----------------------------------------------------------------------------
   The widget grid is a plain CSS grid (see DashboardWidgetGrid) with drag
   reordering from useSortableGrid. It replaced GridStack, so the whole
   .grid-stack / .ui-resizable rule set that used to live here is gone along
   with the dependency.

   The section sits inside the page container, which already supplies the
   horizontal gutter — these wrappers must not add another one, or the widget
   header and grid drift inward relative to the stat cards above them.
   ========================================================================== */
.widgets-section-header {
  padding: 0;
  margin: 0;
}

/* ============================================================================
   MARKETING SITE
   The public pages (/, /product, /about, /careers, legal) have their own
   visual language on a light canvas with two intentionally dark sections.
   ========================================================================== */
.landing-container {
  width: 100%;
  max-width: 80rem; /* matches header max-w-7xl */
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.landing-section-eyebrow {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--primary));
}

.landing-section-title {
  font-family: var(--font-display, "Space Grotesk"), system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.875rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.font-mono {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
}

.bg-navy {
  background-color: hsl(var(--navy));
  color: hsl(var(--navy-foreground));
}

/* Brand accent helpers used by marketing sections */
.text-orange {
  color: hsl(var(--primary));
}
.text-orange-light {
  color: hsl(var(--primary) / 0.8);
}
.bg-orange {
  background-color: hsl(var(--primary));
}
.bg-orange-dark {
  background-color: hsl(var(--primary-hover));
}
.border-orange {
  border-color: hsl(var(--primary));
}
.hover\:bg-orange-dark:hover {
  background-color: hsl(var(--primary-hover));
}
.hover\:border-orange\/30:hover {
  border-color: hsl(var(--primary) / 0.3);
}
.shadow-glow {
  box-shadow: var(--shadow-md);
}

/* Was white -> green, which left the top half of every metric digit invisible
   on the light card it is used on. Now runs dark green -> brand green. */
.text-gradient,
.text-gradient-orange {
  background-image: linear-gradient(
    135deg,
    hsl(var(--primary-hover)),
    hsl(var(--primary) / 0.8)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ascii-grid {
  background-image:
    linear-gradient(hsl(var(--primary) / 0.03) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--primary) / 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

.code-block {
  background: #0d0e12;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    hsl(var(--primary) / 0.3),
    transparent
  );
}

.tab-active {
  background: hsl(var(--primary) / 0.12);
  border-color: hsl(var(--primary) / 0.5);
  color: hsl(var(--primary));
}

.metric-card {
  background: hsl(var(--primary) / 0.04);
  border: 1px solid hsl(var(--primary) / 0.15);
}

.terminal-bg {
  background: linear-gradient(180deg, #0f1014 0%, #0c0d10 100%);
}

.syntax-keyword {
  color: #c678dd;
}
.syntax-string {
  color: #98c379;
}
.syntax-function {
  color: #61afef;
}
.syntax-comment {
  color: #5c6370;
}
.syntax-number {
  color: #d19a66;
}

/* Marketing surface aliases */
.bg-surface {
  background-color: hsl(var(--surface));
}
.bg-surface-elevated {
  background-color: hsl(var(--card));
}
.bg-surface-highlight {
  background-color: hsl(var(--muted));
}
.border-subtle {
  border-color: hsl(var(--border));
}
.text-text-secondary {
  color: hsl(var(--muted-foreground));
}
.text-text-muted {
  color: hsl(var(--muted-foreground) / 0.8);
}

/* Marketing text colours — inherit the token so there is one "near black". */
.oxyfinz-logo,
.oxyfinz-logo span,
.faq-question,
.faq-intro,
.faq-answer,
.legal-sidebar-label,
.legal-sidebar-link,
.legal-page-title,
.legal-page-date,
.header-nav-link,
.header-login-btn,
.contact-info-label,
.contact-info-value,
.footer-category,
.footer-link,
.footer-copyright,
.legal-prose h1,
.legal-prose h2,
.legal-prose h3,
.legal-prose h4,
.legal-prose h5,
.legal-prose h6,
.legal-prose p,
.legal-prose li,
.legal-prose strong {
  color: hsl(var(--foreground));
}

.oxyfinz-logo:hover,
.oxyfinz-logo:hover span,
.header-nav-link:hover,
.footer-link:hover,
.legal-sidebar-link:hover {
  color: hsl(var(--primary));
}

.legal-sidebar-link-active,
.legal-back-link,
.legal-prose a {
  color: hsl(var(--primary));
}

/* CMS-authored HTML: article bodies and FAQ answers, which arrive as raw
   markup and so carry no utility classes of their own. */
.article-prose h1,
.article-prose h2,
.article-prose h3,
.article-prose h4,
.article-prose h5,
.article-prose h6 {
  color: hsl(var(--foreground));
  font-weight: 700;
  margin: 1.25em 0 0.5em;
  line-height: 1.25;
}
.article-prose p {
  margin: 0 0 1em;
}
.article-prose a {
  color: hsl(var(--primary));
}
.article-prose img,
.article-prose video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 1.25em 0;
}
.article-prose ul,
.article-prose ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}
.article-prose iframe {
  max-width: 100%;
}

/* The two deliberately dark marketing sections */
#pricing,
#data-security-compliance {
  background-color: #0c0d10;
  color: #fff;
}

#pricing h1,
#pricing h2,
#pricing h3,
#pricing h4,
#pricing h5,
#pricing h6,
#data-security-compliance h1,
#data-security-compliance h2,
#data-security-compliance h3,
#data-security-compliance h4,
#data-security-compliance h5,
#data-security-compliance h6 {
  color: #fff;
}

#data-security-compliance .bg-surface {
  background-color: #111216;
}

/* ============================================================================
   PRINT & MOTION PREFERENCES
   ========================================================================== */
@media print {
  body {
    background: #fff;
  }
  .no-print {
    display: none !important;
  }
}

@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;
  }
}

.pin-spacer {
  background-color: transparent !important;
}

/* ============================================================================
   IMMERSIVE LANDING (/)
   ----------------------------------------------------------------------------
   The homepage runs its own near-black editorial theme, independent of the
   light/dark toggle: it is a fixed art direction, not a user preference.
   Rather than restyling every shadcn primitive it uses, the scope redefines
   the token layer, so `bg-card`, `text-muted-foreground`, Accordion, Button
   and friends all resolve dark inside it and nowhere else.
   ========================================================================== */
.immersive {
  /* Deep navy rather than pure black: it is the same family as the --navy
     marketing band the rest of the site already uses, and it reads as
     considered rather than stark. */
  --background: 222 24% 7%;
  --foreground: 210 20% 98%;
  --surface: 222 22% 9%;
  --card: 222 20% 11%;
  --card-foreground: 210 20% 98%;
  --popover: 222 20% 11%;
  --popover-foreground: 210 20% 98%;

  /* Brand green, lifted just enough to clear contrast on the dark ground
     without tipping into the neon register. */
  --primary: 129 38% 50%;
  --primary-foreground: 222 24% 7%;
  --primary-hover: 129 40% 57%;
  --primary-soft: 129 26% 14%;

  --secondary: 222 18% 15%;
  --secondary-foreground: 210 20% 98%;
  --muted: 222 18% 14%;
  --muted-foreground: 215 16% 66%;
  --accent: 222 18% 15%;
  --accent-foreground: 210 20% 98%;

  --border: 0 0% 100%;
  --border-strong: 0 0% 100%;
  --input: 220 10% 14%;
  --ring: 129 42% 54%;

  /* Hairlines are the dominant structural device here, so they are expressed
     as an alpha on white rather than a solid grey — they must read on both
     the page ground and the slightly lifted card ground. */
  --hairline: rgb(255 255 255 / 0.09);
  --hairline-strong: rgb(255 255 255 / 0.18);

  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  --font-mono-stack: var(--font-mono, "JetBrains Mono"), ui-monospace, monospace;
}

/* --- Light variant ---------------------------------------------------------
   Opt-in via the HUD toggle (persisted per visitor). Same structure, same
   brand green as the rest of the site's light surfaces; hairlines flip from
   alpha-on-white to alpha-on-ink. */
.immersive.immersive--light {
  --background: 210 20% 98%;
  --foreground: 222 28% 10%;
  --surface: 210 40% 96%;
  --card: 0 0% 100%;
  --card-foreground: 222 28% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 28% 10%;

  --primary: 129 36% 40%; /* #428B4D — the site's light-surface brand green */
  --primary-foreground: 0 0% 100%;
  --primary-hover: 129 39% 34%;
  --primary-soft: 129 33% 93%;

  --secondary: 210 40% 96%;
  --secondary-foreground: 222 28% 10%;
  --muted: 210 40% 94%;
  --muted-foreground: 215 16% 40%;
  --accent: 129 33% 93%;
  --accent-foreground: 129 39% 28%;

  --border: 222 25% 12%;
  --border-strong: 222 25% 12%;
  --input: 214 32% 88%;
  --ring: 129 36% 40%;

  --hairline: rgb(15 30 22 / 0.12);
  --hairline-strong: rgb(15 30 22 / 0.28);
}

/* The sections author their hairlines and hover washes as alpha-on-white
   utilities, which vanish on a light ground. Inside the light scope those
   exact utilities resolve to the ink-based equivalents instead. */
.immersive--light .border-white\/10,
.immersive--light .border-white\/12,
.immersive--light .border-white\/15,
.immersive--light .border-white\/\[0\.07\] {
  border-color: var(--hairline);
}

.immersive--light .hover\:border-white\/30:hover,
.immersive--light .hover\:border-white\/35:hover {
  border-color: var(--hairline-strong);
}

.immersive--light .bg-white\/\[0\.04\] {
  background-color: rgb(15 30 22 / 0.05);
}

.immersive--light .hover\:bg-white\/\[0\.03\]:hover {
  background-color: rgb(15 30 22 / 0.04);
}

.immersive--light .hover\:bg-white\/\[0\.06\]:hover {
  background-color: rgb(15 30 22 / 0.06);
}

.immersive--light .bg-white\/25 {
  background-color: rgb(15 30 22 / 0.25);
}

/* The global `#pricing` / `#data-security-compliance` rules force the old
   marketing pages' dark bands. On the light landing those sections follow the
   light tokens like every other section instead. */
.immersive--light #pricing,
.immersive--light #data-security-compliance {
  background-color: transparent;
  color: hsl(var(--foreground));
}

.immersive--light #pricing h1,
.immersive--light #pricing h2,
.immersive--light #pricing h3,
.immersive--light #pricing h4,
.immersive--light #pricing h5,
.immersive--light #pricing h6,
.immersive--light #data-security-compliance h1,
.immersive--light #data-security-compliance h2,
.immersive--light #data-security-compliance h3,
.immersive--light #data-security-compliance h4,
.immersive--light #data-security-compliance h5,
.immersive--light #data-security-compliance h6 {
  color: hsl(var(--foreground));
}

.immersive--light #data-security-compliance .bg-surface {
  background-color: hsl(var(--surface));
}

/* Tailwind's `border-border` resolves to hsl(var(--border)) at full alpha,
   which would be solid white here. Inside the scope it becomes a hairline. */
.immersive .border-border,
.immersive .divide-border > * + * {
  border-color: var(--hairline);
}

.immersive ::selection {
  background: hsl(var(--primary) / 0.3);
  color: hsl(var(--foreground));
}

/* --- Type ---------------------------------------------------------------- */

.immersive-label {
  font-family: var(--font-mono-stack);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.immersive-label-accent {
  color: hsl(var(--primary));
}

/* The one display scale, used by every section heading. Clamped so the very
   large hero setting never overflows a narrow viewport. */
.immersive-display {
  font-family: var(--font-display, "Space Grotesk"), system-ui, sans-serif;
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 6vw, 5.5rem);
}

.immersive-heading {
  font-family: var(--font-display, "Space Grotesk"), system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-size: clamp(1.625rem, 3.2vw, 2.75rem);
}

.immersive-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: hsl(var(--foreground) / 0.86);
}

.immersive-container {
  width: 100%;
  max-width: 88rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

@media (min-width: 1024px) {
  .immersive-container {
    padding-inline: 3rem;
  }
}

/* --- Structure ------------------------------------------------------------ */

.immersive-rule {
  border-top: 1px solid var(--hairline);
}

/* Section shells carry a hairline top edge and the corner "+" markers that
   punctuate the whole page. */
.immersive-section {
  position: relative;
  border-top: 1px solid var(--hairline);
}

/* --- Surfaces ------------------------------------------------------------- */

.immersive-card {
  background-color: hsl(var(--card));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  transition:
    border-color 0.3s var(--ease-out-soft),
    background-color 0.3s var(--ease-out-soft),
    box-shadow 0.3s var(--ease-out-soft),
    transform 0.3s var(--ease-out-soft);
}

/* Hover lifts the card without thinning it. The previous rule dropped the
   surface to 75% alpha, which let the fixed ambient canvas bleed through the
   copy on the one card the reader is actually looking at. Depth now comes
   from the edge and the shadow, which costs no legibility. */
.immersive-card:hover {
  border-color: hsl(var(--primary) / 0.35);
  background-color: hsl(var(--card));
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px hsl(var(--foreground) / 0.04),
    0 18px 40px -20px hsl(var(--foreground) / 0.18);
}

/* Icon chip used at the head of every card. */
.immersive-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
}

/* Section header block: eyebrow row, then heading, then optional lede. */
.immersive-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--hairline);
}

/* --- Reveal primitives ---------------------------------------------------- */

/* Split lines animate inside a clipping mask so glyph descenders are hidden
   until they arrive, rather than sliding over the rule above them. */
.immersive-line-mask {
  overflow: hidden;
  display: block;
}

/* Elements handed to a scroll reveal start hidden. GSAP clears this the moment
   its ScrollTrigger fires; the no-JS / reduced-motion fallback below makes sure
   nothing is stranded invisible. */
.immersive [data-reveal] {
  opacity: 0;
}

.immersive [data-reveal-ready] [data-reveal] {
  opacity: 1;
}

/* --- Motion opt-out ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .immersive [data-reveal],
  .immersive [data-reveal-text] {
    opacity: 1 !important;
    transform: none !important;
  }

  .immersive-marquee__track {
    animation: none !important;
  }
}

/* --- Footer watermark ------------------------------------------------------ */

/* The wordmark carries a slow sheen: a slightly brighter band sweeping
   through otherwise-faint letterforms. Painted via background-clip so the
   text itself stays a watermark; under reduced motion the global opt-out
   freezes it as a static faint gradient. */
.immersive-watermark {
  background-image: linear-gradient(
    100deg,
    hsl(var(--foreground) / 0.05) 42%,
    hsl(var(--foreground) / 0.14) 50%,
    hsl(var(--foreground) / 0.05) 58%
  );
  background-size: 250% 100%;
  background-position: 200% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: watermark-sheen 9s linear infinite;
}

@keyframes watermark-sheen {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -150% 0;
  }
}

/* --- Marquee -------------------------------------------------------------- */

.immersive-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.immersive-marquee__track {
  display: flex;
  width: max-content;
  animation: immersive-marquee 38s linear infinite;
}

.immersive-marquee:hover .immersive-marquee__track {
  animation-play-state: paused;
}

@keyframes immersive-marquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    /* The track renders its content twice; -50% lands exactly on the seam. */
    transform: translate3d(-50%, 0, 0);
  }
}

/* --- Autofill ------------------------------------------------------------- */

/* Chrome and Safari paint autofilled fields with their own pale blue and force
   their own text colour, and both land with UA precedence that an ordinary
   `background-color` cannot beat — which is why an autofilled email sat in a
   blue box on the contact form.
   Clipping the background to the glyphs is what actually removes it: the fill
   still paints, but only behind the text, where the matching text-fill-colour
   covers it. The older `box-shadow: inset 0 0 0 1000px <surface>` trick needs
   the rule to know what colour sits underneath; this does not, so one rule
   holds across both themes and over cards, panels and the bare page alike. */
.immersive input:-webkit-autofill,
.immersive input:-webkit-autofill:hover,
.immersive input:-webkit-autofill:focus,
.immersive input:-webkit-autofill:active,
.immersive textarea:-webkit-autofill,
.immersive select:-webkit-autofill,
.immersive input:autofill,
.immersive textarea:autofill,
.immersive select:autofill {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: hsl(var(--foreground));
  caret-color: hsl(var(--foreground));
  /* Belt and braces. Chrome applies its fill through a transition, so a
     transition it will never finish keeps the colour from ever arriving on
     builds where background-clip alone is not enough. Only ever in force while
     the field is autofilled, and these inputs have no background of their own
     to animate. */
  transition: background-color 600000s 0s;
}

/* --- Product tour --------------------------------------------------------- */

/* The window chrome shows a real route, so it keeps a route's casing —
   .immersive-label would otherwise uppercase it into a headline. This rule
   follows .immersive-label in the file, which is what lets it win. */
.immersive-tour-route {
  text-transform: none;
  letter-spacing: 0.08em;
}

/* Depth for the tour's window frame.
   Three stacked shadows rather than one large blur: a contact shadow that
   keeps the border crisp, a mid shadow for the lift, and a wide, very soft
   cast for the ground. One big blur reads as a smudge behind the frame; this
   reads as an object resting on the page. The inset hairline is the light
   catching the top edge of the bezel. */
.immersive-tour-frame {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.06),
    0 1px 2px rgb(0 0 0 / 0.3),
    0 12px 28px -12px rgb(0 0 0 / 0.55),
    0 44px 80px -40px rgb(0 0 0 / 0.75);
}

/* On the light ground the same three layers, tinted with the page's ink and
   pulled right down — a near-black cast that looked considered on the dark
   scheme looks like dirt on this one. */
.immersive--light .immersive-tour-frame {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    0 1px 2px rgb(15 30 22 / 0.06),
    0 12px 28px -14px rgb(15 30 22 / 0.16),
    0 44px 80px -44px rgb(15 30 22 / 0.28);
}

/* The stage is a percentage-padding ratio box so the frame can resize to each
   screen's own proportions; percentage padding is interpolable in every engine,
   which `aspect-ratio` is not reliably. Duration comes from the component so
   the resize and the cross-fade stay in step. */
.immersive-tour-stage {
  transition-property: padding-top;
  transition-timing-function: var(--ease-out-soft);
}

/* The rail's spine segment beside the active step, filling top-down over that
   step's hold. Keyed off the running state in React, so it re-mounts and
   restarts rather than animating continuously. */
.immersive-tour-spine {
  transform: scaleY(0);
  animation: immersive-tour-spine linear forwards;
}

@keyframes immersive-tour-spine {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* Nothing here should move for a visitor who asked for less motion: the frame
   snaps to each screen's shape and the spine simply stands lit. */
@media (prefers-reduced-motion: reduce) {
  .immersive-tour-stage {
    transition: none;
  }

  .immersive-tour-spine {
    animation: none;
    transform: scaleY(1);
  }
}

/* --- Ambient scene -------------------------------------------------------- */

.immersive-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* This fixed layer is the page ground, not just the canvas host. The
     .immersive wrapper's own background only covers the first viewport:
     ScrollSmoother fixes the content wrapper, so the wrapper contributes no
     height and past one screen of scroll the layout's light bg-background
     showed through — white headings on a near-white ground. */
  background-color: hsl(var(--background));
}

/* The field is drawn low in the viewport, but the outer threads still drift
   upward. This mask is the hard guarantee: the canvas simply cannot paint
   into the top half of the screen, which is where the eye is actually
   reading. Fades back out at the very bottom so the band has no cut edge. */
.immersive-scene canvas {
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    transparent 46%,
    rgba(0, 0, 0, 0.5) 60%,
    rgba(0, 0, 0, 1) 72%,
    rgba(0, 0, 0, 1) 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    transparent 46%,
    rgba(0, 0, 0, 0.5) 60%,
    rgba(0, 0, 0, 1) 72%,
    rgba(0, 0, 0, 1) 92%,
    transparent 100%
  );
}

/* Vignette that sinks the scene into the page ground at the edges. */
.immersive-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 50% 45%, transparent 0%, hsl(var(--background) / 0.2) 75%, hsl(var(--background) / 0.85) 100%),
    linear-gradient(180deg, hsl(var(--background) / 0.2) 0%, transparent 32%, transparent 74%, hsl(var(--background) / 0.9) 100%);
}
