:root {
  color-scheme: dark;
  --bg: #0e1113;
  --ink: #d3dad7;
  --muted: #7f8c88;
  --accent: #8fe3c0;
  --line: rgba(255, 255, 255, 0.09);
  --fill: #d9b382;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 18% -12%, rgba(143, 227, 192, 0.07), transparent 62%),
    radial-gradient(900px 500px at 100% 108%, rgba(122, 162, 255, 0.055), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 92px 24px 72px;
}

/* ---------- masthead ---------- */

.masthead {
  padding-bottom: 44px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(3.2rem, 9vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: #eef3f0;
}

.tagline {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

/* ---------- sections ---------- */

.section {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 28px;
  padding: 30px 0;
  scroll-margin-top: 26px;
  border-top: 1px solid var(--line);
}

.section > h2 {
  margin: 0;
  padding-top: 5px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
}

.section p {
  margin: 0 0 1em;
}

.section p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration: underline;
}

.fill {
  color: var(--fill);
}

/* ---------- list rows ---------- */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows > li {
  display: flex;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.rows > li:last-child {
  border-bottom: 0;
}

.rows .k {
  flex: 0 0 86px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- last.fm ---------- */

.lastfm {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 9px;
}

.lf-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.lf-label.is-live {
  color: var(--accent);
}

.lf-label.is-live::before {
  content: "●";
  margin-right: 5px;
  font-size: 8px;
  vertical-align: 2px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

.lf-track {
  color: var(--ink);
}

.lf-artist {
  color: var(--muted);
}

.lf-artist::after {
  content: "—";
}

@media (prefers-reduced-motion: reduce) {
  .lf-label.is-live::before {
    animation: none;
  }
}

/* ---------- waffle ---------- */

.waffle {
  position: absolute;
  top: 30px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.waffle:hover,
.waffle[aria-expanded="true"] {
  color: var(--accent);
  border-color: rgba(143, 227, 192, 0.32);
  background: rgba(143, 227, 192, 0.06);
}

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

.launcher[hidden] {
  display: none;
}

.launcher {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.launcher-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(6, 8, 9, 0.66);
  backdrop-filter: blur(2px);
  cursor: default;
  animation: fade 0.16s ease;
}

.launcher-panel {
  position: absolute;
  top: 74px;
  right: max(24px, calc(50vw - 360px + 24px));
  width: min(368px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #121719;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: rise 0.18s ease;
}

.launcher-panel:focus {
  outline: none;
}

.launcher-title {
  margin: 2px 0 4px 2px;
  font-size: 10.5px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
}

.launcher-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.launcher-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.launcher-list li:last-child {
  border-bottom: 0;
}

.launcher-list a,
.launcher-list .row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 4px;
  color: var(--ink);
  font-size: 13px;
}

.launcher-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

.launcher-list a[aria-current="page"] {
  color: var(--accent);
}

.launcher-list a:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.launcher-list .meta {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .launcher-scrim,
  .launcher-panel {
    animation: none;
  }
}

/* ---------- interior pages ---------- */

.page-head {
  padding-bottom: 34px;
}

.back {
  display: inline-block;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.back:hover {
  color: var(--accent);
  text-decoration: none;
}

.page-title {
  font-size: clamp(2.6rem, 8vw, 3.5rem);
  line-height: 1.05;
}

.page-head .tagline {
  max-width: 46ch;
  margin-top: 12px;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.entries h3 {
  margin: 0 0 3px;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
}

.entries p {
  margin: 0;
  color: #a4aeab;
  font-size: 13.5px;
}

.entries .meta {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.05em;
}

.gallery {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #14181a;
}

.gallery figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

/* ---------- projects ---------- */

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.projects h3 {
  margin: 0 0 3px;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.projects p {
  margin: 0;
  color: #a4aeab;
  font-size: 13.5px;
}

.projects .year {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  margin-left: 8px;
}

.projects h3 a {
  color: inherit;
}

.projects h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
}

/* ---------- footer ---------- */

.foot {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.03em;
}

::selection {
  background: var(--accent);
  color: #0e1113;
}

@media (max-width: 620px) {
  .wrap {
    padding: 56px 20px 48px;
  }

  .section {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 24px 0;
  }

  .section > h2 {
    padding-top: 0;
  }

  .rows {
    display: grid;
    gap: 2px;
  }

  .rows > li {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .waffle {
    top: 18px;
    right: 20px;
  }

  .launcher-panel {
    top: 62px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- games ---------- */

.game-shell {
  max-width: 560px;
}

.game-shell canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0e10;
  touch-action: none;
}

.game-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-bar b {
  color: var(--ink);
  font-weight: 400;
}

.game-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.game-pad {
  display: none;
  gap: 8px;
  margin-top: 12px;
}

@media (pointer: coarse) {
  .game-pad {
    display: flex;
  }
}

.game-pad button {
  flex: 1;
  padding: 11px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

.game-pad button:active {
  color: var(--accent);
  border-color: rgba(143, 227, 192, 0.32);
}

