:root {
  color-scheme: light;
  --bg: #f6efe2;
  --paper: #fff8ed;
  --paper-strong: #ffffff;
  --ink: #241a13;
  --muted: #735f4c;
  --line: #e5d1b9;
  --accent: #85572e;
  --accent-2: #5a3d2a;
  --gold: #b9853c;
  --plum: #67452d;
  --wood: #94613a;
  --shadow: 0 18px 60px rgba(62, 42, 25, 0.13);
  --radius: 22px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17100b;
  --paper: #24180f;
  --paper-strong: #2e1f14;
  --ink: #f9ead6;
  --muted: #d4bda3;
  --line: #563820;
  --accent: #c8894d;
  --accent-2: #a46f42;
  --gold: #d4a85a;
  --plum: #9a6a45;
  --wood: #b57a49;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(185, 133, 60, 0.13), transparent 34rem),
    linear-gradient(135deg, rgba(133, 87, 46, 0.06), transparent 45%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  padding-bottom: 8.5rem;
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a.button {
  min-height: 44px;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  transform: translateY(-180%);
  z-index: 20;
  background: var(--paper-strong);
  padding: 0.75rem 1rem;
  border-radius: 999px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  margin-right: auto;
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1;
}

.brand small {
  display: none;
  color: var(--muted);
  font-size: 0.78rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-nav {
  display: none;
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 82px;
  padding: 1rem;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-nav.is-open {
  display: grid;
  gap: 0.5rem;
}

.site-nav a {
  text-decoration: none;
  padding: 0.72rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--ink);
}

.menu-toggle,
.theme-toggle,
.icon-button,
.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 0.68rem 1rem;
  cursor: pointer;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.hero {
  position: relative;
  display: grid;
  gap: 2rem;
  align-items: center;
  min-height: 70vh;
  padding: 4rem 0;
  overflow: hidden;
}

.hero h1,
.page-hero h1,
.detail-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 12vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-visual {
  min-height: 320px;
  position: relative;
  border-radius: 2rem;
  background:
    radial-gradient(circle at 72% 22%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 8rem),
    radial-gradient(circle at 22% 78%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 9rem),
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent),
    repeating-linear-gradient(0deg, transparent 0 34px, color-mix(in srgb, var(--ink) 12%, transparent) 35px 36px),
    var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 1.25rem;
  border-radius: 1.4rem;
  border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  pointer-events: none;
}

.music-mark {
  position: absolute;
  display: block;
  color: color-mix(in srgb, var(--accent) 76%, transparent);
  font-family: "Segoe UI Symbol", "Noto Music", "Apple Symbols", var(--serif);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 14px 28px rgba(62, 42, 25, 0.12);
}

.music-mark--clef {
  left: 11%;
  top: 4%;
  color: color-mix(in srgb, var(--wood) 86%, var(--ink));
  font-size: clamp(10rem, 26vw, 18rem);
  transform: rotate(-8deg);
  opacity: 0.88;
  animation: drift 14s ease-in-out infinite;
}

.music-mark--note {
  color: color-mix(in srgb, var(--gold) 72%, var(--accent));
  animation: floatNote 9s ease-in-out infinite;
}

.music-mark--note-one {
  right: 18%;
  top: 13%;
  font-size: clamp(4.2rem, 10vw, 7.5rem);
}

.music-mark--note-two {
  right: 38%;
  top: 48%;
  font-size: clamp(3.2rem, 7vw, 5.5rem);
  animation-delay: -2s;
}

.music-mark--note-three {
  right: 7%;
  top: 39%;
  font-size: clamp(3rem, 6vw, 4.8rem);
  animation-delay: -4s;
}

.music-mark--note-four {
  left: 42%;
  top: 19%;
  color: color-mix(in srgb, var(--plum) 72%, var(--gold));
  font-size: clamp(2.6rem, 6vw, 4.3rem);
  animation-delay: -1s;
}

.music-mark--note-five {
  left: 69%;
  bottom: 10%;
  color: color-mix(in srgb, var(--accent-2) 74%, transparent);
  font-size: clamp(2.5rem, 5vw, 4rem);
  animation-delay: -5s;
}

.music-mark--note-six {
  left: 60%;
  top: 24%;
  color: color-mix(in srgb, var(--muted) 74%, transparent);
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  animation-delay: -7s;
}

.section,
.page-hero,
.detail-hero {
  padding: 3rem 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.1;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.45rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 700;
}

.muted,
.small {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  min-height: 46px;
  min-width: 3.25rem;
  max-width: 100%;
  padding: 0.82rem 1.18rem;
  background: var(--accent);
  color: #fff9ee;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.button--ghost,
button.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.is-selected,
button.button.is-selected,
.button[aria-pressed="true"],
button.button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.95rem;
  align-items: center;
}

.tool-card .button-row,
.panel .button-row {
  row-gap: 1rem;
  margin-block: 0.95rem;
}

.tool-card .button-row .button,
.panel .button-row .button {
  padding-inline: 1.25rem;
}

[data-metro-minus],
[data-metro-plus] {
  min-width: 58px;
  padding-inline: 0.9rem;
}

.card-grid,
.feature-grid {
  display: grid;
  gap: 1rem;
}

.feature-card,
.piece-card,
.panel,
.tool-card,
.state {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature-card {
  display: grid;
  gap: 0.25rem;
  padding: 1.25rem;
  text-decoration: none;
}

.feature-card strong {
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
}

.piece-card,
.panel,
.tool-card,
.state {
  padding: 1.25rem;
}

.piece-card {
  display: grid;
  gap: 1rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.piece-card:hover {
  transform: translateY(-3px);
}

.piece-card h3 {
  margin: 0;
}

.piece-card h3 a {
  text-decoration: none;
}

.piece-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.favorite-button {
  min-width: 64px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.meta-grid {
  display: grid;
  gap: 0.75rem;
}

.meta-item {
  display: grid;
  gap: 0.1rem;
}

.meta-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.filters {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 0.78rem 0.85rem;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}

.check input {
  width: auto;
}

.tool-grid,
.journal-form {
  display: grid;
  gap: 1rem;
}

.tools-layout {
  display: grid;
  gap: 1rem;
}

.beat-display,
.timer-face {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  min-height: 130px;
}

.beat-display span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  transition: transform 90ms ease, background 90ms ease;
}

.beat-display span.is-on {
  transform: scale(1.25);
  background: var(--gold);
}

.timer-face [data-timer-time] {
  font-family: var(--serif);
  font-size: 4rem;
  line-height: 1;
}

.progress {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.fingerboard {
  width: 100%;
  min-height: 260px;
  color: var(--ink);
}

.finger-note {
  cursor: pointer;
}

.finger-note-hit {
  pointer-events: all;
}

.finger-note:hover .finger-note-dot,
.finger-note:focus .finger-note-dot,
.finger-note:focus-visible .finger-note-dot {
  fill: color-mix(in srgb, var(--accent) 70%, var(--paper));
}

.finger-note:focus-visible .finger-note-dot {
  stroke: var(--gold);
  stroke-width: 4;
}

.bow-guide {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
}

.bow-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wood), var(--gold), var(--wood));
}

.bow-track i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.bow-track i.is-active {
  animation: bowWhole 3s ease-in-out infinite alternate;
}

.bow-track i.is-active.bow-whole { animation-name: bowWhole; }
.bow-track i.is-active.bow-upper { left: 75%; animation-name: bowUpper; }
.bow-track i.is-active.bow-lower { left: 25%; animation-name: bowLower; }
.bow-track i.is-active.bow-middle { left: 50%; animation-name: bowMiddle; }
.bow-track i.is-active.bow-slow { animation-duration: 6s; }
.bow-track i.is-active.bow-fast { animation-duration: 1.2s; }

.prev-next {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0;
}

.video-section {
  margin-bottom: 1rem;
}

.video-grid {
  display: grid;
  gap: 1rem;
}

.video-card {
  display: grid;
  gap: 0.75rem;
}

.video-card .section-heading {
  align-items: center;
  margin-bottom: 0;
}

.youtube-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 18px;
  background: #000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.video-card--fallback {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-strong);
}

.about-media-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.about-photo {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.about-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.about-photo figcaption {
  padding: 0.85rem 1rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.state {
  text-align: center;
  padding: 2rem;
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: spin 900ms linear infinite;
}

.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0 9rem;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--gold) 10%, transparent), transparent 24rem),
    color-mix(in srgb, var(--paper) 76%, transparent);
}

