/* ==========================================================================
   anime4000.github.io
   Palette: ink and paper from the Hitoha illustration, with the four candy
   colours of the .moe logo as accents — one per subject.
     yellow = fibre / PON     blue = code     pink = anime     teal = community
   No web fonts, no frameworks.
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --paper: #f7f0e6;
  --surface: #fffaf3;
  --sunken: #efe6d8;
  --ink: #27222d;
  --muted: #655c69;
  --line: #e2d6c5;
  --line-strong: #cdbfaa;

  --pink: #e8518d;      --pink-ink: #b3275c;
  --blue: #2f86dc;      --blue-ink: #1b60a8;
  --yellow: #f5b301;    --yellow-ink: #855600;
  --teal: #17a5a0;      --teal-ink: #0a716d;
  --russet: #b05a36;    --russet-ink: #8c4222;
  --led: #2fb866;

  --shadow: 0 1px 2px rgba(39, 34, 45, .06), 0 8px 24px rgba(39, 34, 45, .07);

  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
    "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
    "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;

  --tone: var(--pink);
  --tone-ink: var(--pink-ink);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16131a;
    --surface: #1f1b25;
    --sunken: #110f14;
    --ink: #f3ebe1;
    --muted: #aba1ad;
    --line: #322c3a;
    --line-strong: #463e50;

    --pink: #ff7fb0;      --pink-ink: #ff9cc3;
    --blue: #62aefc;      --blue-ink: #8cc4ff;
    --yellow: #f8c544;    --yellow-ink: #f8c544;
    --teal: #45cfc6;      --teal-ink: #6fddd5;
    --russet: #e8a283;    --russet-ink: #f0b69c;
    --led: #4fe08a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #16131a;
  --surface: #1f1b25;
  --sunken: #110f14;
  --ink: #f3ebe1;
  --muted: #aba1ad;
  --line: #322c3a;
  --line-strong: #463e50;

  --pink: #ff7fb0;      --pink-ink: #ff9cc3;
  --blue: #62aefc;      --blue-ink: #8cc4ff;
  --yellow: #f8c544;    --yellow-ink: #f8c544;
  --teal: #45cfc6;      --teal-ink: #6fddd5;
  --russet: #e8a283;    --russet-ink: #f0b69c;
  --led: #4fe08a;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

.tone-pink   { --tone: var(--pink);   --tone-ink: var(--pink-ink); }
.tone-blue   { --tone: var(--blue);   --tone-ink: var(--blue-ink); }
.tone-yellow { --tone: var(--yellow); --tone-ink: var(--yellow-ink); }
.tone-teal   { --tone: var(--teal);   --tone-ink: var(--teal-ink); }
.tone-russet { --tone: var(--russet); --tone-ink: var(--russet-ink); }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }

p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }

a { color: inherit; text-decoration-color: var(--tone); text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { color: var(--tone-ink); }

:focus-visible {
  outline: 3px solid var(--tone);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--pink); color: #fff; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: .6em 1em; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.jp { font-weight: 500; }
.quiet { color: var(--muted); }

/* ---- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  display: flex; align-items: center; gap: 12px 20px;
  min-height: 60px;
}

.brand {
  display: flex; align-items: baseline; gap: 10px;
  text-decoration: none; white-space: nowrap;
  margin-right: auto;
}
.brand-jp { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-en { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.brand:hover .brand-jp { color: var(--pink-ink); }

.site-nav ul { display: flex; gap: 2px; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 999px;
  font-size: .92rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--muted);
}
.site-nav a:hover { color: var(--ink); background: var(--sunken); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--sunken); }
.site-nav .ext { font-size: .8em; margin-left: 3px; opacity: .7; }

.theme-toggle {
  flex: none; display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--line-strong); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

@media (max-width: 720px) {
  .site-header-inner { flex-wrap: wrap; padding-top: 8px; row-gap: 2px; }
  .site-nav {
    order: 3; flex: 1 0 100%;
    margin-inline: calc(var(--gutter) * -1);
    overflow-x: auto; scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { padding: 4px var(--gutter) 8px; width: max-content; }
  .brand-en { display: none; }
}

/* ---- Shared pieces ----------------------------------------------------- */
.eyebrow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0 .6em;
  margin: 0 0 1rem;
  font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--tone-ink);
}
.eyebrow .jp { font-family: var(--font-sans); letter-spacing: .04em; color: var(--muted); text-transform: none; }
.eyebrow-mark {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--tone); transform: rotate(45deg);
}

