/* Laurel & Lantern Inn — The Music Room
   Self-contained styles. Tokens follow the Inn design system. */

@font-face { font-family: "Cinzel"; src: url("../fonts/cinzel-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("../fonts/cinzel-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --blackberry: #160016;
  --plum: #330033;
  --magenta: #7A0059;
  --parchment: #F3E7D6;
  --parchment-dim: #A8A296;
  --copper: #CC9966;
  --copper-deep: #c28562;
  --amber: #FF9933;
  --teal: #006666;
  --teal-glow: #3AA6A3;      /* lighter teal so it reads on ebony keys */
  --iron: #4A5260;
  --walnut: #2a0f0a;
  --ink: #1d0f12;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blackberry);
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--copper); text-underline-offset: .2em; }
a:hover { color: var(--parchment); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
img { max-width: 100%; display: block; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--parchment); color: var(--blackberry); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { top: 1rem; }

/* ---------- header / footer ---------- */
.inn-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid rgba(204,153,102,.22);
  background: linear-gradient(180deg, rgba(22,0,22,.96), rgba(22,0,22,.82));
  position: relative; z-index: 5;
}
.inn-mark { font-family: var(--display); letter-spacing: .14em; font-size: .95rem; text-decoration: none; color: var(--parchment); text-transform: uppercase; }
.inn-mark span { color: var(--copper); }
.inn-header nav a { font-family: var(--display); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; }

.inn-footer {
  border-top: 1px solid rgba(204,153,102,.22);
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 3rem;
  color: var(--parchment-dim);
  font-size: 1rem;
  background: #120012;
}
.inn-footer .wrap { max-width: 68rem; margin: 0 auto; display: grid; gap: 1.25rem; }
.inn-footer .disclosure { font-style: italic; color: var(--parchment); max-width: 46rem; }
.inn-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.inn-footer .credits { font-size: .9rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--display); font-size: .82rem; letter-spacing: .16em; text-transform: uppercase;
  padding: .85rem 1.4rem; min-height: 44px;
  color: var(--parchment); text-decoration: none; cursor: pointer;
  background: rgba(22,0,22,.55);
  border: 1px solid var(--copper);
  border-radius: 2px;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.btn:hover { background: var(--copper); color: var(--blackberry); }
.btn--primary { background: var(--copper); color: var(--blackberry); }
.btn--primary:hover { background: var(--parchment); border-color: var(--parchment); }

/* ---------- entrance ---------- */
.entrance { position: relative; min-height: min(92svh, 60rem); display: grid; align-items: end; overflow: hidden; }
.entrance picture, .entrance picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.entrance::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(22,0,22,.25) 0%, rgba(22,0,22,0) 35%, rgba(22,0,22,.55) 68%, rgba(22,0,22,.97) 100%),
    radial-gradient(ellipse at 20% 100%, rgba(22,0,22,.7), transparent 60%);
}
.entrance__inner { position: relative; z-index: 1; padding: 0 clamp(1rem, 5vw, 4rem) clamp(2rem, 6vw, 4.5rem); max-width: 46rem; }
.eyebrow { font-family: var(--display); font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--copper); margin: 0 0 .75rem; }
.entrance h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1.05; letter-spacing: .06em; margin: 0 0 1rem; }
.entrance p.lede { font-size: clamp(1.2rem, 2.2vw, 1.45rem); font-style: italic; margin: 0 0 1.75rem; color: var(--parchment); text-shadow: 0 1px 12px rgba(22,0,22,.8); }
.entrance .actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.rule { display: flex; align-items: center; gap: 1rem; color: var(--copper); margin: 0 auto 2rem; max-width: 20rem; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--copper), transparent); }

.lessons { padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2.5rem); background: radial-gradient(ellipse at top, #250025 0%, var(--blackberry) 60%); }
.lessons__head { text-align: center; max-width: 40rem; margin: 0 auto 2.75rem; }
.lessons__head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: .08em; margin: 0 0 .75rem; }
.lessons__head p { margin: 0; color: var(--parchment-dim); }
.levels { list-style: none; margin: 0 auto; padding: 0; max-width: 68rem; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.level {
  background: linear-gradient(160deg, rgba(51,0,51,.85), rgba(22,0,22,.9));
  border: 1px solid rgba(204,153,102,.28);
  border-top: 2px solid var(--copper);
  padding: 1.5rem 1.5rem 1.25rem;
  position: relative;
}
.level__num { font-family: var(--display); font-size: .72rem; letter-spacing: .28em; color: var(--copper); text-transform: uppercase; }
.level h3 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; letter-spacing: .06em; margin: .35rem 0 .4rem; }
.level p { margin: 0 0 1rem; color: var(--parchment-dim); font-size: 1.02rem; line-height: 1.5; }
.level ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(204,153,102,.18); }
.level li a {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; align-items: center;
  padding: .7rem 0; text-decoration: none; color: var(--parchment);
  border-bottom: 1px solid rgba(204,153,102,.12);
}
.level li a:hover .t { color: var(--copper); }
.level li .t { font-size: 1.12rem; font-weight: 600; transition: color .2s; }
.level li .c { grid-column: 1; font-size: .92rem; font-style: italic; color: var(--parchment-dim); }
.level li .done { grid-row: 1 / span 2; grid-column: 2; font-family: var(--display); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--teal-glow); white-space: nowrap; }
.lessons__note { text-align: center; max-width: 40rem; margin: 2.5rem auto 0; font-size: .95rem; color: var(--parchment-dim); font-style: italic; }

