/*!
 * Hammhaus Showcase — page-specific styles for index.html (the style guide)
 *
 * Why this file is separate from hammhaus.css: hammhaus.css is the portable
 * product people download; this file is the gallery walls — hero set pieces,
 * playground controls, watermark numerals — that exist only on this page.
 * Keeping them apart means the downloadable system ships zero demo weight.
 * Everything here is scoped to the .sx-* namespace and depends on
 * hammhaus.css for tokens and components. The star is hammhaus.css —
 * these styles are the gallery walls, not the art.
 */

/* ==========================================================================
   Page shell
   ========================================================================== */

.sx-page {
  position: relative;
  overflow-x: clip;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--hh-blue) 10%, transparent) 0, transparent 42%),
    radial-gradient(90% 60% at 0% 100%, color-mix(in srgb, var(--hh-red) 8%, transparent) 0, transparent 40%),
    linear-gradient(90deg, color-mix(in srgb, var(--hh-ink) 4%, transparent) 1px, transparent 1px) 0 0 / 104px 104px,
    linear-gradient(0deg, color-mix(in srgb, var(--hh-ink) 3%, transparent) 1px, transparent 1px) 0 0 / 104px 104px,
    var(--hh-paper);
}

/* A whisper of film grain over everything — sells the "paper" in paper &
   ink. Fixed so it reads as the sheet the page is printed on. */
.sx-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.05;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") repeat 0 0 / 160px 160px;
}

/* Reading progress: a Bauhaus tricolor rule that grows across the top of
   the viewport as you scroll. Pure CSS scroll-driven animation; browsers
   without support simply never show it. */
.sx-progress {
  display: none;
}

@supports (animation-timeline: scroll()) {
  .sx-progress {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--hh-red) 0 38%, var(--hh-yellow) 38% 62%, var(--hh-blue) 62%);
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: sx-progress-grow auto linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes sx-progress-grow {
  to { transform: scaleX(1); }
}

.sx-skip {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  transform: translateY(-150%);
  transition: transform 160ms var(--hh-ease);
}

.sx-skip:focus-visible {
  transform: translateY(0);
}

/* Scroll-reveal. JS adds .is-visible; without JS or with reduced motion the
   content is shown immediately. */
.sx-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 720ms var(--hh-ease), transform 720ms var(--hh-ease);
}

.sx-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.no-js .sx-reveal {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Navigation extras (scrollspy active state)
   ========================================================================== */

.hh-nav {
  box-shadow: 0 1px 0 var(--hh-line), 0 10px 30px color-mix(in srgb, var(--hh-ink) 6%, transparent);
}

.hh-brand { text-transform: none; }

.sx-nav__links a {
  position: relative;
}

.sx-nav__links a.is-active {
  color: currentColor;
}

.sx-nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.4rem;
  height: 3px;
  background: var(--hh-accent);
  border-radius: var(--hh-radius-pill);
}

/* Theme toggle: show the sun when dark is active, the moon when light. */
.sx-theme-toggle .sx-i-sun { display: none; }
.sx-theme-toggle[data-mode="dark"] .sx-i-sun { display: block; }
.sx-theme-toggle[data-mode="dark"] .sx-i-moon { display: none; }

/* This page carries more nav links than the base system (plus a theme
   toggle), so stack to a scrollable row earlier to avoid a crowded-row
   overflow on tablets. */
@media (max-width: 920px) {
  .sx-page .hh-nav__inner {
    flex-direction: column;
    align-items: flex-start;
    padding-block: var(--hh-space-4);
  }
  .sx-nav__links {
    width: 100%;
    overflow-x: auto;
    padding-block-end: var(--hh-space-1);
  }
}

/* ==========================================================================
   Section heads (big numbered editorial headers)
   ========================================================================== */

.sx-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--hh-space-5);
  align-items: start;
  margin-bottom: var(--hh-space-7);
}

.sx-head__index {
  font-family: var(--hh-font-mono);
  font-size: var(--hh-type-small);
  font-weight: 700;
  letter-spacing: 0;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid currentColor;
  border-radius: var(--hh-radius-pill);
  white-space: nowrap;
}