.lede { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); line-height: 1.55; color: var(--muted); max-width: 62ch; }
.narrow { max-width: 62ch; }
.fineprint { margin: 1rem 0 0; font-size: .82rem; color: var(--muted); }
.h-sub { margin-bottom: 1rem; font-size: 1.05rem; }
.h-sub .jp { color: var(--muted); font-size: .85em; }

.button {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .7em 1.15em; border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: transparent; color: var(--ink);
  font-weight: 650; font-size: .98rem; text-decoration: none; line-height: 1.2;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.button:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.button-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.button-primary:hover { background: var(--tone-ink); border-color: var(--tone-ink); color: var(--paper); }
:root[data-theme="dark"] .button-primary:hover { color: var(--sunken); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .button-primary:hover { color: var(--sunken); }
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.5rem 0 0; }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section + .section { border-top: 1px solid var(--line); }
.section h2 { margin-bottom: 1.25rem; max-width: 22ch; }
.section h2 + .lede { margin-top: -.25rem; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 8px 24px; margin-bottom: 1.75rem;
}
.section-head h2 { margin: 0; }
.more { font-weight: 650; font-size: .95rem; white-space: nowrap; text-decoration: none; color: var(--tone-ink); }
.more:hover { text-decoration: underline; }

.split { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.1rem, 3vw, 1.75rem); box-shadow: var(--shadow);
}
.panel-title { font-size: .95rem; margin-bottom: 1.1rem; color: var(--muted); font-weight: 650; }

.prose p { max-width: 64ch; }
.prose h2 { margin-bottom: 1.25rem; }

.tag {
  display: inline-block; padding: .1em .6em; border-radius: 999px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600; letter-spacing: .03em;
  border: 1px solid var(--tone); color: var(--tone-ink); vertical-align: .12em; white-space: nowrap;
}
.tag-quiet { border-color: var(--line-strong); color: var(--muted); }
.tag-mine { background: var(--tone); border-color: var(--tone); color: #241a00; }

/* ---- Hero -------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding-top: clamp(2.5rem, 7vw, 5.5rem);
}
/* Manga screentone, fading out toward the copy. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--line-strong) 1.3px, transparent 1.6px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 88% 30%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 90% at 88% 30%, #000 0%, transparent 70%);
  opacity: .8;
}

.hero-inner {
  display: grid; gap: 2rem; align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr); gap: 3rem; }
}

.status-pill {
  display: inline-flex; align-items: center; gap: .6em;
  margin: 0 0 1.5rem; padding: .35em .9em .35em .7em;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); cursor: help;
}
.status-pill strong { color: var(--ink); }
.led {
  width: 9px; height: 9px; border-radius: 50%; background: var(--led);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--led) 60%, transparent);
  animation: led 2.4s ease-out infinite;
}
@keyframes led {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--led) 60%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
  --sx: 5; --sy: 5;
  font-size: clamp(3.3rem, 1rem + 11.5vw, 8.25rem);
  font-weight: 850; letter-spacing: -.05em; line-height: .92;
  margin-left: -.04em;
  /* The offset shadow leans away from the pointer — a small nod to the
     spotlight on the old front page. */
  text-shadow: calc(var(--sx) * 1px) calc(var(--sy) * 1px) 0 var(--pink);
  transition: text-shadow .12s ease-out;
}

.hero-tagline {
  margin: 1.1rem 0 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.2rem, 1rem + 1.2vw, 1.75rem); letter-spacing: -.01em;
}
.hero-tagline-sep { color: var(--line-strong); margin-inline: .15em; }

.hero-lede { margin: 1.4rem 0 0; max-width: 56ch; font-size: clamp(1.05rem, 1rem + .35vw, 1.2rem); color: var(--muted); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.8rem; }
.hero .button-primary:hover { background: var(--pink-ink); border-color: var(--pink-ink); }

.hero-links {
  display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 1.6rem;
  font-family: var(--font-mono); font-size: .82rem;
}
.hero-links a { color: var(--muted); text-decoration: none; padding-block: 4px; border-bottom: 1.5px solid var(--line-strong); }
.hero-links a:hover { color: var(--ink); border-color: var(--pink); }

