/* ===========================================================================
   LocalLuna — marketing site

   Everything visual (cards, tags, buttons, tables, stepper, tabs, dialog,
   typography) comes from modest-ui. This file does two jobs only:

     1. Retheme modest-ui's tokens to Luna's palette (see frontend/theme.css,
        which is the source of truth for the product's colours).
     2. Page layout, the blueprint backdrop, and the illustrated UI mocks —
        none of which modest-ui covers by design.

   If you find yourself restyling a component here, check the library first.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1. Theme — Luna's palette, mapped onto modest-ui's tokens
   --------------------------------------------------------------------------- */

:root {
  /* Luna's palette, copied from frontend/theme.css */
  --luna-bg: #0f0f0f;
  --luna-surface: #1a1a1a;
  --luna-surface-raised: #252525;
  --luna-border: #333;
  --luna-text: #e5e5e5;
  --luna-text-secondary: #a0a0a0;
  --luna-text-muted: #666;
  --luna-primary: #3b82f6;
  --luna-primary-hover: #2563eb;
  --luna-success: #22c55e;
  --luna-warning: #f59e0b;
  --luna-error: #ef4444;

  /* modest-ui, rethemed */
  --mdst-color-bg: var(--luna-bg);
  --mdst-color-fg: var(--luna-text);
  --mdst-color-border: var(--luna-border);
  --mdst-color-muted: var(--luna-text-secondary);
  --mdst-color-subtle: var(--luna-surface);
  --mdst-color-surface: var(--luna-surface);
  --mdst-color-focus: var(--luna-primary);
  --mdst-color-success: var(--luna-success);
  --mdst-color-warning: var(--luna-warning);
  --mdst-color-error: var(--luna-error);

  /* Buttons hover to Luna blue rather than inverting to white */
  --mdst-button-hover-bg: var(--luna-primary);
  --mdst-button-hover-color: #fff;
  --mdst-button-hover-border: var(--luna-primary);

  /* The app uses soft corners, so the site does too */
  --mdst-radius: 0.375rem;

  --mdst-font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
  --mdst-line-height: 1.6;

  /* Site-only rhythm */
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-y: clamp(3.25rem, 6vw, 5.5rem);
  --measure: 46rem;
}

/* modest-ui cards/toasts/dialogs default to --mdst-color-bg. On a dark page
   they want to sit slightly above it. */
.mdst-card,
.mdst-toast,
.mdst-pre {
  background: var(--luna-surface);
}

/* Raised, so a nested pre still reads against it */
.mdst-dialog {
  background: var(--luna-surface-raised);
}

/* modest-ui's reset zeroes every margin, so prose rhythm is ours to set. */
.mdst-p,
.mdst-ul,
.mdst-ol {
  margin-block-end: var(--mdst-space-4);
}

.mdst-p--sm {
  margin-block-end: var(--mdst-space-3);
}

.mdst-p:last-child,
.mdst-ul:last-child,
.mdst-ol:last-child {
  margin-block-end: 0;
}

/* Accent the active tab and stepper step in Luna blue */
.mdst-tabs .mdst-tab[data-state="active"] {
  border-bottom-color: var(--luna-primary);
  border-radius: 0;
}

/* The library sizes the indicator with width/height but no flex-shrink. In the
   vertical layout the step is a flex row, so a step whose label wraps squeezes
   its own circle a pixel narrower and drags the label out of line with the rest.
   Worth fixing upstream. */
.mdst-stepper .mdst-stepper-indicator {
  flex: none;
}

.mdst-stepper .mdst-stepper-step[data-state="active"] .mdst-stepper-indicator {
  border-color: var(--luna-primary);
  color: var(--luna-primary);
}

.mdst-avatar {
  background-color: var(--luna-primary);
}

/* ---------------------------------------------------------------------------
   2. Base + backdrop
   --------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body.mdst-ui {
  background: var(--luna-bg);
  color: var(--luna-text);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Blueprint grid, straight from the app's canvas, faded out at the edges */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size:
    100px 100px,
    100px 100px,
    20px 20px,
    20px 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--luna-primary);
  color: #fff;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Grid items default to min-width:auto, so one wide child (a `white-space: pre`
   code block, say) can force its whole column wider than the viewport. Every
   grid on this page opts out. */
