:root {
  --background: #f5f4ef;
  --background-soft: #ede9f7;
  --surface: #fffef9;
  --surface-cool: #f7fbff;
  --foreground: #111111;
  --muted: #65616b;
  --border: #d8d3dc;
  --border-strong: #15151a;
  --accent-purple: #d8c7ff;
  --accent-blue: #cfe8ff;
  --accent-deep: #2f3d7e;
  --shadow-color: #171722;
  --shadow: 3px 3px 0 var(--shadow-color);
  --shadow-hover: 5px 5px 0 var(--shadow-color);
  --rail-offset: 40px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

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

button {
  font: inherit;
}

img,
video,
iframe {
  display: block;
  max-width: 100%;
}

.page {
  width: min(100%, 860px);
  padding: 18px 16px 48px;
}

.masthead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 34px;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.nav,
.link-row,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--foreground);
}

.nav a,
.link-row a,
.footer-links a,
.back-link,
.project-body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
}

.nav a:hover,
.link-row a:hover,
.footer-links a:hover,
.back-link:hover,
.project-body a:hover {
  text-decoration-thickness: 2px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.intro-copy {
  max-width: 620px;
}

.eyebrow,
.meta,
.section-heading span,
time {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 10px;
}

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

h1 {
  max-width: 620px;
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.14;
}

.intro p:not(.eyebrow) {
  max-width: 620px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.55;
}

.portrait {
  align-self: start;
  width: 118px;
  margin: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portrait img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  filter: grayscale(0.08);
}

.section {
  margin-top: 34px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
}

.rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-left: 8px;
  padding: 14px 0;
  border-left: 1px solid var(--border);
}

.rail::before,
.rail::after {
  position: absolute;
  left: -1px;
  width: 1px;
  height: 28px;
  content: "";
}

.rail::before {
  top: 0;
  background: linear-gradient(to top, transparent, var(--background));
}

.rail::after {
  bottom: 0;
  background: linear-gradient(to bottom, transparent, var(--background));
}

.rail-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-left: 24px;
  padding: 9px 12px;
  color: var(--foreground);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

a.rail-card:hover {
  background: var(--background-soft);
}

.rail-card.featured {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rail-card.featured:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-1px, -1px);
}

.rail-card.soft {
  border: 1px solid var(--border);
  background: rgba(255, 253, 250, 0.62);
}

.rail-card.soft:hover {
  border-color: #b8c8e9;
  background: var(--surface-cool);
  box-shadow: 3px 3px 0 #b8c8e9;
}

.node {
  position: absolute;
  top: 15px;
  left: calc(-1 * var(--rail-offset));
  width: 7px;
  height: 7px;
  background: var(--accent-deep);
  outline: 2px solid var(--background);
  transform: rotate(45deg);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card-head h3 {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.card-head time {
  flex: 0 0 auto;
  white-space: nowrap;
}

.title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 28px;
  height: 16px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 1px solid rgba(47, 61, 126, 0.2);
  background: var(--accent-purple);
  color: #171722;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.badge.quiet {
  background: var(--accent-blue);
}

.rail-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.rail-card.media {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 12px;
}

.rail-card.media img {
  width: 168px;
  height: 94px;
  border: 1px solid var(--border);
  background: var(--background-soft);
  object-fit: cover;
}

.news-panel {
  border: 1px solid var(--border);
  background: rgba(255, 253, 250, 0.58);
}

.news-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.news-row:last-child,
details .news-row:last-child {
  border-bottom: 0;
}

.news-copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
}

.news-copy strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
}

.news-row.compact {
  padding-left: 18px;
}

details summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

details .summary-open {
  display: none;
}

details[open] .summary-open {
  display: inline;
}

details[open] .summary-closed {
  display: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.filters button {
  min-height: 28px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  padding: 4px 9px;
}

.filters button:hover,
.filters button.active {
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--shadow-color);
}

.project-card.is-hidden {
  display: none;
}

.compact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mini-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 253, 250, 0.58);
  padding: 10px;
}

.mini-card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.mini-card h3 {
  font-size: 12px;
  line-height: 1.3;
}

.mini-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mini-card p span {
  display: block;
}

.mini-card p span + span {
  color: var(--foreground);
}

