/* International Taiji World Championship — archive stylesheet.
   Original design: white paper, deep-red accent, serif headings, system-font body.
   Sparse decorative Hanzi at ~5% opacity behind the content (aria-hidden). */

:root {
  --bg: #ffffff;
  --paper: #f7f5f0;
  --paper-2: #efebe3;
  --line: #ddd6ca;
  --line-strong: #b9b0a2;
  --ink: #1d1b19;
  --muted: #5c5650;
  --red: #8b1e1e;
  --red-dark: #6b1515;
  --red-tint: #f6eceb;
  --navy: #1f3a5a;
  --brass: #8a6a2c;
  --deco: rgba(139, 30, 30, .05);
  --cjk: "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", STSong, SimSun, serif;
  --serif: "Noto Serif", Georgia, Cambria, "Times New Roman", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", STSong, SimSun, serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 2px;
  --wrap: 72rem;
}

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

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

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.7 var(--text);
  border-top: 4px solid var(--red);
}

img { max-width: 100%; height: auto; display: block; background: var(--paper); }
/* build.py wraps every image in <picture>; keep the wrapper a plain block box. */
picture { display: block; max-width: 100%; }

a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--red-dark); text-decoration-thickness: 2px; }

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

h1, h2, h3, .display {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--ink);
}
h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); margin: .2em 0 .45em; font-weight: 700; }
h2 {
  font-size: clamp(1.4rem, 3.6vw, 1.85rem);
  margin: 2.2em 0 .6em;
}
h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-top: .45em;
  background: var(--red);
}
h3 { font-size: clamp(1.12rem, 2.6vw, 1.3rem); margin: 1.8em 0 .4em; }

p, ul, ol { margin: 0 0 1.1em; }
strong { color: var(--ink); font-weight: 700; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 44rem; margin-inline: auto; }
.center { text-align: center; }

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

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 10;
  padding: .6rem 1rem;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}
.skip:focus { top: 1rem; color: #fff; }

main:focus { outline: none; }

/* ---------------------------------------------------------------- decorative Hanzi */

/* Layered above the panels but multiplied, so on white/paper it reads as a faint
   watermark and over dark text it is invisible; never intercepts clicks. */
.deco {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  mix-blend-mode: multiply;
}
.deco span {
  position: absolute;
  font: 600 clamp(11rem, 34vw, 24rem)/1 var(--cjk);
  color: var(--deco);
}
.deco span:nth-child(1) { top: 5rem; right: -2.5rem; }
.deco span:nth-child(2) { top: 52%; left: -3.5rem; display: none; }

@media (min-width: 48rem) {
  .deco span:nth-child(2) { display: block; }
}

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand lang" "nav nav";
  align-items: center;
  gap: .5rem 1rem;
  padding-block: .9rem .25rem;
}
.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--ink); }
/* Brand mark: the emblem itself, same file the browser caches for the favicon.
   Decorative - the link's accessible name comes from .brand-name below it. */
.brand-badge {
  flex: none;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: none; /* the global img rule paints a paper tone behind images */
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 600 1.02rem/1.2 var(--serif); }
.brand-sub { font-size: .78rem; color: var(--muted); }

.lang-switch {
  grid-area: lang;
  margin: 0;
  display: flex;
  gap: .25rem;
  font: 600 .85rem/1 var(--text);
  letter-spacing: .04em;
}
.lang-switch a, .lang-current {
  display: inline-block;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}
.lang-current { background: var(--paper); color: var(--muted); }
.lang-switch a { color: var(--red); }
.lang-switch a:hover { border-color: var(--red); }

.main-nav { grid-area: nav; overflow-x: auto; scrollbar-width: thin; }
.main-nav ul {
  display: flex;
  gap: .15rem;
  margin: 0;
  padding: 0 0 .4rem;
  list-style: none;
  white-space: nowrap;
}
.main-nav a {
  display: block;
  padding: .55rem .7rem .45rem;
  font: 500 .95rem/1 var(--text);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--red); border-bottom-color: var(--line-strong); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--red); color: var(--red); }
.main-nav .nav-1987 a { color: var(--red); font-weight: 600; }

@media (min-width: 60rem) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav lang";
    padding-block: 1rem;
  }
  .main-nav ul { justify-content: flex-end; padding: 0; }
}

/* ---------------------------------------------------------------- buttons, badges */

.btn {
  display: inline-block;
  margin: .25rem;
  padding: .75rem 1.25rem;
  font: 600 .98rem/1.2 var(--text);
  text-decoration: none;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  transition: background-color .15s, color .15s;
}
.btn:hover { color: #fff; background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: #fff; color: var(--red); }
.btn-ghost:hover { color: var(--red-dark); background: var(--red-tint); }

.year-badge {
  display: inline-block;
  padding: .12em .5em;
  font: 600 .85rem/1.3 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--red);
  background: #fff;
  border: 1px solid currentColor;
  border-radius: var(--radius);
}

