/* Valencia School of Music: the count-in. Read top to bottom, in the order the page is read. */

/* The palette, type scale, spaces and timings: use these custom properties, never raw values. */
:root {
  --colour-of-the-slate: #63818a;
  --colour-of-the-ink: #07171d;
  --colour-of-the-reading-ink: #04121a; /* the ink taken a shade darker so running type clears AA on slate */
  --colour-of-the-ochre: #c49a47;
  --colour-of-the-pale-ink: #f0f7fa; /* on slate only at heading sizes; any size on deep slate */
  --colour-of-the-deep-slate: #243d46;
  --face-for-the-opening: 'Dela Gothic One', 'Arial Black', sans-serif;
  --face-for-reading: 'Geologica', 'Segoe UI', system-ui, sans-serif;
  --size-of-running-type: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --size-of-small-type: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
  --size-of-a-heading: clamp(1.625rem, 1.2rem + 1.7vw, 2.625rem);
  --size-of-the-opening-words: clamp(1.875rem, 6.7vw, 5.75rem);
  --size-of-the-ending-links: clamp(2rem, 1rem + 5vw, 4.75rem);
  --thickness-of-the-bar: 0.5rem;
  --space-above-the-bar: 0.3125rem;
  --space-at-the-page-edge: clamp(1rem, 3.4vw, 3rem);
  --space-between-columns: clamp(1rem, 1.8vw, 1.75rem);
  --space-between-sections: clamp(2.5rem, 9vh, 6.5rem);
  --space-between-paragraphs: 1.1em;
  --depth-of-the-step: 0.5rem;
  --height-of-the-offer: 3rem;
  --time-of-the-wipe: 950ms;
  --time-of-the-unfold: 650ms;
  --time-of-the-settle: 850ms;
  --ease-with-weight: cubic-bezier(0.22, 0.8, 0.2, 1);
}
@media (min-width: 56em) {
  :root { --height-of-the-offer: 3.5rem; }
}

/* The one silhouette, a piano key's stepped shoulder: set --depth-of-the-step on the element to scale it. */
.Path-slash, .Count-beat, .Count-beat::after, .Photo-frame, .Key::before, .Beats > li::before {
  clip-path: polygon(0 0, calc(100% - var(--depth-of-the-step)) 0, calc(100% - var(--depth-of-the-step)) var(--depth-of-the-step), 100% var(--depth-of-the-step), 100% 100%, 0 100%);
}

/* The page itself: slate ground everywhere, Geologica for reading; body is a column so the cookie band can sit under the path. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
  margin: 0;
  background: var(--colour-of-the-slate);
  color: var(--colour-of-the-reading-ink);
  font: 400 var(--size-of-running-type) / 1.55 var(--face-for-reading);
}
main { order: 2; flex: 1 0 auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
img, video, svg { display: block; max-inline-size: 100%; block-size: auto; }
a { color: inherit; text-decoration-thickness: 0.125rem; text-underline-offset: 0.2em; }
:focus-visible { outline: 0.1875rem solid var(--colour-of-the-pale-ink); outline-offset: 0.1875rem; }

/* Skip link: .Jump, the first thing in the body. */
.Jump {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--colour-of-the-ochre);
  color: var(--colour-of-the-ink);
  transform: translateY(-130%);
}
.Jump:focus { transform: none; }

/* The path navigation: .Path > .Path-parts (.Path-home, .Path-link, .Path-here, .Path-toggle with .Path-slash) and the unfolding .Path-menu (.Path-places, .Path-place, .Path-number).
   It reads as one sentence from the school's name: each part carries its slash after it, so a wrapped row never starts with one.
   On a phone it wraps where it must; on a desk screen it is one row from the top left, ending in the slash. */
