/* The landing furniture a content page can build: route cards and the
   module stack. */

/* The landing hero: the glowcap mark beside the wordmark and a one-line
   promise. It is the same drawing the header lockup carries, at hero size, so
   the front door and the chrome show one mushroom. */
.hero {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.2rem);
  margin: 0.5rem 0 2.25rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

/* A square box for the mark to stand in, because the mark's pieces are placed
   as percentages of it. The mark brings its own bloom from mark.css, so this
   adds no shadow of its own. */
.hero-mark {
  flex: none;
  /* The mark reaches past this box on every side, so the box is smaller than
     the drawing looks. Sized against the wordmark beside it rather than to
     fill the space it has. */
  width: clamp(76px, 13vw, 118px);
  height: clamp(76px, 13vw, 118px);
}

/* Both marks fill the box: the shader's canvas where a device drew one, the
   still artwork where it could not. The still mark carries no bloom of its
   own here. Its windows take the lit tone, so the first image is a mushroom
   that makes its own light even where the shader cannot run. */
.hero-mark .mark-live,
.hero-mark .icon-mark {
  width: 100%;
  height: 100%;
}

.hero-mark > .icon-mark .mark-windows {
  background: var(--mark-light);
}

.hero-copy {
  min-width: 0;
}

.hero-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 3.4rem;
  letter-spacing: 0;
}

/* The Rooms front door carries the app's own lockup at hero scale. The two
   sizes and the letterfit are the rail's `.wordmark` proportions (17 and 13
   with 4.8 between, in ui/mark.css) scaled to the hero title, so the mark
   beside it meets the same drawing it meets in the app's chrome. */
.hero-lockup {
  display: flex;
  align-items: baseline;
  gap: 0.28em;
  font-weight: 800;
  line-height: 1;
}

.hero-lockup small {
  font-weight: 600;
  font-size: 0.765em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.hero-tagline {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink-soft);
  /* Even the two lines out so a short word like "boundary." can't strand
     itself on a line of its own. */
  text-wrap: balance;
}

/* The README's closing line, carried through as a light, playful kicker, with a
   trailing twinkle to land the wink. */
.hero-kicker {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--accent-ink);
}

/* The two doors out of the hero. A reader arrives either ready to build or
   wanting to know why any of this matters, and those are different pages, so
   the front door names both instead of leaving the choice to a wall of cards
   further down. The filled one is the commitment; the other is the way out,
   the same two roles rooms uses, even though the markup stays an HTML class. */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-control);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease;
}

.btn:hover {
  text-decoration: none;
}

/* The filled amber is the whole statement; a shadow under a commitment was a
   second signal for one fact. */
.btn-primary {
  font-weight: 800;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-deep));
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: color-mix(in srgb, var(--teal) 7%, transparent);
  color: var(--teal-ink);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--teal) 16%, transparent);
}

/* The arrow rides along on hover. It is a small thing, but it makes the button
   feel like a door rather than a label. */
.btn .btn-arrow {
  flex: none;
  transition: transform 0.15s ease;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn .btn-arrow,
  .card {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }

  .btn:hover .btn-arrow {
    transform: none;
  }
}

@media (max-width: 38rem) {
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* The lockup is a flex row, so centered text does not center it. */
  .hero-lockup {
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }
}


/* ── Pizazz: cards and the module stack ──────────────────────────────────── */

/* Route cards: a responsive grid a content page builds with a fenced block of
   links. Authored in SuperMD as an HTML block. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

/* A card left on its own under a full row is the visual equivalent of a widow
   in a paragraph: the eye reads the gap beside it as something missing rather
   than as the end of the set. The two shapes below are the only ones a grid of
   these sizes produces, and each is fixed where the fix is honest.

   Four cards in three columns become two rows of two. The rule can only take
   columns away, so at a width where the grid had already dropped to two it
   changes nothing, and the media query only keeps it clear of the one-column
   stack. */
