/* =============================================================================
   visual-musicology.com
   One stylesheet for the landing page, the imprint and the 404 page. No inline styles and no third-party requests:
   the pages run under a strict Content-Security-Policy (deploy/default.conf).
   Fonts: Instrument Serif, Inter, JetBrains Mono (SIL OFL 1.1, fonts/OFL-*.txt), served from this host.
   The twelve pitch-class colours are those of the circle-of-fifths colour wheel of the harmonic fingerprint
   (Miller et al., DocEng 2019); the six level colours those of the rhythmic fingerprint (Fürst et al., VIS4DH 2020).
   ========================================================================== */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ------------------------------------------------------------- tokens --- */
:root {
  color-scheme: light;

  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* circle of fifths, clockwise from C */
  --pc-c: #F90859;  --pc-g: #F84203;  --pc-d: #F79300;  --pc-a: #F6D009;
  --pc-e: #F7F409;  --pc-b: #D5F500;  --pc-fs: #3FF902; --pc-db: #06F7A8;
  --pc-ab: #0670F7; --pc-eb: #3A08F5; --pc-bb: #9D08E6; --pc-f: #E508F6;
  --spectrum: linear-gradient(90deg, var(--pc-c), var(--pc-g), var(--pc-d), var(--pc-a), var(--pc-e), var(--pc-b),
    var(--pc-fs), var(--pc-db), var(--pc-ab), var(--pc-eb), var(--pc-bb), var(--pc-f));

  /* rhythmic fingerprint levels 2 .. -3 (notes / rests) */
  --rn-2: #6A1B9A; --rn-1: #A33A95; --rn-0: #C96196; --rn-m1: #E58D9B; --rn-m2: #F7BBA5; --rn-m3: #FFECB3;
  --rr-2: #4B981B; --rr-1: #39A247; --rr-0: #5FC892; --rr-m1: #8FE6D7; --rr-m2: #A6E2F7; --rr-m3: #B3C6FF;

  /* surfaces (light) */
  --bg: #F7F5F1;
  --bg-2: #EFECE6;
  --surface: #FFFFFF;
  --border: #E2DDD5;
  --border-strong: #C9C2B7;
  --ink: #15121D;
  --ink-2: #3B3647;
  --ink-3: #635D70;
  --accent: #4325D3;
  --accent-ink: #3517C0;
  --accent-soft: #ECE8FE;
  --on-accent: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(21, 18, 29, .06), 0 1px 1px rgba(21, 18, 29, .04);
  --shadow-md: 0 12px 32px -12px rgba(21, 18, 29, .22), 0 2px 6px rgba(21, 18, 29, .06);
  --shadow-lg: 0 40px 80px -30px rgba(21, 18, 29, .35), 0 8px 24px -8px rgba(21, 18, 29, .12);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* the stage: the hero and the contact band stay dark in both themes */
  --stage: #0C0A13;
  --stage-2: #15111F;
  --stage-ink: #F4F1FA;
  --stage-ink-2: #C7C0D6;
  --stage-ink-3: #9C94AE;
  --stage-line: rgba(244, 241, 250, .09);
  --stage-accent: #B4A6FF;

  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(72px, 11vw, 148px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F0D16;
  --bg-2: #14111D;
  --surface: #191524;
  --border: #2A2537;
  --border-strong: #3D3650;
  --ink: #F2EFF8;
  --ink-2: #CAC4D8;
  --ink-3: #A39BB5;
  --accent: #A898FF;
  --accent-ink: #C2B7FF;
  --accent-soft: #231C44;
  --on-accent: #120D26;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .85), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --stage: #08070D;
  --stage-2: #110E19;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F0D16;
    --bg-2: #14111D;
    --surface: #191524;
    --border: #2A2537;
    --border-strong: #3D3650;
    --ink: #F2EFF8;
    --ink-2: #CAC4D8;
    --ink-3: #A39BB5;
    --accent: #A898FF;
    --accent-ink: #C2B7FF;
    --accent-soft: #231C44;
    --on-accent: #120D26;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
    --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .85), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --stage: #08070D;
    --stage-2: #110E19;
  }
}