.hero__grid > *,
.cards > *,
.diagram > *,
.mem > *,
.mem__layers > *,
.split > *,
.proactive > *,
.start > *,
.channels .mdst-tabs-panel > * {
  min-width: 0;
}

/* The LUNA logotype, from frontend/theme.css */
.wordmark {
  font-family: var(--mdst-font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4rem;
  color: var(--luna-text);
}

.wordmark--sm {
  font-size: 0.8125rem;
  letter-spacing: 0.28rem;
}

.eyebrow {
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--luna-primary);
  margin: 0 0 var(--mdst-space-4);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  flex: none;
}

.eyebrow--sm {
  margin-bottom: var(--mdst-space-3);
}

/* ---------------------------------------------------------------------------
   3. Nav
   --------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--luna-bg) 82%, transparent);
  border-bottom: 1px solid var(--luna-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--mdst-space-6);
  min-height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  margin-right: auto;
}

/* The mark. Stroke-based and single colour, so it just inherits a colour. */
.brand__mark {
  width: 1.625rem;
  height: 1.625rem;
  color: var(--luna-primary);
  flex: none;
  overflow: visible;
}

.nav__links {
  display: none;
  gap: var(--mdst-space-5);
}

.nav__links a {
  color: var(--luna-text-secondary);
  text-decoration: none;
  font-size: var(--mdst-text-sm);
}

.nav__links a:hover {
  color: var(--luna-text);
}

.nav__links a.is-current {
  color: var(--luna-text);
}

.nav__links a.is-current::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 0.25rem;
  background: var(--luna-primary);
}

.nav__cta {
  flex: none;
}

@media (min-width: 62rem) {
  .nav__links {
    display: flex;
  }
}

/* ---------------------------------------------------------------------------
   4. Sections
   --------------------------------------------------------------------------- */

.section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--luna-border);
}

.section--alt {
  background: color-mix(in srgb, var(--luna-surface) 45%, transparent);
}

.section__title {
  font-size: clamp(1.75rem, 3.6vw, 2.625rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: var(--measure);
  margin: 0 0 var(--mdst-space-5);
  text-wrap: balance;
}

.section__lede {
  max-width: var(--measure);
  color: var(--luna-text-secondary);
  margin-bottom: var(--mdst-space-8);
}

/* ---------------------------------------------------------------------------
   5. Hero
   --------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 7vw, 6rem) var(--section-y);
}

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

@media (min-width: 62rem) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero__title {
  font-size: clamp(2.25rem, 5.6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 var(--mdst-space-6);
  text-wrap: balance;
}

.hero__title em {
  font-style: normal;
  color: var(--luna-primary);
}

.hero__copy > .mdst-p--lg {
  max-width: 34rem;
  color: var(--luna-text-secondary);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mdst-space-3);
  margin-block: var(--mdst-space-8);
}

/* Facts strip */
.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--mdst-space-6);
  margin: clamp(3rem, 6vw, 5rem) 0 0;
  padding: var(--mdst-space-6) 0 0;
  border-top: 1px solid var(--luna-border);
}

