/* Version: 1.0.0 */
/* Public landing page (templates/index.html).
   Builds on the tokens in static/css/dashboard.css; no colors of its own beyond them.
   Type: Archivo Variable only. The display line uses the wide end of its width axis.
   Signature: the hero is an ice shelf (one sky light, a sharp glacier edge) with the bot's
   messages playing in, one example scene after another; the screen carousel breaks out over
   that edge. Everything below stays calm. */

/* The landing page manages its own widths and spacing instead of the shell's container. */
main > .lp-page { padding-block: 0; }

.lp-container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px) { .lp-container { padding-inline: 24px; } }
@media (min-width: 1024px) { .lp-container { padding-inline: 40px; } }

.lp {
  display: flex;
  flex-direction: column;
  gap: clamp(72px, 9vw, 120px);
  padding-bottom: clamp(48px, 6vw, 80px);
}

/* --------------------------------------------------------------------------
   Hero: the ice shelf
   -------------------------------------------------------------------------- */

.lp-hero {
  --lp-edge-depth: clamp(56px, 7vw, 104px);
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: calc(100svh - 61px);
  padding: clamp(40px, 6vw, 80px) 0 calc(var(--lp-edge-depth) + clamp(120px, 14vw, 200px));
  /* The 2px between this layer and the fill below is the lit edge of the shelf. */
  background: var(--kp-sky-line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--lp-edge-depth)), 89% calc(100% - 38px), 77% calc(100% - 82px), 63% calc(100% - 14px), 48% calc(100% - 66px), 32% calc(100% - 22px), 18% calc(100% - 74px), 0 calc(100% - 30px));
}

.lp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* The page's single light: polar light behind the bot scene. */
  background: radial-gradient(ellipse 55% 60% at 78% 38%, var(--kp-sky-tint-strong), transparent 72%), var(--kp-surface);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--lp-edge-depth) - 2px), 89% calc(100% - 40px), 77% calc(100% - 84px), 63% calc(100% - 16px), 48% calc(100% - 68px), 32% calc(100% - 24px), 18% calc(100% - 76px), 0 calc(100% - 32px));
}

.lp-hero-text { min-width: 0; }

.lp-hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}

.lp-display {
  margin: 0;
  color: var(--kp-text);
  /* Sized so "Every server" always fits one line of the text column. */
  font-size: clamp(2.5rem, 12.6vw - 0.4rem, 5.75rem);
  font-stretch: 125%;
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.lp-lead {
  margin: clamp(20px, 2.6vw, 32px) 0 0;
  max-width: 54ch;
  color: var(--kp-text-2);
  font-size: clamp(16px, 0.9rem + 0.35vw, 18.5px);
  line-height: 1.6;
}

.lp-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: clamp(24px, 3vw, 36px);
}

.lp-btn {
  min-height: 48px;
  padding: 0 22px;
  font-size: 15px;
}
.lp-hero-actions .lp-btn { width: 100%; }

.lp-proof {
  margin: 20px 0 0;
  color: var(--kp-text-2);
  font-size: 14.5px;
}
.lp-proof strong { color: var(--kp-text); font-weight: 680; font-variant-numeric: tabular-nums; }

.lp-note {
  margin: 8px 0 0;
  max-width: 48ch;
  color: var(--kp-text-3);
  font-size: 12.5px;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .lp-hero-actions { flex-direction: row; flex-wrap: wrap; }
  .lp-hero-actions .lp-btn { width: auto; }
}

@media (min-width: 1100px) {
  .lp-hero-grid { grid-template-columns: minmax(0, 1fr) 440px; gap: 56px; }
  .lp-display { font-size: clamp(3.75rem, 12.2vw - 4.4rem, 5.5rem); }
}

/* --------------------------------------------------------------------------
   Hero: the bot at work
   -------------------------------------------------------------------------- */

.lp-scene {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--kp-line-strong);
  border-radius: var(--kp-radius-section);
  background: var(--kp-well);
  box-shadow: var(--kp-shadow-overlay);
}

