/* KittyScan memorial. The look follows the original Angular public site (2025):
   blurred pink sunset, frosted cards, Minecraft font, white ink. */

@font-face { font-family: 'Minecraft'; src: url('../fonts/MinecraftRegular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Minecraft'; src: url('../fonts/MinecraftItalic.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Minecraft'; src: url('../fonts/MinecraftBold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Minecraft'; src: url('../fonts/MinecraftBoldItalic.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: dark;
  --font: 'Minecraft', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-plain: system-ui, -apple-system, 'Segoe UI', sans-serif;

  --page: #1b0f1c;
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.82);
  --ink-3: rgba(255, 255, 255, 0.62);
  --card: rgba(38, 20, 42, 0.42);
  --card-solid: #3a2340;
  --card-border: rgba(241, 241, 241, 0.35);
  --hairline: rgba(241, 241, 241, 0.22);
  --chip: rgba(255, 255, 255, 0.12);
  --chip-active: rgba(255, 255, 255, 0.9);
  --chip-active-ink: #2a1530;
  --accent: #ffb3d4;

  --radius: 2rem;
  --gap: 2rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 1rem; }

body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--page);
  min-height: 100vh;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  overflow-x: hidden;
}
/* a fixed layer instead of background-attachment: fixed, which mobile Safari ignores */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--page);
  background-image: linear-gradient(rgba(20, 8, 24, 0.28), rgba(20, 8, 24, 0.28)), url('../img/bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
strong { font-weight: 700; }
img { max-width: 100%; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--card-solid); padding: .5rem 1rem; border-radius: 1rem; }

/* Header */
header.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 1rem 2rem; padding: 2.5rem 3rem 0;
}
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.brand img { width: 3rem; height: 3rem; }
.brand h1 { font-size: 3rem; font-weight: 400; line-height: 1; }

/* Section nav: stays at the top while scrolling */
nav.sticky {
  position: sticky; top: 0; z-index: 15;
  display: flex; justify-content: center; gap: .25rem 1.5rem; flex-wrap: nowrap; overflow-x: auto;
  padding: .7rem 1.5rem; margin-top: 1rem;
  background: rgba(32, 16, 36, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--hairline); scrollbar-width: none;
}
nav.sticky::-webkit-scrollbar { display: none; }
nav.sticky a { font-size: 1.15rem; text-decoration: none; white-space: nowrap; color: var(--ink-2); padding: .2rem .1rem; border-bottom: 2px solid transparent; }
nav.sticky a:hover { color: var(--ink); }
nav.sticky a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--accent); }
html { scroll-padding-top: 4.5rem; }

