:root {
  --bg: #FAF7F2;
  --ink: #111111;
  --ink-strong: #0f172a;
  --ink-soft: #334155;
  --text: #475569;
  --muted: #64748b;
  --faint: #94a3b8;
  --rule: #e2e8f0;
  --badge-bg: rgba(226, 232, 240, 0.6);
  --badge-border: rgba(203, 213, 225, 0.6);
  --accent: #10b981;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --reading: "Newsreader", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Cormorant Garamond defaults to old-style numerals (lowercase-height);
   use lining numerals so digits match capital letters in titles. */
.display,
.entry-title,
.track-piece,
.prose h2,
.prose h3 {
  font-variant-numeric: lining-nums;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #e2e8f0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
}

/* Shared type */

.display {
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  text-transform: uppercase;
}

/* Keeps the title's capitalisation as written (project pages). */
.display-as-written {
  text-transform: none;
  line-height: 1.1;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.bio {
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.625;
  color: var(--text);
}

.meta {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
}

/* Landing page */

.landing {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

.intro>*+* {
  margin-top: 2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--badge-border);
  border-radius: 0.25rem;
  background: var(--badge-bg);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.identity>*+* {
  margin-top: 0.75rem;
}

.details {
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.details-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.details-row+.details-row {
  margin-top: 0.75rem;
}

.details-row> :first-child {
  text-transform: uppercase;
}

.details-row> :last-child {
  color: var(--ink-strong);
  text-align: right;
}

.details-row a {
  text-decoration: underline;
}

.details-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 1rem;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.social a {
  transition: color 0.15s;
}

.social a:hover {
  color: #000;
}

/* Sections and link lists */

.sections>*+* {
  margin-top: 3rem;
}

.section-heading {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.entries {
  margin-top: 1.5rem;
}

.entry {
  display: block;
}

.entry+.entry {
  margin-top: 2rem;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.entry-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.333;
  color: var(--ink);
  text-decoration: underline transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s;
}

.entry:hover .entry-title,
.entry:focus-visible .entry-title {
  text-decoration-color: currentColor;
}

.entry-text {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 300;
  line-height: 1.625;
  color: var(--text);
}

/* Listening sidebar */

.listening-toggle {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.listening-toggle::-webkit-details-marker {
  display: none;
}

.listening-toggle::after {
  content: "\2212";
}

.listening:not([open]) .listening-toggle::after {
  content: "+";
}

.listening-toggle:hover {
  color: var(--muted);
}

.tracks {
  max-height: 22rem;
  margin-top: 1.5rem;
  padding-right: 0.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}

.track {
  display: block;
}

.track+.track {
  margin-top: 1.25rem;
}

.track-piece {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: underline transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s;
}

a.track:hover .track-piece,
a.track:focus-visible .track-piece {
  text-decoration-color: currentColor;
}

.track-artist {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Writing index and posts */

.article {
  max-width: 60rem;
}

.crumbs {
  display: flex;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.crumbs a {
  color: var(--muted);
  transition: color 0.15s;
}

.crumbs a:hover {
  color: #000;
}

.article-header {
  margin: 3rem 0;
}

.article-header>*+* {
  margin-top: 1rem;
}

.article-header .meta {
  display: block;
}

.article-header .project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.project-meta a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.15s;
}

.project-meta a:hover {
  color: #000;
}

.prose {
  font-family: var(--reading);
  font-size: 1.125rem;
  line-height: 1.7;
  color: #1f2937;
}

.prose>* {
  margin: 0;
}

.prose>*+* {
  margin-top: 1.25em;
}

.prose h2,
.prose h3 {
  margin-top: 2em;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}

.prose h2 {
  font-size: 1.75rem;
}

.prose h3 {
  font-size: 1.375rem;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li+li {
  margin-top: 0.35em;
}

.prose blockquote {
  padding-left: 1.25em;
  border-left: 1px solid var(--faint);
  font-style: italic;
  color: var(--text);
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.8em;
}

.prose pre {
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  background: rgba(226, 232, 240, 0.35);
  line-height: 1.5;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
}

.prose .mermaid {
  text-align: center;
}

.prose .mermaid svg {
  max-width: 100%;
  height: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 0.6em 1em 0.6em 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.prose th {
  border-bottom-color: var(--faint);
  font-weight: 500;
}

.prose td strong {
  font-weight: 500;
}


/* Footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
}

/* Breakpoints */

@media (min-width: 640px) {
  body {
    padding: 3rem;
  }

  .display {
    font-size: 3rem;
  }
}

@media (min-width: 768px) {
  body {
    padding: 4rem;
  }
}

@media (min-width: 1024px) {
  .landing {
    grid-template-columns: 5fr 7fr;
    gap: 4rem;
  }

  .intro {
    position: sticky;
    top: 3rem;
  }

  .listening {
    grid-column: 2;
  }
}

@media (min-width: 1280px) {
  .wide .container {
    max-width: 80rem;
  }

  .landing.has-sidebar {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 15rem;
    gap: 3rem;
  }

  .landing.has-sidebar:has(.listening:not([open])) {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) auto;
  }

  .listening {
    grid-column: auto;
    position: sticky;
    top: 3rem;
  }

  .tracks {
    max-height: calc(100vh - 11rem);
  }
}