.hero-portrait { position: relative; margin: 0; justify-self: center; width: min(100%, 360px); }
.portrait-disc {
  aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, #fff 0%, #fff4e6 45%, #f6dfc8 100%);
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--line-strong), 14px 14px 0 0 var(--yellow), var(--shadow);
}
.portrait-disc img { width: 100%; height: 100%; object-fit: cover; }
.spark { position: absolute; line-height: 1; font-size: 1.6rem; animation: twinkle 3.2s ease-in-out infinite; }
.spark-a { top: 6%; left: -2%; color: var(--pink); font-size: 2rem; }
.spark-b { bottom: 12%; right: -4%; color: var(--blue); animation-delay: -1.1s; }
.spark-c { top: -2%; right: 14%; color: var(--yellow-ink); font-size: 1.3rem; animation-delay: -2.1s; }
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(.7) rotate(18deg); opacity: .55; }
}
@media (max-width: 859px) {
  .hero-portrait { order: -1; width: 168px; justify-self: start; }
  .portrait-disc { box-shadow: 0 0 0 1.5px var(--line-strong), 8px 8px 0 0 var(--yellow); }
}

/* ---- Fibre strand ------------------------------------------------------ */
.fibre { height: 60px; margin-top: clamp(1.5rem, 4vw, 3rem); }
.fibre svg { width: 100%; height: 100%; overflow: visible; }
.fibre path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.fibre-glass { stroke: var(--line-strong); stroke-width: 2; }
.fibre-pulse { stroke-width: 3; stroke-dasharray: 70 930; }
.fibre-down { stroke: var(--yellow); animation: fibre-down 5.5s linear infinite; }
.fibre-up { stroke: var(--pink); stroke-dasharray: 40 960; animation: fibre-up 7s linear infinite; }
@keyframes fibre-down { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
@keyframes fibre-up { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 1000; } }

/* ---- Signal path (OLT → splitter → ONT → router) ----------------------- */
.signal-path { position: relative; display: grid; gap: 10px; }
.signal-path::before {
  content: ""; position: absolute; left: 15px; top: 18px; bottom: 18px; width: 2px;
  background: linear-gradient(var(--yellow), var(--yellow)) no-repeat 0 0 / 100% 28px, var(--line-strong);
  animation: path-light 3.6s linear infinite;
}
@keyframes path-light { from { background-position: 0 -28px, 0 0; } to { background-position: 0 calc(100% + 28px), 0 0; } }

.hop {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
  padding: 12px 14px 12px 44px;
  border: 1px solid transparent; border-radius: 12px;
}
.hop::before {
  content: ""; position: absolute; left: 9px; top: 17px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong);
}
.hop-name { grid-column: 1; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -.01em; }
.hop-owner {
  grid-column: 2; grid-row: 1; align-self: center;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.hop-desc { grid-column: 1 / -1; font-size: .9rem; line-height: 1.45; color: var(--muted); }
.hop-open {
  background: color-mix(in srgb, var(--yellow) 14%, var(--surface));
  border-color: var(--yellow);
}
.hop-open::before { background: var(--yellow); border-color: var(--yellow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow) 30%, transparent); }
.hop-open .hop-owner { color: var(--yellow-ink); font-weight: 700; }
.hop-open .hop-desc { color: var(--ink); }

