/* ==========================================================================
   Christine Lucas Piano Studio (christinelucaspiano.com) — styles
   Visual language shared with theorymadefun.com: Fraunces + Nunito Sans,
   blue primary, soft cards, pill buttons, dark footer band.
   Light + dark themes (toggle in the header, same as theorymadefun.com).
   The MyMusicStaff widgets always render on white, so the sign-in dialog
   stays light in both themes.
   No frameworks.
   ========================================================================== */

:root {
  --radius: 16px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --primary: #0098ce;
  --teal: #00c8a5;
  --accent: #fbfb00;
  --on-vibrant: #08141c;

  --band-bg: #080d12;
  --band-text: rgba(233, 242, 247, 0.82);

  --bg: #f6f9fb;
  --bg-alt: #e9f2f7;
  --surface: #ffffff;
  --border: #dae5ec;
  --text: #10181d;
  --text-muted: #4c5b66;
  --heading: #0c2331;
  --link: #0072a1;
  --link-hover: #005a82;
  --focus: #006c99;
  --shadow: 0 10px 30px -12px rgba(12, 35, 48, 0.16);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0f13;
  --bg-alt: #12181d;
  --surface: #171f25;
  --border: #2b353d;
  --text: #e9f0f4;
  --text-muted: #a6b3bc;
  --heading: #f4f9fc;
  --link: #4cbfef;
  --link-hover: #79d2f5;
  --focus: #4cbfef;
  --shadow: 0 12px 34px -14px rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

/* Follow the OS preference until the visitor makes an explicit choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b0f13;
    --bg-alt: #12181d;
    --surface: #171f25;
    --border: #2b353d;
    --text: #e9f0f4;
    --text-muted: #a6b3bc;
    --heading: #f4f9fc;
    --link: #4cbfef;
    --link-hover: #79d2f5;
    --focus: #4cbfef;
    --shadow: 0 12px 34px -14px rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h3 {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 600;
}

h4 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 1.8rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

img {
  max-width: 100%;
  height: auto;
}

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

.site-footer :focus-visible {
  outline-color: var(--accent);
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--on-vibrant);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

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

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
  padding: 0.85rem 1.7rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--on-vibrant);
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--primary) 60%, transparent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--primary) 88%, #ffffff);
  color: var(--on-vibrant);
}

.btn-ghost {
  color: var(--link);
  border: 2px solid var(--link);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--primary);
  color: var(--on-vibrant);
  border-color: var(--primary);
}

.btn-small {
  padding: 0.45rem 1.1rem;
  font-size: 0.95rem;
}

.btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px -12px rgba(0, 0, 0, 0.35);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 0.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-inline-end: auto;
  text-decoration: none;
  color: var(--heading);
}

.brand:hover {
  color: var(--heading);
}

.brand-mark {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.1;
}

.brand-name span {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a:not(.btn) {
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
}

.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] {
  color: var(--link);
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.has-js .theme-toggle {
  display: inline-flex;
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle[data-mode="dark"] .icon-moon {
  display: none;
}

.theme-toggle[data-mode="dark"] .icon-sun {
  display: block;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-bar {
  position: relative;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bar::before {
  top: -6px;
}

.nav-toggle-bar::after {
  top: 6px;
}

@media (max-width: 900px) {
  .has-js .nav-toggle {
    display: inline-flex;
  }

  .has-js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: -1.25rem;
    right: -1.25rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem 1.5rem;
  }

  .has-js .site-header.nav-open .site-nav {
    display: block;
  }

  .has-js .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .has-js .site-nav a:not(.btn) {
    display: block;
    padding: 0.65rem 0.5rem;
    border-radius: 8px;
  }

  .has-js .site-nav a:not(.btn):hover {
    background: var(--surface);
  }

  .has-js .site-nav .btn {
    margin-top: 0.75rem;
    width: 100%;
  }

  html:not(.has-js) .header-inner {
    flex-wrap: wrap;
  }

  html:not(.has-js) .site-nav ul {
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
  }
}

@media (max-width: 480px) {
  .brand {
    gap: 0.5rem;
  }

  .brand-mark {
    width: 2.2rem;
    height: 2.2rem;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .brand-name span {
    font-size: 0.7rem;
  }

  .nav-toggle {
    padding: 0.55rem 0.7rem;
  }

  .nav-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Page layout ---------- */

.page {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.page-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 4vw, 2.5rem);
  min-width: 0;
}

.page-main > :last-child {
  margin-bottom: 0;
}

.page-main ul,
.page-main ol {
  padding-left: 1.4rem;
  margin: 0 0 1em;
}

.page-main li {
  margin-bottom: 0.45rem;
}

.page-main li > ul {
  margin-top: 0.45rem;
}

.page-aside {
  position: sticky;
  top: 6.5rem;
}

.aside-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  text-align: center;
}

.aside-card img {
  display: block;
  width: 100%;
  border-radius: 12px;
  margin-bottom: 1.1rem;
}

.aside-card .btn {
  width: 100%;
}

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

  .page-aside {
    position: static;
  }

  .aside-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
  }

  .aside-card img {
    width: 5.5rem;
    margin: 0;
  }

  .aside-card .btn {
    width: auto;
    flex: 1;
  }
}

/* ---------- Callout (homepage banner) ---------- */

.callout {
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.8rem;
  font-size: 1.05rem;
}

.callout a {
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- Policies page ---------- */

.monospaced {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
}

/* ---------- MyMusicStaff registration widget (white in both themes) ---------- */

.page-main iframe[src*="mymusicstaff.com"] {
  background: #ffffff;
  border-radius: 12px;
}

/* ---------- Contact map ---------- */

.page-main iframe[src*="google.com/maps"] {
  display: block;
  border-radius: 12px;
  margin-top: 1.5rem;
}

/* ---------- Group class page ---------- */

.lab-photo {
  margin: 0 0 1.5rem;
  max-width: 520px;
}

.lab-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lab-photo figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.signup-form {
  max-width: 520px;
  margin-bottom: 1rem;
}

.signup-form label {
  display: block;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 1rem;
}

.signup-form input,
.signup-form select,
.signup-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}

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

.signup-form .optional {
  color: var(--text-muted);
  font-weight: 400;
}

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

#signup-status {
  margin-top: 0.75rem;
}

#signup-status a {
  text-decoration: underline;
}

/* ---------- Sign-in dialog (MyMusicStaff login widget) ---------- */

.signin-dialog {
  color-scheme: light;
  background: #ffffff;
  color: #10181d;
  width: min(440px, 100% - 2rem);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.signin-dialog::backdrop {
  background: rgba(8, 13, 18, 0.55);
  backdrop-filter: blur(2px);
}

.signin-dialog .lead {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: #0c2331;
}

.signin-widget {
  min-height: 3rem;
}

.dialog-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: #e9f2f7;
  color: #0c2331;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  background: #dae5ec;
}

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

.site-footer {
  background:
    radial-gradient(40rem 18rem at 10% 130%, rgba(0, 200, 165, 0.22) 0%, transparent 60%),
    radial-gradient(36rem 18rem at 95% -30%, rgba(0, 152, 206, 0.2) 0%, transparent 60%),
    var(--band-bg);
  color: var(--band-text);
  padding-block: 2.5rem;
  font-size: 0.95rem;
}

.site-footer p {
  margin-bottom: 0.5rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
}

.footer-fine {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.site-footer a {
  color: var(--accent);
}
