/* Chicago Piano Works: site styles.
   Hand-ported from the legacy Tailwind build (legacy/style/tailwind.css and the
   utility classes in legacy/src/*.rs). Breakpoints match Tailwind:
   sm 640px, md 768px, lg 1024px. */

/* ---- Fonts (self-hosted variable woff2, preloaded in the layout) ---- */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/playfair-display-var.woff2") format("woff2");
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/open-sans-var.woff2") format("woff2");
}

/* ---- Tokens: deep navy "ink", copper "brass", warm "cream" ---- */
:root {
  --ink: #243b50;
  --ink-soft: #4a5a68;
  --cream: #fbfaf7;
  --cream-deep: #f1ece4;
  --brass: #cc8a65;
  --brass-deep: #a8624a;
  --line: #e4ddd2;
  --white-60: rgb(255 255 255 / 0.6);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Open Sans", ui-sans-serif, system-ui, sans-serif;
  --radius: 1rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
input, textarea, button { font: inherit; color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.25rem; }
@media (min-width: 640px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }
}
main { flex: 1; }

/* ---- Layout primitives ---- */
.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 640px) { .container { padding-inline: 2rem; } }

.section { padding-block: 5rem; }
.section-sm { padding-block: 4rem; }
.section-lg { padding-block: 6rem; }
@media (min-width: 640px) {
  .section { padding-block: 6rem; }
  .section-sm { padding-block: 5rem; }
  .section-lg { padding-block: 8rem; }
}
.section-tint { background: var(--cream-deep); }

.grid { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
.container.grid { margin-top: 0; }
@media (min-width: 640px) { .grid-3:not(.grid-md) { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3.grid-md { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) { .grid-3:not(.grid-md), .grid-3.grid-md { grid-template-columns: repeat(3, 1fr); } }
.stack > * + * { margin-top: 1.5rem; }

.split { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 1024px) { .split { grid-template-columns: 1fr 1fr; } }

/* ---- Type helpers ---- */
.eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--brass-deep);
}
.eyebrow + h1, .eyebrow + h2 { margin-top: 0.75rem; }
.lede { margin-top: 1rem; max-width: 42rem; font-size: 1.125rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.875rem; }
.body { margin-top: 1.25rem; line-height: 1.625; }
.center { text-align: center; }
.link { display: inline-block; font-size: 0.875rem; font-weight: 500; color: var(--brass-deep); }
.link:hover { text-decoration: underline; }
.price { margin-top: 1rem; font-size: 0.875rem; font-weight: 600; color: var(--brass-deep); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-ink:hover { background: var(--ink-soft); }
.btn-brass { background: var(--brass); color: var(--ink); }
.btn-brass:hover { background: var(--brass-deep); color: var(--cream); }
.btn-ghost { border-color: rgb(251 250 247 / 0.3); color: var(--cream); }
.btn-ghost:hover { background: rgb(251 250 247 / 0.1); }

/* ---- Cards ---- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white-60);
  padding: 1.5rem;
}
.card-hover { transition: box-shadow 0.15s; }
.card-hover:hover { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.card h3 { margin-top: 1rem; }
.card h3 + p { margin-top: 0.5rem; line-height: 1.625; }
.card-title { font-size: 1rem; }
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: var(--cream-deep);
  color: var(--brass-deep);
}
.icon-tile-lg { width: 3.5rem; height: 3.5rem; flex-shrink: 0; }

.photo { position: relative; overflow: hidden; border-radius: var(--radius); display: block; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-4x3 { aspect-ratio: 4 / 3; }
.photo-3x4 { aspect-ratio: 3 / 4; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgb(228 221 210 / 0.8);
  background: rgb(251 250 247 / 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.header-bar { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.brand img { height: 2.25rem; width: auto; }

.nav-desktop { display: none; align-items: center; gap: 1.75rem; }
.nav-desktop a:not(.btn) {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.15s;
}
.nav-desktop a:not(.btn):hover,
.nav-desktop a[aria-current="page"] { color: var(--brass-deep); }

.nav-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile .nav-close,
.nav-mobile[open] .nav-open { display: none; }
.nav-mobile[open] .nav-close { display: block; }
.nav-mobile-panel {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.nav-mobile-panel .container { display: flex; flex-direction: column; padding-block: 0.75rem; }
.nav-mobile-panel a { padding-block: 0.5rem; font-weight: 500; color: var(--ink-soft); }
.nav-mobile-panel a:hover,
.nav-mobile-panel a[aria-current="page"],
.nav-mobile-panel .nav-call { color: var(--brass-deep); }

@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .nav-mobile { display: none; }
}

/* ---- Page header (interior pages) ---- */
.page-header { border-bottom: 1px solid var(--line); background: var(--cream-deep); }
.page-header .container { padding-block: 4rem; }
@media (min-width: 640px) { .page-header .container { padding-block: 5rem; } }

/* ---- Home: hero ---- */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--cream); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.25; }
.hero-inner { position: relative; padding-block: 6rem; }
.hero .eyebrow { color: var(--brass); }
.hero h1 { margin-top: 1rem; max-width: 48rem; color: inherit; line-height: 1.25; }
.hero-sub { margin-top: 1.5rem; max-width: 36rem; font-size: 1.125rem; color: rgb(251 250 247 / 0.8); }
.hero-actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 1rem; }
@media (min-width: 640px) { .hero-inner { padding-block: 8rem; } }
@media (min-width: 1024px) { .hero h1 { font-size: 3.75rem; } }

