/* Hallmark · job: try (download) · shape: Workbench, the builder as the first screen · genre: playful · theme: locked (DESIGN.md) · redesign: full · hero: Counter, the live builder beside the head and the download · nav: slab, wordmark, head, language and download in one bar · footer: mast · signature: the 3D keyboard you press and hear
 * axes: posture restrained, sage signal on cream paper · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V3 · weakest: V, a table, steps and a statement are the easy reaches; the table is the README's own part-to-sound map and the steps are the real first run, so each carries a fact the builder cannot */
/* Hallmark · waive 24b · page 22px, tray 14px, chip 6px and the 6px 10px pill padding are the values DESIGN.md locks · they are the Mac app's own card and capsule metrics, so the builder feels like opening the app */
/* Hallmark · dismissed F4 · EN and VI are one segmented language switch, only the pressed half is filled */

:root {
  --color-cream: #f4ebdd;
  --color-paper: #fbf6ec;
  --color-desk: #e5d7c1;
  --color-sage: #a9c7a0;
  --color-sage-deep: #547a5c;
  --color-sage-press: #4c7054;
  --color-on-accent: #fffcf5;
  --color-ink: #4a3f35;
  --color-ink-soft: #6e6256;
  --color-wood: #8a5a3b;
  --color-rule: rgba(74, 63, 53, 0.12);
  --color-hairline: rgba(74, 63, 53, 0.08);
  --color-swatch-edge: rgba(74, 63, 53, 0.14);
  --color-status: rgba(251, 246, 236, 0.95);
  --color-shade: rgba(0, 0, 0, 0.06);

  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;

  --shadow: 0 3px 8px var(--color-shade);

  --radius-card: 22px;
  --radius-pill: 999px;

  --page: 22px;
  --tray: 14px;
  --chip: 6px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --section-gap-s: 96px;
  --section-gap: 128px;

  --container: 1440px;
  --gap-columns: var(--space-xl);
  --pad-pill: 6px 10px;
  --pad-download: 8px 14px;
  --pad-download-lg: 14px 24px;
  --pad-download-sm: 8px 12px;
  --pad-status: 6px 12px;
  --pad-lang: 3px;

  --text-display: clamp(1.25rem, 2.1vw, 1.7rem);
  --text-section: clamp(2rem, 3.4vw, 3.25rem);
  --text-statement: clamp(2.25rem, 4.6vw, 4.25rem);
  --text-title: clamp(1.125rem, 1.5vw, 1.375rem);
  --text-lead: clamp(1.0625rem, 1.4vw, 1.3125rem);
  --text-md: 16px;
  --text-sm: 14px;
  --text-label: 13px;
  --text-chip: 12px;
  --text-hint: 11px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-micro: 120ms;

  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  overflow-x: clip;
  font-synthesis: none;
}

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

:focus-visible {
  outline: 2px solid var(--color-sage-deep);
  outline-offset: 3px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-sage) var(--color-cream);
}

a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

p, li, td { text-wrap: pretty; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--page);
}

.lead {
  margin: 0;
  font-size: var(--text-lead);
  color: var(--color-ink-soft);
  line-height: 1.4;
}

/* Header: the hero's text and action share the bar with the wordmark */

.top-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--gap-columns);
  padding-block: var(--space-md) var(--space-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 1.05rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

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

h1 {
  font-size: var(--text-display);
  line-height: 1.15;
}

.hero-text .lead {
  margin-top: 2px;
  font-size: var(--text-sm);
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: var(--space-xs);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-sage-deep);
  color: var(--color-on-accent);
  font-size: var(--text-label);
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: 1px;
}

.local-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-sage);
}