.sx-head__body { display: grid; gap: var(--hh-space-3); }
.sx-head__lead { max-width: 54ch; }

@media (max-width: 620px) {
  .sx-head { grid-template-columns: 1fr; gap: var(--hh-space-3); }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.sx-hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 4.5rem);
  min-height: calc(100dvh - 4.5rem);
  display: grid;
  align-items: center;
  overflow: hidden;
  padding-block: var(--hh-space-8) var(--hh-space-7);
  background:
    linear-gradient(90deg, transparent 0 60%, color-mix(in srgb, var(--hh-blue) 92%, var(--hh-ink)) 60% 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--hh-red) 12%, transparent) 0 16%, transparent 16% 100%),
    var(--hh-paper);
}

.sx-hero__deco {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.sx-blob {
  position: absolute;
  display: block;
  will-change: transform;
}

.sx-blob--circle {
  top: 4.5rem; right: 6vw;
  width: 15rem; aspect-ratio: 1;
  background: var(--hh-red);
  border-radius: 50%;
}

.sx-blob--square {
  right: 24vw; bottom: 5rem;
  width: 9rem; height: 9rem;
  background: var(--hh-yellow);
  border: 2px solid var(--hh-ink);
  transform: rotate(-9deg);
}

.sx-blob--ring {
  left: 4vw; top: 30%;
  width: 7rem; height: 7rem;
  border: 3px solid color-mix(in srgb, var(--hh-ink) 55%, transparent);
  border-radius: 50%;
}

.sx-blob--triangle {
  right: 40vw; top: 18%;
  width: 0; height: 0;
  border-inline: 2.6rem solid transparent;
  border-bottom: 4.6rem solid color-mix(in srgb, var(--hh-blue) 70%, transparent);
  transform: rotate(6deg);
}

.sx-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.85fr);
  gap: var(--hh-space-7);
  align-items: center;
}

.sx-hero__grid > * { min-width: 0; }

/* Entrance choreography: the headline column rises line by line, the
   specimen card settles in, the deco shapes pop. Pure CSS, killed by the
   global prefers-reduced-motion rule in hammhaus.css. */
@keyframes sx-rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}

@keyframes sx-pop {
  from {
    opacity: 0;
    scale: 0.4;
  }
}

.sx-hero .hh-stack > * {
  animation: sx-rise 640ms var(--hh-ease) backwards;
}

.sx-hero .hh-stack > :nth-child(2) { animation-delay: 90ms; }
.sx-hero .hh-stack > :nth-child(3) { animation-delay: 180ms; }
.sx-hero .hh-stack > :nth-child(4) { animation-delay: 270ms; }
.sx-hero .hh-stack > :nth-child(5) { animation-delay: 360ms; }

.sx-specimen {
  animation: sx-specimen-in 820ms 240ms var(--hh-ease) backwards;
}

@keyframes sx-specimen-in {
  from {
    opacity: 0;
    transform: rotate(-1.5deg) translateY(34px) scale(0.97);
  }
}

.sx-blob {
  animation: sx-pop 700ms var(--hh-ease) backwards;
}

.sx-blob--circle   { animation-delay: 340ms; }
.sx-blob--square   { animation-delay: 460ms; }
.sx-blob--ring     { animation-delay: 560ms; }
.sx-blob--triangle { animation-delay: 640ms; }

/* The accent word underlines itself once the headline has landed — set a
   touch off-axis, like a stroke of the press operator's china marker. */
.sx-hero__title em {
  position: relative;
}

.sx-hero__title em::after {
  content: "";
  position: absolute;
  left: 0.02em;
  right: 0.08em;
  bottom: 0.05em;
  height: 0.09em;
  z-index: -1;
  background: var(--hh-yellow);
  transform: rotate(-1.5deg) scaleX(0);
  transform-origin: 0 50%;
  animation: sx-sweep 700ms 720ms var(--hh-ease) forwards;
}

@keyframes sx-sweep {
  to { transform: rotate(-1.5deg) scaleX(1); }
}

.sx-hero__title {
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: clamp(3.2rem, 11vw, 9rem);
  line-height: 0.82;
  letter-spacing: var(--hh-tracking-hero);
  text-wrap: balance;
  font-kerning: normal;
  font-feature-settings: "kern" 1;
}

