/* Japanese Color Atlas — design system tokens */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Ink + paper */
  --sumi: #1B1B1B;
  --deep-ink: #111111;
  --washi: #F4EFE6;
  --warm-paper: #E8DDCB;
  --paper-shadow: #D9CDB6;

  /* Pigments */
  --aizome: #264653;
  --deep-ai: #19313D;
  --beni: #B33A3A;
  --sakura: #F1C6C1;
  --yamabuki: #D8A431;
  --matcha: #7A8B55;
  --murasaki: #6B4C7A;
  --asagi: #5F9EA0;

  /* Neutrals */
  --nezumi: #7C7A73;
  --nezumi-soft: #A8A49B;
  --soft-border: rgba(244,239,230,0.18);
  --paper-border: rgba(27,27,27,0.12);
  --paper-border-strong: rgba(27,27,27,0.22);

  /* Type */
  --serif: "Noto Serif JP", "Source Han Serif", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

/* ---- Atoms ---- */

.jca {
  font-family: var(--sans);
  color: var(--sumi);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.jca--dark { color: var(--washi); }

.jca .serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.jca .mono  { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.jca .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}

.jca .rule { display: block; height: 1px; background: currentColor; opacity: 0.18; }
.jca .rule-double {
  height: 4px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.4;
}

/* Washi paper texture overlay */
.washi-tex {
  position: relative;
}
.washi-tex::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.15  0 0 0 0 0.12  0 0 0 0 0.08  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Ink/dark surface noise */
.ink-tex::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.96  0 0 0 0 0.9  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---- Hanko (red seal) ---- */
.hanko {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--beni);
  color: var(--washi);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0;
  border-radius: 4px;
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(244,239,230,0.85);
  transform: rotate(-2deg);
}
.hanko::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 4px;
  background:
    radial-gradient(circle at 30% 20%, transparent 1px, rgba(27,27,27,0.18) 1.2px, transparent 1.5px) 0 0 / 6px 6px,
    radial-gradient(circle at 70% 80%, transparent 1px, rgba(27,27,27,0.12) 1.2px, transparent 1.5px) 2px 2px / 7px 7px;
  mix-blend-mode: multiply;
  opacity: 0.6;
}

/* ---- Tate-gaki (vertical) ---- */
.tate {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.15em;
  font-family: var(--serif);
}

/* ---- Mon (crest) ornament ---- */
.mon-rule {
  display: flex; align-items: center; gap: 12px;
}
.mon-rule .line { flex: 1; height: 1px; background: currentColor; opacity: 0.2; }
.mon-rule .mon {
  width: 8px; height: 8px;
  border: 1px solid currentColor; opacity: 0.5;
  transform: rotate(45deg);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 1px;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  transition: all .15s ease;
}
.btn .arrow { font-family: var(--serif); font-size: 14px; line-height: 1; }
.btn--primary {
  background: var(--washi);
  color: var(--sumi);
  border-color: var(--washi);
}
.btn--ghost-light { color: var(--washi); }
.btn--ghost-dark  { color: var(--sumi); }
.btn--solid-ink {
  background: var(--sumi);
  color: var(--washi);
  border-color: var(--sumi);
}

/* ---- Badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid currentColor;
  border-radius: 1px;
}
.badge .dot {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}

/* ---- Color card (museum specimen) ---- */
.swatch-card {
  background: var(--washi);
  border: 1px solid var(--paper-border);
  display: flex; flex-direction: column;
}
.swatch-card .chip {
  height: 140px;
  position: relative;
}
.swatch-card .chip::after {
  /* inner deboss */
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.swatch-card .meta {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 4px;
}

/* ---- Numbered marks (catalog index) ---- */
.cat-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--nezumi);
}

/* ---- Tab row ---- */
.tabrow { display: flex; gap: 28px; border-bottom: 1px solid var(--paper-border); }
.tabrow .tab {
  padding: 14px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--nezumi);
  position: relative;
}
.tabrow .tab.is-active { color: var(--sumi); }
.tabrow .tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--sumi);
}

/* tiny helpers */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.muted { color: var(--nezumi); }