.local-badge:hover { background: #4C7054; }

.tools {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.lang {
  display: flex;
  padding: var(--pad-lang);
  background: var(--color-paper);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
}

.lang button,
.download,
.chip,
.swatch,
.reset {
  font: inherit;
  cursor: pointer;
}

.lang button {
  border: 0;
  background: transparent;
  color: var(--color-ink);
  border-radius: var(--radius-pill);
  padding: var(--pad-pill);
  font-size: var(--text-chip);
  font-weight: 700;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}

.lang button:hover { background: var(--color-cream); }

.lang button[aria-pressed="true"] {
  background: var(--color-sage-deep);
  color: var(--color-on-accent);
}

.download {
  display: inline-block;
  text-decoration: none;
  background: var(--color-sage-deep);
  color: var(--color-on-accent);
  border-radius: var(--radius-pill);
  padding: var(--pad-download);
  font-size: var(--text-label);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.download:hover { background: var(--color-sage-press); }
.download:active { transform: scale(0.97); }

.download-lg {
  padding: var(--pad-download-lg);
  font-size: var(--text-md);
}

button:disabled,
[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* The builder: one keyboard on the desk, a short dock of parts over its foot */

.studio {
  padding-block: var(--space-xs) var(--page);
}

.stage-wrap {
  position: relative;
  height: calc(100svh - 104px);
  min-height: 560px;
  max-height: 920px;
  border-radius: var(--radius-card);
  overflow: hidden;
  min-width: 0;
  background: var(--color-desk);
}

#stage {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  background: var(--color-desk);
}

#stage:active { cursor: grabbing; }

#status {
  position: absolute;
  left: var(--tray);
  top: var(--tray);
  margin: 0;
  background: var(--color-status);
  color: var(--color-ink);
  border-radius: var(--radius-pill);
  padding: var(--pad-status);
  font-size: var(--text-chip);
  font-weight: 700;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.tray {
  position: absolute;
  left: 50%;
  bottom: var(--tray);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: var(--space-lg);
  width: max-content;
  max-width: calc(100% - var(--tray) * 2);
  background: var(--color-status);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: var(--space-sm) var(--tray) var(--tray);
}

.group { min-width: 0; }

.group + .group {
  padding-left: var(--space-lg);
  border-left: 1px solid var(--color-rule);
}

.label {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-label);
  font-weight: 700;
}

.theme-name {
  font-weight: 400;
  color: var(--color-ink-soft);
}

.chips, .swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--chip);
  min-width: 0;
}

.swatches { padding: var(--space-2xs); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--chip);
  border: 1px solid var(--color-hairline);
  background: var(--color-cream);
  color: var(--color-ink);
  border-radius: var(--radius-pill);
  padding: var(--pad-pill);
  min-height: 32px;
  max-width: 100%;
  min-width: 0;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.chip.dotted { padding-left: var(--space-xs); }
.chip:hover { border-color: var(--color-sage-deep); }
.chip:active { transform: scale(0.97); }

.chip[aria-pressed="true"] {
  background: var(--color-sage-deep);
  color: var(--color-on-accent);
  border-color: transparent;
}

.chip-text {
  font-size: var(--text-chip);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.stem {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--color-swatch-edge);
}

.chip[aria-pressed="true"] .stem { box-shadow: 0 0 0 2px var(--color-on-accent); }

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-swatch-edge);
  padding: 0;
  transition: transform var(--dur-micro) var(--ease-out);
}

.swatch:hover { transform: translateY(-1px); }

.swatch[aria-pressed="true"] {
  outline: 2px solid var(--color-sage-deep);
  outline-offset: 2px;
}

/* Sections below the builder */

main > section { padding-block: var(--section-gap); }

.head {
  display: grid;
  gap: var(--space-md);
  align-content: start;
}

h2 {
  font-size: var(--text-section);
  max-width: 18ch;
}

h3 {
  font-size: var(--text-title);
  letter-spacing: -0.02em;
}

/* Parts: the README's part-to-sound map as a table */

.parts-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--gap-columns);
  align-items: start;
}

.part-table {
  width: 100%;
  border-collapse: collapse;
}

.part-table th,
.part-table td {
  text-align: left;
  vertical-align: baseline;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-rule);
}

.part-table thead th {
  padding-block: 0 var(--space-sm);
  border-top: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-ink-soft);
}

