/* TokyoFX — editorial magazine styles */
:root {
  --paper: #FAFAF7;
  --paper-deep: #F2EFE6;
  --ink: #1A1A1A;
  --ink-soft: #3A3A36;
  --ink-mute: #6B6B63;
  --rule: #d4d0c4;
  --rule-soft: #e7e3d7;
  --karashi: #B8893A;
  --karashi-deep: #8E6A2A;
  --shu: #A8442A; /* 朱 — used very sparingly */
}

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.font-klee { font-family: "Klee One", "Shippori Mincho", serif; font-weight: 600; }
.font-mincho { font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif; }
.font-mono { font-family: "JetBrains Mono", "Courier New", monospace; font-feature-settings: "tnum" 1; }

.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* Vertical writing for accent labels */
.vrl {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.15em;
}

/* Editorial rules */
.rule-top { border-top: 1px solid var(--rule); }
.rule-bottom { border-bottom: 1px solid var(--rule); }
.rule-double-bottom {
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 4px 0 -3px var(--rule);
}
.rule-top-double {
  border-top: 3px double var(--ink);
}

/* Pull quote */
.pullquote {
  font-family: "Klee One", serif;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.02em;
}
.pullquote::before {
  content: "「";
  display: inline-block;
  margin-left: -0.7em;
}
.pullquote::after { content: "」"; }

/* Hanging numeral for ranks (kanji-numeral feel via large serif) */
.rank-numeral {
  font-family: "Klee One", "Shippori Mincho", serif;
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--ink);
}

/* Subtle paper texture using layered gradients (no images) */
.paper-bg {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at top left, rgba(184,137,58,0.025), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(26,26,26,0.02), transparent 60%);
}

/* Tab underline */
.tab-active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--karashi);
}
.tab-inactive {
  color: var(--ink-mute);
}
.tab-inactive:hover { color: var(--ink); }

/* Small caps-like label */
.kicker {
  font-family: "Shippori Mincho", serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--karashi-deep);
  text-transform: none;
}

/* Decorative double-line divider */
.divider-dot {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-mute);
}
.divider-dot::before,
.divider-dot::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}

/* Header sticky underline */
.shadow-paper {
  box-shadow: 0 1px 0 var(--rule);
}

/* Karte badges */
.badge-line {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.badge-mustard {
  background: #F3E8CC;
  color: var(--karashi-deep);
  border: 1px solid #E0CFA0;
}

/* Inline tategaki marker */
.marker-han {
  display: inline-block;
  width: 1.6em;
  height: 1.6em;
  line-height: 1.6em;
  text-align: center;
  background: var(--shu);
  color: #fff;
  font-family: "Klee One", serif;
  font-weight: 600;
  border-radius: 2px;
  letter-spacing: 0;
}

/* Star rating using ◐ characters - keep simple */
.stars { color: var(--karashi); letter-spacing: 0.05em; }
.stars-empty { color: var(--rule); }

/* Karte card */
.karte {
  background: var(--paper);
  border: 1px solid var(--rule);
  position: relative;
}
.karte::before {
  content: "";
  position: absolute;
  top: 8px; left: 8px; right: 8px; bottom: 8px;
  border: 1px solid var(--rule-soft);
  pointer-events: none;
}

/* Hand-drawn underline */
.handline {
  background-image: linear-gradient(to right, var(--karashi) 0, var(--karashi) 100%);
  background-repeat: no-repeat;
  background-size: 100% 6px;
  background-position: 0 88%;
  padding: 0 2px;
}

/* Article card hover */
.article-card { transition: background 200ms ease; }
.article-card:hover { background: var(--paper-deep); }

/* Custom checkbox-like indicator */
.dot-marker {
  width: 6px; height: 6px;
  background: var(--karashi);
  display: inline-block;
  margin-right: 8px;
  transform: translateY(-2px);
}

/* Sticky TOC */
.toc-link {
  display: block;
  padding: 8px 0;
  color: var(--ink-mute);
  border-left: 1px solid var(--rule);
  padding-left: 14px;
  font-size: 13px;
  transition: all 150ms;
}
.toc-link:hover, .toc-link.active {
  color: var(--ink);
  border-left-color: var(--karashi);
}

/* Number column in karte */
.metric-num {
  font-family: "Klee One", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Page chrome */
.tab-button {
  font-family: "Shippori Mincho", serif;
  font-size: 14px;
  letter-spacing: 0.1em;
  padding: 14px 4px;
  margin-right: 28px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 180ms;
}

/* Hover lift on rank rows */
.rank-row { transition: background 150ms; }
.rank-row:hover { background: rgba(184,137,58,0.04); }

/* Buttons */
.btn-affil {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Shippori Mincho", serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  border: 1px solid var(--ink);
  transition: all 180ms;
  cursor: pointer;
}
.btn-affil:hover {
  background: var(--paper);
  color: var(--ink);
}
.btn-affil-outline {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-affil-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Vertical caption (small) */
.cap-vrl {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--ink-mute);
}

.a8-pixel {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.affiliate-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.affiliate-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--rule-soft);
  pointer-events: none;
}
.affiliate-card > * {
  position: relative;
  z-index: 1;
}

/* Scrollbar — subtle */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }

/* Editorial drop cap */
.dropcap::first-letter {
  font-family: "Klee One", serif;
  font-weight: 600;
  font-size: 3.4em;
  float: left;
  line-height: 0.95;
  margin: 0.05em 0.12em 0 -0.04em;
  color: var(--karashi-deep);
}

/* Reading column constraints */
.column-narrow { max-width: 620px; }
.column-wide { max-width: 980px; }

/* Underline that draws on hover */
.uline {
  background-image: linear-gradient(to right, var(--ink) 0, var(--ink) 100%);
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 100%;
  transition: background-size 250ms;
  padding-bottom: 2px;
}
.uline:hover { background-size: 100% 1px; }

/* Tategaki rank tag for cards */
.rank-tag {
  position: absolute;
  top: 0;
  left: -1px;
  width: 32px;
  background: var(--ink);
  color: var(--paper);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 12px 6px 14px;
  font-family: "Klee One", serif;
  font-size: 13px;
  letter-spacing: 0.3em;
}

/* Editorial blockquote bar */
.lead-quote {
  border-left: 2px solid var(--karashi);
  padding-left: 22px;
  font-family: "Klee One", serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.85;
}