/* Staggered entrance; each element sets --delay inline. */
.slide-in { animation: slide-in-left 0.75s var(--ease-out) both; animation-delay: var(--delay, 0s); }
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-2.25rem); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- Home: sections ---- */
.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.section-head .muted { margin-top: 0.75rem; max-width: 36rem; }
@media (min-width: 640px) { .section-head { flex-direction: row; align-items: flex-end; } }
.split .link { margin-top: 1.5rem; }

.cta-band { background: var(--ink); color: var(--cream); padding-block: 4rem; }
.cta-band h2 { color: inherit; font-size: 1.5rem; }
.cta-band p { margin-top: 0.5rem; color: rgb(251 250 247 / 0.8); }
.cta-band .btn { flex-shrink: 0; padding-inline: 1.75rem; }
.cta-band .btn:hover { background: var(--cream); color: var(--ink); }
.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  text-align: center;
}
@media (min-width: 640px) {
  .cta-band h2 { font-size: 1.875rem; }
  .cta-inner { flex-direction: row; text-align: left; }
}

/* ---- Testimonials ---- */
.stars { display: flex; gap: 0.125rem; color: var(--brass); }
.testimonial blockquote { margin-top: 1rem; color: var(--ink-soft); }
.testimonial figcaption { margin-top: 1rem; font-size: 0.875rem; font-weight: 600; }
.testimonial figcaption span { font-weight: 400; color: var(--ink-soft); }
.testimonial-lg { padding: 1.75rem; }
.testimonial-lg blockquote { font-size: 1.125rem; line-height: 1.625; }
.testimonial-lg figcaption { margin-top: 1.25rem; }

