/* The wiki around the viewer: a reading site, laid out like a reference page. */

:root {
  --ground: #f6f7f9;
  --surface: #ffffff;
  --sunk: #eceff3;
  --ink: #15181d;
  --muted: #5c6673;
  --line: #dee3e9;
  --line-strong: #c3cbd5;
  --accent: #15607a;
  --accent-soft: #e3f0f5;
  --shadow: 0 1px 2px rgba(16, 22, 30, .05), 0 10px 26px -20px rgba(16, 22, 30, .5);
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --display: "Bitter", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #10141a;
    --surface: #171d25;
    --sunk: #141a21;
    --ink: #e6eaf0;
    --muted: #98a3b1;
    --line: #252e39;
    --line-strong: #38424f;
    --accent: #6fc2dd;
    --accent-soft: #12262e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -24px #000;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* ---- chrome ---- */
.top {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.top-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 58px;
  flex-wrap: wrap;
}
.brand {
  font: 600 18px/1 var(--display);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 18px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.top nav a[aria-current] { font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

.crumbs {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px 0;
  font: 400 13.5px/1.4 var(--body);
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; opacity: .6; }

main { max-width: 1080px; margin: 0 auto; padding: 8px 20px 80px; }
.page { max-width: 720px; }
h1 {
  font: 600 clamp(28px, 5vw, 38px)/1.15 var(--display);
  letter-spacing: -.015em;
  margin: 18px 0 6px;
  text-wrap: balance;
}
h2 {
  font: 600 22px/1.25 var(--display);
  margin: 38px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.tagline { margin: 0 0 18px; color: var(--muted); font-size: 17px; }
p { margin: 0 0 14px; }
.lead { font-size: 17px; }

/* ---- project cards on the home page ---- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin: 26px 0 0; }
.project {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.project img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--sunk); }
.project-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.project-body strong { font: 600 19px/1.2 var(--display); }
.project-body p { margin: 0; color: var(--muted); font-size: 15px; }
.project-body .count { font: 400 12.5px/1 var(--mono); color: var(--accent); margin-top: 4px; }

/* ---- structure index ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 22px; }
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.card:hover { border-color: var(--line-strong); }
.card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--sunk); }
.card-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 3px; }
.card-body b { font-weight: 600; }
.card-body small { color: var(--muted); font: 400 12.5px/1.4 var(--mono); }

/* ---- a structure page: article + infobox ---- */
.with-box { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 34px; align-items: start; }
@media (max-width: 860px) { .with-box { grid-template-columns: 1fr; gap: 22px; } }

.infobox {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  font-size: 14px;
}
.infobox img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--sunk); }
.infobox h2 {
  margin: 0;
  padding: 11px 14px;
  font: 600 15px/1.2 var(--body);
  background: var(--accent-soft);
  color: var(--accent);
  border: 0;
  border-bottom: 1px solid var(--line);
}
.infobox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.infobox dt, .infobox dd { padding: 8px 14px; margin: 0; border-top: 1px solid var(--line); }
.infobox dt { color: var(--muted); white-space: nowrap; }
.infobox dd { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
.infobox dl > :nth-child(-n+2) { border-top: 0; }

/* ---- the embedded viewer ---- */
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #10121a;
  margin: 20px 0 10px;
  box-shadow: var(--shadow);
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-open {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #10121a;
  color: #fff;
  font: inherit;
  display: grid;
  place-content: center;
  gap: 12px;
  overflow: hidden;
}
.embed-open img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4.8px) brightness(.78);
  transform: scale(1.12);
  transition: filter .25s;
}
.embed-open:hover img { filter: blur(3px) brightness(.9); }
.embed-open > * { position: relative; }
.embed-open .play {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-content: center;
  margin: 0 auto;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
}
.embed-open b { font-size: 16px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.embed-open small { color: #c3cbd5; font-size: 13px; }
.embed-note { margin: 0 0 26px; color: var(--muted); font-size: 13.5px; }

.controls { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 15px; }
.controls li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
.controls b { font: 500 13px/1.5 var(--mono); color: var(--accent); }
@media (max-width: 520px) { .controls li { grid-template-columns: 1fr; gap: 0; } }

footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 22px 20px 40px;
  color: var(--muted);
  font-size: 13.5px;
}
footer div { max-width: 1080px; margin: 0 auto; }
