/* Homepage card: Waves */

/* ---------- Waves feature ---------- */
/* The card is the demo: a mounted `waves:v1:` configuration fills it edge to
   edge. Its colours are the ones that configuration names — one string per
   colour scheme, both in index.html. */
.waves-feature {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  min-height: clamp(30rem, 46vw, 37rem);
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(2.25rem, 5vw, 5rem);
  overflow: hidden;
  border: 1px solid var(--waves-hairline);
  border-radius: clamp(12px, 1.5vw, 18px);
  background: var(--waves-canvas-bg);
  color: var(--waves-ink);
  isolation: isolate;
}

.product + .waves-feature { border-top: 1px solid var(--waves-hairline); }

.waves-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  /* stands in until the renderer mounts, and matches the background the
     configuration itself paints */
  background: var(--waves-canvas-bg);
}

/* the pattern runs the full width; the copy side takes just enough shade to
   stay readable over the thickest part of it */
.waves-feature::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    100deg,
    var(--waves-scrim) 0 34%,
    var(--waves-scrim-soft) 58%,
    transparent 86%
  );
}

.waves-copy {
  position: relative;
  z-index: 5;
  max-width: 34rem;
}

.waves-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: clamp(1.6rem, 3vw, 2.6rem);
  color: var(--waves-ink-soft);
}

.waves-meta span + span::before {
  content: "·";
  margin-right: 1rem;
  color: var(--waves-accent);
}

.waves-title {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
}

.waves-lede {
  margin: clamp(1.7rem, 3vw, 2.5rem) 0 1.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.waves-feature .product-desc {
  max-width: 31rem;
  color: var(--waves-ink-soft);
  line-height: 1.75;
}

.waves-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

/* the card carries its own contrast, so the buttons answer to it */
.waves-app-link:hover {
  background: var(--waves-accent);
  color: var(--waves-on-accent);
}

.waves-secondary-link { color: var(--waves-ink-soft); }
.waves-secondary-link:hover { color: var(--waves-accent); }

.waves-action-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* ---------- the configuration behind it ---------- */
.waves-vignette {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  align-self: center;
}

.waves-spec {
  width: min(100%, 25rem);
  padding: 1rem 1.2rem 1.2rem;
  border: 1px solid var(--waves-spec-edge);
  border-radius: 10px;
  background: var(--waves-spec-bg);
  box-shadow: 0 28px 60px -30px var(--waves-shadow);
  backdrop-filter: blur(14px);
}

/* nothing to show until the renderer reports what it mounted */
.waves-spec:has(.waves-spec-string:empty) { display: none; }

.waves-spec figcaption {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--waves-ink-soft);
}

.waves-spec-string {
  display: block;
  color: var(--waves-ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.85;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 861px) and (max-height: 850px) {
  .waves-feature {
    min-height: calc(100svh - var(--nav-height) - 3.5rem);
    padding-block: clamp(2.25rem, 6vh, 3rem);
  }

  .waves-meta {
    margin-bottom: clamp(1.1rem, 3vh, 1.75rem);
  }

  .waves-lede {
    margin-top: clamp(1.2rem, 3.5vh, 1.7rem);
  }
}

@media (max-width: 860px) {
  .waves-feature {
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: auto;
  }
  /* stacked, the shade has to cover the whole card rather than one side */
  .waves-feature::before {
    background: linear-gradient(
      180deg,
      var(--waves-scrim) 0 46%,
      var(--waves-scrim-soft) 74%,
      transparent
    );
  }
  .waves-copy { max-width: 38rem; }
  .waves-vignette { place-items: center start; }
  .waves-spec { width: min(100%, 30rem); }
}

@media (max-width: 520px) {
  .waves-feature {
    gap: 1.5rem;
    padding: 1.75rem 1.15rem 1.75rem;
    border-radius: 12px;
  }
  .waves-meta { gap: 0.7rem; }
  .waves-meta span + span::before { margin-right: 0.7rem; }
  .waves-actions { justify-content: center; }
  .waves-vignette { place-items: center; }
  .waves-spec { padding: 0.85rem 1rem 1rem; }
  .waves-spec-string { font-size: 0.64rem; }
}
