/* Mistral-inspired landing — bento grid, pixel field, snap-scroll panels */

:root {
  --ldg-bg: #f4f3f0;
  --ldg-text: #0f0f0f;
  --ldg-muted: rgba(0, 0, 0, 0.55);
  --ldg-grid: rgba(0, 0, 0, 0.12);
  --ldg-surface: #fff;
  --ldg-orange: #ff6a00;
  --ldg-header-h: 52px;
  --ldg-aside-w: min(460px, 37vw);
  --ldg-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Landing is light-mode only — tokens above apply in all color schemes */
html.ldg-mistral {
  color-scheme: light;
}

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

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

body.ldg-mistral {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font, 'Inter', system-ui, sans-serif);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ldg-text);
  background: var(--ldg-bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------------------
   Header — full-width bar with grid border
--------------------------------------------------------------------------- */

body.ldg-mistral > header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--ldg-header-h);
  margin: 0;
  /* Match the hero title's left inset so the wordmark lines up with the headline */
  padding: 0 max(clamp(20px, 2vw, 32px), env(safe-area-inset-right, 0px)) 0
    max(clamp(20px, 2vw, 32px), env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--ldg-grid);
  background: color-mix(in srgb, var(--ldg-bg) 92%, transparent);
  backdrop-filter: blur(10px);
  justify-content: center;
}

body.ldg-mistral > header .logo-block {
  flex: 1;
  max-width: none;
  width: 100%;
  margin: 0;
  justify-content: flex-start;
  gap: 0;
}

body.ldg-mistral > header .logo-block-lockup-row {
  margin-right: clamp(8px, 1.5vw, 16px);
}

.ldg-header-nav {
  display: none;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  min-width: 0;
}

.ldg-header-nav li {
  display: flex;
  align-items: center;
}

.ldg-header-nav li + li {
  border-left: 1px solid var(--ldg-grid);
}

.ldg-header-nav a {
  display: block;
  padding: 0 clamp(10px, 1.4vw, 18px);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ldg-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.ldg-header-nav a:hover {
  opacity: 0.65;
}

@media (min-width: 900px) {
  .ldg-header-nav {
    display: flex;
  }
}

.ldg-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.ldg-learn-more {
  position: relative;
  display: none;
}

.ldg-learn-more summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ldg-text);
  padding: 6px 0;
}

.ldg-learn-more summary::-webkit-details-marker {
  display: none;
}

.ldg-learn-more summary::after {
  content: ' ⌄';
  font-size: 0.75rem;
  opacity: 0.6;
}

.ldg-learn-more ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  border: 1px solid var(--ldg-grid);
  border-radius: 8px;
  background: var(--ldg-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.ldg-learn-more:not([open]) ul {
  display: none;
}

.ldg-learn-more a {
  display: block;
  padding: 8px 14px;
  font-size: 0.8125rem;
  color: var(--ldg-text);
  text-decoration: none;
}

.ldg-learn-more a:hover {
  background: color-mix(in srgb, var(--ldg-text) 6%, transparent);
}

@media (min-width: 900px) {
  .ldg-learn-more {
    display: block;
  }
}

.ldg-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 34px;
  padding: 6px 16px;
  border-radius: 2px;
  border: none;
  background: var(--ldg-text);
  color: var(--ldg-bg);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.ldg-header-cta:hover {
  opacity: 0.88;
}

.ldg-header-cta .cta-arrow {
  transition: transform 0.15s ease;
}

.ldg-header-cta:hover .cta-arrow {
  transform: translateX(2px);
}

/* Header menu icon — mobile only; desktop uses text CTA */
.ldg-header-cta--menu {
  display: none;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: var(--ldg-text);
}

.ldg-header-cta--menu:hover {
  opacity: 0.65;
}

.ldg-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 18px;
  height: 18px;
}

.ldg-menu-grid-dot {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: #000;
}

/* ---------------------------------------------------------------------------
   Snap-scroll root
--------------------------------------------------------------------------- */

.ldg-scroll {
  /* Normal document scroll — the hero flows straight into the footer. No inner
     viewport scroller and no sticky slide-over stage; overflow-x only guards
     against sideways drift. */
  overflow-x: hidden;
}

.ldg-panel {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--ldg-grid);
  background: var(--ldg-bg);
}

.ldg-panel-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: var(--ldg-header-h);
}

