/* The Juicebox
   Colors come from the juice-box carton logo (plum + coral) and the
   song worksheets (blue ruled lines, pencil handwriting). */

:root {
  --plum: #4d2955;
  --plum-deep: #2e1733;
  --ink: #2a1830;
  --coral: #f15d5d;
  --coral-ink: #c43a3a;
  --rule: #bcd0f0;
  --pencil: #5d5563;
  --paper: #ffffff;
  --wash: #f3f6fc;

  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --hand: "Shantell Sans", "Comic Sans MS", cursive;

  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.35rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  --step-4: clamp(2.1rem, 1.2rem + 3.6vw, 3.75rem);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 6px;
}

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

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

/* Only ever scroll vertically. Rotated media can poke past the edge on iOS Safari. */
html { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--sans);
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 { font-size: var(--step-3); font-stretch: 85%; font-variation-settings: "opsz" 72; }
h3 { font-size: var(--step-1); font-variation-settings: "opsz" 24; }
p { margin: 0 0 1em; max-width: 62ch; }

a { color: inherit; text-underline-offset: 0.18em; }
a:hover { color: var(--coral-ink); }

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

.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--plum); color: #fff; padding: .6rem 1rem; border-radius: var(--radius);
}
.skip:focus { top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .8em 1.35em;
  border: 2px solid var(--plum);
  border-radius: 999px;
  background: var(--plum); color: #fff;
  font: 650 1rem/1 var(--sans);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--plum-deep); border-color: var(--plum-deep); color: #fff; }
.btn-quiet { background: transparent; color: var(--plum); }
.btn-quiet:hover { background: var(--plum); color: #fff; }
.btn-small { padding: .6em 1.1em; font-size: .95rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgb(255 255 255 / .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 10px; }
.brand span { font-weight: 800; font-size: 1.45rem; font-stretch: 80%; letter-spacing: -0.02em; color: var(--plum); }
nav { display: flex; align-items: center; gap: 1.5rem; }
nav ul { display: flex; gap: 1.4rem; margin: 0; padding: 0; list-style: none; }
nav ul a { text-decoration: none; font-size: 1rem; font-weight: 550; }
nav ul a:hover { text-decoration: underline; }
@media (max-width: 860px) { nav ul { display: none; } }

/* Hero: a page from a song worksheet */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 5.5rem);
  background:
    linear-gradient(to right, transparent calc(var(--gutter) * .6), var(--coral) calc(var(--gutter) * .6), var(--coral) calc(var(--gutter) * .6 + 2px), transparent calc(var(--gutter) * .6 + 2px)),
    repeating-linear-gradient(to bottom, transparent 0 2.4rem, var(--rule) 2.4rem calc(2.4rem + 1px));
  border-bottom: 1px solid var(--rule);
}
.hero-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.worksheet-line {
  font-size: var(--step-4);
  font-weight: 700;
  font-stretch: 82%;
  font-variation-settings: "opsz" 96;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}
.worksheet-line .line { display: block; margin-bottom: .55em; }
.worksheet-line .nw { white-space: nowrap; }
.blank {
  position: relative;
  display: inline-block;
  min-width: 3.3em;
  padding: 0 .2em;
  border-bottom: 3px solid var(--ink);
  text-align: center;
  line-height: 1;
  vertical-align: baseline;
}
.fill {
  display: inline-block;
  font-family: var(--hand);
  font-weight: 500;
  font-stretch: normal;
  color: var(--pencil);
  font-size: .92em;
  transform: rotate(-2deg) translateY(.04em);
  clip-path: inset(-.4em -.3em -.5em -.3em);
  animation: write .7s steps(12, end) var(--d, 0s) both;
}
.hint {
  position: absolute; left: 0; right: 0; top: calc(100% + .3rem);
  font: 400 var(--step--1)/1.2 var(--sans);
  letter-spacing: 0;
  color: var(--pencil);
  white-space: nowrap;
}
@keyframes write { from { clip-path: inset(-.4em 100% -.5em -.3em); } to { clip-path: inset(-.4em -.3em -.5em -.3em); } }
@media (prefers-reduced-motion: reduce) { .fill { animation: none; } }