.sx-hero__title em {
  font-style: normal;
  color: var(--hh-red);
}

/* The verb leans into the sentence — roman, italic, then the red payoff. */
.sx-hero__title i {
  font-style: italic;
  letter-spacing: -0.03em; /* italics set a touch looser at 900 */
}

.sx-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 2px solid var(--hh-ink);
  background: color-mix(in srgb, var(--hh-paper) 84%, var(--hh-white));
  box-shadow: var(--hh-shadow-hard);
}

.sx-hero__stats div {
  min-width: 0;
  padding: var(--hh-space-3) var(--hh-space-4);
  border-right: 2px solid var(--hh-ink);
}

.sx-hero__stats div:last-child { border-right: 0; }

.sx-hero__stats dt {
  font-family: var(--hh-font-display);
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: var(--hh-tracking-title);
}

.sx-hero__stats dd {
  margin: var(--hh-space-1) 0 0;
  font-family: var(--hh-font-mono);
  font-size: var(--hh-type-micro);
  text-transform: uppercase;
  line-height: 1.35;
}

/* Themable specimen card (no external image) */
.sx-specimen {
  position: relative;
  display: grid;
  gap: var(--hh-space-4);
  padding: var(--hh-space-5);
  background: var(--hh-paper-3);
  border: 2px solid var(--hh-ink);
  border-radius: var(--hh-radius);
  box-shadow: var(--hh-shadow-hard);
  transform: rotate(-1.5deg);
  transition: transform 320ms var(--hh-ease);
}

.sx-specimen:hover {
  transform: rotate(0deg) translateY(-4px);
}

.sx-specimen__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hh-space-2);
  font-family: var(--hh-font-mono);
  font-size: var(--hh-type-micro);
  text-transform: uppercase;
  color: var(--hh-muted);
}

.sx-specimen__glyph {
  display: grid;
  place-items: center;
  min-height: 12rem;
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: 11rem;
  line-height: 1;
  letter-spacing: var(--hh-tracking-hero);
  color: var(--hh-ink);
  background:
    linear-gradient(135deg, transparent 0 64%, color-mix(in srgb, var(--hh-yellow) 60%, transparent) 64% 72%, transparent 72%);
}

.sx-specimen__strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 2.4rem;
  border: 1.5px solid var(--hh-ink);
  overflow: hidden;
}

.sx-specimen__strip span { display: block; }

@media (max-width: 980px) {
  .sx-hero {
    min-height: auto;
    background: var(--hh-paper);
  }
  .sx-hero__grid { grid-template-columns: 1fr; }
  .sx-hero__title { font-size: clamp(3rem, 14vw, 6rem); }
  .sx-blob { display: none; }
}

/* ==========================================================================
   Marquee band
   ========================================================================== */

/* Chrome bands stay dark in both themes (fixed brand anchors). */
.sx-band {
  border-block: 2px solid var(--hh-black);
  background: var(--hh-black);
  color: var(--hh-cream);
}

.sx-band .hh-marquee { border-block: 0; }
.sx-band .hh-marquee__item { font-size: 1.5rem; letter-spacing: var(--hh-tracking-subhead); }

/* ==========================================================================
   Watermark numbers
   ========================================================================== */

.sx-section { position: relative; isolation: isolate; }

.sx-wm {
  position: absolute;
  z-index: -1;
  top: -0.15em; right: 2vw;
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: clamp(8rem, 22vw, 22rem);
  line-height: 0.8;
  letter-spacing: var(--hh-tracking-hero);
  color: color-mix(in srgb, currentColor 6%, transparent);
  pointer-events: none;
  user-select: none;
}

/* ==========================================================================
   Tokens: swatches + click to copy
   ========================================================================== */

.sx-copyable {
  position: relative;
  cursor: copy;
  text-align: left;
  font: inherit;
  color: inherit;
  border: 0;
  padding: 0;
  background: none;
  width: 100%;
  transition: translate 200ms var(--hh-ease);
}

.sx-copyable:hover,
.sx-copyable:focus-visible {
  translate: 0 -4px;
}

.sx-copyable .hh-swatch {
  transition: box-shadow 200ms var(--hh-ease), border-color 200ms var(--hh-ease);
}