/* Panel enter transition */
html.ldg-js .ldg-panel:not(.is-active) [data-panel-content] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s var(--ldg-ease),
    transform 0.85s var(--ldg-ease);
  transition-delay: calc(var(--panel-i, 0) * 0.02s);
}

html.ldg-js .ldg-panel.is-active [data-panel-content] {
  opacity: 1;
  transform: none;
}

html:not(.ldg-js) .ldg-panel [data-panel-content] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.ldg-js .ldg-panel [data-panel-content] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------------------
   Hero panel — Mistral bento split
--------------------------------------------------------------------------- */

.ldg-hero-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100dvh - var(--ldg-header-h));
}

@media (min-width: 900px) {
  .ldg-hero-layout {
    grid-template-columns: minmax(0, 1fr) var(--ldg-aside-w);
  }
}

.ldg-hero-main {
  /* Same 40/60 row split as the aside so the title|video divider lines up
     exactly with the aside's lede|featured divider. */
  display: grid;
  grid-template-rows: minmax(0, 2fr) minmax(0, 3fr);
  border-bottom: 1px solid var(--ldg-grid);
}

@media (min-width: 900px) {
  .ldg-hero-main {
    border-bottom: none;
    border-right: 1px solid var(--ldg-grid);
  }
}

.ldg-hero-title-wrap {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(2rem, 5vw, 3.5rem) max(var(--ppx-page-inset, 20px), env(safe-area-inset-right, 0px))
    clamp(1.75rem, 3vw, 2.5rem) max(clamp(20px, 2vw, 32px), env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--ldg-grid);
  /* Dark fallback so the white headline stays legible before/if the background
     video paints. */
  background: #0c0c0c;
}

/* Desktop hero title video — fills the top-left box behind the headline. */
.ldg-title-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

/* Bottom scrim keeps the white headline readable across all video frames. */
.ldg-hero-title-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6),
    rgba(0, 0, 0, 0.18) 46%,
    rgba(0, 0, 0, 0) 76%
  );
  pointer-events: none;
}

.ldg-hero-title {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--font-wordmark, 'DM Sans', sans-serif);
  font-size: clamp(2.75rem, 5.8vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.ldg-type-line {
  display: block;
  min-height: 1em;
}

.ldg-hero-title-char {
  display: inline-block;
  white-space: pre;
  will-change: transform, filter, opacity;
}

/* Pop-in reveal — lines stay hidden until JS splits them into per-char spans,
   then each glyph flips in with blur + overshoot on a staggered delay. */
html.ldg-js .ldg-type-line {
  visibility: hidden;
}

html.ldg-js .ldg-type-line.is-split {
  visibility: visible;
}

html.ldg-js .ldg-hero-title-char {
  opacity: 0;
}

html.ldg-js .ldg-hero-title-char.is-in {
  animation: ldg-pop-in 540ms cubic-bezier(0.2, 0.8, 0.2, 1.4) both;
}

@keyframes ldg-pop-in {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(0.4em) scale(0.9);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ldg-js .ldg-type-line {
    visibility: visible;
  }

  html.ldg-js .ldg-hero-title-char {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }
}

/* Mobile: show headline immediately — no per-char pop-in stagger. */
@media (max-width: 899px) {
  html.ldg-js .ldg-type-line {
    visibility: visible;
  }

  html.ldg-js .ldg-hero-title-char {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }
}

.ldg-pixel-wrap {
  position: relative;
  overflow: hidden;
  background: var(--ldg-orange);
}

.ldg-hero-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ldg-pixel-tag {
  position: absolute;
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: clamp(0.5625rem, 1.2vw, 0.6875rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.ldg-pixel-tag--tr {
  top: 14px;
  right: 16px;
  left: auto;
}

.ldg-pixel-tag--tl {
  top: 14px;
  left: 16px;
}

/* Balaji backing badge — Nigel-style dark status bar over the orange video */
.ldg-backed {
  position: absolute;
  left: clamp(12px, 2vw, 20px);
  bottom: clamp(12px, 2vw, 20px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(320px, calc(100% - 24px));
  padding: 8px 12px;
  background: #0f0f0f;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-family: var(--font, 'Inter', system-ui, sans-serif);
  line-height: 1.3;
  pointer-events: auto;
  transition:
    color 0.18s ease,
    background-color 0.18s ease;
}

.ldg-backed:hover {
  color: rgba(255, 255, 255, 0.92);
  background: #1c1c1c;
}

.ldg-backed:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.ldg-backed-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1.5px);
  grid-auto-rows: 1.5px;
  gap: 1.5px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.85);
}

.ldg-backed-matrix i {
  background: currentColor;
  border-radius: 999px;
  opacity: 0.25;
  animation: ldg-backed-wave 2.4s ease-in-out infinite;
  animation-delay: calc(var(--backed-d, 0) * 0.22s);
}

@keyframes ldg-backed-wave {
  0%, 70%, 100% { opacity: 0.25; }
  28% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ldg-backed-matrix i {
    animation: none;
    opacity: 0.5;
  }
}

.ldg-backed-text {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.ldg-backed-line {
  display: block;
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ldg-backed-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.52);
}

.ldg-backed:hover .ldg-backed-icon {
  color: rgba(255, 255, 255, 0.72);
}

/* Right aside — two stacked grid cells: lede over featured card */
.ldg-hero-aside {
  display: grid;
  grid-template-rows: minmax(0, 2fr) minmax(0, 3fr);
  min-height: calc(100dvh - var(--ldg-header-h));
  padding: 0;
}

.ldg-aside-lede {
  display: flex;
  align-items: flex-end;
  padding: clamp(1.75rem, 4vw, 2.5rem) max(clamp(1.25rem, 2.6vw, 2.75rem), env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--ldg-grid);
  background: color-mix(in srgb, var(--ldg-bg) 82%, var(--ldg-text) 4%);
}

.ldg-hero-lede {
  margin: 0;
  font-family: var(--font-wordmark);
  font-size: clamp(1.0625rem, 1.6vw, 1.375rem);
  font-weight: 500;
  line-height: 1.38;
  color: var(--ldg-text);
  letter-spacing: -0.02em;
  max-width: 26ch;
}

/* Hero CTA — mobile only; header copy stays on desktop */
.ldg-hero-cta {
  display: none;
}

.ldg-featured {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2rem) max(clamp(1.25rem, 2.6vw, 2.75rem), env(safe-area-inset-right, 0px));
  min-height: 0;
}