.lede { font-size: var(--step-1); line-height: 1.5; margin-top: 2.25rem; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.hero-media { margin: 0; }
.player {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--plum-deep);
  aspect-ratio: 16 / 9;
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--rule);
  transform: rotate(1deg);
}
.player video { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; left: 1rem; bottom: 1rem;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.1rem .7rem .9rem;
  border: 0; border-radius: 999px;
  background: #fff; color: var(--plum);
  font: 650 1rem/1 var(--sans);
  cursor: pointer;
}
.play:hover { background: var(--coral); color: #fff; }
.play .dur { font-weight: 450; opacity: .75; }
.hero-media figcaption { margin-top: 1rem; font-size: var(--step--1); color: var(--pencil); }

/* Proof */
.proof { padding-block: 2rem; }
.proof-row {
  display: grid; gap: 1.5rem 2.5rem;
  grid-template-columns: 1.3fr 1fr 1.2fr;
  align-items: center;
}
@media (max-width: 860px) { .proof-row { grid-template-columns: 1fr; } }
.proof p { margin: 0; font-size: 1rem; color: var(--pencil); }
.proof strong { color: var(--ink); font-weight: 650; }
.award { display: flex; align-items: center; gap: 1rem; }
.award img { width: 64px; height: auto; flex: none; }

/* Sections */
section:not(.hero):not(.proof) { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-lede { font-size: var(--step-1); color: var(--pencil); margin-top: .75rem; }

.session { border-top: 1px solid var(--rule); }
.steps {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; gap: 2.5rem 2rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  counter-reset: step;
}
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; }
.steps img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: var(--radius); margin-bottom: 1.1rem; }
.steps h3 { display: flex; gap: .55rem; align-items: baseline; margin-bottom: .5rem; }
.steps h3::before {
  content: counter(step);
  flex: none;
  display: inline-grid; place-items: center;
  width: 1.7rem; height: 1.7rem;
  border: 2px solid var(--coral); border-radius: 50%;
  font: 600 .95rem/1 var(--hand);
  color: var(--coral-ink);
  transform: translateY(-.1em);
}
.steps p { font-size: 1rem; color: var(--pencil); }