.Path { order: 0; position: relative; z-index: 5; font-size: 1rem; line-height: 1.3; }
.Path-parts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  column-gap: 0.5rem;
  margin: 0;
  padding: 0 var(--space-at-the-page-edge);
  list-style: none;
}
.Path-parts > li { display: flex; flex: 0 1 auto; align-items: center; column-gap: 0.5rem; min-inline-size: 0; }
.Path-parts > li:has(+ li:not(.Path-end))::after { content: "/"; }
.Path-link, .Path-here {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-block-size: 2.75rem;
  text-decoration: none;
}
.Path-link:hover { text-decoration: underline; }
.Path-link[aria-current], .Path-here { font-weight: 500; font-variation-settings: "wght" 500; }
.Path-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-block-size: 2.75rem;
  padding: 0;
  padding-inline-end: 0.5rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.Path-slash {
  --depth-of-the-step: 0.4375rem;
  display: inline-grid;
  place-items: center;
  inline-size: 1.875rem;
  block-size: 1.875rem;
  background: var(--colour-of-the-ochre);
  color: var(--colour-of-the-ink);
}
.Path[data-state="unfolded"] .Path-slash { background: var(--colour-of-the-deep-slate); color: var(--colour-of-the-pale-ink); }
html:not(.js) .Path-end { display: none; }
@media (min-width: 56em) {
  .Path-parts { padding-block: 0.5rem; }
  .Path-link, .Path-here { gap: 0.625rem; }
}
.Path-menu { background: var(--colour-of-the-deep-slate); color: var(--colour-of-the-pale-ink); }
.js .Path-menu {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows var(--time-of-the-unfold) var(--ease-with-weight), visibility 0s linear var(--time-of-the-unfold);
}
.js .Path[data-state="unfolded"] .Path-menu { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.Path-places {
  overflow: hidden;
  min-block-size: 0;
  margin: 0;
  padding: 0;
  padding-inline: var(--space-at-the-page-edge);
  list-style: none;
}
.Path-places > li:first-child { padding-block-start: 0.75rem; }
.Path-places > li:last-child { padding-block-end: 1rem; }
.Path-place {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  align-items: center;
  min-block-size: 3rem;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  text-decoration: none;
}
.Path-place:hover, .Path-place[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--colour-of-the-ochre);
  text-decoration-thickness: 0.1875rem;
  text-underline-offset: 0.32em;
}

/* The logo mark, inline SVG in the path: .Sign with rects .Sign-key, .Sign-held and .Sign-bar. */
.Sign { flex: none; inline-size: 2rem; }
.Sign-key { fill: var(--colour-of-the-pale-ink); }
.Sign-held, .Sign-bar { fill: var(--colour-of-the-ochre); }
@media (min-width: 56em) {
  .Sign { inline-size: 2.75rem; }
}

/* The cookie band, in flow under the path: #agree.Cookies > .Cookies-words + .Cookies-choices holding two equal .Key buttons,
   set here as plain single-line tabs on the deep slate, each standing on an ochre line.
   On a phone it is slim: the explanation on tight leading, the two choices on one line right under it. */
.Cookies {
  order: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding: 0.25rem var(--space-at-the-page-edge) 0;
  background: var(--colour-of-the-deep-slate);
  color: var(--colour-of-the-pale-ink);
  font-size: var(--size-of-small-type);
  line-height: 1.22;
}
.Cookies[hidden] { display: none; }
.Cookies-words { flex: 1 1 18rem; max-inline-size: 48rem; }
.Cookies-choices { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-start; gap: 0 1rem; }
.Cookies .Key {
  --colour-of-the-key: transparent;
  flex: none;
  min-block-size: 2.75rem;
  padding: 0;
  color: var(--colour-of-the-pale-ink);
  font-size: 0.9375rem;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--colour-of-the-ochre);
  text-decoration-thickness: 0.1875rem;
  text-underline-offset: 0.32em;
}
@media (min-width: 56em) {
  .Cookies { padding-block: 0.375rem; line-height: 1.4; }
  .Cookies-choices { justify-content: flex-end; gap: 0 1.5rem; margin-inline-start: auto; }
}

/* A page opening: section.Intro.Spread with the h1.Heading and .Intro-sentence in .Spread-story, a .Count in .Spread-narrow, a .Photo in .Spread-side.
   On a phone the opening sits close under the path so the first window keeps room for the offer band at its foot. */