.facts li {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.facts strong {
  font-family: var(--mdst-font-mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--luna-primary);
  letter-spacing: -0.02em;
}

.facts span {
  font-size: var(--mdst-text-sm);
  line-height: 1.4;
}

@media (min-width: 48rem) {
  .facts {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------------------------
   6. Terminal + card header layout helpers
   --------------------------------------------------------------------------- */

.term__bar,
.mock__bar {
  display: flex;
  align-items: center;
  gap: var(--mdst-space-3);
  padding-block: var(--mdst-space-2) !important;
  background: var(--luna-surface-raised);
  border-top-left-radius: var(--mdst-radius);
  border-top-right-radius: var(--mdst-radius);
}

.term__dots {
  display: flex;
  gap: 0.375rem;
  flex: none;
}

.term__dots i {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--luna-border);
}

.term .mdst-card-body {
  padding: 0 !important;
}

.term pre {
  margin: 0;
  font-size: var(--mdst-text-sm);
  line-height: 1.85;
  padding: var(--mdst-space-5);
  background: transparent;
}

.tok {
  color: var(--luna-primary);
}

/* On a phone, wrapping the commands beats making people scroll sideways
   through them. The lines are short; only the trailing comments are long. */
@media (max-width: 48rem) {
  /* Needs to out-specify .mdst-pre.mdst-pre--scroll */
  .term pre.mdst-pre--scroll {
    white-space: pre-wrap;
    overflow-x: visible;
  }
}

/* Card headers that hold a title plus a tag or number */
.mdst-card-header:has(h3) {
  display: flex;
  align-items: center;
  gap: var(--mdst-space-3);
}

.mdst-card-header h3 {
  margin: 0;
  font-size: var(--mdst-text-lg);
  letter-spacing: -0.01em;
}

.mdst-card-header:has(h3) .mdst-tag {
  margin-left: auto;
  flex: none;
}

.num {
  font-size: var(--mdst-text-xs);
  letter-spacing: 0.1em;
}

.mdst-card-body > .mdst-p:last-child,
.mdst-card-body > p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   7. Card grids
   --------------------------------------------------------------------------- */

.cards {
  display: grid;
  gap: var(--mdst-space-5);
}

.cards article {
  display: flex;
  flex-direction: column;
}

@media (min-width: 40rem) {
  .cards--2,
  .cards--3,
  .cards--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .cards--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------------------------
   8. Chat mocks — bubbles, chips, confirmation
   --------------------------------------------------------------------------- */

.mock {
  overflow: hidden;
}

.mock__status {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}

.mock__body {
  display: flex;
  flex-direction: column;
  gap: var(--mdst-space-4);
  padding: var(--mdst-space-5) !important;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(59, 130, 246, 0.05), transparent 70%), var(--luna-bg);
}

.mock__gap {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--luna-border);
  border-bottom: 1px solid var(--luna-border);
  background: var(--luna-bg);
  font-weight: 400 !important;
  padding-block: var(--mdst-space-2) !important;
}

.bubble {
  margin: 0;
  padding: var(--mdst-space-3) var(--mdst-space-4);
  border-radius: 1rem;
  font-size: var(--mdst-text-sm);
  line-height: 1.55;
  max-width: 88%;
}

.bubble--you {
  align-self: flex-end;
  background: var(--luna-primary);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.bubble--luna {
  align-self: flex-start;
  background: var(--luna-surface-raised);
  border: 1px solid var(--luna-border);
  border-bottom-left-radius: 0.25rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
}

/* Content sits directly in this card rather than a .mdst-card-body, so the
   padding and rhythm are ours to set. */
.confirm {
  border-color: var(--luna-warning);
  background: color-mix(in srgb, var(--luna-warning) 8%, var(--luna-surface));
  padding: var(--mdst-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--mdst-space-3);
}

.confirm p {
  margin: 0;
}

.confirm__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--luna-warning);
  font-weight: 600;
}

.confirm__body {
  line-height: 1.7;
}

.confirm__actions {
  display: flex;
  gap: var(--mdst-space-3);
  margin: var(--mdst-space-1) 0 0 !important;
}

/* Static, non-interactive buttons inside the mocks */
.mock .mdst-button {
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   9. Diagram
   --------------------------------------------------------------------------- */

.diagram {
  display: grid;
  gap: var(--mdst-space-4);
  align-items: start;
}

.diagram__col {
  min-width: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--mdst-space-2);
  margin: 0;
}

.node {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: var(--mdst-space-3) var(--mdst-space-4);
  font-size: var(--mdst-text-sm);
  font-weight: 500;
}

/* A tint rather than an edge stripe: a 2px border on one side of a rounded box
   tapers into the corner and reads as a mistake. */
.node--accent {
  border-color: color-mix(in srgb, var(--luna-primary) 24%, transparent);
  background: color-mix(in srgb, var(--luna-primary) 5%, var(--luna-surface));
}

/* Connectors: a horizontal dashed run on wide screens, vertical when stacked */
.diagram__flow {
  position: relative;
  min-height: 1.5rem;
}

.diagram__flow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 1px dashed color-mix(in srgb, var(--luna-primary) 55%, transparent);
}

.diagram__flow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1px solid var(--luna-primary);
  border-bottom: 1px solid var(--luna-primary);
  transform: translate(-50%, 50%) rotate(45deg);
}

.diagram__col--core .mdst-stepper {
  padding: var(--mdst-space-4);
  border: 1px solid var(--luna-border);
  border-radius: var(--mdst-radius);
  background: var(--luna-surface);
}

.note + .note {
  margin-top: var(--mdst-space-3);
}