.part-table tbody th {
  width: 36%;
  padding-right: var(--space-lg);
  font-size: var(--text-title);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.part-table td { font-size: var(--text-md); }

/* Steps: the real first run, on paper */

.mac { background: var(--color-paper); }

.mac .head { margin-bottom: var(--space-2xl); }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap-columns);
}

.steps li {
  counter-increment: step;
  display: grid;
  gap: var(--space-sm);
  align-content: start;
  padding-top: var(--space-lg);
  border-top: 2px solid var(--color-sage-deep);
}

.steps li::before {
  content: counter(step);
  font-size: var(--text-section);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--color-sage-deep);
  font-variant-numeric: tabular-nums;
}

.steps p { margin: 0; color: var(--color-ink-soft); }

/* Privacy: one sentence on the desk */

.privacy { background: var(--color-desk); }

.statement {
  font-size: var(--text-statement);
  max-width: 20ch;
  line-height: 1.05;
}

.privacy-lead {
  margin-top: var(--space-lg);
  max-width: 52ch;
  color: var(--color-ink);
}

.facts {
  list-style: none;
  margin: var(--space-2xl) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap-columns);
}

.facts li {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-rule);
  font-weight: 700;
}

/* Close: the download beside what the app adds */

.close-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--gap-columns);
  align-items: center;
}

.close-action {
  display: grid;
  gap: var(--space-md);
  justify-items: start;
}

.close-action p { margin: 0; }

.close-action .download-lg { margin-top: var(--space-xs); }

.fine {
  color: var(--color-ink-soft);
  font-size: var(--text-sm);
  max-width: 52ch;
}

.in-app {
  list-style: none;
  margin: 0;
  padding: var(--space-xl);
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.in-app li {
  padding-block: var(--space-md);
  font-size: var(--text-lead);
  font-weight: 700;
  line-height: 1.3;
}

.in-app li + li { border-top: 1px solid var(--color-rule); }

/* Footer: the wordmark as a mast */

footer {
  border-top: 1px solid var(--color-rule);
  padding-block: var(--space-2xl) var(--space-xl);
  color: var(--color-ink-soft);
}

.foot {
  display: grid;
  gap: var(--space-md);
}

.foot-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-lg);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--color-ink);
  text-decoration: none;
}

.foot-icon {
  width: clamp(64px, 9vw, 128px);
  height: auto;
  flex-shrink: 0;
}

.foot p { margin: 0; font-size: var(--text-sm); }

@media (max-width: 1080px) {
  .steps, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parts-grid, .close-grid { grid-template-columns: minmax(0, 1fr); gap: var(--gap-columns); }
}

@media (max-width: 860px) {
  .top-row { grid-template-columns: auto minmax(0, 1fr); }
  .tools { justify-self: end; }
  .hero-text { grid-column: 1 / -1; grid-row: 2; }
  .stage-wrap { height: auto; min-height: 0; max-height: none; overflow: visible; background: none; }
  #stage { height: 72vw; max-height: 520px; border-radius: var(--radius-card); }
  .tray {
    position: static;
    transform: none;
    width: auto;
    max-width: none;
    margin-top: var(--space-sm);
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-md);
    background: var(--color-paper);
  }
  .group + .group { padding-left: 0; border-left: 0; }
  main > section { padding-block: var(--section-gap-s); }
}

@media (max-width: 560px) {
  .steps, .facts { grid-template-columns: minmax(0, 1fr); }
  .part-table thead { display: none; }
  .part-table tr { display: grid; gap: var(--space-xs); padding-block: var(--space-md); border-top: 1px solid var(--color-rule); }
  .part-table th, .part-table td { border: 0; padding: 0; width: auto; }
  .in-app { padding: var(--space-lg); }
  .top-row { gap: var(--space-sm); }
  .local-badge { margin: var(--space-2xs) 0 0; }
  .download { padding: var(--pad-download-sm); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .download:active, .chip:active, .swatch:hover { transform: none; }
}