.lp-scene-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--kp-line);
  background: var(--kp-rail);
}
/* Room for the scene controls laid over the right end of the bar. */
.lp-scene[data-rotating="true"] .lp-scene-bar { padding-right: 128px; }
.lp-scene-server { flex: none; color: var(--kp-text); font-size: 14px; font-weight: 650; }
.lp-scene-labels { display: grid; min-width: 0; text-align: right; }
.lp-scene-day { grid-area: 1 / 1; color: var(--kp-text-3); font-size: 12px; }
.lp-scene-day[data-active="false"] { visibility: hidden; }

/* Pause control and scene dots, revealed by the script. */
.lp-scene-controls {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
}
.lp-scene-controls[hidden] { display: none; }
.lp-scene-dots { display: flex; align-items: center; }

.lp-toggle.lp-scene-toggle {
  position: static;
  width: 28px;
  height: 28px;
  font-size: 14px;
  box-shadow: none;
  opacity: 1;
}

.lp-scene-dot {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.lp-scene-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--kp-text-3);
  transition: background-color 0.15s;
}
.lp-scene-dot:hover::before { background: var(--kp-text-2); }
.lp-scene-dot[aria-current="true"]::before { background: var(--kp-sky); }
.lp-scene-dot:focus-visible { outline: none; box-shadow: var(--kp-focus-ring); }

/* All scenes share one grid cell: the tallest one reserves the height. */
.lp-scene-stage { display: grid; }
.lp-scene-stage > .lp-feed { grid-area: 1 / 1; min-width: 0; }
.lp-feed[data-active="false"] { visibility: hidden; }

.lp-feed {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 8px 0 14px;
  list-style: none;
}

.lp-msg {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px;
  padding: 6px 16px;
}
.lp-msg[data-header="true"] { margin-top: 10px; }
.lp-msg[data-header="false"] .lp-msg-body { grid-column: 2; }

.lp-msg-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--kp-sky-strong);
  color: var(--kp-on-sky);
  font-size: 13px;
  font-weight: 700;
}
.lp-msg-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

.lp-msg-body { min-width: 0; }
.lp-msg-head { display: flex; align-items: center; gap: 6px; margin: 0; }
.lp-msg-name { color: var(--kp-text); font-size: 14.5px; font-weight: 650; }
.lp-msg-bot {
  padding: 1px 5px;
  border-radius: var(--kp-radius-chip);
  background: var(--kp-sky-strong);
  color: var(--kp-on-sky);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
}
.lp-msg-meta { margin: 1px 0 0; color: var(--kp-text-3); font-size: 12px; }
.lp-msg-text { margin: 4px 0 0; color: var(--kp-text-2); font-size: 14px; line-height: 1.5; }

.lp-embed {
  margin-top: 6px;
  padding: 10px 12px 11px;
  border-left: 3px solid var(--kp-sky);
  border-radius: var(--kp-radius-chip);
  background: var(--kp-surface-2);
}
.lp-msg[data-tone="warning"] .lp-embed { border-left-color: var(--kp-amber); }
.lp-msg[data-tone="success"] .lp-embed { border-left-color: var(--kp-emerald); }
.lp-embed-author { margin: 0 0 3px; color: var(--kp-text); font-size: 13px; font-weight: 650; }
.lp-embed-title { margin: 0; color: var(--kp-text); font-size: 14px; font-weight: 650; }
.lp-embed-text { margin: 3px 0 0; color: var(--kp-text-2); font-size: 13.5px; line-height: 1.5; }
.lp-embed-footer { margin: 6px 0 0; color: var(--kp-text-3); font-size: 12px; }

/* Poll results as the bot writes them: a ten-step block bar, the share and the votes. */
.lp-bars { display: grid; gap: 3px; margin: 6px 0 0; padding: 0; list-style: none; }
.lp-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 10px;
  color: var(--kp-text-2);
  font-size: 13px;
  line-height: 1.45;
}
.lp-bar-label { min-width: 0; color: var(--kp-text); }
.lp-bar-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lp-bar-fill { color: var(--kp-sky); font-family: var(--kp-mono); font-size: 11px; letter-spacing: -0.04em; }

.lp-mention {
  padding: 0 3px;
  border-radius: var(--kp-radius-chip);
  background: var(--kp-sky-tint-strong);
  color: var(--kp-text);
  font-weight: 560;
  white-space: nowrap;
}

