/*
 * Cascade chrome — navbar + footer restyle.
 * Loaded after the clone's stylesheets so these win without editing the
 * 100KB minified bundle. Everything else on the page is untouched.
 */

/* ------------------------------------------------------------------ navbar */

/* Full-bleed: the clone caps the header at the 1500px layout container. */
#site-header {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  background-color: rgb(20 20 20 / 78%);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

#site-header-content {
  height: 5.75rem;
  align-items: center;
  padding-left: var(--margin-m);
  padding-right: var(--margin-m);
  border-bottom: none;
}

@media (min-width: 900px) {
  #site-header-content {
    padding-left: 2.25rem;
    padding-right: 2.25rem;
  }
}

/* The clone pins this to --site-header-height (4.5rem), overflowing the bar. */
#site-header-content .header-logo {
  height: 100%;
  width: auto;
  align-items: center;
}

.header-logo a {
  padding-left: 0;
  align-items: center;
}

.heading-logo img {
  height: 3.7rem;
}

/* Links: mono, uppercase, tight enough to read as a set rather than stretched. */
#site-menu ul {
  align-items: center;
  gap: 0.15rem;
}

#site-menu .main-nav-link {
  font-family: var(--font-code);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hex-fg-4);
  padding-left: 0.7rem;
  padding-right: 0.7rem;
  transition: color 0.15s ease-out;
}

#site-menu .main-nav-link:hover,
#site-menu .main-nav-link.is-active {
  color: var(--hex-fg-1);
}

/*
 * Underline lives on the text span, not the link box. The link is height:100%
 * of the bar, so a box-anchored ::after drifted into the middle of the text
 * once the bar grew. A background-size sweep on the span stays glued to the
 * glyphs at any bar height.
 */
#site-menu li:not(.nav-cta-item) .main-nav-link > span {
  background-image: linear-gradient(var(--hex-red-1), var(--hex-red-1));
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0% 1px;
  padding-bottom: 0.25em;
  transition: background-size 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-menu li:not(.nav-cta-item) .main-nav-link:hover > span,
#site-menu li:not(.nav-cta-item) .main-nav-link.is-active > span {
  background-size: 100% 1px;
}

/* The icons the clone ships are module glyphs — not wanted in this style. */
#site-menu .main-nav-link .icon {
  display: none;
}

/* Compact lime CTA, sized to sit inside the bar rather than dominate it. */
.nav-cta-item {
  margin-left: 0.9rem;
}

#site-menu .main-nav-link.nav-cta {
  height: 2rem;
  border-radius: 0.25rem;
  background-color: var(--hex-red-1);
  color: var(--hex-bg-1);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  transition: background-color 0.15s ease-out;
}

#site-menu .main-nav-link.nav-cta:hover {
  background-color: #c9ff3d;
  color: var(--hex-bg-1);
}

/* Mobile pane: the clone turns #site-menu into a slide-in sheet under 1200px. */
@media (max-width: 1199px) {
  #site-menu ul {
    align-items: flex-start;
    gap: 0;
  }

  .nav-cta-item {
    margin-left: 0;
    padding-top: var(--margin-s);
  }

  #site-menu .main-nav-link.nav-cta {
    display: inline-flex;
    height: 2.75rem;
  }

  #site-menu li:not(.nav-cta-item) .main-nav-link > span {
    background-image: none;
    padding-bottom: 0;
  }

  #site-menu .main-nav-link {
    font-size: var(--text-s);
    letter-spacing: 0.08em;
  }
}

/* ------------------------------------------------------------------ footer */

/*
 * Full-bleed. `.layout-container` caps every block on the page at 1500px,
 * which left wide screens with dead gutters either side of the footer while
 * the React marketing footer (Container) already runs edge to edge. The
 * footer is the one block that opts out; the wordmark is sized in cqw off
 * this element, so it scales up with the extra width on its own.
 */
#site-footer {
  max-width: none;
  /*
   * No inline padding: the top rule on #site-footer-content has to run the
   * full width, the way the React footer's `border-t` does. The gutter lives
   * on #site-footer-content instead, which carries both the rule and the
   * gutter exactly as the React footer's `border-t ... min-[900px]:px-6` does.
   */
  padding-inline: 0;
  padding-bottom: 0;
}

/*
 * Mirrors the React footer's outer box: the rule and the gutter sit on the
 * same element, so the rule runs the full width while the content is inset.
 */
#site-footer-content {
  border-top: 1px solid rgb(255 255 255 / 10%);
  padding-top: 0;
  padding-inline: 0;
}

@media (min-width: 900px) {
  #site-footer-content {
    padding-inline: 1.5rem;
  }
}