/* ---- Stats ------------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line-strong);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 1.1rem 1rem 1.1rem 0; border-bottom: 1px solid var(--line); }
.stat dd {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); line-height: 1; font-variant-numeric: tabular-nums;
}
.stat dt { margin-top: .5rem; font-size: .86rem; line-height: 1.35; color: var(--muted); max-width: 22ch; }

/* ---- Cards ------------------------------------------------------------- */
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card::before {
  content: ""; position: absolute; left: 1.25rem; top: -1px; width: 34px; height: 4px;
  border-radius: 0 0 4px 4px; background: var(--tone);
}
.card:hover, .card:focus-within { transform: translateY(-3px); border-color: var(--tone); box-shadow: var(--shadow); }
.card h3 { font-size: 1.22rem; }
.card-link { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:hover { color: inherit; }
.card-link:focus-visible { outline: none; }
.card:focus-within { outline: 3px solid var(--tone); outline-offset: 2px; }

.project-role {
  margin: .25rem 0 .5rem; font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--tone-ink);
}
.project-full { margin: .2rem 0 0; font-size: .86rem; color: var(--muted); }
.project-desc { margin: .7rem 0 1rem; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.project-meta {
  display: flex; align-items: center; gap: 14px; margin-top: auto;
  font-family: var(--font-mono); font-size: .76rem; color: var(--muted);
}
.project-meta .stars { color: var(--ink); font-weight: 600; }
.go { margin-left: auto; font-family: var(--font-mono); color: var(--muted); transition: color .18s ease, transform .18s ease; }
.card:hover .go { color: var(--tone-ink); transform: translate(2px, -2px); }
.place .go { position: absolute; right: 1.1rem; top: 1rem; }
.place .project-desc { margin-bottom: 0; }

/* ---- Language ranks ---------------------------------------------------- */
.ranks { margin-top: 1.75rem; border-top: 1px solid var(--line-strong); }
.rank { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0 .5rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.rank-no { font-family: var(--font-mono); font-size: .85rem; font-weight: 600; color: var(--tone-ink); padding-top: .45rem; }
.rank-name { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0; }
.rank-name strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.rank:first-child .rank-name strong { font-size: 2.3rem; }
.rank-note { margin: .15rem 0 0; color: var(--muted); font-size: .95rem; }
.rank-used { margin: .3rem 0 0; font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
.pips { display: inline-flex; gap: 5px; flex: none; }
.pip { width: 11px; height: 11px; border-radius: 3px; transform: rotate(45deg); border: 1.5px solid var(--line-strong); }
.pip-on { background: var(--tone); border-color: var(--tone); }

.likes { display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.likes li { padding: .8rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.likes strong { color: var(--ink); }
.speaks { margin-top: 1.5rem; color: var(--muted); }
.speaks strong { color: var(--ink); }

/* ---- Anime list -------------------------------------------------------- */
.anime-list {
  counter-reset: anime;
  display: grid; gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line-strong);
}
@media (min-width: 760px) {
  .anime-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(5, auto); }
}
.anime-list li { counter-increment: anime; border-bottom: 1px solid var(--line); }
.anime-list a {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0 .25rem;
  padding: .95rem 0; text-decoration: none;
}
.anime-list a::before {
  content: counter(anime, decimal-leading-zero);
  grid-row: 1 / span 3; padding-top: .5rem;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600; color: var(--tone-ink);
}
.anime-jp { grid-column: 2; font-family: var(--font-display); font-size: clamp(1.2rem, 1rem + .9vw, 1.55rem); font-weight: 800; line-height: 1.3; letter-spacing: 0; transition: color .15s ease; }
.anime-en { grid-column: 2; font-size: .92rem; color: var(--muted); }
.anime-year { font-family: var(--font-mono); font-size: .78rem; margin-left: .35em; }
.anime-note { grid-column: 2; font-size: .84rem; color: var(--tone-ink); margin-top: .1rem; }
.anime-list a:hover .anime-jp { color: var(--tone-ink); }

/* ---- Row lists (posts, archive, links) --------------------------------- */
.posts { border-top: 1px solid var(--line-strong); }
.posts li { border-bottom: 1px solid var(--line); }
.posts a {
  display: grid; gap: 2px 1.25rem; align-items: baseline;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: .95rem 0; text-decoration: none;
}
.post-date { grid-column: 1 / -1; font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.post-title { font-weight: 650; font-size: 1.06rem; line-height: 1.35; transition: color .15s ease; }
.post-desc { display: block; font-weight: 400; font-size: .92rem; color: var(--muted); margin-top: .1rem; }
.post-topic { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--tone-ink); white-space: nowrap; }
.posts a:hover .post-title { color: var(--tone-ink); }
@media (min-width: 700px) {
  .posts a { grid-template-columns: 7.5rem minmax(0, 1fr) auto; }
  .post-date { grid-column: auto; }
  .posts-nodate a { grid-template-columns: minmax(0, 1fr) auto; }
}

.plain-list { border-top: 1px solid var(--line-strong); }
.plain-list li { border-bottom: 1px solid var(--line); }
.plain-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .8rem; padding: .8rem 0; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.plain-list .quiet { font-weight: 400; font-size: .9rem; }

/* ---- Page head --------------------------------------------------------- */
.page-head { position: relative; overflow: hidden; padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); }
.page-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--line-strong) 1.3px, transparent 1.6px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse 60% 110% at 95% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 110% at 95% 0%, #000 0%, transparent 70%);
  opacity: .8;
}
.page-head h1 {
  font-size: clamp(2.3rem, 1.2rem + 5.2vw, 4.6rem); font-weight: 850; letter-spacing: -.04em; line-height: 1;
  max-width: 18ch;
  text-shadow: 3px 3px 0 var(--tone);
}
.page-head .lede { margin: 1.5rem 0 0; }
.page-head + .section { border-top: 0; }