/* ---- Services page ---- */
.service-row { display: flex; flex-direction: column; gap: 1.25rem; }
.service-row > div { flex: 1; }
.service-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.service-title h2 { font-size: 1.5rem; }
.service-title .price { margin-top: 0; }
.service-row .body { margin-top: 0.75rem; }
@media (min-width: 640px) {
  .service-row { flex-direction: row; align-items: flex-start; padding: 2rem; }
}
.cta-center { padding-block: 3.5rem; }
.cta-center .container { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.cta-center h2 { font-size: 1.5rem; }
.cta-center p { max-width: 36rem; }

/* ---- About page ---- */
.about-grid { display: grid; gap: 3rem; align-items: start; }
@media (min-width: 1024px) {
  .about-grid { grid-template-columns: 2fr 3fr; }
}
.lead-body { font-size: 1.125rem; line-height: 1.625; }
.facts { margin-top: 2.5rem; display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts .card { border-radius: 0.75rem; padding: 1.25rem; }
.facts dt { font-size: 0.875rem; font-weight: 600; color: var(--brass-deep); }
.facts dd { margin-top: 0.25rem; }
.facts dd + dd { margin-top: 0; }
.about-grid .btn { margin-top: 2rem; }

/* ---- Gallery ---- */
.gallery { gap: 1.25rem; margin-top: 0; }
.gallery-item { padding: 0; overflow: hidden; }
.gallery-item .photo { border-radius: 0; cursor: zoom-in; }
.gallery-item img { transition: transform 0.5s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item figcaption { padding: 1rem; }
.gallery-title { font-weight: 600; }
.gallery-title + p { margin-top: 0.25rem; }

/* ---- Piano Care ---- */
.care-sections > * + * { border-top: 1px solid var(--line); }
.section-care { padding-block: 3rem; }
@media (min-width: 640px) { .section-care { padding-block: 4rem; } }
.care-block { max-width: 48rem; }
.care-block h2 { font-size: 1.5rem; }
.care-block .eyebrow + h2 { margin-top: 0.5rem; }
.care-fun-fact, .care-tip { max-width: none; border-radius: var(--radius); padding: 1.5rem; }
.care-fun-fact { border: 1px solid rgb(204 138 101 / 0.4); background: rgb(204 138 101 / 0.1); }
.care-tip { border: 1px solid var(--line); background: var(--cream-deep); }
.care-fun-fact > *, .care-tip > * { max-width: 48rem; }
@media (min-width: 640px) {
  .care-block h2 { font-size: 1.875rem; }
  .care-fun-fact, .care-tip { padding: 2.5rem; }
}

/* Rendered Markdown (ported from .prose-cpw). */
.prose { margin-top: 1rem; color: var(--ink-soft); line-height: 1.7; }
.prose > * + * { margin-top: 1rem; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.75rem; line-height: 1.25; }
.prose h1 { font-size: 1.75rem; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.2rem; }
.prose a { color: var(--brass-deep); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--brass); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { list-style: disc; padding-left: 1.5rem; }
.prose ol { list-style: decimal; padding-left: 1.5rem; }
.prose li { margin-top: 0.4rem; }
.prose blockquote { border-left: 3px solid var(--brass); padding-left: 1rem; color: var(--ink); font-style: italic; }
.prose code { background: var(--cream-deep); padding: 0.1rem 0.35rem; border-radius: 0.35rem; font-size: 0.9em; }
.prose pre { background: var(--ink); color: var(--cream); padding: 1rem; border-radius: 0.75rem; overflow-x: auto; }
.prose pre code { background: transparent; padding: 0; color: inherit; }
.prose img { border-radius: 0.75rem; margin-top: 1rem; }
.prose hr { border: none; border-top: 1px solid var(--line); margin-top: 1.5rem; }

/* ---- Contact ---- */
.contact-grid { display: grid; gap: 3rem; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 2fr 1fr; } }
.contact-form > * + * { margin-top: 1.25rem; }
.form-grid { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field label { display: block; margin-bottom: 0.375rem; font-size: 0.875rem; font-weight: 500; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus { border-color: var(--brass); }
.contact-form .btn { padding-inline: 1.75rem; }
.notice-sent {
  align-self: start;
  border-color: rgb(204 138 101 / 0.4);
  background: var(--cream-deep);
  padding: 2rem;
  text-align: center;
}
.notice-title { font-size: 1.125rem; font-weight: 600; }
.notice-title + p { margin-top: 0.5rem; }
.notice-error {
  border: 1px solid #fca5a5;
  border-radius: 0.5rem;
  background: #fef2f2;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #991b1b;
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-list { margin-top: 1rem; color: var(--ink-soft); }
.contact-list li + li { margin-top: 0.75rem; }
.contact-list span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brass-deep);
}
.contact-list a:hover { color: var(--brass-deep); }

/* ---- 404 ---- */
.section-lg .lede + .btn { margin-top: 2rem; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); background: var(--cream-deep); }
.footer-grid { display: grid; gap: 2rem; padding-block: 2.25rem; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-about { grid-column: span 2; }
}
.footer-about p { font-size: 0.875rem; color: var(--ink-soft); }
.footer-about p + p { margin-top: 0.75rem; }
.footer-about .footer-name + p { margin-top: 0.5rem; max-width: 24rem; }
.footer-about .footer-name { font-family: var(--serif); font-size: 1.125rem; font-weight: 600; color: var(--ink); }
.socials { margin-top: 1rem; display: flex; gap: 0.75rem; }
.socials a {
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--white-60);
  padding: 0.5rem;
  color: var(--ink-soft);
  transition: color 0.15s, border-color 0.15s;
}
.socials a:hover { border-color: var(--brass); color: var(--brass-deep); }
.footer-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brass-deep);
}
.site-footer ul { margin-top: 0.75rem; font-size: 0.875rem; color: var(--ink-soft); }
.site-footer li + li { margin-top: 0.375rem; }
.site-footer ul a:hover, .footer-bottom a:hover { color: var(--brass-deep); }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 1rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
@media (min-width: 640px) { .footer-bottom .container { flex-direction: row; } }