/* ---------- piano page ---------- */
body.piano-page { min-height: 100svh; display: flex; flex-direction: column; background: #0d000d; }
.piano-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .55rem clamp(.75rem, 3vw, 1.75rem);
  background: linear-gradient(180deg, #1e061a, #140010);
  border-bottom: 1px solid rgba(204,153,102,.25);
  min-height: 52px;
}
.piano-bar .back { font-family: var(--display); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.piano-bar .title { text-align: center; line-height: 1.2; overflow: hidden; }
.piano-bar .title strong { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(.9rem, 2vw, 1.1rem); letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piano-bar .title span { font-size: .9rem; font-style: italic; color: var(--parchment-dim); white-space: nowrap; }
.piano-bar .spacer { width: 7rem; }

.stage-outer { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 0; background: #0d000d; }
.stage {
  --crop-top: 8.333%;       /* 90px of 1080 */
  position: relative;
  width: min(100%, calc((100svh - 190px) * 2.743));
  aspect-ratio: 1920 / 700;
  overflow: hidden;
  overflow-x: hidden;
  background: #1a0a08;
}
.plate {
  position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 16 / 9;
  transform: translateY(calc(var(--crop-top) * -1));
}
.plate > picture, .plate > picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.plate > picture img { object-fit: cover; }

/* closer view for small screens: the plate grows (sized in JS), the stage scrolls sideways
   and shows only the keys; the music sheet moves into the strip above */
.stage.is-zoomed { aspect-ratio: auto; width: 100%; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--copper) transparent; }
.stand-strip { display: none; justify-content: center; padding: .35rem .5rem; background: #120010; align-self: stretch; width: 100%; }
body.is-zoomed.is-lesson .stand-strip { display: flex; }
.stand-strip .stand { position: relative; left: auto; top: auto; width: min(100%, 34rem); height: 6.2rem; }
.stand-strip .stand__hint { font-size: 9px; }
body.is-zoomed .stage-outer { flex-direction: column; justify-content: center; }
.octave-nav.seg { display: none; }
body.is-zoomed .octave-nav.seg { display: inline-flex; }

/* ---- coded keyboard, laid exactly over the painted one (1920×1080 plate) ---- */
.keys {
  position: absolute;
  left: 11.927%; width: 75.938%;   /* x 229 → 1687 */
  top: 55.926%; height: 10.370%;    /* y 604 → 716 */
  touch-action: none; user-select: none; -webkit-user-select: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.45));
}
.key { position: absolute; top: 0; cursor: pointer; }
.key--white {
  height: 100%;
  background: linear-gradient(180deg, #f6eee0 0%, #efe4d1 70%, #e2d3bb 100%);
  border: 1px solid #7c6a58; border-top: none;
  border-radius: 0 0 2px 2px;
  box-shadow: inset 0 -3px 0 #cdbb9f, inset -1px 0 0 rgba(255,255,255,.5);
}
.key--black {
  height: 61%; z-index: 2;
  background: linear-gradient(180deg, #2a2122 0%, #161012 60%, #0c0809 100%);
  border: 1px solid #000; border-top: none;
  border-radius: 0 0 2px 2px;
  box-shadow: inset 0 -4px 0 #3b3133, 0 1px 2px rgba(0,0,0,.6);
}
.key--white.is-down { background: linear-gradient(180deg, #e2d6c1, #d6c7ad); box-shadow: inset 0 2px 4px rgba(0,0,0,.25); }
.key--black.is-down { background: linear-gradient(180deg, #120c0d, #0a0607); box-shadow: inset 0 -1px 0 #3b3133; }
.key .lbl {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  font-family: var(--display); font-weight: 600; font-size: clamp(7px, .75vw, 12px); line-height: 1;
  pointer-events: none; opacity: 0;
}
.key .lbl { text-align: center; white-space: nowrap; }
.key .lbl .k { display: block; font-size: 1.5em; margin-bottom: .3em; font-family: var(--serif); font-weight: 600; }
/* middle C marker, always on */
.key--white.is-middle-c::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--copper-deep); opacity: .8; }

/* the glow: copper for the right hand, teal for the left, letter for colour-blind guests */
.key.glow-rh, .key.glow-lh { transition: background .12s; }
.key--white.glow-rh { background: linear-gradient(180deg, #e9b98a 0%, var(--copper) 45%, #b8763f 100%); box-shadow: inset 0 0 0 2px #6e3f1f, 0 0 18px 5px rgba(255,153,51,.7); z-index: 1; }
.key--white.glow-lh { background: linear-gradient(180deg, #8fd0cd 0%, var(--teal-glow) 45%, #1f7f7c 100%); box-shadow: inset 0 0 0 2px #003a3a, 0 0 18px 5px rgba(58,166,163,.75); z-index: 1; }
.key--black.glow-rh { background: linear-gradient(180deg, #e0ad7c, var(--copper) 70%, #9b6a42); box-shadow: 0 0 12px 3px rgba(255,153,51,.6); }
.key--black.glow-lh { background: linear-gradient(180deg, #6cc3c0, var(--teal-glow) 70%, #1f6f6d); box-shadow: 0 0 12px 3px rgba(58,166,163,.65); }
.key.glow-rh .lbl, .key.glow-lh .lbl { opacity: 1; color: var(--blackberry); }
.key.glow-ghost { opacity: 1; }
.key--white.glow-ghost.glow-rh, .key--white.glow-ghost.glow-lh { filter: saturate(.55) brightness(1.05); }
.key.is-satisfied { filter: brightness(.82); }
body.lamp-off .key.glow-rh, body.lamp-off .key.glow-lh { box-shadow: none; }
body.lamp-off .key--white.glow-rh, body.lamp-off .key--white.glow-lh { background: linear-gradient(180deg, #f6eee0 0%, #efe4d1 70%, #e2d3bb 100%); box-shadow: inset 0 -3px 0 #cdbb9f; }
body.lamp-off .key--black.glow-rh, body.lamp-off .key--black.glow-lh { background: linear-gradient(180deg, #2a2122 0%, #161012 60%, #0c0809 100%); }
body.lamp-off .key .lbl { opacity: 0 !important; }

/* ---- music stand: the real lesson sheet laid over the painted book ---- */
.stand {
  position: absolute;
  left: 38.438%; width: 22.5%;      /* x 738 → 1170 */
  top: 14.630%; height: 22.963%;    /* y 158 → 406 */
  display: none;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,250,240,.0) 50%, rgba(120,80,40,.18) 100%),
    linear-gradient(90deg, #efe1c6 0%, #f6ecda 46%, #e3d2b3 50%, #f6ecda 54%, #efe1c6 100%);
  box-shadow: 0 0 0 1px rgba(90,60,30,.35), 0 4px 14px rgba(0,0,0,.35);
  border-radius: 2px;
  cursor: zoom-in;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--ink);
  text-align: left;
}
body.is-lesson .stand { display: block; }
.stand__scroll { position: absolute; inset: 4% 3% 12% 3%; overflow: hidden; }
.stand__music { transition: transform .45s var(--ease); transform-origin: 0 0; }
.stand__music svg { display: block; }
.stand__hint {
  position: absolute; left: 0; right: 0; bottom: 2%; text-align: center;
  font-family: var(--display); font-size: clamp(6px, .55vw, 10px); letter-spacing: .2em; text-transform: uppercase; color: #6b5440;
}
.stand:hover { box-shadow: 0 0 0 1px var(--copper), 0 4px 18px rgba(255,153,51,.25); }

/* notation colours */
.sheet svg path, .sheet svg text { fill: var(--ink); }
.sheet .abcjs-note.is-current.abcjs-v0, .sheet .abcjs-note.is-current.abcjs-v0 path, .sheet .abcjs-note.is-current.abcjs-v0 * { fill: #a35f2b; stroke: #a35f2b; }
.sheet .abcjs-note.is-current.abcjs-v1, .sheet .abcjs-note.is-current.abcjs-v1 path, .sheet .abcjs-note.is-current.abcjs-v1 * { fill: var(--teal); stroke: var(--teal); }

/* ---- fallboard / loading overlay ---- */
.fallboard {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(22,0,22,.35), rgba(22,0,22,.75));
}
.fallboard[hidden] { display: none; }
.fallboard__card { text-align: center; padding: 1.25rem 1.5rem; background: rgba(22,0,22,.82); border: 1px solid rgba(204,153,102,.45); max-width: 26rem; margin: 0 1rem; }
.fallboard__card p { margin: .2rem 0 1rem; font-style: italic; }
.fallboard__status { font-size: .95rem; color: var(--parchment-dim); min-height: 1.5em; margin: .75rem 0 0 !important; }

/* ---- control bar ---- */
.controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem .75rem;
  padding: .6rem clamp(.75rem, 3vw, 1.75rem) .8rem;
  background: linear-gradient(180deg, #24100c, #160806);
  border-top: 1px solid rgba(204,153,102,.35);
}
.controls .group { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.controls .sep { width: 1px; height: 28px; background: rgba(204,153,102,.25); }
.ctl {
  font-family: var(--display); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--parchment); background: rgba(22,0,22,.6);
  border: 1px solid rgba(204,153,102,.55); border-radius: 2px;
  padding: .5rem .8rem; min-height: 40px; min-width: 40px; cursor: pointer;
}
.ctl:hover { border-color: var(--copper); }
.ctl[aria-pressed="true"] { background: var(--copper); color: var(--blackberry); border-color: var(--copper); }
.ctl:disabled { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid rgba(204,153,102,.55); border-radius: 2px; }
.seg .ctl { border: none; border-radius: 0; }
.seg .ctl + .ctl { border-left: 1px solid rgba(204,153,102,.35); }
.controls label { font-family: var(--display); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--parchment-dim); display: flex; align-items: center; gap: .45rem; }
.controls input[type="range"] { accent-color: var(--copper); width: 6.5rem; }
.readout { font-size: .95rem; font-style: italic; color: var(--parchment-dim); min-width: 7.5rem; text-align: center; }

.helpline { text-align: center; font-size: .92rem; color: var(--parchment-dim); padding: .5rem 1rem 1rem; margin: 0; background: #160806; }
.helpline kbd { font-family: var(--display); font-size: .72rem; border: 1px solid rgba(204,153,102,.45); padding: .05rem .35rem; border-radius: 2px; color: var(--parchment); }

/* ---- dialogs ---- */
dialog {
  border: 1px solid var(--copper); padding: 0; max-width: min(64rem, 96vw); width: 96vw; max-height: 92svh;
  background: #f4ead6; color: var(--ink);
}
dialog::backdrop { background: rgba(10,0,10,.78); }
.dlg__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; background: var(--blackberry); color: var(--parchment); }
.dlg__head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1rem; letter-spacing: .12em; }
.dlg__body { padding: 1rem 1.25rem 1.5rem; overflow: auto; max-height: calc(92svh - 60px); }
.dlg--dark { background: var(--blackberry); color: var(--parchment); max-width: 30rem; text-align: center; }
.dlg--dark .dlg__body { padding: 2rem 1.5rem; }
.dlg--dark h2 { font-family: var(--display); font-weight: 400; letter-spacing: .1em; margin: 0 0 .5rem; }
.dlg--dark .actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }

/* ---- turn your phone sideways ---- */
.rotate {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(ellipse at center, #2a0a26, var(--blackberry));
  place-items: center; text-align: center; padding: 2rem;
}
.rotate__card { max-width: 22rem; }
.rotate__icon { width: 64px; height: 64px; margin: 0 auto 1.25rem; border: 2px solid var(--copper); border-radius: 8px; position: relative; animation: tilt 2.4s var(--ease) infinite; }
.rotate__icon::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 8px; height: 2px; margin-left: -4px; background: var(--copper); }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
.rotate h2 { font-family: var(--display); font-weight: 400; letter-spacing: .1em; font-size: 1.3rem; margin: 0 0 .5rem; }
.rotate p { margin: 0 0 1.5rem; font-style: italic; }
@media (orientation: portrait) and (max-width: 760px) {
  body.piano-page:not(.portrait-ok) .rotate { display: grid; }
}

/* short landscape screens (phones turned sideways) */
@media (max-height: 520px) {
  .stage { --crop-top: 12.5%; aspect-ratio: 1920 / 600; width: min(100%, calc((100svh - 108px) * 3.2)); }
  .stage.is-zoomed { height: calc(100svh - 108px); width: 100%; }
  .piano-bar { min-height: 40px; padding-top: .25rem; padding-bottom: .25rem; }
  .piano-bar .title span { display: none; }
  .controls { padding: .3rem .5rem .4rem; gap: .35rem .5rem; }
  .ctl { min-height: 34px; padding: .35rem .55rem; font-size: .62rem; }
  .controls input[type="range"] { width: 4.5rem; }
  .helpline { display: none; }
  .readout { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
