/* 地獄帝国郵政局 — Postes Impériales des Enfers
   墨 (ink) · 金 (gold) · 古紙 (album paper) */

:root {
  --ink: #0e0c0a;
  --ink-2: #16130f;
  --ink-3: #221d17;
  --line: #3a3127;
  --paper: #efe6d2;
  --paper-2: #e3d6ba;
  --paper-ink: #2a2118;
  --text: #e9e0cc;
  --text-dim: #a89c85;
  --gold: #c29a4e;
  --gold-2: #e0c07e;
  --serif-ja: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --serif-la: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(194,154,78,.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(163,40,58,.07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--serif-ja);
  font-size: 17px;
  line-height: 1.9;
  overflow-x: hidden;
}
body[data-lang="en"], body[data-lang="fr"], body[data-lang="de"] {
  font-family: var(--serif-la);
  font-size: 19px;
  line-height: 1.7;
}
body.locked { overflow: hidden; }
a { color: var(--gold-2); }
button { font: inherit; color: inherit; }
::selection { background: rgba(194,154,78,.35); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px var(--gutter);
  background: rgba(14,12,10,.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar-mark {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-size: 15px; letter-spacing: .12em; white-space: nowrap;
}
.bar-mark img { width: 32px; height: 32px; flex: none; }
.bar-nav { display: flex; gap: 20px; margin-left: auto; }
.bar-nav a { color: var(--text-dim); text-decoration: none; font-size: 15px; letter-spacing: .1em; }
.bar-nav a:hover { color: var(--gold-2); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 2px; }
.lang button {
  background: none; border: 0; padding: 4px 10px; cursor: pointer;
  font-family: var(--serif-la); font-size: 14px; letter-spacing: .06em; color: var(--text-dim);
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.lang button:focus-visible, .btn:focus-visible, .chap-btn:focus-visible, .stamp-btn:focus-visible, .ed-tab:focus-visible {
  outline: 2px solid var(--gold-2); outline-offset: 2px;
}

@media (max-width: 1040px) { .bar-mark span { display: none; } }
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 8px 12px; }
  .bar-mark span { display: none; }
  .bar-nav { gap: 14px; margin-left: 0; }
  .lang { margin-left: auto; }
  .lang button { padding: 4px 8px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  max-width: 1100px; margin: 0 auto;
  padding: clamp(56px, 10vw, 120px) var(--gutter) clamp(56px, 8vw, 96px);
  text-align: center;
}
.hero-seal {
  position: relative;
  width: min(360px, 78vw); aspect-ratio: 1; margin: 0 auto 28px;
}
.hero-ring {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  animation: turn 240s linear infinite;
}
.hero-emblem {
  position: absolute; left: 50%; top: 50%;
  width: 80%; height: auto; transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 18px rgba(0,0,0,.8));
}
.hero-seal .ring { fill: none; stroke: var(--gold); stroke-width: 2; opacity: .85; }
.hero-seal .ring.thin { stroke-width: 1; opacity: .6; }
.hero-seal .ring-text { fill: var(--gold); font-family: var(--serif-la); font-size: 13.5px; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero-ring { animation: none; } html { scroll-behavior: auto; } }

.hero-eyebrow {
  margin: 0 0 12px; color: var(--gold); font-size: 14px; letter-spacing: .3em;
}
.hero-title { margin: 0; font-weight: 500; line-height: 1.2; }
.ja-title {
  display: block; font-family: var(--serif-ja);
  font-size: clamp(40px, 8vw, 84px); letter-spacing: .18em;
  color: var(--text); text-indent: .18em;
}
.fr-title {
  display: block; margin-top: 14px;
  font-family: var(--serif-la); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 3.4vw, 32px); letter-spacing: .08em; color: var(--gold-2);
}
.hero-lede span { display: inline-block; margin: 0 .55em; }
body[data-lang="ja"] .hero-lede span { margin: 0 .5em; }
.hero-lede {
  max-width: 34em; margin: 28px auto 0; color: var(--text-dim);
}
.hero-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  max-width: 880px; margin: 44px auto 0;
  background: var(--line); border: 1px solid var(--line);
  text-align: left;
}
.hero-meta > div { background: var(--ink); padding: 14px 18px; }
.hero-meta dt { font-size: 12px; letter-spacing: .24em; color: var(--gold); text-transform: uppercase; }
.hero-meta dd { margin: 4px 0 0; font-size: 15px; line-height: 1.6; }
.hero-meta small { display: block; color: var(--text-dim); font-family: var(--serif-la); font-style: italic; font-size: 14px; }
@media (max-width: 720px) { .hero-meta { grid-template-columns: 1fr; } }

