/* Cuprum: SIL OFL 1.1, subset to Latin and Cyrillic (assets/fonts/OFL.txt) */
@font-face {
  font-family: "Cuprum";
  src: url("assets/fonts/cuprum-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Cuprum";
  src: url("assets/fonts/cuprum-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* The frame has no accent of its own: each project brings its color as --c. */
:root {
  --night: #10142a;
  --night-deep: #0b0e1f;
  --line: #283055;
  --text: #e9ecf6;
  --muted: #a3abc6;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 400 1.125rem/1.5 "Cuprum", "Arial Narrow", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

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

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--c, var(--muted));
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--c, var(--text));
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--night);
}
.skip:focus { top: 1rem; }

.wrap {
  max-width: 75rem;
  margin-inline: auto;
  padding-inline: max(1rem, 4vw);
}

/* Intro: the name is the hero */

.intro { padding-block: clamp(2.5rem, 8vw, 6rem) 0; }

.intro h1 {
  font-size: clamp(3.25rem, 15vw, 11rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.025em;
  margin-left: -0.04em;
}

.lede {
  max-width: 34rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.35;
  text-wrap: pretty;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
}
.social a { display: inline-block; padding-block: 0.25rem; }

/* Groups and grid */

.group { margin-top: clamp(4rem, 10vw, 7.5rem); scroll-margin-top: 1rem; }

.group h2 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.group-note { margin-top: 0.25rem; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 2rem;
}

.project { position: relative; }
.half-7 { grid-column: span 7; }
.half-5 { grid-column: span 5; }
.wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
}
.wide .specimen { grid-column: span 7; }
.wide .about { grid-column: span 5; }

.about { max-width: 32rem; }
.half-7 .about, .half-5 .about { margin-top: 1.5rem; }

.about h3 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
}
.about h3 + p { margin-top: 0.5rem; text-wrap: pretty; }

/* The whole project is clickable; the source link sits above that layer. */
.about h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.more { position: relative; z-index: 1; margin-top: 0.75rem; }
.more a { display: inline-block; padding-block: 0.25rem; }

.nb { white-space: nowrap; }

.facts { margin-top: 0.5rem; color: var(--muted); font-size: 1rem; }

.also { margin-top: clamp(3rem, 6vw, 4.5rem); color: var(--muted); }

/* Specimens: every project wears the look of its own site. */

.specimen { position: relative; }

/* Cosplay Convention Crisis: comic panel */
.sp-ccc {
  border: 4px solid #000;
  outline: 3px solid #fff;
  background: #000;
  box-shadow: 10px 10px 0 3px var(--c);
  transform: rotate(-1.2deg);
  margin: 6px 16px 24px 6px;
}
.sp-ccc .sticker {
  position: absolute;
  top: -16px;
  right: -14px;
  padding: 0.1em 0.45em;
  background: var(--c);
  border: 3px solid #000;
  color: #000;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  transform: rotate(7deg);
}

/* Win 98 Web Edition: window with bevels */
.sp-98 {
  padding: 3px;
  background: #c0c0c0;
  box-shadow: inset -1px -1px #000, inset 1px 1px #dfdfdf, inset -2px -2px #808080, inset 2px 2px #fff;
  font-family: Tahoma, "MS Sans Serif", "Segoe UI", sans-serif;
}
.sp-98 .titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  margin-bottom: 2px;
  padding: 0 2px 0 5px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.sp-98 .buttons { display: flex; gap: 2px; }
.sp-98 .buttons i {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  box-shadow: inset -1px -1px #000, inset 1px 1px #fff, inset -2px -2px #808080;
  color: #000;
  font: 700 10px/13px Tahoma, sans-serif;
  font-style: normal;
  text-align: center;
}
.sp-98 .buttons i:last-child { margin-left: 2px; }