.kicker {
  font: 400 .95rem/1.4 var(--text);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin: 2.2rem 0 0;
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg picture { height: 100%; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .14; filter: grayscale(1); }
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(247, 245, 240, .6) 0%, rgba(247, 245, 240, .92) 65%, var(--paper) 100%);
}
.hero-inner { padding-block: 2.75rem 3rem; text-align: center; }
.hero-kicker { margin: 0; color: var(--muted); font: 400 .95rem/1.4 var(--text); }
.hero-kicker::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: .8rem auto 0;
  background: var(--red);
}
.hero-title {
  max-width: 22ch;
  margin: .5em auto .7em;
}
.hero-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
  max-width: 36rem;
  margin: 0 auto 1.75rem;
}
.hero-fighter { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.hero-fighter picture { width: 100%; max-width: 11rem; }
.hero-portrait {
  width: 100%;
  max-width: 11rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  padding: .3rem;
  background: #fff;
  border: 1px solid var(--line-strong);
}
.hero-name { margin-top: .4rem; font: 600 clamp(1rem, 3vw, 1.25rem)/1.2 var(--serif); }
.hero-tag { font-size: .85rem; color: var(--muted); }
.hero-text { max-width: 38rem; margin: 0 auto 1.2rem; font-size: 1.1rem; }

.vs-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  font: italic 400 clamp(1.4rem, 5vw, 2rem)/1 var(--serif);
  color: var(--red);
}
.vs-mark::before, .vs-mark::after {
  content: "";
  width: 1px;
  height: clamp(1.5rem, 6vw, 3rem);
  background: var(--line-strong);
}

/* ---------------------------------------------------------------- article */

.article { padding-bottom: 3rem; }
.article-head { margin-bottom: 1.5rem; }
.lede {
  font: 400 1.18rem/1.6 var(--serif);
  color: var(--ink);
  border-left: 3px solid var(--red);
  padding-left: 1rem;
}

.figure { margin: 2rem 0; }
.figure img { width: 100%; border: 1px solid var(--line); }
.figure figcaption {
  margin-top: .55rem;
  padding-top: .45rem;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--muted);
}

.toc {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
}
.toc-title { margin: 0 0 .5rem; font-size: 1.1rem; }
.toc-title::after { display: none; }
.toc ol { margin: 0; padding-left: 1.3rem; }
.toc li { padding: .1rem 0; }

.timeline { list-style: none; padding: 0; }
.timeline li { display: flex; gap: .8rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line); }

.disclaimer {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--red-tint);
  border: 1px solid #e0c4c1;
  border-left: 4px solid var(--red);
}
.disclaimer h2 { margin-top: 0; color: var(--red-dark); }
.disclaimer h2::after { display: none; }
.disclaimer p { margin: 0; }