.sx-copyable:hover .hh-swatch,
.sx-copyable:focus-visible .hh-swatch {
  border-color: currentColor;
  box-shadow: var(--hh-shadow-soft);
}

.sx-swatch__color { position: relative; }

.sx-copyable .hh-swatch__color::after {
  content: "Click to copy";
  position: absolute;
  inset-inline: 0.5rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.4rem;
  font-family: var(--hh-font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--hh-ink);
  background: color-mix(in srgb, var(--hh-paper) 88%, transparent);
  border-radius: var(--hh-radius-sm);
  opacity: 0;
  transition: opacity 160ms var(--hh-ease);
}

.sx-copyable:hover .hh-swatch__color::after,
.sx-copyable:focus-visible .hh-swatch__color::after { opacity: 1; }

.sx-copyable.is-copied .hh-swatch__color::after {
  content: "Copied ✓";
  opacity: 1;
  background: var(--hh-yellow);
}

/* ==========================================================================
   Live theming playground
   ========================================================================== */

.sx-lab {
  display: grid;
  grid-template-columns: 20rem minmax(0, 1fr);
  gap: var(--hh-space-6);
  align-items: start;
}

.sx-lab__controls {
  /* The panel sits on a paper-3 surface inside the ink section, so it must
     carry its own fg/line tokens — otherwise it inherits the section's
     light-on-dark foreground and renders cream-on-cream. */
  --hh-bg: var(--hh-paper-3);
  --hh-fg: var(--hh-ink);
  --hh-line: color-mix(in srgb, var(--hh-ink) 18%, transparent);
  --hh-line-strong: color-mix(in srgb, var(--hh-ink) 35%, transparent);
  display: grid;
  gap: var(--hh-space-5);
  padding: var(--hh-space-5);
  border: 2px solid var(--hh-ink);
  border-radius: var(--hh-radius);
  background: var(--hh-bg);
  color: var(--hh-fg);
  box-shadow: var(--hh-shadow-hard);
  position: sticky;
  top: 6rem;
}

/* Bauhaus seal: quartered circle, the control panel's maker's mark. */
.sx-lab__seal {
  inline-size: 2.4rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--hh-ink);
  background: conic-gradient(var(--hh-red) 0 25%, var(--hh-blue) 0 50%, var(--hh-yellow) 0 75%, var(--hh-paper-3) 0);
}

.sx-lab__controls .hh-code-block {
  font-size: 0.72rem;
  line-height: 1.55;
  padding: var(--hh-space-4);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sx-control { display: grid; gap: var(--hh-space-3); }

.sx-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.sx-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  font-size: var(--hh-type-small);
  font-weight: 700;
  border: 1.5px solid var(--hh-line-strong);
  border-radius: var(--hh-radius-pill);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: border-color 160ms var(--hh-ease), background-color 160ms var(--hh-ease);
}

.sx-choice::before {
  content: "";
  inline-size: 0.85rem;
  block-size: 0.85rem;
  border-radius: 50%;
  background: var(--sx-choice, var(--hh-accent));
  border: 1px solid color-mix(in srgb, var(--hh-ink) 30%, transparent);
}

.sx-choice[aria-pressed="true"] {
  border-color: var(--hh-fg);
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.sx-choice--surface::before { display: none; }

.sx-range-out {
  font-family: var(--hh-font-mono);
  font-size: var(--hh-type-small);
}

.sx-lab__preview {
  border: 2px solid var(--hh-ink);
  border-radius: var(--hh-radius);
  overflow: hidden;
  box-shadow: var(--hh-shadow-soft);
  transition: background-color 240ms var(--hh-ease), color 240ms var(--hh-ease);
}

.sx-preview__inner {
  display: grid;
  gap: var(--hh-space-5);
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--hh-bg);
  color: var(--hh-fg);
}

.sx-preview__title {
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: var(--hh-tracking-display);
  text-wrap: balance;
}

.sx-preview__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--hh-space-4);
}

/* First preview card wears the hard shadow so the shadow slider reads.
   Keep the accent top border — it's the card's signature. */
