/* Stack: product page.
   Consumes the Jess Design System tokens from /assets/ds/colors_and_type.css.
   No brand hex values are written here on purpose: every colour is a token or a
   color-mix() of one, so a palette change carries through. */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--jds-blueberry);
}

body {
  /* One column geometry for the whole page, so the nav, the hero and every
     band line up on the same left edge at every width. */
  --stack-page: min(1120px, 100% - 40px);
  --stack-accent: var(--jds-blue-200);
  --stack-ink: var(--jds-milk);
  --stack-ink-muted: color-mix(in srgb, var(--jds-milk) 74%, transparent);
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--jds-blueberry);
  color: var(--stack-ink);
}

a {
  color: inherit;
}

/* ---------- skip link (site pattern) ---------- */

.stack-skip {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 18px;
  background: var(--jds-milk);
  border-radius: var(--radius-sm);
  color: var(--jds-blueberry);
  font-weight: 800;
  text-decoration: none;
  transform: translate(-50%, -160%);
  transition: transform 150ms ease;
}

.stack-skip:focus {
  transform: translate(-50%, 0);
}

/* ---------- nav ---------- */

.stack-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: var(--stack-page);
  margin: 0 auto;
  padding: 14px 0;
}

.stack-mark,
.stack-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 900;
  text-decoration: none;
}

.stack-mark {
  font-size: 24px;
  letter-spacing: -.03em;
}

.stack-mark span {
  color: var(--stack-accent);
}

.stack-back {
  gap: 8px;
  font-size: 14px;
  color: var(--stack-ink-muted);
}

.stack-back:hover {
  color: var(--stack-ink);
}