.note {
  margin: var(--mdst-space-4) 0 0;
  padding: var(--mdst-space-4);
  border: 1px solid color-mix(in srgb, var(--luna-primary) 32%, transparent);
  background: color-mix(in srgb, var(--luna-primary) 7%, transparent);
  color: var(--luna-text-secondary);
  border-radius: var(--mdst-radius);
}

.loop {
  margin-top: var(--mdst-space-6);
  border-color: color-mix(in srgb, var(--luna-primary) 32%, transparent);
  background: color-mix(in srgb, var(--luna-primary) 6%, var(--luna-surface));
}

.loop .mdst-p {
  margin: 0;
  color: var(--luna-text-secondary);
}

.loop strong {
  color: var(--luna-text);
}

@media (min-width: 64rem) {
  .diagram {
    grid-template-columns: 1fr auto 1.15fr auto 1fr;
    gap: var(--mdst-space-3);
  }

  .diagram__flow {
    align-self: center;
    width: 2.5rem;
    min-height: 0;
    height: 1px;
  }

  .diagram__flow::before {
    left: 0;
    right: 0;
    top: 50%;
    bottom: auto;
    border-left: none;
    border-top: 1px dashed color-mix(in srgb, var(--luna-primary) 55%, transparent);
  }

  .diagram__flow::after {
    left: auto;
    right: 0;
    bottom: 50%;
    transform: translate(50%, 50%) rotate(-45deg);
  }
}

/* ---------------------------------------------------------------------------
   10. Memory
   --------------------------------------------------------------------------- */

.mem {
  display: grid;
  gap: var(--mdst-space-6);
  align-items: start;
}

.mem__layers {
  display: grid;
  gap: var(--mdst-space-5);
}

.mem__layers .mdst-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mdst-space-3);
}

.mem__layers .mdst-card-header .mdst-tag {
  margin-left: 0;
}

@media (min-width: 64rem) {
  .mem {
    grid-template-columns: 1fr 1fr;
    gap: var(--mdst-space-8);
  }
}

.pull {
  margin: clamp(3rem, 5vw, 4rem) 0 0;
  border-left: 2px solid var(--luna-primary);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.5;
  max-width: var(--measure);
  color: var(--luna-text);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   11. Channels (tabs)
   --------------------------------------------------------------------------- */

.channels .mdst-tabs-list {
  margin-bottom: var(--mdst-space-6);
}

/* The library sets .mdst-tabs .mdst-tabs-panel[data-state="active"] to
   display:block, so this needs matching specificity to win on source order. */
.channels .mdst-tabs-panel[data-state="active"] {
  display: grid;
  gap: var(--mdst-space-6);
  align-items: center;
}

.channel h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  letter-spacing: -0.015em;
  margin: 0 0 var(--mdst-space-4);
}

.channel__copy .mdst-p {
  max-width: 34rem;
}

.channel__copy .mdst-p:last-child {
  margin-bottom: 0;
}

@media (min-width: 56rem) {
  .channels .mdst-tabs-panel[data-state="active"] {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
  }
}

/* Shared frame for the illustrated channel art */
.art {
  position: relative;
  border: 1px solid var(--luna-border);
  border-radius: var(--mdst-radius);
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(59, 130, 246, 0.07), transparent 70%), var(--luna-surface);
  padding: var(--mdst-space-6);
  min-height: 17rem;
  display: flex;
  flex-direction: column;
  gap: var(--mdst-space-4);
  overflow: hidden;
}

.art-caption {
  margin: var(--mdst-space-4) 0 0;
  text-align: center;
}

/* Web */
.art__bar {
  display: flex;
  gap: 0.375rem;
  padding-bottom: var(--mdst-space-3);
  border-bottom: 1px solid var(--luna-border);
  margin-bottom: var(--mdst-space-2);
}

.art__bar i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--luna-border);
}

.bubble--mini {
  font-size: var(--mdst-text-xs);
  padding: 0.375rem 0.625rem;
  border-radius: 0.75rem;
}

/* An artefact window, the thing it builds for you */
.artefact {
  margin-top: auto;
  border: 1px solid var(--luna-primary);
  border-radius: var(--mdst-radius);
  background: color-mix(in srgb, var(--luna-primary) 7%, var(--luna-bg));
  overflow: hidden;
}