.sx-preview__cards .hh-card:first-child {
  border: 2px solid var(--hh-ink);
  border-top: 4px solid var(--hh-accent);
  box-shadow: var(--hh-shadow-hard);
}

@media (max-width: 880px) {
  .sx-lab { grid-template-columns: 1fr; }
  .sx-lab__controls { position: static; }
}

/* ==========================================================================
   Typography specimens
   ========================================================================== */

.sx-type-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.2fr) minmax(0, 1fr);
  gap: var(--hh-space-5);
  align-items: baseline;
  padding-block: var(--hh-space-4);
  border-top: 1px solid var(--hh-line);
}

.sx-type-row:last-child { border-bottom: 1px solid var(--hh-line); }
.sx-type-row__demo { min-width: 0; }

.sx-tester {
  margin-top: var(--hh-space-6);
  padding: var(--hh-space-5);
  border: 2px dashed var(--hh-line-strong);
  border-radius: var(--hh-radius);
  background: color-mix(in srgb, var(--hh-bg) 70%, var(--hh-white));
}

.sx-tester__field {
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.9;
  letter-spacing: var(--hh-tracking-display);
  outline: none;
  border-radius: var(--hh-radius-sm);
}

.sx-tester__field:focus-visible {
  outline: 3px solid var(--hh-focus);
  outline-offset: 6px;
}

@media (max-width: 620px) {
  .sx-type-row { grid-template-columns: 1fr; gap: var(--hh-space-2); }
}

/* ==========================================================================
   Component gallery (spec cards)
   ========================================================================== */

.sx-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: var(--hh-space-5);
}

.sx-spec {
  display: flex;
  flex-direction: column;
  gap: var(--hh-space-4);
  padding: var(--hh-space-5);
  border: 1.5px solid var(--hh-line-strong);
  border-radius: var(--hh-radius);
  background: color-mix(in srgb, var(--hh-bg) 86%, var(--hh-white));
  box-shadow: 0 0.85rem 0 color-mix(in srgb, var(--hh-ink) 5%, transparent);
  transition: transform 220ms var(--hh-ease), box-shadow 220ms var(--hh-ease), border-color 220ms var(--hh-ease);
}

.sx-spec:hover {
  transform: translateY(-4px);
  border-color: currentColor;
  box-shadow: 0 1.1rem 0 color-mix(in srgb, var(--hh-ink) 9%, transparent);
}

.sx-spec--wide { grid-column: 1 / -1; }

.sx-spec__head {
  display: flex;
  align-items: center;
  gap: var(--hh-space-3);
  padding-bottom: var(--hh-space-3);
  border-bottom: 1px solid var(--hh-line);
}

.sx-spec__head h3 {
  flex: 1;
}

/* "Copy HTML" — injected by JS on every spec card so any component's
   markup is one click away. */
