:root {
  --bg: #ffffff;
  --fg: #111418;
  --muted: #646a73;
  --line: #e4e6ea;
  --accent: #2236d9;
  --max: 68rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

/* Theme is set by data-theme on <html> (see theme.js): light, dark, or system. */

:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

:root[data-theme="dark"] {
  --bg: #0e1013;
  --fg: #eceef1;
  --muted: #9097a1;
  --line: #23272d;
  --accent: #8a97ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0e1013;
    --fg: #eceef1;
    --muted: #9097a1;
    --line: #23272d;
    --accent: #8a97ff;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

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

/* Header and navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem var(--pad);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(1.1rem, 3vw, 2.25rem);
}

.site-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--muted);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover { color: var(--fg); }

.site-nav a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

@media (max-width: 40rem) {
  .site-header .inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .site-nav {
    width: 100%;
    overflow-x: auto;
    gap: 1.25rem;
    padding-bottom: 2px;
  }
}

/* Page body */

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 7rem) var(--pad);
}

/* Centered content columns. The header stays at full width; these pages
   narrow the content and center it. On small screens only the side padding remains. */
main.narrow { max-width: calc(38rem + 2 * var(--pad)); }
main.bio-page { max-width: calc(52rem + 2 * var(--pad)); }
main.reel-page { max-width: calc(56rem + 2 * var(--pad)); }

h1 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.03;
  font-size: clamp(2.5rem, 7.5vw, 5rem);
  max-width: 16ch;
}

h1.page-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.03em;
  max-width: none;
}

h2 {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.prose {
  max-width: 38rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.prose p { margin: 0 0 1.2em; }

.prose a,
.rows a:not(.row-title) {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover,
.rows a:hover { color: var(--accent); }

.section { margin-top: clamp(2.5rem, 6vw, 4rem); }

.section > h2 { margin-bottom: 0.9rem; }

/* Row lists */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 6rem;
  gap: 0.25rem 2rem;
  align-items: baseline;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.rows .row-title {
  font-weight: 550;
  text-decoration: none;
}

.rows .row-detail,
.rows .row-meta { color: var(--muted); }

.rows .row-meta {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 40rem) {
  .rows li { grid-template-columns: 1fr; }
  .rows .row-meta { text-align: left; }
}

/* Bio: portrait beside the text on desktop, stacked on small screens */

.bio {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.bio .prose { margin-top: 0; max-width: 34rem; }

.bio-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 6px;
}

@media (max-width: 40rem) {
  .bio { grid-template-columns: 1fr; }
  .bio-photo { max-width: 10rem; aspect-ratio: 1 / 1; object-position: 50% 35%; }
}

/* Video reel */

/* Embedded players are light-scheme pages. If the iframe element inherits the
   page's dark color-scheme, browsers paint an opaque white backdrop behind it
   (the white bars). Resetting it keeps the player transparent so the .video
   background shows through. */
iframe { color-scheme: normal; }

.reel {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg); /* shows through as letterbox bars on non-16:9 videos */
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Vimeo iframes pasted directly into an .reel-item scale to the full column
   width and keep their own aspect ratio, so every picture is the same width. */
.reel-item > iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; /* fallback; music.html sets each from its width/height attributes */
  border: 0;
  background: var(--bg);
}

/* Items placed directly in <main> (outside .reel) get the same spacing. */
main > .reel-item { margin-top: clamp(2.5rem, 6vw, 4rem); }
main > h1.page-title + .reel-item { margin-top: clamp(2rem, 5vw, 3.5rem); }

.video-title {
  margin: 0.9rem 0 0.1rem;
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.video-credits {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Plugins */

.section-note {
  margin: 0 0 1.75rem;
  color: var(--muted);
  max-width: 38rem;
}

.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2rem);
}

.plugin-shot {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background: var(--bg);
}

/* Images fill the card width, aligned to the left edge of the title below. */
.plugin-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 6px solid var(--line);
}

/* Cards stretch to the row height; the screenshot box absorbs the extra
   height so titles and blurbs line up across a row (e.g. STRONG SYNTH and
   VERMONT REVERB). */
.plugin { display: flex; flex-direction: column; }
.plugin-shot { flex: 1 1 auto; }

@media (min-width: 40rem) {
  .plugin-wide { grid-column: span 2; }
}

/* Desktop: 6-column grid. STRONG SYNTH takes its own full-width row; the
   other plugins are two per row. */
@media (min-width: 56rem) {
  .plugin-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .plugin { grid-column: span 3; }
  .plugin-wide { grid-column: span 6; }
}

.plugin-name {
  margin: 0.9rem 0 0.1rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.plugin-blurb {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Contact */

.contact-list {
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  max-width: 38rem;
}

.contact-list div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.contact-list div:last-child { border-bottom: 1px solid var(--line); }

.contact-list dt { color: var(--muted); }
.contact-list dd { margin: 0; }

@media (max-width: 40rem) {
  .contact-list div { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* Contact form */

.contact-form {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  max-width: 38rem;
  display: grid;
  gap: 1.1rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  width: 100%;
}

.contact-form textarea { min-height: 9rem; resize: vertical; }

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.contact-form button {
  justify-self: start;
  font: inherit;
  font-weight: 550;
  color: var(--bg);
  background: var(--fg);
  border: 0;
  border-radius: 6px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}

.contact-form button:hover { background: var(--accent); }
.contact-form button:disabled { opacity: 0.6; cursor: default; }

.form-status { margin: 0; min-height: 1.6em; }

/* Footer */


.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--pad);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