.imprint {
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.imprint p { margin: 0; }

/* Federation address: sober letterhead-style block, not a dashed placeholder. */
.address-block {
  margin: 1.5rem 0;
  padding: 1.1rem 1.35rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
}
.address-block p {
  margin: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .95rem;
  line-height: 1.7;
}

.footer-address {
  margin: .75rem 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .85rem;
  line-height: 1.7;
  color: var(--muted);
}

.section-intro { color: var(--muted); }
.intro { padding-top: 1rem; }

/* ---------------------------------------------------------------- VS screen: programme-style juxtaposition */

.vs-screen {
  margin: 2rem 0 2.25rem;
  padding: 1.25rem 1rem 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px double var(--red);
  border-bottom: 3px double var(--red);
}
.vs-kicker {
  margin: 0 0 1.25rem;
  padding-bottom: .75rem;
  text-align: center;
  font: italic 400 1rem/1.4 var(--serif);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.vs-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
.vs-grid .vs-mark { align-self: center; flex-direction: row; gap: .75rem; }
.vs-grid .vs-mark::before, .vs-grid .vs-mark::after { width: 3rem; height: 1px; }
.vs-side { display: grid; gap: .35rem; }
.vs-portrait {
  width: 100%;
  max-width: 13rem;
  margin-inline: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  padding: .3rem;
  background: #fff;
  border: 1px solid var(--line-strong);
}
.vs-name { margin: .5rem 0 0; text-align: center; font: 600 1.35rem/1.2 var(--serif); }
.fight-name { margin: 0; text-align: center; font: italic 400 1rem/1.35 var(--serif); color: var(--red); }
.vs-left { --bar: var(--navy); }
.vs-left .fight-name { color: var(--navy); }

@media (min-width: 42rem) {
  .vs-screen { padding-inline: 1.5rem; }
  .vs-grid { grid-template-columns: 1fr auto 1fr; gap: 1.5rem; }
  .vs-grid .vs-mark { flex-direction: column; }
  .vs-grid .vs-mark::before, .vs-grid .vs-mark::after { width: 1px; height: 4rem; }
}

/* ---------------------------------------------------------------- stat bars */

.stats { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .35rem; }
.stat {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.2rem;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
}
.stat-label { font: 400 .85rem/1.2 var(--text); color: var(--muted); }
.stat-bar { height: .45rem; background: var(--paper-2); border-radius: 1px; overflow: hidden; }
.stat-bar span {
  display: block;
  height: 100%;
  width: calc(var(--v) * 1%);
  background: var(--bar, var(--red));
}
.stat-val { text-align: right; font: 600 .9rem/1 var(--serif); font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }

/* ---------------------------------------------------------------- series strip */

.series { margin: 1.5rem 0 2rem; }
.series figcaption {
  margin-bottom: .7rem;
  font: italic 400 1rem/1.4 var(--serif);
  color: var(--muted);
}
.series-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: .5rem;
}
.game a {
  display: grid;
  gap: .2rem;
  align-content: start;
  height: 100%;
  padding: .75rem .8rem;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
}
.game a:hover { background: var(--paper); }
.win-nopper a { border-top-color: var(--red); }
.win-lee a { border-top-color: var(--navy); }
.game:last-child a { background: var(--red-tint); border-color: #e0c4c1; border-top-color: var(--red); }
.g-num { font: 400 .8rem/1.2 var(--text); color: var(--muted); }
.g-win { font: 600 1.02rem/1.2 var(--serif); }
.win-nopper .g-win { color: var(--red); }
.win-lee .g-win { color: var(--navy); }
.g-score { font: 600 .85rem/1.2 var(--text); font-variant-numeric: tabular-nums; color: var(--ink); }
.g-note { font-size: .8rem; line-height: 1.35; color: var(--muted); }
.series-legend { margin: .7rem 0 0; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.key { display: inline-block; width: 1.4rem; height: .4rem; }
.key-nopper { background: var(--red); }
.key-lee { background: var(--navy); margin-left: .6rem; }

/* ---------------------------------------------------------------- eras */

.era-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.era {
  padding: 1rem 1.15rem 1.1rem;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
}
.era h3 { margin: .7rem 0 .3rem; }
.era p { margin: 0; color: var(--muted); font-size: .95rem; }
.era-lee { border-top-color: var(--navy); }
.era-1987 { border-top-color: var(--red); background: var(--red-tint); }

/* ---------------------------------------------------------------- champion profile cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  scroll-margin-top: 1rem;
}
.card-portrait { position: relative; padding: .6rem .6rem 0; }
.card-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); }
.card-portrait .year-badge { position: absolute; left: 1.1rem; bottom: .5rem; }
.card-body { padding: .9rem 1rem 1.2rem; }
.card h3 { margin: 0; font-size: 1.35rem; }
.card .fight-name { text-align: left; }
.card-meta { margin: .3rem 0 0; font-size: .85rem; color: var(--muted); }
.quote {
  margin: 1rem 0 0;
  padding: .1rem 0 .1rem .85rem;
  border-left: 2px solid var(--red);
  font: italic 400 .98rem/1.55 var(--serif);
}
.quote p { margin: 0; }
.quote p::before { content: "“"; }
.quote p::after { content: "”"; }
:lang(de) .quote p::before { content: "„"; }
:lang(de) .quote p::after { content: "“"; }

/* ---------------------------------------------------------------- hall table */

.table-wrap { overflow-x: auto; margin-bottom: 3rem; background: #fff; border: 1px solid var(--line); }
.hall { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hall caption { padding: .8rem .9rem; text-align: left; font: 600 1.1rem/1.3 var(--serif); color: var(--ink); }
.hall th, .hall td { padding: .55rem .9rem; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
.hall thead th {
  font: 600 .85rem/1.2 var(--text);
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.hall tbody tr:nth-child(even) { background: #fbfaf7; }
.hall tbody tr:hover { background: var(--paper); }
.hall .year-badge { padding: 0; border: 0; background: none; font-size: .98rem; }
.hall .num { text-align: right; font-variant-numeric: tabular-nums; }

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

.site-footer {
  margin-top: 3rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: .9rem;
}
.satire {
  font: 600 1.05rem/1.4 var(--serif);
  color: var(--red-dark);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; list-style: none; padding: 0; }
.footer-nav a { color: var(--ink); }
.footer-nav a:hover { color: var(--red); }
.footer-note { color: var(--muted); margin: 0; }

.error-page { padding: 4rem 0; text-align: center; }
.error-code { font: 600 5rem/1 var(--serif); color: var(--red); margin: 0; }

/* ---------------------------------------------------------------- motion, contrast modes, print */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .deco { display: none; }
  .stat-bar { border: 1px solid CanvasText; }
  .stat-bar span, .key { background: CanvasText; forced-color-adjust: none; }
  .brand-badge { border: 1px solid CanvasText; }
  h2::after, .hero-kicker::after { background: CanvasText; }
}

@media print {
  .deco, .hero-bg, .skip, .main-nav, .lang-switch { display: none; }
  body { border-top: 0; }
}