.sx-spec__copy {
  padding: 0.3rem 0.6rem;
  font-family: var(--hh-font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: inherit;
  background: transparent;
  border: 1px solid var(--hh-line-strong);
  border-radius: var(--hh-radius-pill);
  cursor: copy;
  white-space: nowrap;
  transition: border-color 160ms var(--hh-ease), background-color 160ms var(--hh-ease);
}

.sx-spec__copy:hover {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.sx-spec__copy.is-copied {
  background: var(--hh-yellow);
  color: var(--hh-black);
  border-color: var(--hh-black);
}

.sx-spec__demo {
  display: flex;
  flex-direction: column;
  gap: var(--hh-space-4);
}

/* ==========================================================================
   Surface sampler (full bleed)
   ========================================================================== */

/* The surfaces section skips .hh-section so its sampler can bleed
   full-width, so it supplies its own head padding; the strip itself stays
   flush against the next section on purpose. */
#surfaces {
  padding-block-start: var(--hh-space-8);
}

.sx-surfaces {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-block: 2px solid var(--hh-ink);
}

.sx-surface {
  display: grid;
  align-content: space-between;
  gap: var(--hh-space-5);
  min-height: 17rem;
  padding: var(--hh-space-5);
  border-right: 2px solid color-mix(in srgb, currentColor 22%, transparent);
}

.sx-surface:last-child { border-right: 0; }
.sx-surface strong { font-family: var(--hh-font-display); font-size: 1.5rem; letter-spacing: var(--hh-tracking-subhead); }

@media (max-width: 1080px) { .sx-surfaces { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px)  { .sx-surfaces { grid-template-columns: 1fr; } .sx-surface { min-height: 11rem; border-right: 0; border-bottom: 2px solid color-mix(in srgb, currentColor 22%, transparent); } .sx-surface:last-child { border-bottom: 0; } }

/* ==========================================================================
   Pattern collage ("Built with Hammhaus")
   ========================================================================== */

.sx-collage {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--hh-space-5);
}

.sx-tile {
  border: 2px solid var(--hh-ink);
  border-radius: var(--hh-radius);
  background: var(--hh-paper-3);
  box-shadow: var(--hh-shadow-hard);
  overflow: hidden;
}

.sx-tile__pad { display: grid; gap: var(--hh-space-4); padding: var(--hh-space-5); }

.sx-tile--pricing { grid-column: span 5; }
.sx-tile--login   { grid-column: span 4; }
.sx-tile--stat    { grid-column: span 3; }
.sx-tile--article { grid-column: span 7; }

.sx-tile--promo {
  grid-column: span 5;
  --hh-bg: var(--hh-ink);
  --hh-fg: var(--hh-paper);
  --hh-accent: var(--hh-yellow);
  --hh-line: color-mix(in srgb, var(--hh-paper) 22%, transparent);
  --hh-line-strong: color-mix(in srgb, var(--hh-paper) 35%, transparent);
  background: var(--hh-ink);
  color: var(--hh-paper);
}

.sx-price {
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: 3.6rem;
  line-height: 1;
  letter-spacing: var(--hh-tracking-title);
}

.sx-price small { font-size: 1rem; font-weight: 700; color: var(--hh-muted); }

.sx-tile__banner {
  display: grid;
  place-items: center;
  min-height: 7rem;
  padding: var(--hh-space-5);
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: var(--hh-tracking-title);
  color: var(--hh-paper);
  background:
    linear-gradient(135deg, var(--hh-red) 0 30%, transparent 30%),
    linear-gradient(45deg, var(--hh-yellow) 0 24%, transparent 24%),
    var(--hh-blue);
}

.sx-feature-list { display: grid; gap: var(--hh-space-2); margin: 0; padding: 0; list-style: none; }
.sx-feature-list li { display: flex; gap: var(--hh-space-3); align-items: center; }

@media (max-width: 900px) {
  .sx-collage { grid-template-columns: 1fr; }
  .sx-tile { grid-column: 1 / -1 !important; }
}

/* ==========================================================================
   Get started steps
   ========================================================================== */

.sx-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--hh-space-5);
  counter-reset: sx-step;
}

.sx-step {
  position: relative;
  display: grid;
  gap: var(--hh-space-3);
  padding: var(--hh-space-5);
  padding-top: var(--hh-space-7);
  border: 1.5px solid var(--hh-line-strong);
  border-radius: var(--hh-radius);
  background: color-mix(in srgb, var(--hh-bg) 88%, var(--hh-white));
}

.sx-step::before {
  counter-increment: sx-step;
  content: counter(sx-step, decimal-leading-zero);
  position: absolute;
  top: var(--hh-space-4);
  left: var(--hh-space-5);
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--hh-accent);
  letter-spacing: var(--hh-tracking-title);
}

@media (max-width: 820px) { .sx-steps { grid-template-columns: 1fr; } }

.sx-codeblock { position: relative; }

/* The agent snippet carries two long CDN URLs; wrap them instead of
   forcing an ugly horizontal scrollbar across the panel. */
#agents .sx-codeblock .hh-code-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The two side-by-side snippets in Start should read as one unit: stretch
   both columns and let each code block fill its column's height. */
#start .hh-split {
  align-items: stretch;
}

#start .sx-codeblock {
  display: grid;
}

#start .sx-codeblock .hh-code-block {
  height: 100%;
}

.sx-copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.35rem 0.7rem;
  font-family: var(--hh-font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--hh-paper);
  background: color-mix(in srgb, var(--hh-paper) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--hh-paper) 32%, transparent);
  border-radius: var(--hh-radius-sm);
  cursor: copy;
}

