/*
 * Wizelab: the "Green Ledger" look (spec section 6).
 * HackerNoon's greens on warm paper, with our own type and layout.
 *
 * Order: tokens, fonts, base elements, layout helpers, components (buttons,
 * label, card, terminal, nav, ticker, footer), then motion.
 *
 * Motion rule: anything animated, or hidden so it can animate in, is declared
 * only under `.js` (set by the inline script in the head partial) and
 * `@media (prefers-reduced-motion: no-preference)`. Without JS, or with reduced
 * motion, every piece of content is visible and still. The reduce block at the
 * end switches every animation and transition off.
 */

:root {
  /* Colors (spec section 6). Mint is a fill and an accent; never text on paper. */
  --paper: #F6F4EB;
  --ink: #112A22;
  --forest: #0D3529;
  --mint: #63FF86;
  --muted: #506459;
  --sage: #C8D3C5;
  --pale: #E8F1E7;
  --card: #FFFFFF;

  /* Type: headlines and big figures, body, labels and terminal, the WIZELAB wordmark only. */
  --f-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --f-pixel: "Silkscreen", ui-monospace, monospace;

  /* Focus ring color; dark surfaces switch it to mint. */
  --focus: var(--forest);
  --gutter: clamp(16px, 4vw, 56px);
}

/* Self-hosted fonts (latin subsets, from @fontsource; licenses in /fonts/<family>/OFL.txt). */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/space-grotesk/space-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/space-grotesk/space-grotesk-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-sans-3/source-sans-3-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-sans-3/source-sans-3-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Silkscreen";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/silkscreen/silkscreen-latin-400-normal.woff2") format("woff2");
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* A column, so the footer sits at the bottom of short pages (404, legal). */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.55 var(--f-body);
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-family: var(--f-head);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.75rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.625rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h3,
h4 {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0 0 1em;
}

strong,
b {
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  background: var(--mint);
  color: var(--ink);
}

img {
  max-width: 100%;
  height: auto;
}

code,
kbd,
samp,
pre {
  font-family: var(--f-mono);
  font-size: 0.9em;
}

hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--sage);
}

/* Disclosures carry the detail on every page (FAQ and "more" blocks). */
details {
  border-top: 1px solid var(--sage);
}

details:last-of-type {
  border-bottom: 1px solid var(--sage);
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding-block: 12px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  content: "+" / "";
  flex: none;
  font-family: var(--f-mono);
  color: var(--muted);
}

details[open] > summary::after {
  content: "\2212";
  content: "\2212" / "";
}

details > :not(summary) {
  max-width: 68ch;
}

/* ---------- Layout ---------- */

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

.section {
  padding-block: clamp(40px, 6vw, 84px);
}

/* Forest panels: masthead, footer, dark product panels. */
.surface-dark {
  --focus: var(--mint);
  background: var(--forest);
  color: var(--card);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Buttons ---------- */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font: 600 1.0625rem/1.2 var(--f-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.btn-primary {
  background: var(--mint);
  color: var(--ink);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--mint) 65%, var(--card));
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--pale);
}

.surface-dark .btn-secondary {
  border-color: var(--mint);
  color: var(--mint);
}

.surface-dark .btn-secondary:hover {
  background: var(--mint);
  color: var(--ink);
}

/* ---------- Label (small uppercase mono kicker) ---------- */

