/* Golden Gate Park Pianos
   Palette borrows from the pianos themselves: the yellow enclosures,
   the green "PUBLIC PIANO" sign, and the park around them. */

:root {
  --bg: #f7f2e7;
  --surface: #fffdf7;
  --surface-2: #efe8d8;
  --ink: #1d261f;
  --muted: #5d6a60;
  --line: #e2d9c6;
  --green: #1f6b3a;
  --green-ink: #ffffff;
  --yellow: #f6c624;
  --yellow-ink: #2b2300;
  --open: #1f7a43;
  --open-bg: #e2f2e6;
  --closed: #6c6f6c;
  --closed-bg: #ebe9e3;
  --error: #b3261e;
  --shadow: 0 1px 2px rgba(29, 38, 31, .06), 0 8px 24px rgba(29, 38, 31, .08);
  --radius: 18px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121713;
    --surface: #1a211c;
    --surface-2: #232b25;
    --ink: #ece7da;
    --muted: #a2ada4;
    --line: #2d3630;
    --green: #6cc28a;
    --green-ink: #0d1a11;
    --yellow: #f6c624;
    --yellow-ink: #2b2300;
    --open: #7fd39c;
    --open-bg: #1d3325;
    --closed: #a5a8a4;
    --closed-bg: #2a2e2b;
    --error: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}

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

a { color: var(--green); text-underline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .4em;
}

h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.narrow { max-width: 640px; }

/* ---------- Header ---------- */

.site-header {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.header-link {
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

.btn-primary { background: var(--yellow); color: var(--yellow-ink); }
.btn-primary:hover { filter: brightness(1.05); }

.btn-green { background: var(--green); color: var(--green-ink); }
.btn-green:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--closed-bg);
  color: var(--closed);
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.btn-block { width: 100%; }

.lede { font-size: 1.1rem; color: var(--muted); margin-bottom: 20px; }

/* ---------- Sections ---------- */

.section { padding: 28px 0; }
.section-head { margin-bottom: 20px; }
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Piano cards ---------- */

.pianos {
  display: grid;
  gap: 18px;
}

@media (min-width: 720px) {
  .pianos { grid-template-columns: 1fr 1fr; }
}

.piano {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.piano-photo {
  aspect-ratio: 2 / 1;
  background: var(--surface-2);
  overflow: hidden;
}

.piano-photo img { width: 100%; height: 100%; object-fit: cover; transition: filter .2s; }

.piano-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 20px;
  flex: 1;
}

.piano-body h3 { margin: 0; }

.piano-status { margin: 0; font-size: .98rem; }

.piano .btn { margin-top: auto; }

.piano.is-closed .piano-photo img { filter: grayscale(1) brightness(.92); }
.piano.is-closed { background: var(--surface-2); box-shadow: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill-open { background: var(--open-bg); color: var(--open); }
.pill-closed { background: var(--closed-bg); color: var(--closed); }

.skeleton {
  min-height: 320px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer { to { background-position: -150% 0; } }

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ---------- Community band ---------- */

.band {
  background: var(--green);
  color: var(--green-ink);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: grid;
  gap: 16px;
  align-items: center;
}

.band h2 { color: inherit; margin: 0; font-size: 1.4rem; }
.band .btn { justify-self: start; }

@media (min-width: 720px) {
  .band { grid-template-columns: 1fr auto; padding: 36px; }
}

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

.site-footer {
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: .9rem;
}

/* ---------- Form ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}

@media (min-width: 600px) { .card { padding: 28px; } }

.form { display: grid; gap: 26px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

legend {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 12px;
  padding: 0;
}

.field-grid { display: grid; gap: 14px; }

@media (min-width: 560px) {
  .field-grid { grid-template-columns: 1fr 1fr; }
}

.field { display: grid; gap: 6px; }

.field label { font-weight: 600; font-size: .95rem; }

.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem var(--sans);
  transition: border-color .15s, box-shadow .15s;
}

.input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent);
}

.input.is-valid { border-color: var(--open); }
.input.is-invalid { border-color: var(--error); }

.choice-list { display: grid; gap: 10px; }

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
}

.choice-text { display: grid; gap: 2px; min-width: 0; }
.choice-text strong { font-size: 1rem; }
.choice-text span { color: var(--muted); font-size: .88rem; }

.choice::after {
  content: "";
  margin-left: auto;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
}

.choice:has(input:checked) {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 7%, var(--bg));
}

.choice:has(input:checked)::after {
  border-color: var(--green);
  background: radial-gradient(circle, var(--green) 45%, transparent 50%);
}

.choice:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 2px; }

.choice:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.choice:has(input:disabled) img { filter: grayscale(1); }

.pledge {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-2);
}

.pledge-promise { font-weight: 600; }

.pledge .input {
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--surface);
}

.pledge .input::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; }

.form-error {
  color: var(--error);
  font-weight: 600;
  margin: 0;
}

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

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Code page ---------- */

.code-hero { text-align: center; padding-top: 36px; padding-bottom: 12px; }

.dials {
  display: inline-flex;
  gap: 8px;
  padding: 16px 18px;
  margin: 18px 0 8px;
  border-radius: 22px;
  background: var(--yellow);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12), var(--shadow);
}

.dial {
  display: grid;
  place-items: center;
  width: clamp(52px, 17vw, 76px);
  height: clamp(68px, 22vw, 96px);
  border-radius: 10px;
  background: linear-gradient(#fdfdfb, #dcdcd6 48%, #f5f5f1 52%, #d6d6cf);
  color: #1b1b1b;
  font: 700 clamp(2rem, 9vw, 3rem)/1 var(--sans);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .25);
}

.code-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: .95rem;
}

.thanks {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
}

.thanks img {
  width: 96px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 50%;
}

.thanks p { margin-bottom: 12px; }


.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