.worksheets { background: var(--wash); }
.worksheets-grid { display: grid; gap: 3rem; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; }
@media (max-width: 900px) { .worksheets-grid { grid-template-columns: 1fr; } }
.worksheets h2 { margin-bottom: 1.25rem; }
.worksheets em { font-family: var(--hand); font-style: normal; font-size: .95em; color: var(--plum); }
.sheets { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.sheets img {
  border-radius: 3px;
  box-shadow: 0 1px 2px rgb(46 23 51 / .12), 0 10px 24px rgb(46 23 51 / .1);
}
.sheets img:first-child { transform: rotate(-3deg) translateX(8%); z-index: 1; }
.sheets img:last-child { transform: rotate(2.5deg) translate(-4%, 12%); }

/* Student work: dark band so the videos read like a screening */
.work { background: var(--plum); color: #fff; }
.work .section-lede { color: rgb(255 255 255 / .78); }
.films { display: grid; gap: 3rem 2.5rem; grid-template-columns: 1fr 1fr; margin-top: 2.5rem; }
@media (max-width: 860px) { .films { grid-template-columns: 1fr; } }
.films h3 { margin-bottom: .5rem; }
.films article > p { color: rgb(255 255 255 / .85); font-size: 1rem; }
.feature-video { margin: 1.25rem 0 0; }
.feature-video video { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; }
.feature-video figcaption { display: flex; flex-direction: column; gap: .2rem; margin-top: .9rem; }
.feature-video strong { font-size: var(--step-1); }
.feature-video span { color: rgb(255 255 255 / .78); font-size: 1rem; }

.songs-title { margin-top: 3.5rem; }
.songs { list-style: none; margin: 1rem 0 0; padding: 0; }
.songs li {
  display: grid; gap: .75rem 2rem; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  padding-block: 1.1rem;
  border-bottom: 1px solid rgb(255 255 255 / .22);
}
.songs li:first-child { border-top: 1px solid rgb(255 255 255 / .22); }
@media (max-width: 700px) { .songs li { grid-template-columns: 1fr; } }
.songs p { margin: 0; display: flex; flex-direction: column; }
.songs strong { font-size: var(--step-1); font-weight: 650; }
.songs span { font-size: 1rem; color: rgb(255 255 255 / .75); }
.songs audio { width: 100%; }
.work a:hover { color: var(--coral); }

.program-grid { display: grid; gap: 3rem; grid-template-columns: 1fr 1fr; margin-top: 2.5rem; }
@media (max-width: 860px) { .program-grid { grid-template-columns: 1fr; } }
.program-grid article { border-top: 3px solid var(--ink); padding-top: 1.25rem; }
.program-grid h3 { margin-bottom: .75rem; }
.program-grid ul { padding-left: 1.2rem; margin: 0; }
.program-grid li { margin-bottom: .35rem; }
.program-grid li::marker { color: var(--coral); }
.small-video { margin: 1.5rem 0 0; }
.small-video video { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; }
.small-video figcaption { margin-top: .6rem; font-size: var(--step--1); color: var(--pencil); }

.about { border-top: 1px solid var(--rule); }
.about-grid { display: grid; gap: clamp(2rem, 5vw, 4.5rem); grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; }
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } .about-grid img { max-height: 520px; width: 100%; } }
.about-grid img { border-radius: var(--radius); object-fit: cover; aspect-ratio: 4 / 5; }
.about h2 { margin-bottom: 1.25rem; }

.book { background: var(--wash); }
.book-grid { display: grid; gap: 3rem; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; }
@media (max-width: 860px) { .book-grid { grid-template-columns: 1fr; } }
.book h2 { margin-bottom: 1.25rem; }
.email a { font-weight: 600; }
.book-form {
  display: grid; gap: 1.1rem;
  background: #fff; padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}
.book-form label { display: grid; gap: .35rem; font-size: 1rem; font-weight: 600; }
.book-form input, .book-form textarea {
  font: 400 1.05rem/1.4 var(--hand);
  color: var(--ink);
  padding: .55rem .1rem;
  border: 0; border-bottom: 2px solid var(--rule);
  background: transparent;
  border-radius: 0;
}
.book-form textarea {
  resize: vertical;
  background: repeating-linear-gradient(to bottom, transparent 0 1.9rem, var(--rule) 1.9rem calc(1.9rem + 1px));
  line-height: 1.95rem; padding-top: 0; border-bottom: 0;
}
.book-form input:focus, .book-form textarea:focus { outline: none; border-bottom-color: var(--plum); }
.book-form input:focus-visible { box-shadow: 0 2px 0 var(--plum); }
.book-form textarea:focus-visible { outline: 2px solid var(--plum); outline-offset: 4px; }
.book-form ::placeholder { color: #9a92a0; }
.book-form .btn { justify-self: start; margin-top: .5rem; }
.hp { display: none; }

.site-footer { background: var(--plum-deep); color: rgb(255 255 255 / .8); padding-block: 2.5rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; align-items: baseline; }
.site-footer p { margin: 0; font-size: var(--step--1); }
.site-footer .motto { font: 500 var(--step-1)/1.3 var(--hand); color: #fff; }

@media (max-width: 480px) {
  .hint { white-space: normal; line-height: 1.1; }
  .worksheet-line .line { margin-bottom: 1.1em; }
}