.label {
  display: block;
  margin: 0 0 16px;
  font: 600 0.75rem/1.6 var(--f-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.surface-dark .label {
  color: var(--mint);
}

/* ---------- Card (white on paper; .card-pale for the highlighted proof card) ---------- */

/* Its own text color and focus ring, so a card stays readable inside .surface-dark. */
.card {
  --focus: var(--forest);
  min-width: 0;
  padding: 22px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--sage);
  border-top: 3px solid var(--forest);
}

.card-pale {
  background: var(--pale);
}

.card > :last-child {
  margin-bottom: 0;
}

/* ---------- Terminal (lines type once with JS and motion; static otherwise) ---------- */

.terminal {
  --focus: var(--mint);
  margin: 0 0 1em;
  padding: 20px 22px;
  background: var(--forest);
  color: var(--pale);
  border-top: 6px solid var(--mint);
  font: 400 0.875rem/1.75 var(--f-mono);
  overflow-wrap: anywhere;
}

.terminal-line {
  /* As wide as its text, so each typing step reveals one character. */
  width: fit-content;
  max-width: 100%;
  margin: 0;
  white-space: pre-wrap;
}

/* Mint text reads only on forest, so it is scoped to the terminal. */
.terminal .terminal-ok {
  color: var(--mint);
}

.terminal-dim {
  color: var(--sage);
}

/* Phones: a smaller face so a 37-character line fits at 360px without wrapping. */
@media (max-width: 479.98px) {
  .terminal {
    padding-inline: 16px;
    font-size: 0.8125rem;
  }
}

/* ---------- Nav (forest masthead; collapses to a menu button under 760px) ---------- */

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  min-height: 72px;
  padding-block: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: auto;
  color: inherit;
  font: 400 1.5rem/1 var(--f-pixel);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.wordmark:hover {
  color: var(--mint);
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1rem;
  text-decoration: none;
}

.nav-menu a:hover {
  text-decoration: underline;
  text-decoration-color: var(--mint);
  text-decoration-thickness: 2px;
}

.nav-cta {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 1rem;
}

/* Shown only with JS on small screens; without JS the links simply wrap. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: inherit;
  border: 1px solid rgb(200 211 197 / 0.45);
  border-radius: 0;
  cursor: pointer;
}

.nav-toggle[aria-expanded="true"] {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--ink);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

@media (forced-colors: active) {
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    background: CanvasText;
  }
}

@media (min-width: 760px) and (max-width: 959.98px) {
  .nav {
    column-gap: 16px;
  }

  .nav-menu {
    column-gap: 16px;
  }

  .wordmark {
    font-size: 1.25rem;
  }
}

@media (max-width: 759.98px) {
  .nav {
    gap: 8px 12px;
    min-height: 64px;
  }

  .wordmark {
    font-size: 1.25rem;
  }

  .nav-cta {
    padding-inline: 12px;
    font-size: 0.9375rem;
  }

  /* The links take their own row below the bar. */
  .nav-menu {
    order: 1;
    flex-basis: 100%;
    gap: 0 18px;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .nav-menu {
    flex-direction: column;
    gap: 0;
    padding-bottom: 8px;
  }

  .js .nav-menu:not(.is-open) {
    display: none;
  }

  .js .nav-menu a {
    width: 100%;
    border-top: 1px solid rgb(200 211 197 / 0.25);
  }
}

/* ---------- Ticker (a static line; ticker.js turns it into a slow loop with a pause button) ---------- */

.ticker {
  background: var(--mint);
  color: var(--ink);
  border-bottom: 1px solid var(--forest);
  font: 600 0.8125rem/1.4 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  min-height: 44px;
  padding-block: 6px;
}

.ticker-label {
  flex: none;
  margin: 0;
}

.ticker-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Spacing lives inside each item (no flex gap), so the repeated halves of the loop are exactly equal. */
.ticker-track > li {
  flex: none;
  padding-inline-end: 1.5em;
  white-space: nowrap;
}

.ticker-track > li::before {
  content: "\25B8";
  content: "\25B8" / "";
  margin-inline-end: 0.75em;
}

.ticker-pause {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.ticker-pause:hover {
  background: var(--ink);
  color: var(--mint);
}

/* Two bars while it moves; a play triangle once paused. */
.ticker-pause-icon {
  width: 8px;
  height: 10px;
  border-inline: 3px solid currentColor;
}

.ticker-pause[aria-pressed="true"] .ticker-pause-icon {
  border-inline-end: 0;
  border-block: 5px solid transparent;
  border-inline-start: 8px solid currentColor;
}

@media (max-width: 759.98px) {
  .ticker-inner {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .ticker-viewport {
    order: 1;
    flex-basis: 100%;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  color: var(--sage);
  font-size: 1rem;
}

.footer-inner {
  padding-block: 32px 40px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--card);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
  text-decoration-color: var(--mint);
}

.footer-credits {
  max-width: 80ch;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ---------- Page sections (home first; later pages reuse them) ---------- */

/* Sections on paper are ruled off like ledger pages. */
.section:not(.surface-dark) + .section:not(.surface-dark) {
  border-top: 1px solid var(--sage);
}

.section-lead {
  max-width: 62ch;
  color: var(--muted);
}

/* A reading column, left-aligned with the other sections. */
.narrow > * {
  max-width: 780px;
}

/* Two columns from 960px: an explanation beside its example. */
.split {
  display: grid;
  gap: 32px 56px;
  align-items: start;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 1em;
}

/* Hero */

.hero-inner {
  padding-block: clamp(40px, 7vw, 96px) clamp(40px, 6vw, 80px);
}

.hero h1 {
  max-width: 14ch;
}

.hero-promise {
  max-width: 44ch;
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.4375rem);
  line-height: 1.45;
}

.hero-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 28px 0 20px;
  padding: 0;
  list-style: none;
}

.hero-prices strong,
.plan-price strong {
  font-family: var(--f-head);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-prices strong {
  font-size: 1.5rem;
}

.hero-requirements {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Results */

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.proof-card {
  display: flex;
  flex-direction: column;
}

.proof-logo {
  display: flex;
  align-items: center;
  height: 60px;
  margin: 0 0 16px;
}

/* Each logo in its own colors, scaled to fit the row. */
.proof-logo img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 56px;
}

.proof-figure {
  margin: 0 0 4px;
  font: 700 clamp(2.5rem, 2rem + 1.4vw, 3.25rem)/1 var(--f-head);
  letter-spacing: -0.04em;
}

.proof-lead {
  font-weight: 600;
  line-height: 1.35;
}

.proof-support {
  color: var(--muted);
  font-size: 1rem;
}

.proof-source {
  display: block;
  margin-top: auto;
  color: var(--muted);
  font: 400 0.75rem/1.5 var(--f-mono);
  letter-spacing: 0.02em;
}

/* The real post */

.draft-brief {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--sage);
}

.draft-brief > div {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 12px;
}

.draft-brief dt {
  color: var(--muted);
  font: 600 0.75rem/1.9 var(--f-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.draft-brief dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 479.98px) {
  .draft-brief > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

.draft-brief .proof-source {
  margin-top: 2px;
}

.draft-excerpt {
  margin: 0 0 16px;
  padding-left: 18px;
  border-left: 3px solid var(--forest);
  font-size: 1.0625rem;
}

.draft-excerpt p:last-child {
  margin-bottom: 0;
}

.draft-gap {
  color: var(--muted);
}

.draft-more {
  margin: 0;
  font-weight: 600;
}

/* The routine: numbered steps in a row */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px;
  margin: 28px 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  padding-top: 14px;
  border-top: 3px solid var(--forest);
  font-size: 1rem;
  counter-increment: step;
}

.steps > li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font: 600 0.75rem/1.6 var(--f-mono);
  letter-spacing: 0.09em;
}

.steps strong {
  display: block;
}

/* How it works: the moon stamps the explanation */

.moon {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  image-rendering: pixelated;
}

.how-intro details ol {
  padding-left: 1.25em;
}

.how-intro details li + li {
  margin-top: 6px;
}

/* Pricing */

.plans {
  display: grid;
  gap: 16px;
  margin: 28px 0 24px;
}

@media (min-width: 760px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 32px);
}

.plan h3 {
  margin-bottom: 8px;
}

.plan-price {
  margin: 0 0 4px;
}

.plan-price strong {
  font-size: clamp(2.25rem, 1.9rem + 1.2vw, 2.875rem);
}

.plan-note {
  color: var(--muted);
}

.plan-list {
  margin: 0 0 24px;
  padding-left: 1.2em;
}

.plan-list li + li {
  margin-top: 6px;
}

.plan .btn-primary {
  align-self: flex-start;
  margin-top: auto;
}

.plans-note {
  max-width: 68ch;
}

/* Free version (forest panel) */

.surface-dark .plan-list li::marker {
  color: var(--mint);
}

/* Story */

.credits {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Services band (and the closing band on Services and About) */

/* Ruled off from the forest footer below it. */
.services-band,
.cta-band {
  border-bottom: 1px solid rgb(200 211 197 / 0.3);
}

.band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 40px;
  padding-block: clamp(36px, 5vw, 64px);
}

.band-inner h2 {
  margin-bottom: 0.25em;
}

.band-inner p {
  margin: 0;
  color: var(--sage);
}

@media (max-width: 759.98px) {
  .actions > a {
    flex: 1 1 auto;
  }
}

/* ---------- Services and About ---------- */

/* A sub-page opens like the home hero, with a longer headline. */
.page-hero h1 {
  max-width: 20ch;
}

.page-hero .hero-promise {
  max-width: 52ch;
}

/* Services: a grid of cards, the button pinned to the bottom of each. */

/* Columns follow the item count (4, 3, 3 and 6 cards), so a row never ends with one orphan. */
.service-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .service-grid-4,
  .service-grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .service-grid-3,
  .service-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .service-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.service {
  display: flex;
  flex-direction: column;
}

.service h3 {
  margin-bottom: 8px;
}

.service-price {
  margin: 0 0 8px;
}

.service-price strong {
  font: 700 clamp(1.75rem, 1.5rem + 0.9vw, 2.125rem)/1.1 var(--f-head);
  letter-spacing: -0.03em;
}

.service-blurb {
  margin-bottom: 20px;
  font-size: 1rem;
}

.service > .btn-primary,
.service > .btn-secondary {
  align-self: flex-start;
  margin-top: auto;
}

/* A retainer shows its monthly and its annual price, each with its own button. */
.service-tiers {
  display: grid;
  gap: 16px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.service-tiers > li {
  padding-top: 14px;
  border-top: 1px dashed var(--sage);
}

.service-tiers .service-price {
  margin-bottom: 4px;
}

.service-note {
  margin: 0 0 10px;
  color: var(--muted);
  font: 400 0.75rem/1.5 var(--f-mono);
  letter-spacing: 0.02em;
}

.service-tiers .btn-primary,
.service-tiers .btn-secondary {
  margin-top: 6px;
}

#billing details > :not(summary) {
  margin-bottom: 16px;
}

/* About: what Wizelab does, in the hero */

.about-points {
  display: grid;
  gap: 12px;
  max-width: 62ch;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.about-points li {
  padding-left: 18px;
  border-left: 3px solid var(--forest);
  font-size: 1.0625rem;
}

/* About: the logo wall. Logos in their own colors on white tiles; the wide lockups
   (EZ Fabric, Jakka.ai) take a full row on phones so they stay readable. */

.logo-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.logo-wall > li {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--sage);
  transition: border-color 150ms ease;
}

.logo-wall > li:hover {
  border-color: var(--forest);
}

/* A fixed height, so the SVG (no intrinsic width) sizes like the PNGs; contain keeps any shrunk logo undistorted. */
.logo-wall img {
  width: auto;
  max-width: 100%;
  height: 52px;
  object-fit: contain;
}

.logo-wide {
  grid-column: span 2;
}

@media (min-width: 600px) {
  .logo-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .logo-wide {
    grid-column: auto;
  }
}

/* About: selected work */

.work-grid {
  display: grid;
  gap: 16px;
  margin: 28px 0 0;
}

@media (min-width: 860px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.work-card {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 32px);
}

/* The logo, then the chip naming Wizelab's part, stacked the same way on both cards. */
.work-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.work-logo {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 48px;
  margin: 0;
}

.work-logo img {
  width: auto;
  max-width: 100%;
  height: 44px;
  object-fit: contain;
  object-position: left center;
}

/* A small mint tag: what part Wizelab built. Mint is the fill; the text is ink. */
.chip {
  display: inline-block;
  padding: 3px 8px;
  background: var(--mint);
  color: var(--ink);
  border: 1px solid var(--ink);
  font: 600 0.6875rem/1.5 var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.work-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin: 4px 0 20px;
  padding: 16px 0 0;
  border-top: 1px dashed var(--sage);
  list-style: none;
}

.work-stat b {
  display: block;
  font: 700 clamp(2.25rem, 1.9rem + 1.2vw, 2.875rem)/1 var(--f-head);
  letter-spacing: -0.04em;
}

.work-stat span {
  color: var(--muted);
  font: 600 0.75rem/1.6 var(--f-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 20px;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 4px 12px;
  background: var(--pale);
  border: 1px solid var(--sage);
  font: 600 0.75rem/1.6 var(--f-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.work-credit {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--sage);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* About: the Claude Build Day line */

.buildday-line {
  max-width: 36ch;
  margin: 0;
  padding-left: 22px;
  border-left: 6px solid var(--mint);
  font: 500 clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem)/1.25 var(--f-head);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

@media (max-width: 759.98px) {
  .cta-band .actions > a {
    flex: 1 1 auto;
  }
}

/* ---------- Free page ---------- */

/* The download form: one card, fields stacked, the button the width of the card. */
.free-card {
  padding: clamp(22px, 3vw, 32px);
}

.free-card h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
}

.field {
  margin: 0 0 20px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.field input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
  font: 400 1.0625rem/1.4 var(--f-body);
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 20px;
}

.field-check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  accent-color: var(--forest);
}

.field-check label {
  font-size: 1rem;
}

.free-card .btn-primary {
  width: 100%;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Filled by free-form.js (or hidden when empty): a short, plain message with a heavy rule. */
.form-error {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-left: 6px solid var(--forest);
  background: var(--pale);
  font-weight: 600;
}

.form-error:empty {
  display: none;
}

.form-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.free-done h3 {
  margin-bottom: 12px;
}

/* Install steps: the example line sits under them, then the note. */
#install .terminal {
  max-width: 62ch;
}

/* ---------- Legal pages (license, privacy, terms) ---------- */

/* One reading column. The license fills it from Markdown, the other two are written by hand. */
.legal-doc h1 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  letter-spacing: -0.035em;
}

.legal-doc h2 {
  margin-top: 2em;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
}

.legal-doc li + li {
  margin-top: 0.4em;
}

/* The first line of each document is the draft notice. */
.legal-doc > p:first-child {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 24px;
  padding: 10px 14px;
  border: 1px solid var(--sage);
  border-left: 6px solid var(--forest);
  background: var(--pale);
  font: 600 0.8125rem/1.5 var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Motion ---------- */

@keyframes ticker-scroll {
  to {
    transform: translateX(-50%);
  }
}

@keyframes terminal-type {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* ticker.js has doubled the brands, so sliding by half loops seamlessly. */
  .js .ticker.is-moving .ticker-track {
    flex-wrap: nowrap;
    width: max-content;
    animation: ticker-scroll var(--ticker-duration, 40s) linear infinite;
  }

  .js .ticker.is-moving .ticker-viewport {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.5em, #000 calc(100% - 1.5em), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 1.5em, #000 calc(100% - 1.5em), transparent);
  }

  .js .ticker.is-paused .ticker-track {
    animation-play-state: paused;
  }

  /* terminal.js arms a terminal (lines wait) and starts typing once it scrolls into view. */
  .js .terminal.is-armed .terminal-line {
    opacity: 0;
  }

  .js .terminal.is-typing .terminal-line {
    animation: terminal-type var(--type-duration, 600ms) steps(var(--type-steps, 20), end) var(--type-delay, 0ms) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
