:root {
  color-scheme: light;
  --paper: #efeee8;
  --ink: #262622;
  --muted: #676760;
  --line: #d1d0c7;
  --orange: #bc390e;
  --mono: "IBM Plex Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
::selection { color: var(--paper); background: var(--orange); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .25em; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--orange); outline-offset: 5px; }
.mono { font-family: var(--mono); font-size: .75rem; font-weight: 400; line-height: 1.5; }
.site-shell {
  width: min(1280px, calc(100% - 112px));
  min-height: 100vh;
  min-height: 100svh;
  margin: auto;
  display: flex;
  flex-direction: column;
}
.skip-link { position: fixed; z-index: 20; top: -100px; left: 1rem; padding: 1rem; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 1rem; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; min-height: 108px; padding: 22px 0; border-bottom: 1px solid var(--ink); }
.wordmark-slot {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 2.5rem;
  container-type: inline-size;
}
.wordmark {
  position: absolute;
  left: 0;
  bottom: 0;
  display: inline-flex;
  align-items: flex-end;
  height: 2.5rem;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -.095em;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: font-size 280ms cubic-bezier(.22, 1, .36, 1), letter-spacing 280ms cubic-bezier(.22, 1, .36, 1);
}
.wordmark-letters { display: inline-flex; align-items: baseline; }
.wordmark-rest {
  display: inline-grid;
  grid-template-columns: 0fr;
  opacity: 0;
  transition: grid-template-columns 180ms cubic-bezier(.4, 0, .2, 1), opacity 100ms ease;
}
.wordmark-rest > span { min-width: 0; overflow: hidden; }
.wordmark-tail {
  display: inline-flex;
  align-items: baseline;
  padding: 0 .2em 0 0;
  transition: padding 180ms cubic-bezier(.4, 0, .2, 1);
}
.wordmark-last-initial { position: relative; display: inline-block; }
.wordmark-dot-track {
  /* This track is exactly as wide as the m, whatever the font or size. */
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translateX(0);
  transition: transform 180ms cubic-bezier(.4, 0, .2, 1);
}
.wordmark-dot-track .wordmark-dot { position: absolute; top: 0; left: 100%; }
.wordmark:is(:hover, :focus-visible) {
  /* Fit the full name within its own header space, leaving the nav still. */
  font-size: clamp(1rem, 12cqi, 2.5rem);
  letter-spacing: -.055em;
}
.wordmark:is(:hover, :focus-visible) .wordmark-rest {
  grid-template-columns: 1fr;
  opacity: 1;
  transition: grid-template-columns 300ms cubic-bezier(.22, 1, .36, 1), opacity 160ms ease;
}
.wordmark:is(:hover, :focus-visible) .wordmark-tail {
  padding: 0 0 0 .48em;
  transition: padding 300ms cubic-bezier(.22, 1, .36, 1);
}
.wordmark:is(:hover, :focus-visible) .wordmark-dot-track {
  /* Travel back across the m and its new leading space to follow the h. */
  transform: translateX(calc(-100% - .48em));
  transition: transform 300ms cubic-bezier(.22, 1, .36, 1);
}
.wordmark:is(:hover, :focus-visible) .wordmark-tail .wordmark-rest { transition-delay: 30ms; }
.wordmark-dot, .name-stop { color: var(--orange); }
nav { margin-left: auto; display: flex; flex-shrink: 0; gap: 2rem; align-items: center; }
nav a { font-size: .875rem; text-decoration: none; padding: 6px 0; }
nav a:hover, nav a[aria-current="page"] { color: var(--orange); }
h1 { font-size: clamp(4.5rem, 7.5vw, 7.3rem); font-weight: 500; line-height: .98; letter-spacing: -.065em; margin: 0; }
.home-intro { padding: 76px 0 68px; }
.home-intro p { font-size: 1rem; line-height: 1.65; margin: 32px 0 0; color: var(--muted); }
.home-intro p a:hover { color: var(--orange); }
.project-index { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 40px; padding: 28px 0 36px; border-top: 1px solid var(--line); }
.index-label { color: var(--muted); font-size: .875rem; margin: 4px 0 0; }
.project-links { list-style: none; padding: 0; margin: 0; }
.project-links li + li { margin-top: 24px; }
.project-links a { display: block; width: fit-content; text-decoration: none; }
.project-title { font-size: 1.375rem; letter-spacing: -.025em; }
.project-arrow { display: inline-block; font-size: 1rem; margin-left: 10px; color: var(--orange); transition: transform .18s; }
.project-links a:hover .project-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.project-links a:hover .project-arrow { transform: translate(2px, -2px); }
.project-caption { display: block; margin-top: 9px; font-size: 1rem; color: var(--muted); line-height: 1.55; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: auto; padding: 70px 0 25px; }
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--orange); }
.back-top { font-size: 1.25rem; padding: 8px; }