.hero-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  width: max-content; max-width: 100%; margin: 40px auto 0;
}
.hero-actions .btn { text-align: center; padding-left: 30px; padding-right: 30px; }
@media (max-width: 620px) {
  .hero-actions { grid-template-columns: 1fr; width: 100%; max-width: 340px; }
}
.btn {
  display: inline-block; padding: 11px 26px; text-decoration: none;
  font-size: 15px; letter-spacing: .12em; border-radius: 1px; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-gold { background: var(--gold); color: var(--ink); border: 1px solid var(--gold); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-line { border: 1px solid var(--gold); color: var(--gold-2); }
.btn-line:hover { background: rgba(194,154,78,.12); }

/* ---------- section heads ---------- */
section { scroll-margin-top: 64px; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-no {
  margin: 0; font-family: var(--serif-la); font-size: 15px; letter-spacing: .4em; color: var(--gold);
}
.section-no::before, .section-no::after { content: "—"; margin: 0 .8em; opacity: .6; }
.section-title {
  margin: 8px 0 0; font-weight: 500; letter-spacing: .14em;
  font-size: clamp(26px, 4vw, 38px);
}
body[data-lang="en"] .section-title, body[data-lang="fr"] .section-title, body[data-lang="de"] .section-title { letter-spacing: .04em; font-size: clamp(28px, 4.4vw, 42px); }
.section-note { max-width: 36em; margin: 14px auto 0; color: var(--text-dim); font-size: 15px; }

/* ---------- history ---------- */
.history {
  max-width: 1100px; margin: 0 auto;
  padding: 72px var(--gutter);
  border-top: 1px solid var(--line);
}
.chapters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px;
  max-width: 900px; margin: 0 auto 36px;
}
.chap-btn {
  background: none; border: 0; border-bottom: 1px solid transparent;
  padding: 4px 10px; cursor: pointer; color: var(--text-dim); font-size: 15px;
}
.chap-btn:hover { color: var(--text); }
.chap-btn[aria-current="true"] { color: var(--gold-2); border-bottom-color: var(--gold); }
.chapter {
  max-width: 36em; margin: 0 auto; min-height: 18em;
  animation: fade .5s ease;
}
body[data-lang="ja"] .chapter { max-width: 34em; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chapter-title {
  font-weight: 500; font-size: 22px; letter-spacing: .1em; margin: 0 0 1.2em;
  color: var(--gold-2); text-align: center;
}
.chapter p { margin: 0 0 1.25em; text-align: justify; hyphens: auto; }
body[data-lang="ja"] .chapter p { text-indent: 1em; }
.chapter p.maxim {
  text-align: center; text-indent: 0; margin: 1.8em 0;
  font-size: 1.15em; color: var(--gold-2); letter-spacing: .08em;
}
.chapter p.maxim::before, .chapter p.maxim::after { content: "❧"; font-size: .7em; margin: 0 .9em; color: var(--gold); opacity: .6; vertical-align: middle; }
.chapter p.maxim::before { display: inline-block; transform: scaleX(-1); }
.signature {
  margin: 3em 0 0; padding-top: 1.6em; border-top: 1px solid var(--line);
  text-align: right; display: flex; flex-direction: column; gap: 4px;
}
.signature span { color: var(--text-dim); font-size: 15px; }
.signature strong { font-weight: 500; font-size: 22px; letter-spacing: .12em; }
.signature em { font-family: var(--serif-la); color: var(--gold); font-size: 17px; }
.chapter-pager {
  display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 32px;
}
.chapter-pager button {
  background: none; border: 1px solid var(--line); padding: 6px 16px; cursor: pointer; color: var(--text-dim); font-size: 14px;
}
.chapter-pager button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-2); }
.chapter-pager button:disabled { opacity: .3; cursor: default; }
.pager-count { font-family: var(--serif-la); color: var(--text-dim); font-size: 15px; letter-spacing: .1em; }

/* ---------- catalogue ---------- */
.catalogue {
  max-width: 1060px; margin: 0 auto;
  padding: 72px var(--gutter);
  border-top: 1px solid var(--line);
}
.group-title {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px;
  font-weight: 500; font-size: 20px; letter-spacing: .12em;
  margin: 48px 0 22px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.group-title small { font-size: 14px; color: var(--text-dim); letter-spacing: .04em; }
.stamps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 34px;
}
@media (max-width: 860px) { .stamps { grid-template-columns: repeat(2, 1fr); gap: 30px 20px; } }
@media (max-width: 520px) { .stamps { grid-template-columns: 1fr; max-width: 360px; } }
.stamp-btn {
  display: block; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; text-align: left;
}

/* plate — the specimen sheet sits on the ink ground inside a thin gold rule */
.stamp-btn .stamp-art { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s; }
.stamp-btn:hover .stamp-art {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 14px 30px rgba(0,0,0,.6), 0 0 0 1px rgba(194,154,78,.25);
}

.stamp-art {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
}
.stamp-art.big { border-color: #4a3e30; }
.stamp-art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.stamp-art .placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--paper-ink);
  background:
    repeating-linear-gradient(45deg, rgba(42,33,24,.05) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #e9dcc0, #d8c7a4);
  border: 1px solid rgba(42,33,24,.25);
}
.stamp-art.has-img .placeholder { display: none; }
.ph-no { font-family: var(--serif-la); font-size: 13px; letter-spacing: .3em; opacity: .7; }
.ph-name { font-family: var(--serif-la); font-style: italic; font-size: 26px; line-height: 1.2; }
.stamp-art.big .ph-name { font-size: 40px; }
.ph-over {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-24deg);
  font-family: var(--serif-la); font-weight: 600; letter-spacing: .3em;
  font-size: 30px; color: rgba(163,40,58,.55);
  border: 2px solid rgba(163,40,58,.45); padding: 0 .4em 0 .7em;
  pointer-events: none;
}
.stamp-art.big .ph-over { font-size: 52px; }
.ph-note { position: absolute; bottom: 10px; font-size: 12px; letter-spacing: .12em; opacity: .6; }