/* --------------------------------------------------------------- base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
ul, ol { margin: 0; padding: 0; }
.sprite { display: none; }
.icon { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .7em;
  margin: 0 0 1.25rem;
  font: 500 .75rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: var(--spectrum); }
.eyebrow .num { color: var(--ink-3); }

.display {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -.012em; line-height: 1.02;
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  text-wrap: balance;
}
.display em { font-style: italic; }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.6; color: var(--ink-2); max-width: 46rem; }

/* -------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 46px; padding: 0 1.15em; border-radius: 999px;
  font: 600 .95rem/1 var(--font-sans); letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--sm { min-height: 38px; padding: 0 .9em; font-size: .875rem; }
.btn .icon { transition: transform .2s var(--ease); }
.btn:hover .icon--arrow { transform: translateX(3px); }
.btn:hover .icon--ext { transform: translate(2px, -2px); }

/* -------------------------------------------------------------- header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--stage);
  border-bottom: 1px solid var(--stage-line);
  color: var(--stage-ink);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--stage-ink); text-decoration: none;
  font: 400 1.4rem/1 var(--font-display); letter-spacing: -.005em; white-space: nowrap; }
.brand svg { width: 32px; height: 32px; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 2px; list-style: none; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--stage-ink-2); text-decoration: none;
  font-size: .9rem; font-weight: 500; transition: color .2s, background-color .2s; }
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--stage-ink); background: rgba(255, 255, 255, .07); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--stage-line); background: transparent; color: var(--stage-ink-2);
}
.theme-toggle:hover { color: var(--stage-ink); background: rgba(255, 255, 255, .07); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle [data-show] { display: none; }
.theme-toggle[data-mode="system"] [data-show="system"],
.theme-toggle[data-mode="light"] [data-show="light"],
.theme-toggle[data-mode="dark"] [data-show="dark"] { display: block; }
.site-header .btn--primary { background: var(--stage-ink); border-color: var(--stage-ink); color: var(--stage); min-height: 40px; }
.site-header .btn--primary:hover { background: #fff; border-color: #fff; }
.site-header :focus-visible { box-shadow: 0 0 0 2px var(--stage), 0 0 0 4px var(--stage-accent); }

@media (max-width: 1080px) { .site-nav { display: none; } .header-actions { margin-left: auto; } }
@media (max-width: 460px) { .site-header .btn--primary { display: none; } }

/* ---------------------------------------------------------------- hero --- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--stage); color: var(--stage-ink);
  padding: clamp(48px, 8vw, 104px) 0 clamp(64px, 9vw, 120px);
}
/* a five-line staff across the stage, and two soft spectral glows */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 55% at 85% 30%, rgba(58, 8, 245, .30), transparent 70%),
    radial-gradient(45% 50% at 12% 95%, rgba(249, 8, 89, .16), transparent 70%),
    radial-gradient(40% 40% at 60% 100%, rgba(6, 247, 168, .08), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 120px; z-index: -1;
  transform: translateY(-50%);
  background: repeating-linear-gradient(to bottom, var(--stage-line) 0 1px, transparent 1px 30px);
  -webkit-mask-image: linear-gradient(90deg, transparent 42%, #000 62%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent 42%, #000 62%, #000 92%, transparent);
  height: 121px;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero .eyebrow { color: var(--stage-accent); }
.hero h1 {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -.02em; line-height: .9;
  font-size: clamp(3.6rem, 8.4vw, 7.6rem);
  margin: 0 0 .28em;
}
.hero h1 .line { display: block; }
.hero h1 em {
  font-style: italic; padding-right: .06em;
  background: linear-gradient(100deg, #FF6B9A 0%, #FFB15C 22%, #F7F49A 40%, #7CF5C8 58%, #6FA8FF 76%, #C08BFF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .tagline { font: italic 400 clamp(1.45rem, 2.4vw, 2rem)/1.25 var(--font-display); color: var(--stage-ink); margin: 0 0 1.1rem; max-width: 30ch; }
.hero .intro { color: var(--stage-ink-2); font-size: 1.075rem; max-width: 36rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 34px; }
.hero .btn { background: transparent; color: var(--stage-ink); border-color: rgba(244, 241, 250, .28); }
.hero .btn:hover { background: rgba(255, 255, 255, .06); border-color: rgba(244, 241, 250, .55); }
.hero .btn--primary { background: var(--stage-ink); color: var(--stage); border-color: var(--stage-ink); }
.hero .btn--primary:hover { background: #fff; }
.hero :focus-visible { box-shadow: 0 0 0 2px var(--stage), 0 0 0 4px var(--stage-accent); }
.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; list-style: none; padding-top: 22px; border-top: 1px solid var(--stage-line); }
.facts li { display: flex; flex-direction: column; gap: 2px; }
.facts b { font: 400 1.9rem/1 var(--font-display); color: var(--stage-ink); }
.facts span { font: 500 .7rem/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--stage-ink-3); }

/* the layered composition */
.stagecomp { position: relative; aspect-ratio: 1.12; min-height: 0; }
.stagecomp figure { margin: 0; }
.comp-card {
  position: absolute; overflow: hidden; border-radius: 16px; background: #fff;
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .08);
}
.comp-card img { width: 100%; height: 100%; object-fit: cover; }
.comp-card--main { left: 4%; top: 9%; width: 78%; aspect-ratio: 1.6; z-index: 2; }
.comp-card--back { right: 0; top: 0; width: 52%; aspect-ratio: 1.45; z-index: 1; opacity: .9; transform: rotate(3deg); }
.comp-card--low { right: 3%; bottom: 2%; width: 50%; aspect-ratio: 1.7; z-index: 3; transform: rotate(-2deg); }
.comp-glyph {
  position: absolute; left: -2%; bottom: 0; z-index: 4; width: 34%; aspect-ratio: 1;
  border-radius: 50%; padding: 4%;
  background: radial-gradient(circle at 50% 45%, #fff 0 60%, #F3F0FF 100%);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .5);
}
.comp-glyph svg { width: 100%; height: 100%; overflow: visible; }
.comp-tag {
  position: absolute; z-index: 5; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 9px; border-radius: 999px;
  background: rgba(12, 10, 19, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .14); color: var(--stage-ink);
  font: 500 .72rem/1 var(--font-mono); letter-spacing: .06em; white-space: nowrap;
}
.comp-tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #fff); box-shadow: 0 0 10px var(--c, #fff); }
.comp-tag--a { left: 10%; top: 3%; --c: var(--pc-g); }
.comp-tag--b { right: 2%; top: 52%; --c: var(--pc-db); }
.comp-tag--c { left: 30%; bottom: -2%; --c: var(--pc-bb); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stagecomp { max-width: 640px; width: 100%; margin: 8px auto 0; }
}
@media (max-width: 520px) {
  .comp-tag { font-size: .62rem; padding: 6px 9px 6px 8px; }
  .comp-tag--b { display: none; }
}

/* spectral rule under the hero */
.spectrum-rule { height: 4px; background: var(--spectrum); }

/* ------------------------------------------------------------- sections --- */
.section { padding: var(--section-y) 0; position: relative; }
.section--alt { background: var(--bg-2); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head .lede { margin: 0; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } }

/* idea */
.idea-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 88px);
  align-items: center; margin-bottom: clamp(48px, 7vw, 88px); }
.statement {
  font: 400 clamp(1.8rem, 3.1vw, 2.75rem)/1.15 var(--font-display); letter-spacing: -.01em;
  margin: 0; text-wrap: balance;
}
.augment-figure { margin: 0; padding: clamp(18px, 3vw, 30px); border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.augment { width: 100%; height: auto; overflow: visible; }
.augment .aug-staff path { stroke: var(--ink-3); stroke-width: 1.2; fill: none; }
.augment .aug-staff .bar { stroke: var(--ink-2); stroke-width: 1.6; }
.augment .aug-time text { font: 400 38px var(--font-display); fill: var(--ink); }
.augment .bar--end { stroke-width: 4; }
.augment .hole { fill: var(--surface); }
.augment .aug-stem { stroke: var(--ink); stroke-width: 2; }
.augment .aug-ledger { stroke: var(--ink-3); stroke-width: 1.4; }
.augment .aug-head { stroke: rgba(0, 0, 0, .25); stroke-width: .8; }
.augment .aug-link { stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 3 4; }
.augment .ring { fill: var(--surface); stroke: var(--border-strong); stroke-width: 3; }
.augment .aug-root { font: 600 30px var(--font-sans); fill: var(--ink); }
.augment-figure figcaption { margin-top: 14px; font-size: .86rem; line-height: 1.5; color: var(--ink-3); }
@media (max-width: 900px) { .idea-grid { grid-template-columns: 1fr; } }
.statement em { font-style: italic; color: var(--accent-ink); }
.statement-source { display: block; margin-top: 18px; font: 500 .75rem/1.4 var(--font-mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; counter-reset: pillar; }
.pillar { position: relative; padding: 28px 26px 26px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.pillar h3 { font: 600 1.15rem/1.3 var(--font-sans); letter-spacing: -.01em; margin: 18px 0 8px; }
.pillar p { margin: 0; color: var(--ink-2); font-size: 1rem; }
.pillar svg { width: 64px; height: 40px; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }

/* apps */
.apps { display: grid; gap: clamp(72px, 10vw, 136px); }
.app { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.app:nth-child(even) { grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); }
.app:nth-child(even) .app-copy { order: 2; }
.app-index { display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font: 500 .75rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.app-index b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-weight: 500; color: #fff; background: var(--app-c); letter-spacing: 0; }
.app h3 { font: 400 clamp(2.4rem, 4.6vw, 3.6rem)/1 var(--font-display); letter-spacing: -.015em; margin-bottom: 10px; }
.app .app-tagline { font: italic 400 1.35rem/1.35 var(--font-display); color: var(--ink-2); margin-bottom: 18px; }
.app p { color: var(--ink-2); }
.app-features { list-style: none; display: grid; gap: 10px; margin: 22px 0 28px; }
.app-features li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: baseline; color: var(--ink-2); font-size: 1rem; }
.app-features li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; transform: translateY(-1px) rotate(45deg);
  background: var(--app-c); justify-self: center; }
.app-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.app-actions .btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.app-actions .btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.app-meta { margin-top: 18px; font-size: .86rem; color: var(--ink-3); }
.app-meta a { color: inherit; }

.app-media { position: relative; }
.app-media::before {
  content: ""; position: absolute; inset: 8% -4% -6% 10%; z-index: 0; border-radius: 32px;
  background: radial-gradient(70% 70% at 60% 40%, color-mix(in srgb, var(--app-c) 30%, transparent), transparent 75%);
  filter: blur(10px);
}
.app:nth-child(even) .app-media::before { inset: 8% 10% -6% -4%; }
.window {
  position: relative; z-index: 1; margin: 0; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.window-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-2); font: 500 .72rem/1 var(--font-mono); color: var(--ink-3); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.window-bar span { margin-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.window figcaption, .media-caption { padding: 12px 16px; font-size: .84rem; line-height: 1.45; color: var(--ink-3); border-top: 1px solid var(--border); background: var(--surface); }
.inset {
  position: absolute; z-index: 2; width: 44%; border-radius: 14px; overflow: hidden; background: #fff;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  right: -3%; bottom: -9%;
}
.app:nth-child(even) .inset { right: auto; left: -3%; }
.inset img { width: 100%; aspect-ratio: 1.6; object-fit: cover; }

.app--musicvis { --app-c: #E0115F; }
.app--melodyvis { --app-c: #3A08F5; }
.app--corpusvis { --app-c: #0B8F72; }
.app--rhythmvis { --app-c: #A33A95; }
:root[data-theme="dark"] .app--melodyvis { --app-c: #7B5CFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .app--melodyvis { --app-c: #7B5CFF; } }

@media (max-width: 900px) {
  .app, .app:nth-child(even) { grid-template-columns: 1fr; }
  .app:nth-child(even) .app-copy { order: 0; }
  .inset { width: 48%; right: -2%; bottom: -7%; }
  .app:nth-child(even) .inset { left: auto; right: -2%; }
}
@media (max-width: 560px) { .inset { display: none; } }

/* method */
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel { position: relative; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); padding: clamp(22px, 3vw, 34px); overflow: hidden; }
.panel h3 { font: 400 clamp(1.7rem, 2.6vw, 2.2rem)/1.1 var(--font-display); margin-bottom: 10px; }
.panel > p { color: var(--ink-2); font-size: 1rem; max-width: 40rem; }
.panel .src { font-size: .84rem; color: var(--ink-3); margin: 14px 0 0; }
.panel--wide { grid-column: 1 / -1; }

.fp-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 28px; align-items: center; margin-top: 22px; }
.fp-figure { margin: 0; display: grid; justify-items: center; gap: 10px; }
.fp-figure svg { width: 100%; max-width: 280px; height: auto; overflow: visible; }
.fp-figure figcaption { font: 500 .7rem/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.fp-wheel text, .fp-glyph text { font-family: var(--font-sans); }
.fp-glyph .ring { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.fp-glyph .root { font: 600 18px var(--font-sans); fill: var(--ink); }
.fp-glyph path { transition: d .55s var(--ease); }
.fp-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2);
  font: 500 .875rem/1 var(--font-sans);
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip sup { font-size: .7em; margin-left: 1px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fp-readout { grid-column: 1 / -1; margin: 0; text-align: center; font-size: .9rem; color: var(--ink-3); min-height: 1.5em; }

.rf-figure { margin: 22px 0 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px 24px; align-items: center; }
.rf-figure svg { width: 100%; height: auto; }
.rf-levels text { font: 500 11px var(--font-mono); fill: var(--ink-3); }
.rf-ring { stroke: var(--surface); stroke-width: 1.2; }
.rf-figure figcaption { grid-column: 1 / -1; font-size: .84rem; color: var(--ink-3); }

.scale { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 28px;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.scale li { padding: 20px 20px 22px; background: var(--bg); border-left: 1px solid var(--border); }
.scale li:first-child { border-left: 0; }
.scale .lvl { font: 500 .7rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.scale h4 { font: 400 1.6rem/1.1 var(--font-display); margin: 10px 0 6px; }
.scale p { margin: 0; font-size: .92rem; color: var(--ink-2); }
.scale .apps-used { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 500 .75rem/1.2 var(--font-sans);
  background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
a.tag:hover { text-decoration: underline; }
.panel .scale-axis { max-width: none; display: flex; justify-content: space-between; margin-top: 10px; font: 500 .7rem/1 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.panel .scale-axis span:nth-child(2) { flex: 1; height: 1px; margin: 0 14px; align-self: center; background: var(--spectrum); opacity: .8; }

@media (max-width: 980px) {
  .method-grid { grid-template-columns: 1fr; }
  .scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scale li:nth-child(3) { border-left: 0; }
  .scale li:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .fp-demo { gap: 14px 12px; }
  .rf-figure { grid-template-columns: 1fr; }
  .scale { grid-template-columns: 1fr; }
  .scale li { border-left: 0; border-top: 1px solid var(--border); }
  .scale li:first-child { border-top: 0; }
}

/* publications */
.thesis {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px 56px; align-items: start;
  padding: clamp(26px, 4vw, 48px); border-radius: var(--radius-lg); margin-bottom: clamp(40px, 6vw, 64px);
  background: var(--stage); color: var(--stage-ink); position: relative; overflow: hidden; isolation: isolate;
}
.thesis::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 80% at 100% 0%, rgba(58, 8, 245, .35), transparent 70%),
              radial-gradient(50% 70% at 0% 100%, rgba(249, 8, 89, .14), transparent 70%); }
.thesis .eyebrow { color: var(--stage-accent); }
.thesis h3 { font: 400 clamp(2.2rem, 4vw, 3.3rem)/1.02 var(--font-display); margin-bottom: 12px; }
.thesis .meta { color: var(--stage-ink-2); margin-bottom: 24px; }
.thesis blockquote { margin: 0; padding-left: 18px; border-left: 2px solid; border-image: var(--spectrum) 1;
  font: italic 400 1.28rem/1.45 var(--font-display); color: var(--stage-ink); }
.thesis blockquote p:last-child { margin-bottom: 0; }
.thesis .btn { background: transparent; color: var(--stage-ink); border-color: rgba(244, 241, 250, .28); }
.thesis .btn:hover { background: rgba(255, 255, 255, .06); }
.thesis .btn--primary { background: var(--stage-ink); color: var(--stage); border-color: var(--stage-ink); }
.thesis :focus-visible { box-shadow: 0 0 0 2px var(--stage), 0 0 0 4px var(--stage-accent); }
.thesis ol { list-style: none; display: grid; gap: 0; counter-reset: part; border-top: 1px solid var(--stage-line); }
.thesis ol li { padding: 12px 0; border-bottom: 1px solid var(--stage-line); display: grid; grid-template-columns: 74px 1fr; gap: 10px; font-size: .95rem; color: var(--stage-ink-2); }
.thesis ol li b { font: 500 .7rem/1.6 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--stage-ink-3); }
.thesis-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
@media (max-width: 900px) { .thesis { grid-template-columns: 1fr; } }

.pubs { list-style: none; border-top: 1px solid var(--border); }
.pub { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 8px 28px; padding: 26px 0; border-bottom: 1px solid var(--border); align-items: start; }
.pub-year { font: 400 1.9rem/1 var(--font-display); color: var(--ink-3); }
.pub h3 { font: 600 1.14rem/1.35 var(--font-sans); letter-spacing: -.01em; margin-bottom: 6px; text-wrap: pretty; }
.pub h3 a { color: var(--ink); text-decoration: none; }
.pub h3 a:hover { color: var(--accent-ink); text-decoration: underline; }
.pub .authors { margin: 0 0 4px; color: var(--ink-2); font-size: .96rem; }
.pub .authors .me { color: var(--ink); font-weight: 600; }
.pub .venue { margin: 0; color: var(--ink-3); font-size: .92rem; font-style: italic; }
.pub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag--award { background: #FFF1C9; color: #6B4A00; }
:root[data-theme="dark"] .tag--award { background: #3B2E0A; color: #FFD978; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag--award { background: #3B2E0A; color: #FFD978; } }
.tag--app { background: color-mix(in srgb, var(--app-c) 13%, transparent); color: var(--ink); }
.tag--app::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--app-c); }
.tag--musicvis { --app-c: #E0115F; } .tag--melodyvis { --app-c: #5B3BFF; } .tag--corpusvis { --app-c: #0B8F72; } .tag--rhythmvis { --app-c: #A33A95; }
.tag--plain { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 380px; }
.pub-links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--ink); text-decoration: none; font: 500 .82rem/1 var(--font-sans);
  background: var(--surface);
}
.pub-links a:hover { border-color: var(--ink-3); }
.pub-links .icon { width: 14px; height: 14px; }
@media (max-width: 820px) {
  .pub { grid-template-columns: 1fr; gap: 6px; }
  .pub-year { font-size: 1.3rem; }
  .pub-links { justify-content: flex-start; max-width: none; margin-top: 8px; }
}
.resources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; list-style: none; }
.resource { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); height: 100%; }
.resource b { font-weight: 600; font-size: 1.02rem; }
.resource b a { color: var(--ink); }
.resource span { color: var(--ink-3); font-size: .93rem; line-height: 1.55; }
@media (max-width: 860px) { .resources { grid-template-columns: 1fr; } }

/* people */
.people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; list-style: none; }
@media (max-width: 1000px) { .people { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; } }
.person { display: flex; flex-direction: column; }
.person a.person-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; border-radius: var(--radius-lg); }
.person-photo { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1; background: var(--bg-2); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.04); transition: filter .5s var(--ease), transform .6s var(--ease); }
.person-photo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--spectrum);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.person a:hover .person-photo img, .person a:focus-visible .person-photo img { filter: none; transform: scale(1.03); }
.person a:hover .person-photo::after, .person a:focus-visible .person-photo::after { transform: scaleX(1); }
.person h3 { font: 600 1.08rem/1.3 var(--font-sans); margin: 16px 0 4px; display: flex; align-items: center; gap: 6px; }
.person h3 .icon { width: 14px; height: 14px; color: var(--ink-3); }
.person p { margin: 0; font-size: .93rem; color: var(--ink-3); line-height: 1.5; }
.former { margin-top: 44px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; color: var(--ink-2); font-size: .98rem; }
.former b { font: 500 .72rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.coauthors { margin-top: 14px; color: var(--ink-3); font-size: .93rem; }

/* contact */
.contact { background: var(--stage); color: var(--stage-ink); position: relative; overflow: hidden; isolation: isolate; }
.contact::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(50% 80% at 15% 0%, rgba(58, 8, 245, .28), transparent 70%),
              radial-gradient(40% 60% at 100% 100%, rgba(6, 247, 168, .10), transparent 70%); }
.contact .eyebrow { color: var(--stage-accent); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px 72px; align-items: end; }
.contact h2 { font: 400 clamp(2.6rem, 6vw, 5rem)/1 var(--font-display); letter-spacing: -.015em; margin-bottom: 18px; }
.contact h2 em { font-style: italic; color: var(--stage-accent); }
.contact p { color: var(--stage-ink-2); max-width: 36rem; }
.mail {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 10px;
  font: 400 clamp(1.3rem, 2.6vw, 2rem)/1.2 var(--font-display); color: var(--stage-ink); text-decoration: none;
  border-bottom: 1px solid rgba(244, 241, 250, .35); padding-bottom: 4px; word-break: break-all;
}
.mail:hover { border-color: var(--stage-ink); }
.contact :focus-visible { box-shadow: 0 0 0 2px var(--stage), 0 0 0 4px var(--stage-accent); }
.contact-list { list-style: none; display: grid; border-top: 1px solid var(--stage-line); }
.contact-list a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 2px;
  border-bottom: 1px solid var(--stage-line); color: var(--stage-ink); text-decoration: none; }
.contact-list a { white-space: nowrap; }
.contact-list a span { white-space: normal; margin-left: auto; text-align: right; color: var(--stage-ink-3); font-size: .9rem; }
.contact-list a:hover { color: #fff; }
.contact-list a:hover .icon { transform: translate(2px, -2px); }
.contact-list .icon { transition: transform .2s var(--ease); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .footer-top nav { margin-left: 0; } }

/* footer */
.site-footer { background: var(--stage); color: var(--stage-ink-3); border-top: 1px solid var(--stage-line); padding: 34px 0 42px; font-size: .88rem; }
.site-footer .wrap { display: grid; gap: 16px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-top .brand { font-size: 1.2rem; }
.footer-top nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--stage-ink-2); }
.site-footer a:hover { color: var(--stage-ink); }
.site-footer p { margin: 0; max-width: 72rem; }
.site-footer :focus-visible { box-shadow: 0 0 0 2px var(--stage), 0 0 0 4px var(--stage-accent); }

/* legal & 404 pages */
.page-hero { background: var(--stage); color: var(--stage-ink); padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 64px); position: relative; overflow: hidden; isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(50% 90% at 90% 0%, rgba(58, 8, 245, .3), transparent 70%); }
.page-hero h1 { font: 400 clamp(2.6rem, 6vw, 4.6rem)/1 var(--font-display); letter-spacing: -.015em; margin-bottom: 12px; }
.page-hero p { color: var(--stage-ink-2); max-width: 44rem; margin: 0; }
.page-hero .eyebrow { color: var(--stage-accent); }
.prose { max-width: 46rem; padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 8vw, 104px); }
.prose h2 { font: 400 2rem/1.15 var(--font-display); margin: 2.2em 0 .6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font: 600 1.08rem/1.4 var(--font-sans); margin: 1.8em 0 .5em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose address { font-style: normal; color: var(--ink-2); margin: 0 0 1em; }
.prose .note { padding: 16px 18px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font-size: .95rem; }
.prose a { word-break: break-word; }

/* --------------------------------------------------------------- motion --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.js-off .reveal { opacity: 1; transform: none; }

@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-8px) rotate(var(--r, 0deg)); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px) rotate(var(--r, 0deg)); } to { opacity: 1; transform: translateY(0) rotate(var(--r, 0deg)); } }
@keyframes sector-in { from { transform: scale(0); } to { transform: scale(1); } }
.stagecomp .comp-card, .stagecomp .comp-glyph { animation: rise 1.1s var(--ease) both; }
.comp-card--back { --r: 3deg; animation-delay: .05s; }
.comp-card--main { animation-delay: .15s; }
.comp-card--low { --r: -2deg; animation-delay: .3s; }
.comp-glyph { animation-delay: .45s; }
.comp-glyph .sector { transform-origin: 0 0; animation: sector-in .9s var(--ease) both; }
.hero-glyph-float { animation: floaty 7s ease-in-out 1.6s infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .theme-toggle, .hero::after, .stagecomp { display: none; }
  .hero, .contact, .site-footer, .thesis { background: none; color: #000; }
}
.comp-glyph .s0 { animation-delay: .9s; } .comp-glyph .s1 { animation-delay: 1.02s; }
.comp-glyph .s2 { animation-delay: 1.14s; } .comp-glyph .s3 { animation-delay: 1.26s; }
.thesis { border: 1px solid var(--stage-line); }
@media (max-width: 980px) {
  .hero::after { top: auto; bottom: 18%; transform: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }
}
/* the inset screenshot overlaps the window's lower corner: keep the caption clear of it */
@media (min-width: 561px) {
  .app .window figcaption { padding-right: calc(46% + 20px); min-height: 84px; }
  .app:nth-child(even) .window figcaption { padding-right: 16px; padding-left: calc(46% + 20px); }
}
@media (min-width: 561px) and (max-width: 900px) {
  .app:nth-child(even) .window figcaption { padding-left: 16px; padding-right: calc(50% + 20px); }
}
.comp-glyph { width: 28%; left: 0; bottom: 4%; }
.rf-figure svg[aria-labelledby="rf-glyph-title"] { max-width: 300px; justify-self: center; }