/* Each project gets enough room to be used and explained. */
.project-heading { padding: 42px 0 40px; }
.back-link { display: inline-flex; align-items: center; gap: 12px; font-size: .875rem; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--orange); }
.project-heading h1 { font-size: clamp(3rem, 5vw, 5rem); margin: 33px 0 22px; }
.project-heading > p { font-size: 1rem; line-height: 1.65; color: var(--muted); max-width: 620px; margin: 0; }
.study-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: start; gap: clamp(40px, 6vw, 90px); padding-bottom: 35px; }
.study-notes h2 { font-size: 1.25rem; font-weight: 500; letter-spacing: -.025em; margin: 4px 0 18px; }
.study-notes h3 { font-size: 1rem; font-weight: 500; margin: 30px 0 12px; }
.study-notes p, .study-notes ol { color: #585951; font-size: 1rem; line-height: 1.75; margin: 0 0 18px; }
.study-notes ol { padding-left: 20px; }
.study-notes li { padding-left: 5px; margin-bottom: 12px; }
.study-notes strong { font-weight: 500; color: var(--ink); }
.study-notes .study-note { font-size: .875rem; margin: 25px 0 0; }

.about-content { padding: 76px 0 40px; }
.about-content h1 { font-size: clamp(3.5rem, 6vw, 6rem); }
.about-prose { max-width: 590px; margin-top: 40px; }
.about-prose p { font-size: 1.125rem; line-height: 1.8; margin: 0 0 22px; color: #585951; }

/* The original instrument finish, kept on its own project page. */
.instrument { padding: 24px; background: #e2e1d9; border: 1px solid #cecdc4; border-radius: 12px; box-shadow: 0 2px 0 #cac9c0, 0 16px 25px -20px #37372d55, inset 0 1px 0 #ffffffa0; scroll-margin-top: 2rem; }
.instrument-top { display: flex; justify-content: space-between; align-items: center; margin: 0 1px 20px; }
.instrument-id { text-transform: uppercase; letter-spacing: .06em; color: #62625a; }
.instrument h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -.035em; margin: 5px 0 0; }
.instrument-mark { text-align: right; line-height: 1.2; border-left: 1px solid #b7b6ad; padding-left: 12px; color: #616159; }
.screen { position: relative; height: 300px; background: #252925; border: 5px solid #d0cfc7; border-radius: 6px; outline: 1px solid #b8b7ae; overflow: hidden; box-shadow: inset 0 2px 8px #0008; }
.screen canvas { width: 100%; height: 100%; display: block; }
.screen-top, .screen-bottom { display: flex; justify-content: space-between; position: absolute; left: 15px; right: 15px; z-index: 1; color: #bac1b3; font-size: .75rem; pointer-events: none; }
.screen-top { top: 13px; }.screen-bottom { bottom: 12px; }
.screen-top span:last-child { font-size: .75rem; color: #9fb397; }
.instrument-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 22px; padding-top: 24px; }
.ratio-control { border: 0; margin: 0; padding: 0; min-width: 0; flex-shrink: 0; }
.control-label { display: block; margin-bottom: 9px; color: #62625a; font-size: .875rem; }
.ratio-options { display: flex; gap: 5px; }
.ratio-options label { position: relative; cursor: pointer; }
.ratio-options input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ratio-options span { display: block; padding: 10px 11px; border: 1px solid #bfbeb4; border-radius: 3px; font-family: var(--mono); font-size: .875rem; box-shadow: 0 2px 0 #b8b7ad, inset 0 1px 0 #ffffffb3; background: #eeede5; transition: background .15s, transform .15s; }
.ratio-options input:checked + span { background: #35362f; color: #f2f1e8; border-color: #35362f; box-shadow: inset 0 1px 3px #0005; transform: translateY(1px); }
.ratio-options input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 3px; }
.phase-control { flex: 1; min-width: 80px; padding-bottom: 7px; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: #9e9f93; border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 3px; background: #9e9f93; border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 15px; height: 24px; margin-top: -11px; border: 1px solid #8f9086; border-radius: 3px; background: #eeede5; box-shadow: 0 2px 2px #0002; }
input[type="range"]::-moz-range-thumb { width: 15px; height: 24px; border: 1px solid #8f9086; border-radius: 3px; background: #eeede5; box-shadow: 0 2px 2px #0002; }
.play-button { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; padding: 0; border: 1px solid #c44415; border-radius: 4px; background: #e85a26; box-shadow: 0 2px 0 #a43b18, inset 0 1px 0 #ffffff50; color: #231d18; }
.play-button:hover { background: #f06b3a; }.play-button:active { transform: translateY(2px); box-shadow: inset 0 1px 3px #0002; }
.play-icon { font-family: Arial, sans-serif; font-size: 1rem; }
.instrument-foot { flex-wrap: wrap; border-top: 1px solid #c6c5bb; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 24px; padding-top: 13px; color: #62625a; }

.project-page .screen { height: 350px; }
.no-script-note { position: absolute; left: 20px; right: 20px; top: 40%; text-align: center; color: #e1e6da; }

/* A small audio-learning instrument, deliberately more studio bench than dashboard. */
.synth-instrument { margin-bottom: 38px; padding: clamp(18px, 3vw, 34px); background: #d8d8ce; border: 1px solid #bcbdb3; border-radius: 9px; box-shadow: 0 2px 0 #b6b6ac, 0 18px 35px -28px #2e302a88, inset 0 1px 0 #ffffffa6; }
.synth-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 0 2px 23px; }
.synth-eyebrow { margin: 0 0 8px; color: #64655d; letter-spacing: .045em; }
.synth-topline h2 { margin: 0; font-size: 1.5rem; font-weight: 500; letter-spacing: -.035em; }
.synth-status { flex-shrink: 0; margin: 5px 0 0; padding: 7px 9px; border: 1px solid #b5b6aa; border-radius: 3px; background: #e8e8df; color: #4e5747; }
.scope-wrap { position: relative; overflow: hidden; height: clamp(180px, 26vw, 245px); border: 5px solid #c6c7bd; border-radius: 5px; outline: 1px solid #a8a99f; background: #1f2420; box-shadow: inset 0 2px 8px #0009; }
.scope-wrap canvas { width: 100%; height: 100%; display: block; }
.scope-labels { position: absolute; inset: 13px 15px auto; display: flex; justify-content: space-between; color: #a7b69b; pointer-events: none; }
.scope-labels span:last-child { color: #f28a59; }
.synth-controls { display: grid; grid-template-columns: 1.65fr 1.25fr repeat(4, minmax(100px, 1fr)); gap: 18px; align-items: end; padding: 26px 1px 22px; }
.preset-control, .waveform-control { min-width: 0; margin: 0; padding: 0; border: 0; }
.preset-options, .waveform-options { display: flex; flex-wrap: wrap; gap: 5px; }
.preset-options label, .waveform-options label { position: relative; cursor: pointer; }
.preset-options input, .waveform-options input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.preset-options span, .waveform-options span { display: block; padding: 9px 10px; border: 1px solid #b6b7ad; border-radius: 3px; background: #ecece5; box-shadow: 0 2px 0 #aaaBA1, inset 0 1px 0 #fff; font-family: var(--mono); font-size: .8125rem; }
.preset-options input:checked + span, .waveform-options input:checked + span { border-color: #363832; background: #363832; box-shadow: inset 0 1px 3px #0008; color: #f5f4ed; transform: translateY(1px); }
.preset-options input:focus-visible + span, .waveform-options input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 3px; }
.synth-slider { min-width: 0; display: block; }
.synth-slider .control-label { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.synth-slider output { color: #4d4e48; font-family: var(--mono); font-size: .75rem; }
.keyboard-area { padding-top: 6px; border-top: 1px solid #bebfb5; }
.keyboard-help { display: flex; justify-content: space-between; margin: 13px 0 12px; color: #62635c; letter-spacing: .035em; }
.keyboard-help span { color: #4d5549; }
.piano { position: relative; display: flex; height: clamp(150px, 19vw, 190px); padding-right: 0; user-select: none; touch-action: none; }
.piano-key { position: relative; display: flex; width: calc(100% / 8); min-width: 0; align-items: flex-end; justify-content: space-between; border: 1px solid #a8a99e; border-radius: 0 0 4px 4px; padding: 10px 9px; background: #f0f0e9; box-shadow: inset 0 -5px 0 #d8d8d0, inset 0 1px 0 #fff; color: #5a5a54; text-align: left; }
.piano-key.white + .piano-key.white { margin-left: -1px; }
.piano-key.white:hover, .piano-key.white.is-playing { background: #dfe7d5; box-shadow: inset 0 -4px 0 #bfcbaf, inset 0 1px 0 #fff; }
.piano-key span { font-family: var(--mono); font-size: .75rem; }
.piano-key kbd { border: 0; padding: 0; background: transparent; color: #6d6e66; font-family: var(--mono); font-size: .6875rem; }
.piano-key.black { position: absolute; z-index: 2; top: 0; width: 7.2%; height: 62%; align-items: flex-end; border-color: #20221f; border-radius: 0 0 3px 3px; background: #2c2f2a; box-shadow: inset 0 -4px 0 #1b1e1b, inset 0 1px 0 #5c6057; color: #ecede5; }
.piano-key.black:hover, .piano-key.black.is-playing { background: #c64a1c; border-color: #9b3916; box-shadow: inset 0 -4px 0 #9f3918, inset 0 1px 0 #f1926c; }
.piano-key.black kbd { color: inherit; }
.piano-key.black:nth-of-type(2) { left: 8.9%; }
.piano-key.black:nth-of-type(4) { left: 21.4%; }
.piano-key.black:nth-of-type(7) { left: 46.4%; }
.piano-key.black:nth-of-type(9) { left: 58.9%; }
.piano-key.black:nth-of-type(11) { left: 71.4%; }
.synth-foot { margin: 20px 0 0; padding: 14px 1px 0; border-top: 1px solid #bebfb5; color: #5e6058; letter-spacing: .025em; }

@media (min-width: 1600px) {
  .home-intro { padding-top: 96px; padding-bottom: 88px; }
  .project-page .screen { height: 400px; }
}
@media (max-width: 1100px) {
  .site-shell { width: calc(100% - 72px); }
  .project-index { grid-template-columns: 130px minmax(0, 1fr); gap: 30px; }
  .study-layout { gap: 36px; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .instrument { padding: 19px; }
  .instrument-controls { gap: 14px; }
  .ratio-options span { padding: 10px 8px; }
  .project-page .screen { height: 310px; }
  .synth-controls { grid-template-columns: 1.4fr repeat(2, minmax(130px, 1fr)); }
}
@media (max-width: 800px) {
  .site-shell { width: calc(100% - 48px); }
  .site-header { min-height: 88px; }
  h1 { font-size: clamp(4.5rem, 12vw, 6rem); }
  .home-intro { padding: 58px 0 55px; }
  .project-index { grid-template-columns: 100px minmax(0, 1fr); gap: 24px; }
  .study-layout { grid-template-columns: 1fr; gap: 40px; }
  .instrument { width: 100%; max-width: 620px; padding: 24px; }
  .project-page .screen { height: 350px; }
  .instrument-controls { gap: 24px; }
  .ratio-options span { padding: 10px 14px; }
  .study-notes { max-width: 590px; }
  .about-content { padding-top: 58px; }
  .synth-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .preset-control, .waveform-control { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .site-shell { width: calc(100% - 36px); }
  nav { gap: 20px; }
  .wordmark { font-size: 2.25rem; }
  .home-intro { padding: 48px 0; }
  h1 { font-size: 4.5rem; }
  .home-intro p { max-width: 260px; margin-top: 28px; }
  .project-index { grid-template-columns: 1fr; gap: 20px; padding: 22px 0; }
  .project-title { font-size: 1.25rem; }
  .project-caption { max-width: 250px; }
  .site-footer { padding-top: 48px; }
  .project-heading { padding-top: 30px; }
  .project-heading h1 { font-size: 3rem; }
  .instrument { padding: 16px; border-radius: 9px; }
  .instrument-top { margin-bottom: 16px; }
  .project-page .screen { height: 276px; }
  .screen-top, .screen-bottom { left: 10px; right: 10px; }
  .screen-top span { font-size: .75rem; }
  .instrument-controls { gap: 13px; padding-top: 18px; }
  .ratio-options { gap: 4px; }
  .ratio-options span { padding: 10px 8px; }
  .phase-control { min-width: 65px; }
  .play-button { width: 38px; height: 42px; }
  .instrument-foot { gap: 5px; margin-top: 20px; }
  .about-content { padding-top: 48px; }
  .about-prose { margin-top: 32px; }
  .synth-instrument { margin-left: -4px; margin-right: -4px; padding: 16px; }
  .synth-topline { padding-bottom: 17px; }
  .synth-status { font-size: .6875rem; }
  .synth-controls { grid-template-columns: 1fr; gap: 17px; padding-top: 21px; }
  .preset-control, .waveform-control { grid-column: auto; }
  .scope-wrap { height: 172px; }
  .piano { height: 142px; }
  .piano-key { padding: 8px 4px; }
  .piano-key span { display: none; }
  .piano-key.white kbd { font-size: .625rem; }
  .piano-key.black { padding: 7px 2px; }
  .piano-key.black kbd { font-size: .625rem; }
  .synth-foot { line-height: 1.6; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