.back-link {
  display: inline-block;
  margin-bottom: 22px;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.project-hero img {
  width: 100%;
  max-height: 280px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.project-body {
  max-width: 760px;
}

.project-body h1,
.project-body h2,
.project-body h3 {
  margin: 28px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.2;
}

.project-body h1 {
  font-size: 26px;
}

.project-body h2 {
  font-size: 22px;
}

.project-body h3 {
  font-size: 18px;
}

.project-body p,
.project-body ul,
.project-body ol,
.project-body table,
.project-body iframe,
.project-body .video-frame {
  margin: 0 0 14px;
}

.project-body ul,
.project-body ol {
  padding-left: 20px;
}

.project-body li + li {
  margin-top: 4px;
}

.project-body img {
  width: 100%;
  height: auto;
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.project-body .video-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.project-body iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.pi-video {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #111111;
  box-shadow: 4px 4px 0 rgba(17, 17, 17, 0.28);
  color: #ffffff;
}

.pi-video video {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: #111111;
  object-fit: contain;
}

.pi-video-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 28px;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(216, 199, 255, 0.36);
  border-radius: 6px;
  background: rgba(17, 17, 17, 0.74);
  backdrop-filter: blur(7px);
  opacity: 0.92;
  transition: opacity 160ms ease;
}

.pi-video:hover .pi-video-controls,
.pi-video:focus-within .pi-video-controls {
  opacity: 1;
}

.pi-video-button {
  position: relative;
  width: 28px;
  height: 22px;
  border: 1px solid rgba(216, 199, 255, 0.48);
  border-radius: 4px;
  background: rgba(216, 199, 255, 0.16);
  color: #ffffff;
  cursor: pointer;
  padding: 0;
}

.pi-video-button:hover,
.pi-video-button:focus-visible {
  border-color: rgba(216, 199, 255, 0.92);
  background: rgba(216, 199, 255, 0.28);
  outline: 0;
}

.pi-icon {
  position: absolute;
  inset: 0;
  display: block;
}

.pi-icon-pause::before,
.pi-icon-pause::after {
  position: absolute;
  top: 6px;
  width: 4px;
  height: 10px;
  background: #ffffff;
  content: "";
}

.pi-icon-pause::before {
  left: 9px;
}

.pi-icon-pause::after {
  right: 9px;
}

.pi-video-toggle.is-paused .pi-icon-pause::before {
  top: 5px;
  left: 11px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #ffffff;
  background: transparent;
}

.pi-video-toggle.is-paused .pi-icon-pause::after {
  display: none;
}

.pi-video-sound-icon {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 18px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.pi-video-sound-icon .pi-icon-speaker {
  fill: currentColor;
  stroke: none;
}

.pi-video-sound-icon .pi-icon-slash {
  opacity: 0;
}

.pi-video-mute.is-muted .pi-video-sound-icon .pi-icon-wave {
  opacity: 0;
}

.pi-video-mute.is-muted .pi-video-sound-icon .pi-icon-slash {
  opacity: 1;
  stroke: #d8c7ff;
}

.pi-video-progress {
  position: relative;
  height: 10px;
  border: 1px solid rgba(216, 199, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.pi-video-progress:focus-visible {
  outline: 2px solid rgba(216, 199, 255, 0.82);
  outline-offset: 2px;
}

.pi-video-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8c7ff, #7c5cff);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.5);
}

.pi-video-time {
  min-width: 78px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.pi-video-trigger {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
}

.pi-video-trigger img {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  object-fit: cover;
  opacity: 0.88;
  filter: saturate(0.92);
  transition:
    opacity 160ms ease,
    transform 180ms ease;
}

.pi-video-trigger:hover img {
  opacity: 1;
  transform: scale(1.015);
}

.pi-video-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.48);
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0;
}

.pi-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(245, 244, 239, 0.82);
  color: var(--foreground);
  backdrop-filter: blur(5px);
  transform: translate(-50%, -50%);
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.pi-video-trigger:hover .pi-video-play {
  background: rgba(255, 254, 249, 0.94);
  transform: translate(-50%, -50%) scale(1.04);
}

.pi-video-play svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.pi-video.is-playing {
  box-shadow: none;
}

.project-body code {
  background: var(--background-soft);
  padding: 1px 4px;
}

.project-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.project-body th,
.project-body td {
  border: 1px solid var(--border);
  padding: 6px;
  text-align: left;
  vertical-align: top;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 54px;
  padding-top: 20px;
  border-top: 1px solid var(--foreground);
}

.footer-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.footer-note a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

@media (min-width: 720px) {
  .page {
    padding: 48px;
  }

  .masthead {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .intro {
    grid-template-columns: minmax(0, 1fr) 118px;
    align-items: start;
  }

  .compact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-hero {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
  }

  .project-hero img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 560px) {
  .card-head,
  .news-row {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .title-line,
  .news-copy {
    align-items: flex-start;
  }

  .rail-card.media {
    grid-template-columns: 1fr;
  }

  .rail-card.media img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .footer {
    flex-direction: column;
  }
}
