/* KAMUYO public site. Night-ink base, vermilion + gold for Amatsu, indigo + jade for Kunitsu, sakura accents. */
:root {
  --ink: #0a0c18;
  --night: #11152b;
  --panel: #171c38;
  --panel-2: #1e2447;
  --line: rgba(226, 178, 90, 0.22);
  --washi: #f4ecdc;
  --text: #e9e3d6;
  --muted: #a9a3ba;
  --gold: #e2b25a;
  --gold-2: #f3d08a;
  --vermilion: #d6452f;
  --sakura: #f3a9c4;
  --indigo: #5866c9;
  --jade: #5fb8a0;
  --radius: 14px;
  --wrap: 1180px;
  --display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--text); font: 400 17px/1.7 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; color: var(--washi); letter-spacing: .01em; }
h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.kj { font-family: var(--display); color: var(--gold); letter-spacing: .12em; }
.eyebrow { display: inline-flex; align-items: center; gap: .6em; font: 700 .78rem/1 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 4px; }

/* ── header ── */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(10, 12, 24, .78); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.06); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--washi); font: 800 1.35rem/1 var(--display); letter-spacing: .16em; }
.brand span { color: var(--gold); font-size: 1.05rem; letter-spacing: .05em; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--text); text-decoration: none; font-size: .93rem; padding: 8px 10px; border-radius: 999px; transition: background .2s, color .2s; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(226,178,90,.12); color: var(--gold-2); }
.nav .btn { margin-left: 8px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--washi); border-radius: 10px; padding: 8px 12px; font: inherit; cursor: pointer; }
@media (max-width: 1120px) {
  .menu-btn { display: block; }
  .nav { position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; background: rgba(10,12,24,.97); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 10px; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: 13px 24px; border-radius: 999px; font: 700 .98rem/1 var(--body); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .2s ease, background .2s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #e65a42, var(--vermilion)); color: #fff; box-shadow: 0 6px 24px rgba(214,69,47,.35); }
.btn-primary:hover { color: #fff; box-shadow: 0 8px 32px rgba(214,69,47,.5); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--washi); border-color: rgba(244,236,220,.28); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { color: #fff; background: #6b77f5; }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── hero ── */
.hero { position: relative; min-height: min(92vh, 860px); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero > picture img, .hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.04); animation: drift 30s ease-in-out infinite alternate; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(180deg, rgba(10,12,24,.25) 0%, rgba(10,12,24,.05) 35%, rgba(10,12,24,.75) 72%, var(--ink) 100%),
  radial-gradient(120% 80% at 20% 100%, rgba(10,12,24,.65), transparent 60%); }
.hero .wrap { padding: 120px 0 72px; }
.hero h1 { letter-spacing: .14em; margin-bottom: .1em; text-shadow: 0 4px 40px rgba(0,0,0,.5); }
.hero .kj-big { font: 700 clamp(1.2rem, 2.6vw, 1.7rem)/1.3 var(--display); color: var(--gold-2); letter-spacing: .3em; margin-bottom: 1.2rem; }
.hero .lede { color: #ddd6e6; font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
@keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
@media (prefers-reduced-motion: reduce) { .hero > picture img, .hero > img { animation: none; } html { scroll-behavior: auto; } }

.page-hero { position: relative; padding: 140px 0 56px; overflow: hidden; isolation: isolate; }
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,12,24,.55), rgba(10,12,24,.7) 50%, var(--ink)); }
.page-hero h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); }