/* --- top: brand block + link columns ------------------------------------ */

.foot-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-top: 2.5rem;
  padding-bottom: 0;
  padding-inline: 1.25rem;
}

@media (min-width: 760px) {
  .foot-top {
    grid-template-columns: 1.1fr 2fr;
  }
}

.foot-mark {
  display: inline-flex;
  margin-bottom: var(--margin-s);
}

.foot-mark img {
  height: 3.4rem;
  width: auto;
}

.foot-pitch {
  max-width: 26ch;
  /* Matches the React footer's `mt-2` on the status line below. */
  margin-bottom: 0.5rem;
  color: var(--hex-fg-3);
  font-size: var(--text-s);
  line-height: 1.45;
}

/* Live-status line — the lime dot is the only "signal" colour up here. */
.foot-status {
  display: flex;
  align-items: center;
  gap: 0.5em;
  /* Matches the React footer's `mt-6` on the social row below. */
  margin-bottom: 1.5rem;
  color: var(--hex-fg-4);
  font-family: var(--font-code);
  font-size: var(--text-xxs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.foot-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background-color: var(--hex-red-1);
  box-shadow: 0 0 0 0 rgb(179 254 1 / 55%);
  animation: foot-pulse 2.4s ease-out infinite;
}

@keyframes foot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(179 254 1 / 55%);
  }
  70% {
    box-shadow: 0 0 0 0.4rem rgb(179 254 1 / 0%);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(179 254 1 / 0%);
  }
}

.foot-social {
  display: flex;
  gap: var(--margin-xxs);
  list-style: none;
  padding-left: 0;
}

.foot-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--br-s);
  color: var(--hex-fg-4);
  transition:
    color 0.15s ease-out,
    border-color 0.15s ease-out,
    background-color 0.15s ease-out;
}

.foot-social a svg {
  width: 1rem;
  height: 1rem;
}

.foot-social a:hover {
  color: var(--hex-bg-1);
  background-color: var(--hex-red-1);
  border-color: var(--hex-red-1);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--margin-m);
}