.Intro { padding-block-start: 0.5rem; }
.Intro-sentence {
  max-inline-size: 36ch;
  margin-block: 0.625rem;
  font-size: clamp(1.1875rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.4;
}
@media (min-width: 56em) {
  .Intro { padding-block-start: clamp(1.25rem, 5vh, 3.5rem); }
  .Intro-sentence { margin-block: 1.25rem; }
}

/* Every heading stands on one ochre bar the length of its last line (the script measures it): .Heading on h1, h2. */
.Heading {
  inline-size: fit-content;
  max-inline-size: 100%;
  padding-block-end: calc(var(--thickness-of-the-bar) + var(--space-above-the-bar));
  background: linear-gradient(var(--colour-of-the-ochre), var(--colour-of-the-ochre)) no-repeat 0 100% / var(--length-of-the-last-line, 100%) var(--thickness-of-the-bar);
  font-size: var(--size-of-a-heading);
  font-weight: 500;
  font-variation-settings: "wght" 500;
  line-height: 1.16;
  letter-spacing: 0;
}

/* The count-in device: .Count holding four .Count-beat spans, each data-state="sounded | held | waiting | open | pressed"; size with --size-of-a-beat. */
.Count {
  --size-of-a-beat: clamp(1.5rem, 3vw, 2.5rem);
  --depth-of-the-step: calc(var(--size-of-a-beat) * 0.3);
  --colour-behind-the-count: var(--colour-of-the-slate);
  display: inline-flex;
  align-items: flex-end;
  gap: calc(var(--size-of-a-beat) * 0.32);
  padding-block-start: calc(var(--size-of-a-beat) * 0.4);
  border-block-end: var(--thickness-of-the-bar) solid var(--colour-of-the-ochre);
}
.Count-beat {
  position: relative;
  inline-size: var(--size-of-a-beat);
  block-size: calc(var(--size-of-a-beat) * 1.6);
  background: var(--colour-of-the-pale-ink);
  transition: background-color 300ms var(--ease-with-weight), translate 300ms var(--ease-with-weight);
}
.Count-beat[data-state="held"] { translate: 0 calc(var(--size-of-a-beat) * -0.3); }
.Count-beat[data-state="pressed"] { background: var(--colour-of-the-ochre); translate: 0 calc(var(--size-of-a-beat) * -0.18); }
.Count-beat[data-state="open"] { background: var(--colour-of-the-ochre); }
.Count-beat[data-state="waiting"]::after, .Count-beat[data-state="open"]::after {
  content: "";
  position: absolute;
  inset: 0.1875rem;
  background: var(--colour-behind-the-count);
}

/* The magazine spread, twelve columns in lanes of three, five and four: .Spread > .Spread-narrow, .Spread-story, .Spread-side, .Spread-pull (two lanes), .Spread-across (all). */
.Spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem var(--space-between-columns);
  padding-inline: var(--space-at-the-page-edge);
  padding-block-end: var(--space-between-sections);
}
.Spread-pull {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  font-weight: 500;
  font-variation-settings: "wght" 500;
  line-height: 1.2;
}
@media (min-width: 56em) {
  .Spread { grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: 1.5rem; }
  .Spread-narrow { grid-column: 1 / span 3; }
  .Spread-story { grid-column: 4 / span 5; }
  .Spread-side { grid-column: 9 / span 4; }
  .Spread-pull { grid-column: 4 / span 9; }
  .Spread-across { grid-column: 1 / -1; }
}

/* The two-line initial on the first paragraph of a story: .Initial on that p. */
.Initial::first-letter {
  float: left;
  float: inline-start;
  padding-inline-end: 0.08em;
  font-size: 3.35em;
  font-weight: 500;
  line-height: 0.82;
}

/* Photograph and caption: figure.Photo > .Photo-frame (img or video inside, stepped crop, 4:3 unless you set aspect-ratio) + figcaption.Photo-words. */
.Photo { display: grid; gap: 0.625rem; }
.Photo-frame {
  --depth-of-the-step: clamp(1.5rem, 4vw, 3.5rem);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--colour-of-the-deep-slate);
}
.Photo-frame > img, .Photo-frame > video { inline-size: 100%; block-size: 100%; object-fit: cover; }
.Photo-words { font-size: var(--size-of-small-type); line-height: 1.4; }

/* Running text, also for the policy pages: .Words around paragraphs, h2.Heading, h3 and lists; links press to ochre. */
.Words > * + * { margin-block-start: var(--space-between-paragraphs); }
.Words > h2, .Words > h3 { margin-block-start: 2.2em; }
.Words h3 { font-size: 1.25rem; font-weight: 500; font-variation-settings: "wght" 500; line-height: 1.3; }
.Words a:hover { background: var(--colour-of-the-ochre); color: var(--colour-of-the-ink); }

/* A list of particulars (format, ages, tuition): dl.Particulars with dt and dd pairs. */
.Particulars {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(0, 2fr);
  gap: 0.625rem 1.25rem;
}
.Particulars dt { font-weight: 500; font-variation-settings: "wght" 500; }

/* The stepped button, for links and buttons alike: .Key; toggles take data-state="released | pressed"; recolour with --colour-of-the-key. */
.Key {
  --colour-of-the-key: var(--colour-of-the-ochre);
  --depth-of-the-step: 0.5rem;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2.75rem;
  padding: 0.5rem 1rem;
  padding-inline-end: 1.375rem;
  border: 0;
  background: none;
  color: var(--colour-of-the-ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: translate 140ms var(--ease-with-weight);
}
.Key::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--colour-of-the-key);
}
.Key:hover { translate: 0 0.125rem; }
.Key[data-state="released"] { --colour-of-the-key: var(--colour-of-the-pale-ink); }
.Key[data-state="pressed"] { translate: 0 0.1875rem; }

