﻿:root {
  color-scheme: dark;
  --bg: #181a1b;
  --panel: #202324;
  --ink: #e9e6dd;
  --muted: #aaa9a1;
  --accent: #c5a67d;
  --line: #393c3b;
  --green: #a2be9a;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; }
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
button { font: inherit; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h3 { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.topbar, main, .site-footer { width: min(1120px, calc(100% - 5rem)); margin-inline: auto; }
.skip-link { position: absolute; top: -100px; left: 1rem; padding: .5rem 1rem; background: var(--ink); color: var(--bg); z-index: 30; }
.skip-link:focus { top: 1rem; }

/* Masthead and introduction */
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; border-bottom: 1px solid var(--line); }
.mark { display: flex; align-items: center; gap: .9rem; flex-shrink: 0; }
.mark-icon { display: block; object-fit: contain; }
.mark strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 400; line-height: 1.25; }
.mark strong span { display: block; margin-top: .3rem; font-family: "Segoe UI", Arial, sans-serif; font-size: .73rem; color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 1.7rem; font-size: .85rem; }
nav a { padding-block: .5rem; }
nav a:hover { text-decoration: underline; }
nav a span { color: var(--muted); }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 6rem; padding: 3.75rem 0 4rem; }
.eyebrow { color: var(--accent); font-size: .83rem; margin-bottom: .7rem; }
h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); letter-spacing: -.035em; line-height: 1.15; margin-bottom: 1.2rem; }
.intro-copy > p:not(.eyebrow) { max-width: 570px; color: var(--muted); font-size: .98rem; }
.intro-copy .intro-signoff { margin-top: .65rem; }
.stream-status-card { padding-left: 1.5rem; border-left: 1px solid var(--line); font-size: .83rem; }
.stream-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .75rem; }
.stream-heading h2 { font: 600 .95rem "Segoe UI", Arial, sans-serif; }
.stream-state { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .72rem; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.is-online .dot { background: var(--green); }
.is-online .stream-state { color: var(--green); }
.stream-status-card p { color: var(--muted); margin-bottom: .7rem; }
.stream-status-card .stream-now-playing { color: var(--ink); overflow-wrap: anywhere; }
.text-link { display: inline-block; color: var(--accent); font-size: .82rem; }
.text-link:hover { color: var(--ink); text-decoration: underline; }
.text-link span { margin-left: .35rem; }

/* Downloads */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.section-head h2 { font-size: 1.9rem; letter-spacing: -.025em; line-height: 1.2; }
.section-head p { margin-top: .4rem; color: var(--muted); font-size: .82rem; }
.section-head > a { flex-shrink: 0; }
.featured-download { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 3rem; padding: 2.25rem 2.5rem; border: 1px solid #494b45; border-top: 2px solid var(--accent); background: var(--panel); }
.file-detail { color: var(--accent); font-family: Consolas, "Courier New", monospace; font-size: .75rem; margin-bottom: .95rem; }
.featured-copy h3 { font-family: Georgia, "Times New Roman", serif; font-size: 2.5rem; line-height: 1.13; font-weight: 400; letter-spacing: -.025em; }
.featured-copy > p:not(.file-detail) { max-width: 370px; color: var(--muted); font-size: .88rem; margin: 1rem 0 1.3rem; }
.download-button { display: inline-flex; align-items: center; justify-content: center; gap: 1.5rem; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: #1b1c19; padding: .65rem .95rem; font-size: .83rem; font-weight: 600; }
.download-button:hover { background: #dac09e; border-color: #dac09e; color: #1b1c19; }
.download-button span { font-size: 1.1rem; line-height: 1; }
.download-filename { display: block; margin-top: .65rem; color: var(--muted); font-family: Consolas, "Courier New", monospace; font-size: .68rem; }
.preview-figure { min-width: 0; }
.mini-browser-preview { border: 1px solid #53564f; border-radius: 5px; overflow: hidden; background: #141718; }
.preview-titlebar { display: flex; align-items: center; gap: .4rem; padding: .5rem .7rem; background: #353934; font-size: .68rem; line-height: 1.4; }
.preview-appmark { width: 14px; height: 14px; background: url("../images/icon.ico") center / contain no-repeat; }
.preview-controls { margin-left: auto; color: #bbbeb6; }
.preview-toolbar { display: flex; align-items: center; gap: .5rem; padding: .6rem; border-bottom: 1px solid #303532; font-size: .64rem; color: var(--muted); }
.preview-toolbar > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid #3c423b; border-radius: 2px; padding: .3rem .5rem; }
.preview-load { padding: .3rem .55rem; background: #3c423b; border-radius: 2px; color: var(--ink); }
.preview-stage { min-height: 175px; padding: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; background: #1b211f; }
.preview-play { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #636f60; border-radius: 50%; color: #bdcbb1; font-size: 1.45rem; line-height: 1; margin-bottom: .6rem; padding-left: 3px; }
.preview-stage strong { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 1.2rem; }
.preview-stage > span:last-child { color: #a4ada2; font-size: .66rem; }
.preview-status { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem .7rem; font-size: .6rem; color: var(--muted); border-top: 1px solid #303532; }
figcaption { margin-top: .65rem; text-align: right; color: var(--muted); font-size: .65rem; }
.download-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 1.25rem; padding: 1.45rem .25rem; border-bottom: 1px solid var(--line); }
.program-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); }
.program-icon svg { width: 30px; height: 30px; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.download-row h3 { font-size: .95rem; }
.download-row p { margin-top: .25rem; color: var(--muted); font-size: .82rem; }
.file-type { color: var(--muted); font-family: Consolas, "Courier New", monospace; font-size: .7rem; margin-right: 1rem; }
.row-download { display: inline-flex; align-items: center; gap: 1rem; min-height: 40px; padding: .4rem .8rem; border: 1px solid #55564d; border-radius: 3px; color: var(--ink); font-size: .8rem; }
.row-download:hover { background: var(--panel); border-color: var(--accent); }
.row-download span { color: var(--accent); }

/* Projects and dated notes */
.work-and-notes { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 4.5rem; margin: 3.75rem 0; }
.project-list article { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.project-list article:last-child { padding-bottom: 0; }
.project-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.project-title h3 { font-size: .92rem; }
.project-title h3 a span { color: var(--accent); font-size: .78rem; }
.project-title h3 a:hover { text-decoration: underline; }
.project-state { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.project-state.ready { color: var(--green); }
.project-list p { max-width: 460px; margin-top: .4rem; color: var(--muted); font-size: .82rem; }
.notes-section { border-left: 1px solid var(--line); padding-left: 2.5rem; }
.note-entry { margin-bottom: 1.5rem; }
.note-entry h3 { font-size: .92rem; }
.note-entry p { margin-top: .45rem; color: var(--muted); font-size: .85rem; line-height: 1.75; }
.elsewhere { display: flex; align-items: baseline; gap: 3rem; padding: 1.5rem 0; border-block: 1px solid var(--line); }
.elsewhere h2 { font-family: "Segoe UI", Arial, sans-serif; font-size: .83rem; font-weight: 600; }
.elsewhere ul { display: flex; flex-wrap: wrap; gap: .75rem 2rem; list-style: none; padding: 0; margin: 0; }
.elsewhere a { font-size: .8rem; color: var(--muted); }
.elsewhere a span { margin-left: .45rem; color: var(--accent); }
.elsewhere a:hover { color: var(--ink); text-decoration: underline; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.65rem 2.5rem; color: var(--muted); font-size: .72rem; }

/* Native dialog keeps focus inside the directory and supports Escape. */
.download-modal { width: min(570px, calc(100% - 2rem)); max-height: calc(100dvh - 3rem); padding: 1.75rem; border: 1px solid #56584f; border-radius: 4px; color: var(--ink); background: var(--panel); }
.download-modal::backdrop { background: rgb(0 0 0 / 75%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modal-head h2 { font-size: 1.9rem; }
.modal-close { flex-shrink: 0; width: 40px; height: 40px; padding: 0; background: transparent; border: 1px solid var(--line); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; border-radius: 3px; }
.modal-close:hover { background: #343731; }
.modal-copy { color: var(--muted); margin: .7rem 0 1.5rem; font-size: .85rem; }
.directory-list a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); font-size: .88rem; }
.directory-list small { color: var(--muted); font-family: Consolas, "Courier New", monospace; font-size: .72rem; overflow-wrap: anywhere; }
.directory-list small span { color: var(--accent); }
.modal-footer { padding-top: 1rem; margin-top: .5rem; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .topbar, main, .site-footer { width: calc(100% - 3rem); }
  .topbar { gap: 1.5rem; }
  nav { gap: 1rem; }
  .intro { gap: 2.5rem; grid-template-columns: minmax(0, 1fr) 230px; padding-block: 3rem; }
  .featured-download { gap: 1.5rem; padding: 1.75rem; }
  .featured-copy h3 { font-size: 2.15rem; }
  .work-and-notes { gap: 2rem; }
  .notes-section { padding-left: 1.75rem; }
  .file-type { display: none; }
  .download-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
}

@media (max-width: 650px) {
  .topbar, main, .site-footer { width: calc(100% - 2rem); }
  .topbar { flex-direction: column; align-items: flex-start; gap: 1rem; padding-block: 1.25rem 1rem; }
  .mark strong { font-size: 1.3rem; }
  nav { width: 100%; justify-content: space-between; gap: .65rem; font-size: .78rem; }
  .intro { grid-template-columns: 1fr; gap: 1.6rem; padding-block: 2.25rem; }
  h1 { font-size: clamp(2rem, 8.5vw, 3rem); }
  .intro-copy > p:not(.eyebrow) { font-size: .9rem; }
  .stream-status-card { padding: 1rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .stream-heading { justify-content: flex-start; gap: 1rem; margin-bottom: .35rem; }
  .stream-status-card p { margin-bottom: .35rem; }
  .section-head h2 { font-size: 1.7rem; }
  .section-head p { font-size: .78rem; }
  .featured-download { grid-template-columns: 1fr; gap: 1.75rem; padding: 1.5rem; }
  .featured-copy h3 { font-size: 2.25rem; }
  .featured-copy h3 br { display: none; }
  .download-button { max-width: 100%; gap: .75rem; }
  .preview-stage { min-height: 150px; }
  .download-row { grid-template-columns: 30px minmax(0, 1fr); gap: .75rem; padding-block: 1.25rem; align-items: start; }
  .program-icon { width: 30px; }
  .row-download { grid-column: 2; justify-self: start; margin-top: .2rem; }
  .work-and-notes { grid-template-columns: 1fr; margin-block: 2.75rem; gap: 2.75rem; }
  .notes-section { padding-left: 0; border-left: 0; }
  .project-title { gap: .6rem; }
  .project-state { font-size: .65rem; }
  .elsewhere { flex-direction: column; gap: .75rem; }
  .elsewhere ul { gap: .5rem 1.25rem; }
  .download-modal { padding: 1.2rem; }
  .directory-list a { flex-direction: column; align-items: flex-start; gap: .25rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