/* ---- Cross-document view transitions ----
   Plain multi-page navigation; supporting browsers animate between pages,
   others just navigate. The header and footer are named so they are matched
   across pages and stay put; only the content area cross-fades, briefly. */
@view-transition { navigation: auto; }

.site-header { view-transition-name: site-header; }
.site-footer { view-transition-name: site-footer; }
main { view-transition-name: content; }

::view-transition-old(content),
::view-transition-new(content) {
  animation-duration: 0.18s;
  animation-timing-function: var(--ease-out);
}

/* No animation for the chrome. The header's translucent backdrop blur is
   baked into each snapshot, so cross-fading old into new would flash;
   showing only the new snapshot avoids that. */
::view-transition-group(site-header),
::view-transition-group(site-footer),
::view-transition-new(site-header),
::view-transition-new(site-footer) {
  animation: none;
}
::view-transition-old(site-header),
::view-transition-old(site-footer) {
  display: none;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide-in { animation: none; }
  .gallery-item img { transition: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ---- Piano Care section photos (wide above the text, or beside it) ---- */
.care-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); object-fit: cover; }
.care-photo-wide .care-img { margin-bottom: 2rem; }
.care-photo-wide .care-text { max-width: 48rem; }
@media (min-width: 1024px) {
  .care-photo-left, .care-photo-right {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
  }
  .care-photo-right .care-img { order: 2; }
}
@media (max-width: 1023px) {
  .care-photo-left .care-img, .care-photo-right .care-img { margin-bottom: 2rem; }
}

/* ---- Gallery lightbox (static/js/lightbox.js) ---- */
html.lb-open { overflow: hidden; }
.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(36 59 80 / 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--cream);
}
.lightbox[open] { display: flex; flex-direction: column; animation: lb-in 0.2s ease-out; }
.lightbox::backdrop { background: transparent; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

.lb-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; color: rgb(251 250 247 / 0.8); }
.lb-count { font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.lb-btn {
  border: 0;
  border-radius: 9999px;
  background: none;
  padding: 0.5rem;
  color: rgb(251 250 247 / 0.85);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.lb-btn:hover { background: rgb(251 250 247 / 0.12); color: var(--cream); }
.lb-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* The image is only as big as the photo, so the dark area around it is
   backdrop: clicking there closes the viewer. */
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 0.5rem; }
@media (min-width: 640px) { .lb-stage { padding: 0 4.5rem; } }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgb(36 59 80 / 0.6); padding: 0.75rem; }
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }
@media (min-width: 640px) { .lb-prev { left: 1rem; } .lb-next { right: 1rem; } }

.lb-caption { padding: 1rem 1.5rem 1.25rem; text-align: center; }
.lb-title { font-weight: 500; }
.lb-text { margin-top: 0.125rem; font-size: 0.875rem; color: rgb(251 250 247 / 0.7); }

@media (prefers-reduced-motion: reduce) {
  .lightbox[open] { animation: none; }
}