.stack-skip:focus-visible,
.stack-mark:focus-visible,
.stack-back:focus-visible,
.stack-cta:focus-visible,
.stack-main a:focus-visible,
.stack-foot a:focus-visible {
  outline: 3px solid var(--stack-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- hero ---------- */

.stack-hero {
  display: grid;
  gap: 40px;
  width: var(--stack-page);
  margin: 0 auto;
  padding: 26px 0 64px;
}

.stack-kicker {
  margin: 0;
  color: var(--stack-accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.stack-kicker span {
  margin: 0 5px;
}

.stack-hero h1 {
  max-width: 20ch;
  margin: 16px 0 0;
  color: var(--jds-white);
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: .92;
  text-transform: none;
}

.stack-hero h1 span {
  display: block;
  color: var(--stack-accent);
}

.stack-lede {
  max-width: 60ch;
  margin-top: 22px;
}

.stack-lede p {
  color: color-mix(in srgb, var(--jds-milk) 92%, transparent);
  font-size: clamp(16px, 1.15vw, 17.5px);
  line-height: 1.55;
}

.stack-lede p + p {
  margin-top: 14px;
}

/* ---------- download ---------- */

.stack-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 26px;
}

.stack-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 26px;
  background: var(--jds-blue);
  border: 1px solid var(--jds-blue);
  border-radius: var(--radius-pill);
  color: var(--jds-blueberry);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease;
}

.stack-cta:hover {
  background: var(--jds-blue-300);
  border-color: var(--jds-blue-300);
}

.stack-cta span {
  font-size: 20px;
  line-height: 1;
}

.stack-download-meta {
  margin: 0;
  color: var(--stack-ink-muted);
  font-size: 14px;
  letter-spacing: 0;
}

/* ---------- three facts ---------- */

.stack-facts {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.stack-facts li {
  padding: 14px 16px;
  background: color-mix(in srgb, var(--jds-navy-700) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--jds-blue-200) 26%, transparent);
  border-radius: var(--radius-sm);
  color: var(--stack-ink-muted);
  font-size: 14px;
  line-height: 1.45;
}

.stack-facts strong {
  display: block;
  margin-bottom: 5px;
  color: var(--jds-white);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.stack-fineprint {
  max-width: 62ch;
  margin: 16px 0 0;
  color: color-mix(in srgb, var(--jds-milk) 62%, transparent);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- hero diagram ---------- */

.stack-diagram {
  align-self: start;
  max-width: 420px;
  margin: 0;
  padding: 22px 20px 18px;
  background: color-mix(in srgb, var(--jds-navy-700) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--jds-blue-200) 20%, transparent);
  border-radius: var(--radius-md);
}

.stack-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.dg-plumb {
  stroke: color-mix(in srgb, var(--jds-milk) 30%, transparent);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.dg-spine {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dg-good .dg-spine {
  stroke: var(--jds-blue-200);
}

.dg-good .dg-dot {
  fill: var(--jds-blue-200);
}

.dg-drift .dg-spine {
  stroke: color-mix(in srgb, var(--jds-milk) 46%, transparent);
}

.dg-drift .dg-dot {
  fill: color-mix(in srgb, var(--jds-milk) 46%, transparent);
}

.dg-offset {
  stroke: color-mix(in srgb, var(--jds-milk) 42%, transparent);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.dg-state-label {
  fill: var(--jds-milk);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dg-drift .dg-state-label {
  fill: color-mix(in srgb, var(--jds-milk) 62%, transparent);
}

.dg-label {
  fill: color-mix(in srgb, var(--jds-milk) 66%, transparent);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0;
}

.stack-diagram figcaption {
  margin-top: 12px;
  color: var(--stack-ink-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ---------- bands ---------- */

.stack-band {
  padding: 52px 0;
}

.stack-band-inner {
  width: var(--stack-page);
  margin: 0 auto;
}

.stack-band--refuse {
  background: var(--jds-navy-700);
  border-block: 1px solid color-mix(in srgb, var(--jds-blue-200) 18%, transparent);
}

.stack-eyebrow {
  margin: 0;
  color: var(--stack-accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.stack-band h2 {
  max-width: 22ch;
  margin: 12px 0 0;
  color: var(--jds-white);
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: .96;
  text-transform: none;
}

.stack-band-lede {
  max-width: 64ch;
  margin: 20px 0 0;
  color: color-mix(in srgb, var(--jds-milk) 90%, transparent);
  font-size: clamp(15.5px, 1.1vw, 17px);
  line-height: 1.55;
}

.stack-band-note {
  max-width: 64ch;
  margin: 24px 0 0;
  color: var(--stack-ink-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------- what it does ---------- */

.stack-steps {
  display: grid;
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: stack-step;
}

.stack-steps li {
  padding: 20px;
  background: color-mix(in srgb, var(--jds-navy-700) 58%, transparent);
  border: 1px solid color-mix(in srgb, var(--jds-blue-200) 20%, transparent);
  border-radius: var(--radius-md);
  counter-increment: stack-step;
}

.stack-steps li::before {
  display: block;
  margin-bottom: 10px;
  color: var(--stack-accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .1em;
  content: "0" counter(stack-step);
}

.stack-steps h3 {
  margin: 0 0 8px;
  color: var(--jds-white);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.08;
}

.stack-steps p {
  color: var(--stack-ink-muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---------- refusals ---------- */

.stack-refusals {
  display: grid;
  gap: 22px 34px;
  margin: 30px 0 0;
}

.stack-refusals > div {
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--jds-blue-200) 30%, transparent);
}

.stack-refusals dt {
  color: var(--jds-white);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.12;
}

.stack-refusals dd {
  max-width: 56ch;
  margin: 9px 0 0;
  color: color-mix(in srgb, var(--jds-milk) 80%, transparent);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------- setup ---------- */

.stack-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.stack-reqs li {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 5px;
  min-height: 44px;
  padding: 4px 16px;
  background: color-mix(in srgb, var(--jds-navy-700) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--jds-blue-200) 24%, transparent);
  border-radius: var(--radius-pill);
  font-size: 14px;
}

/* The one inline link in the requirements row still has to be a 44px target. */
.stack-reqs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--stack-accent);
  text-underline-offset: 3px;
}

.stack-setup-intro {
  max-width: 60ch;
  margin: 22px 0 0;
  color: color-mix(in srgb, var(--jds-milk) 88%, transparent);
  font-size: 15.5px;
  line-height: 1.55;
}

.stack-code {
  max-width: 640px;
  margin: 14px 0 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: var(--jds-navy-800);
  border: 1px solid color-mix(in srgb, var(--jds-blue-200) 28%, transparent);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.stack-code code {
  display: block;
  color: var(--jds-blue-50);
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0;
  line-height: 1.85;
  white-space: pre;
}

code {
  color: var(--jds-blue-100);
  font-family: var(--font-mono);
  font-size: .92em;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.stack-caution {
  max-width: 62ch;
  margin: 18px 0 0;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--jds-amber-400) 12%, transparent);
  border-left: 3px solid var(--jds-amber-400);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: color-mix(in srgb, var(--jds-milk) 92%, transparent);
  font-size: 14.5px;
  line-height: 1.55;
}

.stack-caution strong {
  color: var(--jds-amber-200);
}

.stack-caution code {
  color: var(--jds-amber-100);
}

/* ---------- limitations ---------- */

.stack-limits {
  display: grid;
  gap: 12px;
  max-width: 64ch;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.stack-limits li {
  padding-left: 20px;
  color: var(--stack-ink-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.stack-limits li::before {
  float: left;
  width: 20px;
  margin-left: -20px;
  color: var(--stack-accent);
  content: "\2022";
}

/* ---------- footer ---------- */

.stack-foot {
  width: var(--stack-page);
  margin: 0 auto;
  padding: 30px 0 44px;
  border-top: 1px solid color-mix(in srgb, var(--jds-milk) 14%, transparent);
}

.stack-foot p {
  margin: 0;
  color: color-mix(in srgb, var(--jds-milk) 62%, transparent);
  font-size: 14px;
}

.stack-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 6px;
}

.stack-foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--stack-accent);
  font-weight: 700;
  text-underline-offset: 3px;
}

/* ---------- narrow viewports ---------- */

/* Small phones: shrink the block just enough that the longest command fits
   without a scrollbar. It still scrolls if a future line is longer. */
@media (max-width: 480px) {
  .stack-code {
    padding: 16px 14px;
  }

  .stack-code code {
    font-size: 12px;
    line-height: 1.95;
  }
}

/* ---------- wider viewports ---------- */

@media (min-width: 700px) {
  .stack-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stack-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stack-refusals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .stack-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 56px;
    align-items: start;
    padding: 34px 0 76px;
  }

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

  .stack-diagram {
    position: sticky;
    top: 28px;
    justify-self: end;
    width: 100%;
  }

  .stack-band {
    padding: 68px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stack-skip,
  .stack-cta {
    transition: none;
  }
}