.sx-copy-btn.is-copied { background: var(--hh-yellow); color: var(--hh-ink); border-color: var(--hh-yellow); }

/* ==========================================================================
   Support (free, tip optional — calm and skippable)
   ========================================================================== */

.sx-support {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--hh-space-4);
  max-width: 44rem;
  margin-inline: auto;
  padding: var(--hh-space-7) var(--hh-space-6);
  text-align: center;
  background: var(--hh-paper-3);
  border: 2px solid var(--hh-ink);
  border-radius: var(--hh-radius);
  box-shadow: var(--hh-shadow-hard);
}

.sx-support__shapes {
  display: flex;
  gap: 0.5rem;
}

.sx-support__shapes span {
  inline-size: 0.9rem;
  block-size: 0.9rem;
}

.sx-support__shapes .c { border-radius: 50%; background: var(--hh-red); }
.sx-support__shapes .s { background: var(--hh-blue); }
.sx-support__shapes .t {
  background: transparent;
  inline-size: 0;
  border-inline: 0.45rem solid transparent;
  border-block-end: 0.9rem solid var(--hh-yellow);
}

.sx-support__note {
  font-family: var(--hh-font-mono);
  font-size: var(--hh-type-micro);
  text-transform: uppercase;
  color: var(--hh-muted);
}

.sx-support .hh-button svg { fill: currentColor; stroke: none; }

/* ==========================================================================
   Footer
   ========================================================================== */

.sx-footer {
  padding-block: var(--hh-space-8) var(--hh-space-6);
  background: var(--hh-black);
  color: var(--hh-cream);
  --hh-fg: var(--hh-cream);
  --hh-line-strong: color-mix(in srgb, var(--hh-cream) 30%, transparent);
  border-top: 6px solid var(--hh-red);
}

.sx-footer__mark {
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: clamp(3rem, 12vw, 8rem);
  line-height: 0.85;
  letter-spacing: var(--hh-tracking-hero);
  /* Tuck the motto row right up under the wordmark. The stack gap is
     2rem and the display face carries ~0.2em of descender air below the
     glyphs, so this cancels both. */
  margin-block-end: -2.4rem;
}

.sx-footer__cols {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--hh-space-6);
}

.sx-footer__cols nav { display: grid; gap: var(--hh-space-2); }

/* The motto pill carries a built-in top margin, so drop the link columns
   by the same amount to sit level with it (and clear of the wordmark). */
@media (min-width: 761px) {
  .sx-footer__cols nav {
    padding-block-start: var(--hh-space-5);
  }
}
.sx-footer__cols a { color: color-mix(in srgb, var(--hh-cream) 76%, transparent); text-decoration: none; width: fit-content; }
.sx-footer__cols a:hover { color: var(--hh-cream); }

@media (max-width: 760px) { .sx-footer__cols { grid-template-columns: 1fr; } }

/* ==========================================================================
   Back to top
   ========================================================================== */

.sx-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  background: var(--hh-ink);
  color: var(--hh-paper);
  border-color: var(--hh-ink);
  opacity: 0;
  translate: 0 0.75rem;
  pointer-events: none;
  transition: opacity 220ms var(--hh-ease), translate 220ms var(--hh-ease), background-color 180ms var(--hh-ease);
}

.sx-top:hover {
  background: var(--hh-red);
  border-color: var(--hh-red);
  color: var(--hh-cream);
}

.sx-top.is-shown {
  opacity: 1;
  translate: none;
  pointer-events: auto;
}

/* ==========================================================================
   Toast (copy feedback)
   ========================================================================== */

.sx-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: var(--hh-space-2);
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  color: var(--hh-paper);
  background: var(--hh-ink);
  border: 2px solid var(--hh-yellow);
  border-radius: var(--hh-radius-pill);
  box-shadow: var(--hh-shadow-soft);
  transform: translate(-50%, 200%);
  transition: transform 280ms var(--hh-ease);
}

.sx-toast.is-shown { transform: translate(-50%, 0); }

/* ==========================================================================
   Motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .sx-reveal { opacity: 1; transform: none; transition: none; }
  .sx-blob { translate: none !important; }
  .sx-progress { display: none; }
}