@media (min-width: 46rem) {
  .cards:has(> .card:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A full-width lead followed by three routes becomes a two-card row and one
   final route under the four-card rule above. Let that last route close the
   grid instead of leaving a card-sized hole beside it. Scope this to the
   exact shape: longer landing-page grids with a lead already finish full
   rows, so their last card must keep its ordinary column. */
.cards:has(> .card-lead:first-child):has(> .card:nth-child(4):last-child) > .card:last-child {
  grid-column: 1 / -1;
}

/* A lead followed by four routes: two rows of two under the lead, rather
   than a row of three and one widow. The media query keeps it clear of the
   one-column stack, as the four-card rule above does. */
@media (min-width: 46rem) {
  .cards:has(> .card-lead:first-child):has(> .card:nth-child(5):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A card is raised paper with a hairline; that is the whole of what says
   "card". A shadow under every one of ten made a grid of floating tiles, and
   the lift on hover moved the page under the pointer. The gradient wipe
   below is the one moving part, and the border warming is the answer to a
   pointer. */
.card {
  display: block;
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1.2rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  color: var(--ink);
  transition: border-color 0.12s ease;
}

/* A hairline in the brand gradient sits along the bottom edge of every card and
   wipes across on hover. It is the one moving part of an otherwise still grid,
   and it points along the reading direction, toward the link the card is. */
.card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg in oklch, var(--accent) 0%, var(--teal) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.card:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.card:hover::after,
.card:focus-visible::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .card::after {
    transition: none;
  }
}

/* A card's title is an `h2`: on the landing page these are the top-level
   sections under the page title, and jumping straight to `h3` leaves a hole in
   the outline that a screen reader announces as a missing level. Size is set
   here rather than inherited from the document `h2`, because rank is structure
   and size is presentation. */
.card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.08rem;
  letter-spacing: 0;
  color: var(--accent-ink);
}

.card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

/* The lead card takes the full width of the grid's first row and states the
   one thing a first-time reader most needs to hear. Everything after it is a
   peer; this one is the recommendation. */
.card-lead {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--accent) 10%, var(--paper-raised)),
    var(--paper-raised) 60%
  );
  border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
}

.card-lead .card-lead-mark {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  /* The rim's own amber, so the drawn mark matches the outline the shader
     draws rather than sitting a step off it. */
  color: var(--mark-rim);
  background: currentColor;
  -webkit-mask: var(--mark-line) center / contain no-repeat;
  mask: var(--mark-line) center / contain no-repeat;
}

.card-lead h2 {
  color: var(--accent-ink);
  font-size: 1.15rem;
}

/* The module stack: one connected panel of layers resting on layers, the way
   the architecture composes. It is deliberately not card-shaped, the route
   cards lift and link, this is a diagram that sits still and reads top to
   bottom, so a colored left edge marks each band instead of a raised tile. */
.stack {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.layer {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-raised);
}

.layer:last-child {
  border-bottom: none;
}

.layer strong {
  color: var(--teal-ink);
}

.layer.is-core {
  background: color-mix(in srgb, var(--teal) 8%, var(--paper-raised));
}

.layer.is-adapter {
  background: color-mix(in srgb, var(--accent) 8%, var(--paper-raised));
}

/* The local actor layer: sync and sans-io like the core, but resting on it
   rather than inside it, so it gets its own neutral band. */
.layer.is-local {
  background: color-mix(in srgb, var(--ink-soft) 7%, var(--paper-raised));
}

.layer small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.86rem;
  /* Same widow control as body copy, these read as sentences, not labels. */
  text-wrap: pretty;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  vertical-align: middle;
}

.tag-core {
  color: var(--teal-ink);
  background: color-mix(in srgb, var(--teal) 18%, transparent);
}

.tag-adapter {
  color: var(--accent-ink-tinted);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.tag-local {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink-soft) 18%, transparent);
}