.artefact__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  border-bottom: 1px solid color-mix(in srgb, var(--luna-primary) 55%, transparent);
  background: color-mix(in srgb, var(--luna-primary) 14%, transparent);
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
  color: var(--luna-text-secondary);
}

.artefact__bar .term__dots i {
  width: 0.4rem;
  height: 0.4rem;
  background: color-mix(in srgb, var(--luna-primary) 70%, transparent);
}

.ttt {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: 6.5rem;
  margin: 0.75rem auto;
  background: color-mix(in srgb, var(--luna-primary) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--luna-primary) 40%, transparent);
}

.ttt i {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--luna-bg);
  /* Sans rather than mono: a monospace capital O reads as a zero */
  font-size: var(--mdst-text-sm);
  font-style: normal;
  font-weight: 600;
  color: var(--luna-text);
}

.ttt__next {
  color: var(--luna-primary) !important;
}

/* Voice */
.art--voice {
  align-items: center;
  justify-content: center;
}

.wave {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 5rem;
}

.wave i {
  width: 0.3rem;
  border-radius: 0.2rem;
  background: var(--luna-primary);
  animation: pulse 1.15s ease-in-out infinite;
  height: 22%;
}

.wave i:nth-child(2n) {
  animation-delay: 0.14s;
  background: color-mix(in srgb, var(--luna-primary) 70%, var(--luna-text));
}
.wave i:nth-child(3n) {
  animation-delay: 0.28s;
}
.wave i:nth-child(4n) {
  animation-delay: 0.42s;
}
.wave i:nth-child(5n) {
  animation-delay: 0.56s;
}

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

@media (prefers-reduced-motion: reduce) {
  .wave i {
    animation: none;
    height: 60%;
  }
}

/* Telegram */
.art--phone {
  max-width: 17rem;
  margin-inline: auto;
  border-radius: 1.5rem;
  border-width: 2px;
  padding: var(--mdst-space-5) var(--mdst-space-3) var(--mdst-space-4);
}

.art__notch {
  width: 3rem;
  height: 0.25rem;
  border-radius: 1rem;
  background: var(--luna-border);
  align-self: center;
  margin-bottom: var(--mdst-space-3);
}

.tg {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.875rem;
  font-size: var(--mdst-text-xs);
  line-height: 1.45;
  max-width: 85%;
}

.tg--in {
  align-self: flex-end;
  background: var(--luna-primary);
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

.tg--out {
  align-self: flex-start;
  background: var(--luna-surface-raised);
  border: 1px solid var(--luna-border);
  border-bottom-left-radius: 0.2rem;
}

/* Slack */
.sl-row {
  margin: 0;
  padding: 0.375rem 0.625rem;
  border-radius: var(--mdst-radius);
  font-size: var(--mdst-text-sm);
  color: var(--luna-text-secondary);
}

.sl-row--on {
  background: var(--luna-primary);
  color: #fff;
}

.sl-row--on .mdst-muted {
  color: rgba(255, 255, 255, 0.7);
}

/* Content sits directly in this card, so its padding is ours to set */
.sl-msg {
  margin-top: auto;
  background: var(--luna-bg);
  padding: var(--mdst-space-3) var(--mdst-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--mdst-space-1);
}

.sl-msg p {
  margin: 0;
}

/* Editor */
.art--editor {
  justify-content: center;
}

.art--editor pre {
  margin: 0;
  background: transparent;
  line-height: 1.8;
}

/* Robot */
.art--robot {
  align-items: center;
  justify-content: center;
}

.robot {
  width: 100%;
  max-width: 13rem;
}

.robot__head {
  fill: #1a2436;
  stroke: var(--luna-border);
  stroke-width: 2;
}

.robot__socket {
  fill: #0d1420;
  stroke: var(--luna-border);
  stroke-width: 2;
}

.robot__ring {
  fill: none;
  stroke: #00e5ff;
  stroke-width: 2.5;
  animation: glow 3s ease-in-out infinite;
}

.robot__pupil {
  fill: #cfefff;
}

.robot__bulb {
  fill: #00e5ff;
  animation: glow 2s ease-in-out infinite;
}

.robot__mouth {
  fill: none;
  stroke: #00e5ff;
  stroke-width: 3;
  stroke-linecap: round;
}

@keyframes glow {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .robot__ring,
  .robot__bulb {
    animation: none;
  }
}

/* Image generation: two abstract tiles standing in for what it made, rather
   than fake photographs it didn't. */
.art--images {
  justify-content: center;
}

.frames {
  display: block;
}

.frame {
  aspect-ratio: 3 / 2;
  width: 100%;
  border: 1px solid var(--luna-border);
  border-radius: var(--mdst-radius);
  display: block;
  position: relative;
  overflow: hidden;
}

/* Dusk sky with a hard horizon, then sea. Bright enough to read as a picture
   at this size, which the first attempt at this was not. */
.frame--a {
  background: linear-gradient(to bottom, #2f3f6b 0%, #6d6a9c 30%, #c98a63 48%, #f2b877 55%, #33405f 56%, #1d2740 100%);
}

.frame--b {
  background: linear-gradient(to bottom, #4a2f4d 0%, #8d5a68 30%, #d9776a 48%, #f6a98c 55%, #3a2b3d 56%, #201824 100%);
}

/* A real generated image can be dropped in as <img class="frame"> and the
   painted-on lighthouse below gets out of its way. */
img.frame {
  height: auto;
  aspect-ratio: auto;
}

/* The tower */
i.frame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 43%;
  width: 3.4%;
  height: 36%;
  transform: translateX(-50%);
  background: linear-gradient(to right, #b8aa94, #f8f2e6 40%, #a89a86);
  clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%);
}

/* Its lamp, lit */
i.frame::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 79%;
  width: 12%;
  aspect-ratio: 1;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 250, 230, 0.98) 0 16%,
    rgba(255, 226, 156, 0.6) 30%,
    rgba(255, 210, 130, 0.18) 56%,
    transparent 74%
  );
  z-index: 1;
}