/* ---- xPON page --------------------------------------------------------- */
.firmware { border-top: 1px solid var(--line-strong); }
.firmware li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.firmware-name { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.firmware-name strong { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -.01em; margin-right: 4px; }
.firmware-desc { margin: .3rem 0 0; font-size: .93rem; color: var(--muted); }

.principles { counter-reset: principle; display: grid; gap: 0 2.5rem; margin-top: 2rem; border-top: 1px solid var(--line-strong); }
@media (min-width: 760px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.principles li { counter-increment: principle; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.principles li::before { content: counter(principle, decimal-leading-zero); grid-row: 1 / span 2; padding-top: .2rem; font-family: var(--font-mono); font-size: .8rem; font-weight: 600; color: var(--tone-ink); }
.principles h3 { margin-bottom: .35rem; }
.principles p { margin: 0; color: var(--muted); font-size: .96rem; }

.timeline { position: relative; margin-top: 2rem; }
.timeline li { position: relative; display: grid; gap: .2rem 2rem; padding: 0 0 2rem 28px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: .45rem; width: 12px; height: 12px;
  border-radius: 3px; transform: rotate(45deg); background: var(--tone);
}
.timeline li::after { content: ""; position: absolute; left: 5px; top: 1.6rem; bottom: -.1rem; width: 2px; background: var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline-date { margin: 0; font-family: var(--font-mono); font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--tone-ink); padding-top: .15rem; }
.timeline h3 { margin-bottom: .3rem; }
.timeline p { margin: 0; color: var(--muted); max-width: 60ch; }
@media (min-width: 760px) { .timeline li { grid-template-columns: 11rem minmax(0, 1fr); } }

.notice {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1.5px solid var(--tone); border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--tone) 8%, var(--surface));
}
.notice h2 { max-width: none; }
.notice p:not(.eyebrow) { max-width: 68ch; }
.notice p:last-child { margin-bottom: 0; }

/* ---- Network page ------------------------------------------------------ */
.rack { border-top: 1px solid var(--line-strong); }
.rack li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.rack-where { margin: 0; padding-top: .25rem; font-family: var(--font-mono); font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tone-ink); }
.rack h3 { font-size: 1.15rem; }
.rack-spec { margin: .3rem 0 0; font-family: var(--font-mono); font-size: .8rem; color: var(--ink); }
.rack-desc { margin: .35rem 0 0; font-size: .93rem; color: var(--muted); }

.story { max-width: 46rem; }
.story > p { font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem); line-height: 1.65; }
.story > p:nth-child(2) { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.25rem, 1.05rem + 1vw, 1.7rem); line-height: 1.35; letter-spacing: -.01em; }

.pullquote {
  margin: 1.75rem 0 0; padding: .2rem 0 .2rem 1.25rem;
  border-left: 4px solid var(--tone);
}
.pullquote p {
  margin: 0; max-width: 34ch;
  font-family: var(--font-display); font-weight: 750; letter-spacing: -.015em;
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.7rem); line-height: 1.3;
}
.story .pullquote { margin-top: 2.25rem; }
.story .pullquote p { max-width: 30ch; font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.3rem); line-height: 1.2; }

.partner-list a { justify-content: space-between; }

/* ---- Anime page -------------------------------------------------------- */
.people { margin-top: .5rem; }
.person-jp { margin: .25rem 0 .2rem; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; line-height: 1.25; }
.person h3 { font-size: 1rem; font-weight: 600; color: var(--muted); }
.person-from { margin: .6rem 0 0; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--tone-ink); }
.person-note { margin: .5rem 0 0; font-size: .9rem; color: var(--muted); }

/* ---- 404 --------------------------------------------------------------- */
.notfound h1 { font-size: clamp(2.3rem, 1.2rem + 5.2vw, 4.6rem); font-weight: 850; letter-spacing: -.04em; margin-bottom: 1.25rem; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { margin-top: clamp(2rem, 5vw, 4rem); padding-block: 2.5rem 3rem; border-top: 1px solid var(--line-strong); background: var(--sunken); }
.site-footer-inner { display: grid; gap: 1.5rem 3rem; }
@media (min-width: 820px) { .site-footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.footer-moe { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; }
.footer-moe-text { font-family: var(--font-display); font-size: 1.9rem; font-weight: 850; letter-spacing: -.04em; line-height: 1; }
.footer-brand p { margin: .7rem 0 0; color: var(--muted); font-size: .92rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; align-content: start; font-size: .92rem; font-weight: 600; }
.footer-links a { text-decoration: none; color: var(--muted); }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-note { grid-column: 1 / -1; margin: 0; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

/* ---- Motion preferences ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fibre-pulse { display: none; }
}