.stamp-cap { display: flex; flex-direction: column; gap: 2px; padding: 14px 4px 0; }
.cap-no { font-family: var(--serif-la); font-size: 13px; letter-spacing: .28em; color: var(--gold); }
.cap-name { font-size: 20px; letter-spacing: .06em; line-height: 1.4; }
.cap-latin { font-family: var(--serif-la); font-style: italic; color: var(--text-dim); font-size: 16px; line-height: 1.3; }
.cap-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 14px; color: var(--text-dim); }

.chip {
  display: inline-block; padding: 1px 9px; border-radius: 99px;
  font-size: 12.5px; letter-spacing: .06em; line-height: 1.7; white-space: nowrap;
  border: 1px solid currentColor;
}
.chip-new   { color: #b8c2c6; }
.chip-full  { color: #e6d6a0; }
.chip-solar { color: #86a2ee; }
.chip-lunar { color: #e27080; }

.editions-explain {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line);
}
.editions-explain h4 { margin: 0 0 4px; font-weight: 500; letter-spacing: .1em; color: var(--gold-2); font-size: 17px; }
.editions-explain p { margin: 0; color: var(--text-dim); font-size: 15px; line-height: 1.8; }
@media (max-width: 720px) { .editions-explain { grid-template-columns: 1fr; gap: 18px; } }

/* ---------- postmarks ---------- */
.postmarks {
  max-width: 1200px; margin: 0 auto;
  padding: 72px var(--gutter) 96px;
  border-top: 1px solid var(--line);
}
.pm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
@media (max-width: 960px) { .pm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pm-grid { grid-template-columns: 1fr; } }
.pm { text-align: center; }
.pm-seal { width: min(220px, 100%); margin: 0 auto 16px; }
.pm-seal {
  animation: turn 120s linear infinite;
}
.pm:nth-child(2n) .pm-seal { animation-duration: 150s; }
.pm-seal img {
  width: 100%; height: auto; display: block; border-radius: 50%;
  mix-blend-mode: lighten;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.pm { cursor: pointer; outline: none; }
.pm:hover .pm-seal, .pm:focus-visible .pm-seal, .pm.is-held .pm-seal { animation-play-state: paused; }
.pm:hover .pm-seal img, .pm:focus-visible .pm-seal img, .pm.is-held .pm-seal img { transform: rotate(-8deg) scale(1.06); }
.pm:focus-visible .pm-name { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .pm-seal { animation: none; } }
.pm-new   { --c: #b8c2c6; }
.pm-full  { --c: #e6d6a0; }
.pm-solar { --c: #86a2ee; }
.pm-lunar { --c: #e27080; }
.pm-name { margin: 0; font-weight: 500; font-size: 19px; letter-spacing: .1em; }
.pm-name small { display: block; font-size: 12px; letter-spacing: .2em; color: var(--c); }
.pm-fr { margin: 0; font-family: var(--serif-la); font-style: italic; color: var(--text-dim); font-size: 16px; }
.pm-line { margin: 4px 0 0; color: var(--text-dim); font-size: 14px; line-height: 1.6; }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 48px var(--gutter) 56px; text-align: center; color: var(--text-dim);
}
.foot p { margin: 0 0 8px; }
.foot-seal { font-family: var(--serif-la); font-style: italic; font-size: 22px; color: var(--gold-2); }
.foot-sign span { display: block; letter-spacing: .1em; }
.foot-motto { font-family: var(--serif-la); color: var(--gold); }
.foot-links a { color: #6ea8fe; text-decoration: underline; text-underline-offset: 3px; }
.foot-links a:hover { color: #9ec5fe; }
.foot-copy { font-size: 13px; margin-top: 16px !important; }

/* ---------- detail sheet ---------- */
.sheet {
  width: min(1120px, 100vw - 24px); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--line); background: var(--ink-2); color: var(--text);
  overflow-x: hidden; overflow-y: auto;
  margin: auto;
}
.sheet::backdrop { background: rgba(6,5,4,.78); backdrop-filter: blur(3px); }
.sheet-inner > * { min-width: 0; }
.sheet-inner {
  position: relative;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px;
  padding: 40px 40px 34px;
}
@media (max-width: 860px) { .sheet-inner { grid-template-columns: 1fr; padding: 48px 18px 24px; gap: 22px; } }
.sheet-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--text-dim); padding: 6px 10px;
}
.sheet-close:hover { color: var(--gold-2); }
.ed-tabs { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.ed-tab {
  background: none; border: 1px solid var(--line); padding: 5px 14px; cursor: pointer;
  font-size: 14px; letter-spacing: .06em; color: var(--text-dim);
}
.ed-tab[aria-selected="true"] { border-color: var(--gold); color: var(--ink); background: var(--gold); }
.plate { margin: 0; }
.plate-cap { margin-top: 14px; font-size: 13px; color: var(--text-dim); letter-spacing: .04em; line-height: 1.7; }
.sheet-no { margin: 0; font-family: var(--serif-la); color: var(--gold); letter-spacing: .14em; font-size: 14px; }
body[data-lang="ja"] .sheet-no { font-family: var(--serif-ja); font-size: 13px; }
.sheet-title { margin: 4px 0 0; font-weight: 500; font-size: clamp(28px, 4vw, 40px); letter-spacing: .06em; line-height: 1.3; }
.sheet-sub { margin: 2px 0 18px; font-family: var(--serif-la); font-style: italic; color: var(--text-dim); font-size: 19px; }
body[data-lang="en"] .sheet-sub, body[data-lang="fr"] .sheet-sub, body[data-lang="de"] .sheet-sub { font-family: var(--serif-ja); font-style: normal; font-size: 16px; }
.sheet-body p { margin: 0 0 1em; text-align: justify; hyphens: auto; }
.sheet-meta {
  margin: 22px 0 24px; border-top: 1px solid var(--line);
}
.sheet-meta > div { display: grid; grid-template-columns: minmax(5.5em, 8.5em) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sheet-meta dt { color: var(--gold); font-size: 13px; letter-spacing: .14em; padding-top: 3px; }
.sheet-meta dd { margin: 0; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.sheet-meta .chip { white-space: normal; }
.sheet-meta .date { font-family: var(--serif-la); font-style: italic; color: var(--text-dim); margin-left: 6px; }
.sheet-nav { display: flex; justify-content: space-between; margin-top: 26px; gap: 12px; }
.sheet-nav button {
  background: none; border: 0; cursor: pointer; color: var(--text-dim); font-size: 14px; padding: 4px 0;
}
.sheet-nav button:hover:not(:disabled) { color: var(--gold-2); }
.sheet-nav button:disabled { opacity: .25; cursor: default; }

/* OpenSea links paused — "Under Construction" */
.btn.is-closed, .foot-links a.is-closed {
  cursor: default; pointer-events: none;
  color: var(--text-dim) !important;
  background: repeating-linear-gradient(-45deg, rgba(194,154,78,.10) 0 8px, transparent 8px 16px) !important;
  border: 1px dashed var(--gold) !important;
  text-decoration: none !important;
  letter-spacing: .14em;
}
.foot-links a.is-closed { padding: 2px 12px; font-size: 14px; }