/* A list with stepped-key bullets: ul.Beats > li. */
.Beats { display: grid; gap: 0.625rem; padding: 0; list-style: none; }
.Beats > li { display: grid; grid-template-columns: 1rem minmax(0, 1fr); column-gap: 0.75rem; }
.Beats > li::before {
  --depth-of-the-step: 0.3125rem;
  content: "";
  inline-size: 1rem;
  block-size: 1rem;
  margin-block-start: 0.35em;
  background: var(--colour-of-the-ochre);
}

/* The hand-off that ends every page above the footer: .Onward > .Onward-line (one large sentence) + .Onward-keys (one or two .Key links). */
.Onward {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem var(--space-between-columns);
  margin-inline: var(--space-at-the-page-edge);
  padding-block-end: 1.25rem;
  border-block-end: var(--thickness-of-the-bar) solid var(--colour-of-the-ochre);
}
.Onward-line {
  flex: 1 1 22rem;
  max-inline-size: 24ch;
  font-size: clamp(1.5rem, 1rem + 2.4vw, 3rem);
  font-weight: 500;
  font-variation-settings: "wght" 500;
  line-height: 1.15;
}
.Onward-keys { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Photographs settling into their columns on a spread's first entrance: .Settle on figures inside a .Spread that starts below the first window. */
.Settle {
  transition: opacity var(--time-of-the-settle) var(--ease-with-weight), translate var(--time-of-the-settle) var(--ease-with-weight);
  transition-delay: calc(var(--beat-of-the-settle, 0) * 140ms);
}
.Settle[data-state="waiting"] { opacity: 0; translate: 0 1.5rem; }

/* The footer: .Ending > .Ending-parts (four very large .Ending-part links with .Ending-number and .Ending-label) + one small line .Ending-small. */
.Ending {
  order: 3;
  padding: clamp(2.5rem, 8vh, 5.5rem) var(--space-at-the-page-edge) 1.5rem;
  color: var(--colour-of-the-ink);
}
.Ending-parts { margin: 0; padding: 0; list-style: none; }
.Ending-part {
  display: grid;
  grid-template-columns: clamp(2.75rem, 8vw, 6.5rem) minmax(0, 1fr);
  align-items: baseline;
  padding-block: 0.08em;
  font-size: var(--size-of-the-ending-links);
  line-height: 1.12;
  text-decoration: none;
}
.Ending-number { font-size: max(0.38em, 1rem); }
.Ending-label { justify-self: start; padding-inline: 0.08em; }
.Ending-part:hover .Ending-label, .Ending-part:focus-visible .Ending-label { background: var(--colour-of-the-ochre); }
.Ending-small {
  margin-block-start: 1.75rem;
  color: var(--colour-of-the-reading-ink);
  font-size: var(--size-of-small-type);
  line-height: 2.3;
}
.Ending-settings {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.125rem;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* The offer band, pinned to the foot of the window and wiped across once: #deal.Offer > .Offer-words + .Offer-shut (present only when the school has an offer).
   While it is in, the page keeps its height free at the foot so the last line of the footer is never under it. */
.Offer {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: var(--height-of-the-offer);
  max-block-size: 20vh;
  padding: 0.125rem var(--space-at-the-page-edge);
  background: var(--colour-of-the-ochre);
  color: var(--colour-of-the-ink);
  font: 400 clamp(1rem, 0.8rem + 1vw, 1.5rem) / 1.2 var(--face-for-the-opening);
  opacity: 0;
  transform: translateX(-100%);
  transition: transform var(--time-of-the-wipe) var(--ease-with-weight), opacity 200ms linear;
}
.Offer[hidden] { display: none; }
.Offer.is-in { opacity: 1; transform: none; }
body:has(> .Offer.is-in) { padding-block-end: var(--height-of-the-offer); }
.Offer-shut {
  flex: none;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
@media (min-width: 56em) {
  .Offer { padding-block: 0.375rem; }
}

/* Reduced motion: everything is shown in place and nothing travels. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
  }
  .Settle[data-state="waiting"] { opacity: 1; translate: none; }
  .Offer { transform: none; }
  .Key:hover, .Key[data-state="pressed"] { translate: none; }
}

@media (min-width: 120.0625rem) { html { font-size: 0.8333vw; } }
body, html {
  overflow-x: clip;
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
header :is(a, button), nav :is(a, button) { position: relative; z-index: 2; }