@media (min-width: 620px) {
  .foot-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.foot-cols .footer-block {
  width: auto;
}

/* Stronger heading than the clone's faint default. */
.foot-cols .links-list-heading {
  justify-content: flex-start;
  width: auto;
  margin-bottom: 0.75rem;
  padding: 0 0 0.75rem 0;
  color: var(--hex-fg-2);
  font-family: var(--font-code);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Plain text rows — the clone's default is a filled button. */
.foot-cols .links-list li a {
  height: auto;
  width: auto;
  justify-content: flex-start;
  gap: 0.3em;
  margin-bottom: 0;
  padding: 0.34rem 0;
  border-radius: 0;
  background-color: transparent;
  color: var(--hex-fg-3);
  font-weight: 400;
  font-size: var(--text-xs);
  white-space: normal;
}

.foot-cols .links-list li a:hover {
  background-color: transparent;
  color: var(--hex-red-1);
}

.foot-cols .links-list li a .icon {
  opacity: 0;
  transform: translateX(-0.15rem);
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out;
}

.foot-cols .links-list li a:hover .icon {
  opacity: 1;
  transform: translateX(0);
}

/* --- wordmark ------------------------------------------------------------ */

/*
 * Two elements, as in the React footer: the box owns the gutter and is the
 * size container, the text inside is sized in cqw off that box's content
 * width — so the mark spans edge to edge at any viewport without breakpoints.
 * Filled with a lime-to-nothing gradient so it reads as brand, not flat grey.
 */
.footer-wordmark {
  margin-top: 0;
  container-type: inline-size;
  padding-top: 3.5rem;
  padding-left: 0.5rem;
  padding-bottom: 0;
}

.footer-wordmark-text {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.1cqw;
  line-height: 0.82;
  letter-spacing: -0.035em;
  text-align: left;
  white-space: nowrap;
  user-select: none;
  background-image: linear-gradient(
    180deg,
    rgb(179 254 1 / 92%) 0%,
    rgb(179 254 1 / 55%) 48%,
    rgb(255 255 255 / 30%) 82%,
    rgb(255 255 255 / 14%) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/*
 * Cascade lens layer — sits with the clone's other .grid-canvas screens inside
 * the 3D device. The bundle only transforms elements carrying .grid-canvas, so
 * this one keeps its own placement and is never scaled away by the chapter
 * system (the clone's own .heart-canvas is pinned at scale 0.001 on this page).
 */
#engine .output .cascade-lens-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The clone's easings layers (the spiked form and the diagonal dot curve) sit
   on top of the mark and compete with it — the lens shows the mark alone. */
#engine .output .easings-lines-canvas,
#engine .output .easings-dots-canvas {
  opacity: 0;
}

/* The clone's heart bitmap layer — off-brand for Cascade. */
#engine .output .heart-canvas {
  opacity: 0;
}

/* While the Cascade mark owns the lens, stand down the clone's chapter demos. */
body.cascade-lens-on #engine .output .feature-demo,
body.cascade-lens-on #engine .output .feature-section-demo {
  opacity: 0 !important;
}

/* ------------------------------------------------------------------ fonts */

/*
 * The app's own type: Geist for text, Geist Mono for code/labels, Anton for
 * the closing wordmark. The clone shipped DINish (a width-axis variable font)
 * and Berkeley Mono; overriding the two --font-* tokens repoints every rule.
 */
@font-face {
  font-family: "Geist";
  src: url(../fonts/Geist-Variable.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url(../fonts/GeistMono-Variable.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Anton";
  src: url(../fonts/Anton-Regular.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-code: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-display: "Anton", ui-sans-serif, system-ui, sans-serif;
}

/* DINish-specific axes; Geist has none, so make that explicit. */
html,
body,
input,
button,
select,
i,
em {
  font-variation-settings: normal;
}

i,
em {
  font-style: italic;
}

/* Geist runs wider than DIN — same size that fits the React footer. */
/* Anton is condensed, so it needs a larger size than Geist did to span the width. */
.footer-wordmark-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17cqw;
  letter-spacing: 0.01em;
  line-height: 0.9;
}


/*
 * Display headings in Anton, uppercase — the app's `font-display` treatment
 * used on pricing, FAQ and how-it-works. Body copy stays Geist.
 */
#home .home-section-text h2,
#home .section-heading,
#home .box-heading h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 0.92;
}

/* Anton sits taller than Geist at the same size; give the hero a touch more room. */
#intro .home-section-text h2 {
  font-size: calc(var(--text-xxxxl) * 1.12);
}

/* ---------------------------------------------------------------- modules */

/*
 * The clone colours each module by its own accent ramp. Cascade's modules are
 * one product, so the chart, list dots and floating bubbles all take the
 * primary; alternating opacity keeps adjacent bar segments legible.
 */
.modules-sizes-chart .chart-bar {
  background-color: var(--hex-red-1);
}

.modules-sizes-chart .chart-bar:nth-child(even) {
  opacity: 0.55;
}

.modules-list .label-dot,
.module-label-text .label-dot {
  background-color: var(--hex-red-1);
}

/* Bubble text is a module name now, not a byte count. */
.module-label-text .size {
  font-family: var(--font-code);
  letter-spacing: 0.04em;
}

/* Byte counts and the summed total mean nothing here. */
.modules-list .size,
.modules-bundle-size {
  display: none;
}

/* Pipeline step kicker above each feature heading (01 · Basket … 08 · Ops). */
.flow-step {
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--font-code);
  font-size: var(--text-xxs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hex-current-1);
  opacity: 0.85;
}

/*
 * Page field, pinned. The clone's base sheet has body[data-template=home]
 * { background:#000 } and the bundle tweens body's inline colour per
 * chapter; loaded last with !important, this beats both, so the footer can
 * never sit as a lighter card on a black surround.
 */
html,
body,
body[data-template="home"],
.page {
  background-color: #141414 !important;
}

/*
 * Loading curtain (site-loader.js). The clone's own script only flips
 * .page from opacity:0 to .is-ready once its JS has run, which happens
 * well before fonts, the hero image and the Draco/GLTF device model are
 * actually in — without this, visitors stare at a bare #141414 field for
 * that gap. Sits above everything until those real loads (or an 8s cap)
 * resolve, then fades out and removes itself.
 */
.site-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background-color: #141414;
  transition: opacity 0.5s ease;
}

.site-loader-ring {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-loader-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.site-loader-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 2;
}

.site-loader-ring-arc {
  fill: none;
  stroke: url(#site-loader-ring-gradient);
  stroke-width: 2;
  stroke-linecap: round;
  /* r=28 -> circumference ~175.93; the visible arc is ~28% of the ring,
     the rest transparent via the gradient fading to stop-opacity:0. */
  stroke-dasharray: 176;
  transform-origin: 32px 32px;
  animation: site-loader-spin 1s linear infinite;
}

.site-loader-percent {
  font-family: var(--font-code, monospace);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #fff;
}

.site-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes site-loader-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .site-loader-ring-arc {
    animation-duration: 2.4s;
  }
}