/* Hero */
.hero { text-align: center; padding: 3rem 1.5rem 2rem; max-width: 70rem; margin: 0 auto; }
.hero .sleep { width: 9rem; height: auto; margin-bottom: 1.5rem; image-rendering: pixelated; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }
.hero h2 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); font-weight: 400; margin-bottom: 1rem; }
.hero .dates { font-size: clamp(1.25rem, 2.5vw, 1.75rem); color: var(--ink-2); margin-bottom: 1.5rem; }
.hero p { font-family: var(--font); font-size: 1.15rem; color: var(--ink-2); max-width: 50rem; margin: 0 auto .75rem; }
.zzz { display: inline-block; animation: zzz 3.2s ease-in-out infinite; color: var(--accent); }
@keyframes zzz { 0%,100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(-6px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zzz { animation: none; } html { scroll-behavior: auto; } }

main { padding: 0 3rem 3rem; max-width: 110rem; margin: 0 auto; }

section.block { margin-top: 6rem; }
section.block > h2 {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 400; text-align: center; margin-bottom: .75rem;
}
section.block > .lede {
  text-align: center; max-width: 52rem; margin: 0 auto 2.5rem; color: var(--ink-2); font-size: 1.15rem;
}

/* Subheadings inside a section */
h3.group {
  flex: 1 1 100%; display: flex; align-items: center; gap: 1rem;
  font-size: 1.5rem; font-weight: 400; color: var(--ink); margin: 1.5rem 0 -.25rem;
}
h3.group::before, h3.group::after { content: ''; flex: 1; height: 2px; background: var(--hairline); }

/* Cards */
.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.card {
  background-color: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 0;
}
.card h3 { font-size: 1.6rem; font-weight: 400; margin-bottom: .25rem; }
.card .sub { color: var(--ink-3); font-size: 1rem; margin-bottom: 1rem; }
.card .note { color: var(--ink-3); font-size: .95rem; margin-top: .75rem; }

.stat { flex: 1 1 16rem; max-width: 24rem; display: flex; flex-direction: column; justify-content: center; }
.stat .num { font-size: clamp(3.2rem, 6vw, 5.5rem); line-height: 1.05; white-space: nowrap; }
.stat .title { font-size: 1.5rem; margin-top: .5rem; }
.stat .hint { font-size: 1rem; color: var(--ink-3); margin-top: .5rem; }

.wide { flex: 1 1 100%; }
.half { flex: 1 1 36rem; max-width: 100%; }
.third { flex: 1 1 26rem; max-width: 100%; }

.chart { width: 100%; height: 340px; }
.chart.tall { height: 440px; }
.chart.short { height: 260px; }

/* Chips (metric pickers) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: .5rem 0 1rem; }
.chip {
  font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--chip);
  border: 2px solid var(--hairline); border-radius: 999px; padding: .35rem 1rem; cursor: pointer;
}
.chip:hover { border-color: var(--card-border); }
.chip[aria-pressed="true"] { background: var(--chip-active); color: var(--chip-active-ink); text-shadow: none; border-color: var(--chip-active); }
.chip:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; text-align: left; font-size: 1.1rem; }
table.list th { font-weight: 400; color: var(--ink-3); padding: .25rem .25rem .5rem; }
table.list td { border-bottom: 1px solid var(--hairline); padding: .35rem .25rem; vertical-align: middle; }
table.list .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list td.wrap { overflow-wrap: anywhere; }
#ports table.list td.wrap { white-space: nowrap; }
.bar-cell { position: relative; }
.bar-cell .bar { position: absolute; inset: 15% auto 15% 0; background: rgba(255,255,255,.14); border-radius: 0 4px 4px 0; z-index: -1; }

/* MOTD list: rendered with Minecraft formatting codes */
.motd { font-family: var(--font); background: rgba(10, 6, 12, 0.55); border-radius: .75rem; padding: .6rem .9rem; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; font-size: 1.05rem; text-shadow: 2px 2px 0 rgba(0,0,0,.45); }
.motds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); gap: 1rem; text-align: left; }
.motd-row { display: flex; gap: .75rem; align-items: stretch; }
.motd-row .motd { flex: 1; }
.motd-row .cnt { min-width: 4.5rem; display: flex; flex-direction: column; justify-content: center; text-align: right; color: var(--ink-2); font-size: 1rem; }
.mc-b { font-weight: 700; } .mc-i { font-style: italic; } .mc-u { text-decoration: underline; } .mc-s { text-decoration: line-through; } .mc-u.mc-s { text-decoration: underline line-through; }
.mc-k { filter: blur(2px); }

/* Favicon wall + skins */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); gap: .75rem; }
.wall figure { position: relative; margin: 0; text-align: center; }
.wall img { width: 4rem; height: 4rem; image-rendering: pixelated; border-radius: .5rem; display: block; margin: 0 auto; background: rgba(0,0,0,.2); }
.wall figcaption { font-size: .85rem; color: var(--ink-3); margin-top: .2rem; font-variant-numeric: tabular-nums; }
.wall.skins { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); row-gap: 1.25rem; }
.wall.skins img { width: auto; height: 9rem; border-radius: 0; background: transparent; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }

/* Signs, drawn like oak signs in game */
.signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 1.5rem 1rem; justify-items: center; }
.sign { display: flex; flex-direction: column; align-items: center; }
.sign .board {
  width: 100%; max-width: 10.5rem; height: 5.4rem; display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: repeating-linear-gradient(0deg, #a8834f 0 6px, #9c7845 6px 12px);
  border: 4px solid #6b4f2a; box-shadow: inset 0 0 0 2px #b8935c, 0 4px 10px rgba(0,0,0,.3);
  color: #1b1209; text-shadow: none; font-size: 1rem; line-height: 1.2; text-align: center; overflow: hidden; padding: .2rem .4rem;
}
.sign .board span { display: block; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sign .post { width: 10px; height: 1.6rem; background: #6b4f2a; }
.sign .cnt { color: var(--ink-2); font-size: .95rem; margin-top: .3rem; }

/* Facts */
/* facts and stat tiles: even grids, columns set from the number of items */
.facts { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gap); }
#tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
#tiles .stat { max-width: none; }
@media (max-width: 1100px) {
  .facts, #tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.fact { text-align: left; }
.fact .big { font-size: 2.6rem; line-height: 1.1; }
.fact p { color: var(--ink-2); font-size: 1.1rem; margin-top: .4rem; }

/* Archive world */
.archive { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.archive img { flex: 1 1 28rem; max-width: 100%; width: 0; min-width: min(100%, 28rem); height: auto; filter: drop-shadow(0 12px 24px rgba(0,0,0,.35)); }
.archive .txt { flex: 1 1 22rem; text-align: left; }
.archive .txt p { color: var(--ink-2); font-size: 1.1rem; margin-bottom: .8rem; }

/* Hilbert map */
.hilbert-wrap { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: flex-start; justify-content: center; }
.hilbert { position: relative; width: min(100%, 768px); aspect-ratio: 1; }
.hilbert canvas { width: 100%; height: 100%; image-rendering: pixelated; border-radius: 1rem; background: rgba(10,6,12,.55); display: block; }
.hilbert-side { flex: 1 1 18rem; text-align: left; max-width: 30rem; }
.hilbert-side p { color: var(--ink-2); font-size: 1.05rem; margin-bottom: .8rem; }
.legend-ramp { height: 12px; border-radius: 6px; margin: .4rem 0 .2rem; }
.legend-ramp-labels { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-3); }
.tip {
  position: fixed; pointer-events: none; z-index: 20; background: rgba(28, 14, 32, 0.94); color: #fff;
  border: 1px solid var(--card-border); border-radius: .75rem; padding: .45rem .75rem; font-size: 1rem; display: none; white-space: nowrap;
}

/* Timeline */
ol.timeline { list-style: none; position: relative; max-width: 52rem; margin: 0 auto; text-align: left; }
ol.timeline::before { content: ''; position: absolute; left: 7.45rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--card-border); }
ol.timeline li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 2rem; padding: .6rem 0; position: relative; }
ol.timeline li::before { content: ''; position: absolute; left: calc(7.45rem - 5px); top: 1rem; width: 12px; height: 12px; background: #fff; border-radius: 3px; }
ol.timeline time { color: var(--ink-3); font-size: 1rem; padding-top: .2rem; text-align: right; }
ol.timeline .what { font-size: 1.2rem; }
ol.timeline .what span { display: block; color: var(--ink-2); font-size: 1rem; }

/* The End */
.letter { max-width: 46rem; margin: 0 auto; text-align: left; padding: 2.5rem; }
.letter p { font-size: 1.2rem; line-height: 1.6; margin-bottom: 1rem; color: var(--ink); }
.letter .sig { margin: 1.5rem 0 0; color: var(--ink-2); }
.letter .kicker { color: var(--ink-2); }
.letter.note { margin-top: var(--gap); }
.help { text-align: center; color: var(--ink-2); font-size: 1rem; margin: 1.5rem auto 0; max-width: 46rem; }
ol.timeline .what a { font-size: .95rem; color: var(--ink-2); }
#ipv6-sources .about { color: var(--ink-3); font-size: .9rem; }
#ipv6-sources td { padding: .6rem .25rem; }
.card.story { max-width: 60rem; margin: 0 auto; }
.card.story .chips { margin: 0 0 1.5rem; }

footer { text-align: center; padding: 4rem 1.5rem 3rem; color: var(--ink-2); font-size: 1.1rem; }
footer p { margin-bottom: .5rem; }
footer .heart { color: var(--accent); }

details.table-view { margin-top: .75rem; text-align: left; }
details.table-view summary { cursor: pointer; color: var(--ink-3); font-size: 1rem; text-align: center; }
details.table-view table { margin-top: .5rem; }

@media (max-width: 760px) {
  header.top { padding: 1.5rem 1rem .5rem; justify-content: center; }
  .brand h1 { font-size: 2.4rem; }
  nav.sticky { justify-content: flex-start; padding: .6rem 1rem; gap: 1.25rem; margin-top: 1rem; }
  nav.sticky a { font-size: 1.05rem; }
  h3.group { font-size: 1.25rem; }
  main { padding: 0 1rem 2rem; }
  :root { --gap: 1rem; --radius: 1.25rem; }
  .card { padding: 1.25rem 1rem; }
  .chart { height: 300px; }
  .chart.tall { height: 360px; }
  table.list { font-size: 1rem; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  #tiles .stat { padding: 1.25rem .5rem; }
  #tiles .stat .num { font-size: 2.3rem; }
  #tiles .stat .title { font-size: 1.1rem; }
  #tiles .stat .hint { font-size: .85rem; }
  .fact .big { font-size: 2.1rem; }
  .sign .board { font-size: .9rem; height: 4.8rem; }
  ol.timeline::before { left: .35rem; }
  ol.timeline li { grid-template-columns: 1fr; gap: .1rem; padding-left: 1.5rem; }
  ol.timeline li::before { left: 0; }
  ol.timeline time { text-align: left; }
  .letter { padding: 1.5rem 1.25rem; }
  .card.story .chip { font-size: .9rem; padding: .3rem .7rem; }
  .letter p { font-size: 1.1rem; }
}