.ldg-featured-kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ldg-muted);
}

.ldg-featured-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border: 1px solid var(--ldg-grid);
  background: var(--ldg-surface);
  transition:
    border-color 0.18s var(--ldg-ease),
    transform 0.18s var(--ldg-ease),
    box-shadow 0.18s var(--ldg-ease);
}

.ldg-featured-card:hover {
  border-color: color-mix(in srgb, var(--ldg-text) 26%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

@media (prefers-reduced-motion: reduce) {
  .ldg-featured-card {
    transition: border-color 0.18s var(--ldg-ease);
  }

  .ldg-featured-card:hover {
    transform: none;
    box-shadow: none;
  }
}

.ldg-featured-label {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ldg-muted);
}

.ldg-featured-track {
  position: relative;
  min-height: 72px;
  padding: 12px 14px;
}

.ldg-featured-slide {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.ldg-featured-slide[hidden] {
  display: none !important;
}

.ldg-featured-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 1px solid var(--ldg-grid);
  border-radius: 0;
  overflow: hidden;
  background: var(--ldg-bg);
}

.ldg-featured-slide-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ldg-featured-slide-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.71875rem;
  line-height: 1.45;
  color: var(--ldg-muted);
}

.ldg-featured-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ldg-featured-slide-title {
  font-family: var(--font-wordmark);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.ldg-featured-slide-cta {
  font-size: 0.8125rem;
  font-weight: 600;
}

.ldg-featured-nav {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--ldg-grid);
}