/* The page's one orchestrated moment: the messages of the shown scene arrive one after another;
   showing another scene plays its messages in again. */
.lp-feed[data-active="true"] .lp-msg { animation: lp-msg-in 0.55s var(--kp-ease) both; }
.lp-msg:nth-child(1) { animation-delay: 0.35s; }
.lp-msg:nth-child(2) { animation-delay: 1.05s; }
.lp-msg:nth-child(3) { animation-delay: 1.75s; }
.lp-msg:nth-child(4) { animation-delay: 2.45s; }

@keyframes lp-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 639px) {
  .lp-msg:nth-child(n + 4) { display: none; }
}

@media (min-width: 1100px) {
  .lp-scene { justify-self: end; }
}

/* --------------------------------------------------------------------------
   Screen carousel: breaks out over the edge of the shelf
   -------------------------------------------------------------------------- */

.lp-tour {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * clamp(120px, 14vw, 200px) - clamp(72px, 9vw, 120px));
}

.lp-carousel {
  --lp-interval: 7s;
  position: relative;
  display: grid;
}

.lp-stage {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--kp-line-strong);
  border-top-color: var(--kp-sky-line);
  border-radius: var(--kp-radius-section);
  background: var(--kp-well);
  box-shadow: var(--kp-shadow-overlay);
}

.lp-slide {
  grid-area: 1 / 1;
  min-width: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--kp-ease), visibility 0s linear 0.5s;
}
.lp-slide[data-active="true"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s var(--kp-ease), visibility 0s;
}

.lp-shot {
  display: block;
  width: 100%;
  height: auto;
  background: var(--kp-canvas);
}
/* Clicking the image pauses and resumes the slideshow once the script runs. */
.lp-carousel[data-lp-auto="true"] .lp-shot { cursor: pointer; }

.lp-caption {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--kp-line);
  color: var(--kp-text-2);
  font-size: 13.5px;
  line-height: 1.55;
}
.lp-caption strong { color: var(--kp-text); font-weight: 620; }

/* Covers exactly the image area of the stage (the script sets the image ratio). Only the
   chip and the dots take pointer events, so a click anywhere else reaches the image. */
.lp-controls {
  position: absolute;
  z-index: 1;
  inset: 1px 1px auto;
  aspect-ratio: var(--lp-ratio, 16 / 10);
  pointer-events: none;
}

.lp-tabs {
  position: absolute;
  left: 50%;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border: 1px solid var(--kp-line);
  border-radius: 999px;
  background: var(--kp-raised);
  box-shadow: var(--kp-shadow-raised);
  transform: translateX(-50%);
  pointer-events: auto;
}

/* A 24px hit area around a small dot; the selected dot stretches into a pill that fills up
   while the screen is shown. */
.lp-tab {
  position: relative;
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: width 0.25s var(--kp-ease);
}
.lp-tab::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--kp-text-3);
  transition: width 0.25s var(--kp-ease), background-color 0.15s;
}
.lp-tab:hover::before { background: var(--kp-text-2); }
.lp-tab:focus-visible { outline: none; box-shadow: var(--kp-focus-ring); }
.lp-tab[aria-selected="true"] { width: 36px; }
.lp-tab[aria-selected="true"]::before { width: 24px; background: var(--kp-text); }

.lp-tab-progress {
  position: absolute;
  top: 50%;
  left: 6px;
  width: 24px;
  height: 8px;
  margin-top: -4px;
  border-radius: 999px;
  background: var(--kp-sky);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
}
.lp-carousel[data-lp-auto="true"] .lp-tab[aria-selected="true"] .lp-tab-progress {
  opacity: 1;
  animation: lp-progress var(--lp-interval) linear forwards;
  animation-play-state: paused;
}
.lp-carousel[data-lp-running="true"] .lp-tab[aria-selected="true"] .lp-tab-progress { animation-play-state: running; }

@keyframes lp-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* First in the focus order (WAI-ARIA carousel pattern). Shown while paused, on keyboard
   focus and while the pointer is over the carousel; otherwise the image stays clean. */