/* ---------------------------------------------------------------------------
   12. Identity
   --------------------------------------------------------------------------- */

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

@media (min-width: 64rem) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.split__copy .mdst-p {
  max-width: 34rem;
}

.aside {
  margin-top: var(--mdst-space-6);
  border-color: color-mix(in srgb, var(--luna-primary) 32%, transparent);
  background: color-mix(in srgb, var(--luna-primary) 6%, var(--luna-surface));
}

.aside p {
  margin: 0;
}

.email__head {
  display: flex;
  align-items: center;
  gap: var(--mdst-space-3);
  padding: var(--mdst-space-4) var(--mdst-space-5) !important;
}

.email__head span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

/* The card is --flush, which zeroes body padding. The letter wants room. */
.email > .mdst-card-body {
  padding: var(--mdst-space-5) !important;
}

.email > .mdst-card-body .mdst-p {
  margin-block-end: var(--mdst-space-4);
  line-height: 1.7;
}

.email__meta {
  margin-bottom: var(--mdst-space-5);
}

.email__meta th {
  width: 4.5rem;
  color: var(--luna-text-secondary);
  font-weight: 400;
  font-size: var(--mdst-text-sm);
}

.email__meta td {
  font-size: var(--mdst-text-sm);
}

.email > .mdst-card-footer {
  padding: var(--mdst-space-4) var(--mdst-space-5) !important;
}

.email .mdst-mark {
  background: color-mix(in srgb, var(--luna-primary) 30%, transparent);
  color: var(--luna-text);
  padding: 0.1em 0.3em;
  border-radius: 0.2rem;
}

/* ---------------------------------------------------------------------------
   13. Proactive
   --------------------------------------------------------------------------- */

.proactive {
  display: grid;
  gap: var(--mdst-space-6);
  align-items: start;
}

@media (min-width: 64rem) {
  .proactive {
    grid-template-columns: 1fr 1fr;
    gap: var(--mdst-space-8);
  }
}

.asks {
  display: flex;
  flex-direction: column;
  gap: var(--mdst-space-3);
  margin: 0;
}

/* These are already bordered cards; the stripe was doing nothing. */
.ask {
  padding: var(--mdst-space-4) var(--mdst-space-5);
  font-size: var(--mdst-text-sm);
  color: var(--luna-text);
}

.toastdemo {
  margin-top: var(--mdst-space-5);
}

/* The library flags a toast's variant with a 3px left border. On a rounded
   toast that has the same tapering problem, so this one carries a status dot
   instead and drops the variant. */
.toastdemo .mdst-toast {
  display: block;
}