.ldg-featured-nav button {
  flex: 1;
  width: 36px;
  min-height: 36px;
  border: none;
  border-bottom: 1px solid var(--ldg-grid);
  border-radius: 0;
  background: var(--ldg-surface);
  color: var(--ldg-text);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.ldg-featured-nav button:last-child {
  border-bottom: none;
}

.ldg-featured-nav button:hover {
  border-color: color-mix(in srgb, var(--ldg-text) 30%, transparent);
  background: color-mix(in srgb, var(--ldg-text) 5%, var(--ldg-surface));
}

.ldg-featured-nav button:active {
  background: color-mix(in srgb, var(--ldg-text) 9%, var(--ldg-surface));
}

/* ---------------------------------------------------------------------------
   Footer — shared .site-footer, scrolls in below the hero (light-mode only)
--------------------------------------------------------------------------- */

body.ldg-mistral .site-footer {
  /* Pin shared footer tokens to the landing's light palette so an OS dark
     scheme never darkens this light-only page. */
  --bg: var(--ldg-bg);
  --text: var(--ldg-text);
  --border: var(--ldg-grid);
  --footer-rule: var(--ldg-grid);
  --footer-muted: rgba(0, 0, 0, 0.48);
  --footer-muted-hover: rgba(0, 0, 0, 0.78);
  position: relative;
  z-index: 1;
  margin: 0;
  background: var(--ldg-bg);
  border-top: 1px solid var(--ldg-grid);
  /* Left inset matches the hero title + header so the wordmark lines up */
  padding: clamp(2rem, 4vw, 3rem) max(clamp(20px, 2vw, 32px), env(safe-area-inset-right, 0px))
    clamp(2rem, 4vw, 3rem) max(clamp(20px, 2vw, 32px), env(safe-area-inset-left, 0px));
}

body.ldg-mistral .site-footer .footer-brand.site-wordmark {
  font-family: var(--font-wordmark, 'DM Sans', system-ui, sans-serif);
}

/* ---------------------------------------------------------------------------
   Responsive — mobile fullscreen video hero; footer reflows
--------------------------------------------------------------------------- */

@media (max-width: 899px) {
  /* Full-viewport orange video with title + aside overlaid (Option A). */
  body.ldg-mistral > header {
    background: var(--ldg-bg);
    border-bottom-color: var(--ldg-grid);
    backdrop-filter: none;
  }

  .ldg-header-cta--desktop {
    display: none;
  }

  .ldg-header-cta--menu {
    display: inline-flex;
  }

  .ldg-panel-hero {
    min-height: 100dvh;
    overflow: hidden;
  }

  .ldg-panel-hero .ldg-panel-inner {
    padding-top: 0;
    min-height: 100dvh;
  }

  .ldg-hero-layout {
    display: grid;
    grid-template-rows: auto auto;
    grid-template-columns: 1fr;
    min-height: 100dvh;
    align-content: start;
    position: relative;
  }

  /* Flatten main + aside so title, lede, and video share one grid (title → lede → backdrop). */
  .ldg-hero-main,
  .ldg-hero-aside {
    display: contents;
  }

  .ldg-pixel-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    flex: none;
    min-height: 100dvh;
  }

  .ldg-hero-video {
    object-position: center center;
  }

  .ldg-hero-title-wrap {
    grid-row: 1;
    grid-column: 1;
    z-index: 2;
    align-self: start;
    min-height: auto;
    border-bottom: none;
    background: transparent;
    justify-content: center;
    text-align: center;
    padding: calc(var(--ldg-header-h) + clamp(14vh, 20vh, 24vh))
      max(var(--ppx-page-inset, 20px), env(safe-area-inset-right, 0px))
      clamp(0.5rem, 2vw, 0.75rem)
      max(var(--ppx-page-inset, 20px), env(safe-area-inset-left, 0px));
  }

  /* Mobile has its own full-bleed hero video; the desktop title video and its
     scrim are not used here. */
  .ldg-title-video,
  .ldg-hero-title-wrap::after {
    display: none;
  }

  .ldg-hero-title {
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.42);
    width: 100%;
    text-align: center;
  }

  .ldg-aside-lede {
    grid-row: 2;
    grid-column: 1;
    z-index: 2;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 3vw, 1.25rem);
    justify-content: center;
    text-align: center;
    padding: 0
      max(var(--ppx-page-inset, 20px), env(safe-area-inset-right, 0px))
      clamp(1rem, 3vw, 1.5rem)
      max(var(--ppx-page-inset, 20px), env(safe-area-inset-left, 0px));
    border-bottom: none;
    background: transparent;
  }

  .ldg-hero-lede {
    color: rgba(255, 255, 255, 0.94);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.48);
    max-width: none;
    text-align: center;
  }

  .ldg-hero-cta {
    display: inline-flex;
  }

  .ldg-featured {
    display: none;
  }
}

@media (max-width: 640px) {
  .ldg-hero-title {
    font-size: clamp(2.25rem, 10vw, 2.75rem);
  }

  .ldg-backed {
    left: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 20px);
    gap: 8px;
    padding: 7px 10px;
  }

  .ldg-backed-line {
    font-size: 0.6875rem;
  }
}