/* ── sections ── */
section { padding: 88px 0; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.band { background: linear-gradient(180deg, var(--night), var(--ink)); border-top: 1px solid rgba(255,255,255,.04); }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

.card { background: linear-gradient(180deg, var(--panel), var(--night)); border: 1px solid rgba(255,255,255,.07); border-radius: var(--radius); overflow: hidden; }
.card .pad { padding: 22px 24px 24px; }
.pillar { padding: 28px 26px; position: relative; }
.pillar .num { font: 800 2.4rem/1 var(--display); color: transparent; -webkit-text-stroke: 1px var(--gold); opacity: .8; margin-bottom: 14px; }
.pillar h3 { margin-bottom: .35em; }
.pillar p { color: var(--muted); margin: 0; }

/* factions */
.factions { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 20px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
@media (max-width: 860px) { .factions { grid-template-columns: 1fr; } }
.faction { position: relative; min-height: 520px; padding: 40px 36px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; }
.faction img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s ease; }
.faction:hover img { transform: scale(1.04); }
.faction::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.faction.amatsu::after { background: linear-gradient(180deg, rgba(60,20,10,.15), rgba(40,14,8,.92) 75%); }
.faction.kunitsu::after { background: linear-gradient(180deg, rgba(10,20,40,.15), rgba(8,16,36,.94) 75%); }
.faction .sigil { font: 800 3rem/1 var(--display); margin-bottom: 10px; }
.amatsu .sigil, .amatsu .kj { color: var(--gold-2); }
.kunitsu .sigil, .kunitsu .kj { color: #9fe0cf; }
.faction p { color: #e6dfd2; max-width: 46ch; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--washi); margin: 0 6px 6px 0; }
.tag.amatsu { background: rgba(226,178,90,.16); color: var(--gold-2); }
.tag.kunitsu { background: rgba(95,184,160,.16); color: #a6e6d4; }
.tag.contested { background: rgba(214,69,47,.18); color: #ffb3a6; }

/* portrait cards (races, classes) */
.portraits { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 200px), 1fr)); }
@media (min-width: 900px) { .portraits.r4 { grid-template-columns: repeat(4, 1fr); } }
.portrait { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 2 / 3; background: var(--panel); text-decoration: none; color: inherit; border: 1px solid rgba(255,255,255,.07); isolation: isolate; }
.portrait img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; z-index: -2; position: absolute; inset: 0; }
.portrait::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 45%, rgba(8,10,20,.92)); }
.portrait:hover img { transform: scale(1.05); }
.portrait .cap { position: absolute; left: 16px; right: 16px; bottom: 14px; }
.portrait .cap strong { display: block; font: 700 1.2rem/1.2 var(--display); color: var(--washi); }
.portrait .cap span { font-size: .85rem; color: var(--muted); }

/* detail rows (heroes page) */
.detail { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 32px; align-items: start; padding: 32px 0; border-top: 1px solid rgba(255,255,255,.07); scroll-margin-top: 90px; }
.detail img { border-radius: var(--radius); aspect-ratio: 2/3; object-fit: cover; width: 100%; border: 1px solid rgba(255,255,255,.08); }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } .detail img { max-width: 260px; } }
.detail h3 { font-size: 1.9rem; margin-bottom: .15em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.fact { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 12px 14px; }
.fact b { display: block; font: 700 .72rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.fact .kj { font-size: .85rem; margin-left: 6px; }

/* tales */
.tale-card { display: grid; grid-template-rows: 220px 1fr; text-decoration: none; color: inherit; transition: transform .25s ease, border-color .25s; }
.tale-card:hover { transform: translateY(-4px); border-color: var(--line); color: inherit; }
.tale-card img { width: 100%; height: 100%; object-fit: cover; }
.tale-card .era { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--sakura); font-weight: 700; }
.tale-card h3 { margin: .3em 0 .4em; }
.tale-card p { color: var(--muted); margin: 0; }
.prose { max-width: 68ch; margin-inline: auto; font-size: 1.12rem; line-height: 1.85; }
.prose p:first-of-type::first-letter { font: 800 3.4em/0.9 var(--display); float: left; margin: 6px 12px 0 0; color: var(--gold); }
.prose p { color: #ddd6ca; }
.tale-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 68ch; margin: 56px auto 0; padding-top: 24px; border-top: 1px solid var(--line); }

/* map */
.map { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.map img { width: 100%; }
.pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.pin i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(0,0,0,.25), 0 0 18px currentColor; background: currentColor; }
.pin span { margin-top: 4px; font: 700 .78rem/1.1 var(--body); color: #fff; background: rgba(8,10,20,.78); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.pin.Amatsu { color: var(--gold); } .pin.Kunitsu { color: var(--jade); } .pin.Contested { color: var(--vermilion); } .pin.Neutral { color: #cfd3ff; }
@media (max-width: 700px) { .pin span { display: none; } .pin i { width: 10px; height: 10px; } }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: .9rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.zone { display: grid; grid-template-columns: 300px 1fr; gap: 0; scroll-margin-top: 90px; }
.zone .shot { min-height: 220px; background: var(--panel-2); }
.zone .shot img { width: 100%; height: 100%; object-fit: cover; }
.zone .shot.empty { display: grid; place-items: center; font: 800 3.5rem/1 var(--display); color: rgba(226,178,90,.35); }
@media (max-width: 760px) { .zone { grid-template-columns: 1fr; } .zone .shot { height: 200px; } }
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--gold-2); font-weight: 700; font-size: .95rem; }
.chapters { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.chapters b { color: var(--washi); font-family: var(--display); }

/* legends */
.legend-card { display: grid; grid-template-columns: 1.2fr 1fr; overflow: hidden; }
.legend-card:nth-child(even) { grid-template-columns: 1fr 1.2fr; }
.legend-card:nth-child(even) .art { order: 2; }
.legend-card .art img { width: 100%; height: 100%; object-fit: cover; min-height: 300px; }
.legend-card .pad { padding: 36px; align-self: center; }
@media (max-width: 820px) { .legend-card, .legend-card:nth-child(even) { grid-template-columns: 1fr; } .legend-card:nth-child(even) .art { order: 0; } }

/* gallery */
.masonry { columns: 3 300px; column-gap: 16px; }
.masonry figure { margin: 0 0 16px; break-inside: avoid; border-radius: 12px; overflow: hidden; position: relative; cursor: zoom-in; border: 1px solid rgba(255,255,255,.07); }
.masonry figure img { width: 100%; transition: transform .5s ease; }
.masonry figure:hover img { transform: scale(1.03); }
.masonry figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px; font-size: .85rem; background: linear-gradient(180deg, transparent, rgba(8,10,20,.85)); color: var(--washi); opacity: 0; transition: opacity .3s; }
.masonry figure:hover figcaption, .masonry figure:focus-visible figcaption { opacity: 1; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5,6,12,.94); display: none; align-items: center; justify-content: center; padding: 24px; flex-direction: column; gap: 12px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 84vh; max-width: 100%; border-radius: 10px; }
.lightbox p { color: var(--muted); margin: 0; text-align: center; }
.lightbox button { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.1); border: 0; color: #fff; font-size: 1.4rem; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }

/* devlog */
.post { max-width: 760px; margin-inline: auto; padding: 48px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.post time { color: var(--sakura); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }
.post h2 { margin-top: .3em; }
.post p { color: #d9d2c6; }
.post figure { margin: 24px 0; }
.post figure img { border-radius: 12px; border: 1px solid rgba(255,255,255,.08); }
.post figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.shots img { border-radius: 10px; }
@media (max-width: 600px) { .shots { grid-template-columns: 1fr; } }

/* join */
.join { position: relative; overflow: hidden; isolation: isolate; border-radius: 24px; padding: clamp(32px, 6vw, 64px); border: 1px solid var(--line); }
.join > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.join::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10,12,24,.95) 30%, rgba(10,12,24,.6)); }
.join h2 { max-width: 18ch; }
.form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; max-width: 520px; }
.form input[type="email"] { flex: 1 1 240px; min-width: 0; padding: 14px 18px; border-radius: 999px; border: 1px solid rgba(244,236,220,.25); background: rgba(10,12,24,.6); color: var(--washi); font: inherit; }
.form input::placeholder { color: #8f89a2; }
.form .hp { position: absolute; left: -9999px; }
.fine { font-size: .82rem; color: var(--muted); margin-top: 12px; }

/* footer */
.site-foot { border-top: 1px solid rgba(255,255,255,.06); padding: 48px 0 40px; color: var(--muted); font-size: .9rem; margin-top: 40px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--gold-2); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* the game: alternating feature rows */
.features { display: grid; gap: 56px; }
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; }
.feature img { border-radius: 16px; border: 1px solid rgba(255,255,255,.08); aspect-ratio: 3/2; object-fit: cover; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.feature:nth-child(even) img { order: 2; }
.feature h3 { font-size: 1.9rem; }
.feature p { color: #d9d2c6; font-size: 1.08rem; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; gap: 18px; } .feature:nth-child(even) img { order: 0; } }

/* the war */
.rounded { border-radius: 14px; border: 1px solid rgba(255,255,255,.08); aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.leader { display: grid; grid-template-columns: 220px 1fr; }
.leader img { width: 100%; height: 100%; object-fit: cover; object-position: top; min-height: 320px; }
@media (max-width: 600px) { .leader { grid-template-columns: 1fr; } .leader img { height: 320px; min-height: 0; } }
blockquote { margin: 14px 0 0; padding: 4px 0 4px 16px; border-left: 2px solid var(--gold); font-family: var(--display); font-size: 1.08rem; color: var(--gold-2); }
.mysteries { list-style: none; counter-reset: m; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.mysteries li { counter-increment: m; position: relative; padding: 24px 24px 20px 72px; background: rgba(17,21,43,.75); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; backdrop-filter: blur(4px); }
.mysteries li::before { content: counter(m, cjk-ideographic); position: absolute; left: 22px; top: 20px; font: 800 1.9rem/1 var(--display); color: var(--vermilion); }
.mysteries h3 { margin-bottom: .3em; font-size: 1.2rem; }
.mysteries p { margin: 0; }
.intrigue { position: relative; isolation: isolate; overflow: hidden; }
.intrigue > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.intrigue::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--ink), rgba(10,12,24,.82) 25%, rgba(10,12,24,.82) 75%, var(--ink)); }

/* bestiary families */
.family img { width: 100%; aspect-ratio: 3/2; object-fit: cover; background: #0d0f1c; }
.family h3 { margin-bottom: .3em; }