.lp-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--kp-line);
  border-radius: 999px;
  background: var(--kp-raised);
  box-shadow: var(--kp-shadow-raised);
  color: var(--kp-text);
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.2s var(--kp-ease);
}
.lp-toggle[hidden] { display: none; }
.lp-carousel:hover .lp-toggle,
.lp-toggle[data-state="paused"],
.lp-toggle:focus-visible { opacity: 1; }
.lp-toggle:focus-visible { outline: none; box-shadow: var(--kp-focus-ring); }
.lp-toggle .lp-toggle-play { display: none; }
.lp-toggle[data-state="paused"] .lp-toggle-pause { display: none; }
.lp-toggle[data-state="paused"] .lp-toggle-play { display: inline-block; }
.lp-toggle .ds-icon { fill: none; }
.lp-toggle .lp-toggle-play { fill: currentColor; stroke: none; }

/* --------------------------------------------------------------------------
   Feature ledger
   -------------------------------------------------------------------------- */

.lp-heading {
  margin: 0;
  color: var(--kp-text);
  font-size: clamp(1.625rem, 1.1rem + 1.9vw, 2.5rem);
  font-stretch: 118%;
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lp-body {
  margin: 12px 0 0;
  max-width: 60ch;
  color: var(--kp-text-2);
  font-size: 15px;
  line-height: 1.65;
}

.lp-ledger { display: grid; gap: 24px; }

.lp-group {
  display: grid;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--kp-line);
}

.lp-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--kp-text);
  font-size: 17px;
  font-stretch: 108%;
  font-weight: 680;
  line-height: 1.3;
}
.lp-group-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--kp-sky-line);
  border-radius: var(--kp-radius-control);
  background: var(--kp-sky-tint);
  color: var(--kp-sky);
  font-size: 17px;
}

.lp-items {
  display: grid;
  gap: 10px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-item { min-width: 0; color: var(--kp-text-2); font-size: 13.5px; line-height: 1.5; }
.lp-item-title { display: block; color: var(--kp-text); font-size: 14px; font-weight: 620; }
.lp-item-text { display: block; }

@media (min-width: 640px) {
  .lp-item { font-size: 14px; line-height: 1.55; }
  .lp-item-title { font-size: 14.5px; }
  .lp-group { grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
  .lp-group-title { padding-top: 2px; }
}

@media (min-width: 1024px) {
  .lp-ledger { grid-template-columns: 320px minmax(0, 1fr); gap: 56px; }
  .lp-ledger-intro { position: sticky; top: 96px; align-self: start; }
  .lp-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Closing call to action
   -------------------------------------------------------------------------- */

.lp-closing {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 32px;
  border-top: 1px solid var(--kp-line-strong);
}

.lp-legal {
  max-width: 72ch;
  margin-top: 24px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--kp-text-3);
}

.lp-closing-actions { display: flex; flex-direction: column; gap: 10px; }
.lp-closing-actions .lp-btn { width: 100%; }

@media (min-width: 640px) {
  .lp-closing-actions { flex-direction: row; flex-wrap: wrap; }
  .lp-closing-actions .lp-btn { width: auto; }
}

@media (min-width: 1024px) {
  .lp-closing { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 48px; padding-top: 40px; }
  .lp-closing-actions { flex: none; }
}

/* --------------------------------------------------------------------------
   Motion and forced colors
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .lp-msg { animation: none; }
  .lp-feed[data-active="true"] .lp-msg { animation: none; }
  .lp-scene-dot::before { transition: none; }
  .lp-slide,
  .lp-slide[data-active="true"] { transition: none; }
  .lp-tab-progress { display: none; }
  .lp-tab,
  .lp-tab::before,
  .lp-toggle { transition: none; }
}

@media (forced-colors: active) {
  .lp-hero { clip-path: none; }
  .lp-tab::before,
  .lp-tab[aria-selected="true"]::before { background: CanvasText; }
  .lp-tab:focus-visible,
  .lp-toggle:focus-visible,
  .lp-scene-dot:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
  .lp-scene-dot::before { background: CanvasText; }
  .lp-scene-dot[aria-current="true"]::before { background: Highlight; }
  .lp-tab-progress { background: Highlight; }
  .lp-embed { border: 1px solid CanvasText; }
}