/* MH-X-Ray: dusk, straw and the frame-rate chart from its page */
.sp-xray {
  overflow: hidden;
  background: #2a2832;
  border-radius: 4px;
}
.sp-xray img {
  width: 78%;
  margin-left: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.sp-xray .chart {
  position: absolute;
  left: 5%;
  bottom: 9%;
  width: 52%;
  color: #e6e0e8;
  font-size: clamp(0.75rem, 1.4vw, 0.9375rem);
}
.sp-xray .chart p { margin-bottom: 0.5em; color: #aaa3b6; }
.sp-xray .bar {
  display: grid;
  grid-template-columns: 3.2em 1fr auto;
  align-items: center;
  gap: 0.6em;
  margin-top: 0.35em;
}
.sp-xray .bar b {
  height: 0.8em;
  width: var(--w);
  border-radius: 2px;
}
.sp-xray .win32 b { background: #8b7bbe; }
.sp-xray .x64 b { background: #b58c3c; }
.sp-xray .bar em { font-style: normal; font-variant-numeric: tabular-nums; }
.sp-xray .x64 em { color: #d6bc7f; font-weight: 700; }

/* MH Files: screenshot of the app window */
.sp-files img {
  border: 1px solid #242c38;
  border-radius: 6px;
  background: #0b0b0d;
}

/* MH Sidebar: the panel docked to the edge of a screen */
.sp-side {
  aspect-ratio: 8 / 7;
  overflow: hidden;
  background: radial-gradient(120% 90% at 20% 30%, #1d2740, #0d1119 70%);
  border: 1px solid #242c38;
  border-radius: 6px;
  font-family: "Cuprum", sans-serif;
}
.sp-side .ghost {
  position: absolute;
  left: 7%;
  top: 12%;
  width: 46%;
  height: 58%;
  border: 1px solid #2a3446;
  border-radius: 5px;
  background: #121824 url("assets/xray.webp") center / cover;
  opacity: 0.8;
}
.sp-side .panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(44%, 13.5rem);
  padding: 0.6rem 0.6rem 0;
  background: #0e1116;
  border-left: 1px solid #242c38;
  color: #f1f1f1;
  font-size: 0.75rem;
  line-height: 1.3;
  -webkit-mask-image: linear-gradient(#000 82%, transparent);
  mask-image: linear-gradient(#000 82%, transparent);
}
.sp-side .ph { color: #a9a9ad; font-size: 0.6875rem; letter-spacing: 0.06em; }
.sp-side .clock { margin-top: 0.4rem; font-size: 1.75rem; font-weight: 700; line-height: 1; }
.sp-side .date { color: #a9a9ad; }
.sp-side .blk {
  margin-top: 0.45rem;
  padding: 0.4rem 0.5rem;
  background: #151a22;
  border: 1px solid #242c38;
  border-radius: 5px;
}
.sp-side .row { display: flex; justify-content: space-between; }
.sp-side .row span { color: #3fd0d8; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-side .sub { color: #a9a9ad; }
.sp-side svg { display: block; width: 100%; height: 1rem; margin-top: 0.25rem; }
.sp-side polyline { fill: none; stroke: #3fd0d8; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.sp-side .meter {
  display: block;
  height: 4px;
  margin-top: 0.3rem;
  border-radius: 2px;
  background: linear-gradient(90deg, #3fd0d8 var(--w), #242c38 var(--w));
}

/* MH Sort: the plan before sorting */
.sp-sort {
  overflow: hidden;
  background: #141c31;
  border: 1px solid #2a3655;
  border-radius: 12px;
  color: #e7ecf7;
  font-size: 0.875rem;
  line-height: 1.3;
}
.sp-sort .win-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #2a3655;
}
.sp-sort .field {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0.3rem 0.6rem;
  background: #0c1222;
  border-radius: 6px;
  font: 0.75rem var(--mono);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-sort .win-body { padding: 0.75rem; }
.sp-sort .summary span { margin-left: 0.4rem; color: #93a0bf; }
.sp-sort .spread { display: flex; gap: 3px; margin-top: 0.6rem; }
.sp-sort .spread i { flex: 1; height: 6px; border-radius: 3px; }
.sp-sort .spread i:nth-child(1) { background: #45d0c0; flex: 2; }
.sp-sort .spread i:nth-child(2) { background: #a68cff; flex: 2; }
.sp-sort .spread i:nth-child(3) { background: #6aa8ff; flex: 2; }
.sp-sort .spread i:nth-child(4) { background: #e8c35a; }
.sp-sort .spread i:nth-child(5) { background: #ff7a6b; }
.sp-sort .spread i:nth-child(6) { background: #9aa4ff; }
.sp-sort .spread i:nth-child(7) { background: #45c8e8; }
.sp-sort .rows { margin-top: 0.6rem; padding: 0; list-style: none; }
.sp-sort .rows li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-top: 1px solid #1c2640;
}
.sp-sort .check {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #f3c969;
  box-shadow: inset 0 0 0 3px #f3c969, inset 0 0 0 7px #0f1629;
}
.sp-sort .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 0.75rem var(--mono);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-sort .to { flex: none; font-size: 0.8125rem; }
.sp-sort .skipped { color: #5a6788; }
.sp-sort .skipped .check { background: none; box-shadow: inset 0 0 0 1px #5a6788; }
.sp-sort .win-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid #2a3655;
  color: #93a0bf;
}
.sp-sort .win-foot b { color: #e7ecf7; }
.sp-sort .go {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  background: #f3c969;
  color: #0f1629;
  font-weight: 700;
  white-space: nowrap;
}

/* Footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2.5rem;
  margin-top: clamp(5rem, 12vw, 9rem);
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer img { width: 9rem; flex: none; }
.footer p { max-width: 38rem; }
.footer .copy { margin-top: 0.5rem; font-size: 1rem; }

/* Narrow screens: one column, specimens on top */

@media (max-width: 52rem) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .half-7, .half-5 { grid-column: auto; }
  .wide { display: block; }
  .wide .about { margin-top: 1.5rem; }
  .sp-side .panel { width: min(52%, 13.5rem); }
  .sp-xray img { width: 88%; }
  .sp-xray .chart { width: 60%; }
}

@media (max-width: 30rem) {
  .sp-sort .rows li:nth-child(n + 4):not(.skipped) { display: none; }
  .footer { flex-direction: column; align-items: flex-start; }
}
