/* DeskCat site: a white page, everything in the middle, lots of room for the cat. */
:root {
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #8a8780;
  --soft: #f4f3ef;
  --line: #ebe9e3;
  --box: #f5e05c;
  --font: "Onest", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }

/* ---- header ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px max(16px, 4vw);
}
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; }
.logo img { width: 34px; height: 34px; display: block; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a, .nav button {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--fg); text-decoration: none;
  background: none; border: 0; padding: 8px 12px; border-radius: 999px; cursor: pointer;
  transition: background-color 160ms var(--ease);
}
.nav a:hover, .nav button:hover { background: var(--soft); }
.nav a[aria-current="page"] { background: var(--soft); }

/* ---- home ---- */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 max(16px, 4vw) 20px; }
.intro { text-align: center; margin-top: clamp(8px, 4vh, 48px); }
.intro h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; margin: 0; letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }
.intro p { margin: 10px auto 0; color: var(--muted); font-size: 16px; text-wrap: balance; }

.stage {
  position: relative; width: 100%; max-width: 1100px; height: clamp(300px, 52vh, 560px);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: default;
}
.stage canvas { display: block; width: 100%; height: 100%; }
/* sound: speaker (mute) and a volume slider, with the other controls */
.sound {
  height: 44px; display: flex; align-items: center; gap: 2px; padding: 0 14px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
}
.sound button {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--fg); cursor: pointer; padding: 0;
  display: grid; place-items: center; transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.sound button:hover { background: var(--soft); }
.sound button:active { transform: scale(0.92); }
.sound svg { width: 20px; height: 20px; }
.sound button[aria-pressed="true"] .off, .sound button[aria-pressed="false"] .on { display: none; }
.sound button[aria-pressed="false"] { color: var(--muted); }
.sound input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 76px; height: 20px; background: transparent; cursor: pointer; margin: 0;
}
.sound input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--fg) var(--fill, 40%), var(--line) var(--fill, 40%));
}
.sound input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
.sound input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--fg); }
.sound input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--fg); border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--fg);
}
.sound input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--fg); border: 2px solid var(--bg); }
.sound input[type="range"]:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 4px; }
/* a hairline floor, fading out at both ends */
.stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent);
}

/* ---- controls under the stage ---- */
.controls {
  margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px;
}
.name {
  display: flex; align-items: center; width: 176px; height: 44px; padding: 0 5px 0 39px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); text-align: center;
}
.name:focus-within { border-color: var(--fg); }
.name input { flex: 1; min-width: 0; font: inherit; font-size: 15px; border: 0; padding: 0; background: none; color: inherit; text-align: center; }
.name input:focus { outline: none; }
.name button {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--muted);
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
.name button svg { width: 19px; height: 19px; }
.name button:hover { background: var(--soft); color: var(--fg); }
.name button:active { transform: scale(0.9); }
.name button.rolled svg { animation: roll 420ms var(--ease); }
@keyframes roll { from { transform: rotate(-200deg) scale(0.8); } }

/* coat picker: the Mac app's coat colours */
.coats { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; }
.coat {
  width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; position: relative;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); transition: transform 160ms var(--ease);
}
.coat::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--fg);
  opacity: 0; transform: scale(0.85); transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}
.coat[aria-pressed="true"]::after { opacity: 1; transform: scale(1); }
.coat:active { transform: scale(0.9); }
@media (hover: hover) { .coat:hover { transform: scale(1.1); } }

/* buttons: one height and padding everywhere, so side-by-side buttons always match */
.btn {
  font: inherit; font-size: 15px; font-weight: 600; height: 44px; padding: 0 20px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  text-decoration: none; white-space: nowrap; border: 1px solid transparent;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--fg); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-secondary { background: var(--bg); color: var(--fg); border-color: var(--line); }
.btn-secondary:hover { background: var(--soft); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn svg { width: 18px; height: 18px; }

.get { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.small { font-size: 13px; color: var(--muted); margin: 0; text-align: center; }
.small a { color: inherit; }

/* ---- footer ---- */
.foot {
  padding: 18px max(16px, 4vw) 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
  font-size: 13px; color: var(--muted); text-align: center;
}
.foot a { color: var(--muted); }

/* ---- download dialog ---- */
dialog {
  max-height: calc(100dvh - 32px); border: 0; border-radius: 20px; padding: 0; width: min(460px, calc(100vw - 32px)); color: var(--fg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}
dialog::backdrop { background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog[open] { animation: pop 220ms var(--ease); }
dialog[open]::backdrop { animation: fade 220ms var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes fade { from { opacity: 0; } }
.sheet { padding: 26px 24px 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.sheet h2 { margin: 0; font-size: 22px; letter-spacing: -0.015em; outline: none; }
.sheet p { margin: 0; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.steps li::marker { color: var(--muted); font-weight: 600; }
.note { background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.note code { background: #fff; }
pre { margin: 6px 0 0; font-size: 12.5px; overflow-x: auto; }
pre code { display: block; padding: 8px 10px; background: #fff; }
.sheet .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- about ---- */
.about { flex: 1; width: 100%; max-width: 620px; margin: 0 auto; padding: clamp(16px, 6vh, 64px) max(16px, 4vw) 40px; }
.about h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 14px; text-wrap: balance; }
.about .lede { font-size: 19px; color: #4a4843; margin: 0; }
.about h2 { font-size: 20px; margin: 48px 0 12px; letter-spacing: -0.01em; }
.about p { margin: 0 0 12px; }
.about ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.does { list-style: none; padding: 0 !important; gap: 0 !important; }
.does li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.does li:last-child { border-bottom: 0; }
.does b { font-weight: 600; }
.does span { color: #4a4843; }
.prompts { list-style: none; padding: 0 !important; margin: 0 0 14px !important; gap: 8px !important; }
.prompts li { background: var(--soft); border-radius: 12px; padding: 11px 14px; font-size: 15px; color: #3d3b36; }
.prompts li::before { content: "“"; } .prompts li::after { content: "”"; }
@media (max-width: 520px) { .does li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

@media (max-width: 600px) {
  .top { padding-top: 16px; padding-bottom: 16px; }
  .stage { height: clamp(280px, 42vh, 380px); }
  .controls { gap: 14px 16px; margin-top: 18px; }
  .name { width: 176px; }
  .coats, .sound { order: -2; }   /* colours and sound on the first row, then name and the button */
  .intro h1 { font-size: 34px; max-width: 9em; margin: 0 auto; }   /* two even lines: "A little cat / for your desk." */
  .intro p { max-width: 22em; }
  .controls::before { content: ""; order: -1; flex-basis: 100%; height: 0; }
  .get { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