.toastdemo .mdst-toast strong {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.ticks {
  margin: 0;
  padding-left: 1.1rem;
}

.ticks li {
  font-size: var(--mdst-text-sm);
  color: var(--luna-text-secondary);
  margin-bottom: var(--mdst-space-2);
}

.ticks li::marker {
  color: var(--luna-primary);
}

.ticks li:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   14. Tools
   --------------------------------------------------------------------------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem var(--mdst-space-3);
  margin: 0 0 var(--mdst-space-6);
  padding-bottom: var(--mdst-space-5);
  border-bottom: 1px solid var(--luna-border);
}

/* ---------------------------------------------------------------------------
   15. Under the hood
   --------------------------------------------------------------------------- */

.hood {
  max-width: 56rem;
}

.hood .mdst-details summary {
  font-size: var(--mdst-text-lg);
  letter-spacing: -0.01em;
}

.hood .mdst-details .mdst-p {
  color: var(--luna-text-secondary);
  max-width: var(--measure);
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   16. Get started
   --------------------------------------------------------------------------- */

.start {
  display: grid;
  gap: var(--mdst-space-6);
  align-items: start;
}

@media (min-width: 64rem) {
  .start {
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--mdst-space-8);
  }
}

.access__actions {
  margin-block: var(--mdst-space-5) 0 !important;
}

/* A label/value list rather than tabular data. The library's default rules a
   strong line under each th and a near-invisible one under each td, which reads
   as stray dashes under the labels; this gives one divider per row instead.
   --stack isn't used because it only reflows td, not the th labels. */
.reqs th,
.reqs td {
  padding-block: var(--mdst-space-4);
  border-bottom: 1px solid var(--luna-border);
  vertical-align: top;
  line-height: 1.5rem;
}

.reqs th {
  width: 7rem;
  padding-right: var(--mdst-space-5);
  white-space: nowrap;
  color: var(--luna-text-secondary);
  font-weight: 500;
}

.reqs td {
  font-size: var(--mdst-text-sm);
}

.reqs tr:first-child th,
.reqs tr:first-child td {
  padding-top: 0;
}

.reqs tr:last-child th,
.reqs tr:last-child td {
  padding-bottom: 0;
  border-bottom: none;
}

/* Label above value once there's no room for two columns */
@media (max-width: 34rem) {
  .reqs tr {
    display: block;
    padding-block: var(--mdst-space-4);
    border-bottom: 1px solid var(--luna-border);
  }

  .reqs th,
  .reqs td {
    display: block;
    width: auto;
    padding: 0;
    border-bottom: none;
    white-space: normal;
  }

  .reqs th {
    padding-bottom: var(--mdst-space-1);
  }

  .reqs tr:first-child {
    padding-top: 0;
  }

  .reqs tr:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }
}

/* ---------------------------------------------------------------------------
   17. Closing + footer
   --------------------------------------------------------------------------- */

.closing {
  padding-block: var(--section-y);
  border-top: 1px solid var(--luna-border);
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(59, 130, 246, 0.09), transparent 70%), transparent;
  text-align: center;
}

.closing .eyebrow {
  justify-content: center;
}

.closing__line {
  font-size: clamp(1.375rem, 3.2vw, 2.125rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
  max-width: 42rem;
  margin: 0 auto var(--mdst-space-8);
  text-wrap: balance;
}

.footer {
  border-top: 1px solid var(--luna-border);
  padding-block: var(--mdst-space-8);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mdst-space-6);
  justify-content: space-between;
  align-items: flex-start;
}

.footer__inner p {
  margin: var(--mdst-space-2) 0 0;
}

.footer__brand {
  max-width: 30rem;
}

.footer__links {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 0.5rem var(--mdst-space-6);
}

.footer__links a {
  color: var(--luna-text-secondary);
  text-decoration: none;
  font-size: var(--mdst-text-sm);
}

.footer__links a:hover {
  color: var(--luna-text);
}

@media (min-width: 48rem) {
  .footer__links {
    grid-template-columns: repeat(3, auto);
  }
}

/* ---------------------------------------------------------------------------
   18. Misc
   --------------------------------------------------------------------------- */

/* Links dressed as buttons shouldn't carry the link underline */
a.mdst-button {
  text-decoration: none;
}

/* There is no scroll-reveal animation here, and that's intentional: it would
   make the page's content depend on IntersectionObserver having fired, which
   leaves it invisible to anything that doesn't scroll (screenshots, print, some
   readers). */
