:root {
  color-scheme: light dark;

  /* Brand palette (Sources/SnimachCore/Document/Brand.swift): paper, ink and
     the orange diagonal from the logo, one light-dark() per token. */
  --background: light-dark(#f7f5f1, #161514);
  --surface: light-dark(#ffffff, #1f1e1c);
  --surface-raised: light-dark(#edeae4, #2a2826);
  --hairline: light-dark(#1a1a1a14, #edeae41f);
  --hairline-strong: light-dark(#1a1a1a24, #edeae433);
  --text-primary: light-dark(#1a1a1a, #edeae4);
  --text-dim: light-dark(#5c5850, #b5b0a7);
  --text-faint: light-dark(#706b63, #8f8a81);
  --accent: #e8502a;
  --accent-hover: light-dark(#d1451f, #f0603b);
  --on-accent: #ffffff;
  --link: light-dark(#c2401c, #f07a58);
  --nav-bg: light-dark(#f7f5f1cc, #161514cc);
  --shadow-logo: light-dark(#1a1a1a1f, #00000080);
  --shadow-shot: light-dark(#1a1a1a1a, #00000099);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-pill: 980px;
  --page-width: 1040px;
  --measure: 692px;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-block: 12px;
  padding-inline: 24px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-logo {
  border-radius: 7px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}

.nav-links a {
  color: var(--text-dim);
}

.hero {
  text-align: center;
  padding-block: clamp(64px, 12vw, 128px) clamp(32px, 6vw, 56px);
  padding-inline: 24px;
}

.hero-logo {
  width: 88px;
  height: 88px;
  margin-inline: auto;
  margin-block-end: 28px;
  border-radius: 20px;
  box-shadow: 0 2px 8px var(--shadow-logo), 0 16px 40px var(--shadow-logo);
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

.tagline {
  margin-block-start: 18px;
  margin-inline: auto;
  max-width: 30ch;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--text-dim);
  letter-spacing: -0.01em;
}

.subtitle {
  margin-block-start: 14px;
  margin-inline: auto;
  max-width: 48ch;
  font-size: 17px;
  color: var(--text-faint);
}

.actions {
  margin-block-start: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-block: 14px;
  padding-inline: 26px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.button .icon {
  flex: none;
}

.install {
  margin-block-start: 18px;
  font-size: 14px;
  color: var(--text-faint);
}

.install code {
  padding-block: 5px;
  padding-inline: 10px;
  border-radius: 8px;
  background: var(--surface-raised);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  user-select: all;
}

.meta {
  margin-block-start: 16px;
  font-size: 13px;
  color: var(--text-faint);
}

.shot {
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: 24px;
  padding-block-end: clamp(48px, 8vw, 72px);
}

.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px var(--shadow-shot);
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: 24px;
  padding-block-end: clamp(48px, 8vw, 72px);
}

.bento article {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding-block: 24px;
  padding-inline: 26px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.bento .tile-wide {
  grid-column: span 2;
}

.bento h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bento p {
  margin: 0;
  min-width: 0;
  width: 100%;
  overflow-wrap: anywhere;
  font-size: 14.5px;
  color: var(--text-dim);
  text-wrap: pretty;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  margin-block-start: auto;
  padding: 0;
  list-style: none;
}

.chips li {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding-block: 5px;
  padding-inline: 11px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
}

@media (max-width: 880px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento article:nth-child(4),
  .bento article:nth-child(5) {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr;
  }

  .bento .tile-wide {
    grid-column: auto;
  }

  .bento article:nth-child(4),
  .bento article:nth-child(5) {
    grid-column: auto;
  }
}

.built-with {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 24px;
  padding-block-end: clamp(72px, 12vw, 120px);
  text-align: center;
  font-size: 14px;
  color: var(--text-faint);
}

.page-head {
  max-width: var(--measure);
  margin-inline: auto;
  padding-block: clamp(56px, 9vw, 96px) 8px;
  padding-inline: 24px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.page-head p {
  margin-block-start: 12px;
  font-size: 19px;
  color: var(--text-faint);
}

.empty {
  max-width: var(--measure);
  margin-inline: auto;
  margin-block: 32px;
  padding-inline: 24px;
  color: var(--text-faint);
}

.releases {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: var(--measure);
  margin-inline: auto;
  padding-block: clamp(24px, 4vw, 40px) 120px;
  padding-inline: 24px;
}

.release {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding-block: 26px 24px;
  padding-inline: 30px;
  background: var(--surface);
}

.release-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.release-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.badge {
  padding-block: 3px;
  padding-inline: 9px;
  border-radius: var(--radius-pill);
  background: #e8502a26;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.release-head time {
  font-size: 14px;
  color: var(--text-faint);
}

.release-notes {
  margin-block-start: 16px;
  font-size: 15.5px;
  color: var(--text-dim);
}

.release-notes > :first-child {
  margin-block-start: 0;
}

.release-notes > :last-child {
  margin-block-end: 0;
}

.release-notes :is(h2, h3) {
  margin-block: 20px 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.release-notes p {
  margin-block: 10px;
}

.release-notes ul {
  margin-block: 10px;
  padding-inline-start: 22px;
}

.release-notes li {
  margin-block: 5px;
}

.release-notes strong {
  color: var(--text-primary);
}

.release-notes code {
  padding-block: 2px;
  padding-inline: 6px;
  border-radius: 6px;
  background: var(--surface-raised);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.release-notes pre {
  padding-block: 14px;
  padding-inline: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  overflow: auto;
}

.release-notes pre code {
  padding: 0;
  background: none;
}

.release-notes hr {
  margin-block: 18px;
  border: none;
  border-top: 1px solid var(--hairline);
}

.release-download {
  margin-block: 18px 0;
  font-size: 15px;
  font-weight: 500;
}

.footer {
  padding-block: 40px 56px;
  padding-inline: 24px;
  border-top: 1px solid var(--hairline);
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.footer p {
  margin-block: 6px;
}

.footer a {
  color: var(--text-faint);
}

@media (hover: hover) {
  a:hover {
    text-decoration: underline;
  }

  .nav-brand:hover {
    text-decoration: none;
  }

  .nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
  }

  .button:hover {
    background: var(--accent-hover);
    text-decoration: none;
  }

  .button:active {
    transform: scale(0.96);
  }

  .footer a:hover {
    color: var(--text-primary);
    text-decoration: none;
  }
}

@media (max-width: 520px) {
  .release {
    padding-block: 22px 20px;
    padding-inline: 20px;
  }

  .nav-inner {
    padding-inline: 18px;
  }

  .nav-links {
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

/* ---- Illustrations. Rest states: every one reads with no motion at all. ---- */

.viz {
  display: block;
  width: 100%;
  height: auto;
  margin-block-end: 12px;
  overflow: visible;
}

.viz .line {
  fill: var(--text-faint);
  opacity: 0.35;
}

.viz .shot,
.viz .screen {
  fill: var(--surface-raised);
}

.viz-clipboard .screen,
.viz-annotate .shot,
.viz-backdrop .shot,
.viz-inspect .shot {
  stroke: var(--hairline-strong);
  stroke-width: 1;
}

/* Capture: three dimmed screens, the captured region lights up on hover. */
.viz-capture .dim {
  fill: var(--shadow-logo);
  stroke: var(--hairline-strong);
  stroke-width: 1;
}

.viz-capture .cutout {
  fill: var(--surface-raised);
  opacity: 0;
}

.viz-capture .target {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1;
}

.viz-capture .titlebar {
  stroke: var(--text-faint);
  stroke-width: 1;
}

.viz-capture .dot {
  fill: var(--text-faint);
}

.viz-capture .window-shadow {
  fill: var(--shadow-logo);
}

.viz-capture .brackets {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(1.15);
}

.viz-capture .brackets path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: miter;
}

.viz-capture .label {
  fill: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 8px;
  text-anchor: middle;
  opacity: 0;
}

/* Clipboard: the glyph already holds the shot, the preview card arrives second. */
.viz-clipboard .board,
.viz-clipboard .tab,
.viz-clipboard .check {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viz-clipboard .tab {
  fill: var(--surface);
}

.viz-clipboard .held {
  fill: var(--surface-raised);
  stroke: var(--hairline-strong);
  stroke-width: 1;
}

.viz-clipboard .card {
  opacity: 0.35;
  transform-box: fill-box;
  transform-origin: center;
  transform: translateX(14px);
}

.viz-clipboard .card-body {
  fill: var(--surface);
  stroke: var(--hairline-strong);
  stroke-width: 1;
}

.viz-clipboard .thumb {
  fill: var(--surface-raised);
}

.viz-clipboard .card-actions {
  fill: var(--text-faint);
  opacity: 0;
}

/* Annotate: four tools placed in ink, committing to the accent in tool order. */
.viz-annotate .arrow,
.viz-annotate .badge,
.viz-annotate .frame,
.viz-annotate .pixels {
  opacity: 0.55;
}

.viz-annotate .arrow-shaft,
.viz-annotate .arrow-head {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 2;
  stroke-linecap: round;
}

.viz-annotate .arrow-head {
  stroke-linejoin: miter;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.92);
}

.viz-annotate .badge {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.92);
}

.viz-annotate .badge circle {
  fill: var(--text-dim);
}

.viz-annotate .badge text {
  fill: var(--surface);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
}

.viz-annotate .frame {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.viz-annotate .pixels {
  fill: var(--text-dim);
}

.viz-annotate .cell-a {
  opacity: 0.45;
}

.viz-annotate .cell-b {
  opacity: 0.85;
}

/* Backdrop: a thin ink gradient peeks around the shot, K grows it to full padding. */
.viz-backdrop .stop-start {
  stop-color: var(--text-faint);
}

.viz-backdrop .stop-end {
  stop-color: var(--text-primary);
}

.viz-backdrop .backdrop {
  fill: url(#snimach-viz-backdrop-gradient);
  opacity: 0.5;
  transform-box: fill-box;
  transform-origin: center;
}

.viz-backdrop .shadow {
  fill: var(--shadow-shot);
  opacity: 0;
}

.viz-backdrop .shot {
  rx: 4px;
}

/* Inspect: a loupe over the shot, a readout pill that fills with the picked hex. */
.viz-inspect .loupe {
  transform-box: fill-box;
  transform-origin: center;
}

.viz-inspect .grid rect {
  fill: var(--text-faint);
}

.viz-inspect .grid .g1 {
  opacity: 0.15;
}

.viz-inspect .grid .g2 {
  opacity: 0.3;
}

.viz-inspect .grid .g3 {
  opacity: 0.45;
}

.viz-inspect .pixel {
  fill: transparent;
  stroke: var(--text-primary);
  stroke-width: 1.5;
}

.viz-inspect .ring {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.5;
}

.viz-inspect .pill {
  fill: var(--surface);
  stroke: var(--hairline-strong);
  stroke-width: 1;
}

.viz-inspect .swatch {
  fill: transparent;
  stroke: var(--hairline-strong);
  stroke-width: 1;
}

.viz-inspect .hex {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  dominant-baseline: central;
}

.viz-inspect .hex-rest {
  fill: var(--text-faint);
}

.viz-inspect .hex-live {
  fill: var(--text-primary);
  opacity: 0;
}

.viz-inspect .copy-back,
.viz-inspect .copy-front {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.5;
}

.viz-inspect .copy-back {
  opacity: 0.5;
}

.viz-inspect .copy-front {
  fill: var(--surface);
}

/* ---- Hover: the only trigger. Reduced-motion and touch users get the rest state. ---- */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .viz-capture .cutout,
  .viz-capture .brackets,
  .viz-capture .label,
  .viz-clipboard .check,
  .viz-clipboard .card,
  .viz-clipboard .card-actions,
  .viz-annotate .arrow,
  .viz-annotate .arrow-shaft,
  .viz-annotate .arrow-head,
  .viz-annotate .badge,
  .viz-annotate .badge circle,
  .viz-annotate .frame,
  .viz-annotate .pixels,
  .viz-backdrop .stop-end,
  .viz-backdrop .backdrop,
  .viz-backdrop .shadow,
  .viz-backdrop .shot,
  .viz-inspect .loupe,
  .viz-inspect .pixel,
  .viz-inspect .swatch,
  .viz-inspect .hex,
  .viz-inspect .copy-back,
  .viz-inspect .copy-front {
    transition-duration: 300ms;
    transition-timing-function: var(--ease-out);
  }

  .viz-capture .cutout,
  .viz-capture .label,
  .viz-clipboard .card-actions,
  .viz-backdrop .shadow,
  .viz-inspect .hex {
    transition-property: opacity;
  }

  .viz-capture .brackets,
  .viz-clipboard .card {
    transition-property: opacity, transform;
  }

  .viz-clipboard .check {
    transition-property: stroke;
    transition-duration: 150ms;
  }

  .viz-annotate .arrow,
  .viz-annotate .frame,
  .viz-annotate .pixels {
    transition-property: opacity, fill, stroke;
  }

  .viz-annotate .arrow-shaft {
    transition-property: stroke;
  }

  .viz-annotate .arrow-head {
    transition-property: stroke, transform;
  }

  .viz-annotate .badge {
    transition-property: opacity, transform;
  }

  .viz-annotate .badge circle {
    transition-property: fill;
  }

  .viz-backdrop .stop-end {
    transition-property: stop-color;
  }

  .viz-backdrop .backdrop {
    transition-property: opacity, transform;
  }

  .viz-backdrop .shot {
    transition-property: rx;
  }

  .viz-inspect .loupe {
    transition-property: transform;
  }

  .viz-inspect .pixel,
  .viz-inspect .swatch {
    transition-property: fill;
  }

  .viz-inspect .copy-back,
  .viz-inspect .copy-front {
    transition-property: stroke;
  }

  /* Capture */
  .bento article:hover .viz-capture .cutout {
    opacity: 1;
  }

  .bento article:hover .viz-capture .brackets {
    opacity: 1;
    transform: scale(1);
  }

  .bento article:hover .viz-capture .label {
    opacity: 0.9;
  }

  .bento article:hover .viz-capture .panel-window :is(.cutout, .brackets, .label) {
    transition-delay: 70ms;
  }

  .bento article:hover .viz-capture .panel-screen :is(.cutout, .brackets, .label) {
    transition-delay: 140ms;
  }

  /* Clipboard */
  .bento article:hover .viz-clipboard .check {
    stroke: var(--accent);
  }

  .bento article:hover .viz-clipboard .card {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 60ms;
  }

  .bento article:hover .viz-clipboard .card-actions {
    opacity: 0.7;
    transition-delay: 120ms;
  }

  /* Annotate */
  .bento article:hover .viz-annotate :is(.arrow, .badge, .frame, .pixels) {
    opacity: 1;
  }

  .bento article:hover .viz-annotate :is(.arrow-shaft, .arrow-head, .frame) {
    stroke: var(--accent);
  }

  .bento article:hover .viz-annotate :is(.badge circle, .pixels) {
    fill: var(--accent);
  }

  .bento article:hover .viz-annotate :is(.arrow-head, .badge) {
    transform: scale(1);
  }

  .bento article:hover .viz-annotate :is(.badge, .badge circle) {
    transition-delay: 50ms;
  }

  .bento article:hover .viz-annotate .frame {
    transition-delay: 100ms;
  }

  .bento article:hover .viz-annotate .pixels {
    transition-delay: 150ms;
  }

  /* Backdrop */
  .bento article:hover .viz-backdrop .backdrop {
    opacity: 1;
    transform: scale(1.5, 1.333);
  }

  .bento article:hover .viz-backdrop .stop-end {
    stop-color: color-mix(in oklab, var(--accent) 35%, var(--text-primary));
  }

  .bento article:hover .viz-backdrop .shadow {
    opacity: 0.6;
  }

  .bento article:hover .viz-backdrop .shot {
    rx: 8px;
  }

  /* Inspect */
  .bento article:hover .viz-inspect .loupe {
    transform: translate(10px, -4px);
  }

  .bento article:hover .viz-inspect :is(.pixel, .swatch) {
    fill: var(--accent);
  }

  .bento article:hover .viz-inspect .hex-rest {
    opacity: 0;
  }

  .bento article:hover .viz-inspect .hex-live {
    opacity: 1;
  }

  .bento article:hover .viz-inspect :is(.swatch, .hex) {
    transition-delay: 80ms;
  }

  .bento article:hover .viz-inspect :is(.copy-back, .copy-front) {
    stroke: var(--accent);
    transition-delay: 140ms;
  }
}