.footer-inner {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.footer-brand {
  max-width: 34rem;
}

.footer-brand__title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.footer-brand__title img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
}

.footer-brand p {
  margin: 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.footer-bottom a {
  color: var(--muted);
  font-size: 0.9rem;
}

.vv-player {
  position: fixed;
  z-index: 12;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 0.75rem;
}

.vv-player.is-hidden {
  display: none;
}

.vv-player__main {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.vv-player__meta {
  min-width: min(100%, 220px);
  margin-right: auto;
}

.vv-player__meta strong,
.vv-player__meta span {
  display: block;
}

.vv-player__meta span {
  color: var(--muted);
  font-size: 0.88rem;
}

.vv-player input[type="range"] {
  width: 110px;
  padding: 0;
}

.vv-player__frame-wrap {
  margin-top: 0.75rem;
}

.vv-player__frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}

.vv-player__fallback {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  min-height: 220px;
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--gold) 14%, transparent), transparent 18rem),
    var(--paper);
}

.vv-player__fallback strong {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.1;
}

.vv-player__fallback p {
  max-width: 38rem;
  margin: 0;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 680px) {
  .brand small {
    display: block;
  }

  .hero {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .card-grid,
  .feature-grid,
  .tools-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meta-grid,
  .filters,
  .tool-grid,
  .journal-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .menu-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .site-nav a {
    padding: 0.55rem 0.75rem;
  }

  .card-grid,
  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
  }

  .vv-player {
    left: 50%;
    right: auto;
    width: min(940px, calc(100% - 2rem));
    transform: translateX(-50%);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(18px) rotate(3deg); }
}

@keyframes floatNote {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-6deg); }
  50% { transform: translate3d(10px, -18px, 0) rotate(7deg); }
}

@keyframes bowWhole {
  from { left: 2%; }
  to { left: 98%; }
}

@keyframes bowUpper {
  from { left: 55%; }
  to { left: 98%; }
}

@keyframes bowLower {
  from { left: 2%; }
  to { left: 45%; }
}

@keyframes bowMiddle {
  from { left: 38%; }
  to { left: 62%; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
