@import url('https://fonts.googleapis.com/css2?family=Asimovian&family=Share+Tech+Mono&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* =============================================
   PROJECT TSUKIYO — SHARED STYLESHEET
   =============================================
   Color palette pulled from the banner image:
   Deep navy base, neon cyan/teal (Reikon Net),
   blood red (Kuro Oni), hot pink accents.
   ============================================= */

:root {
  --bg:          #0a0a0a;
  --bg-mid:      #111111;
  --bg-card:     #161616;
  --bg-card-alt: #121212;
  --border:      #242424;
  --text:        #c8d4e0;
  --text-dim:    #607080;
  --text-bright: #f0f6ff;

  /* Reikon Net — neon cyan */
  --rn:          #00e5cc;
  --rn-dim:      #007a6e;
  --rn-glow:     0 0 8px #00e5cc88, 0 0 20px #00e5cc44;

  /* Kuro Oni — blood red */
  --ko:          #e02030;
  --ko-dim:      #7a0f18;
  --ko-glow:     0 0 8px #e0203088, 0 0 20px #e0203044;

  /* Accent — hot pink from banner */
  --pink:        #d946ef;
  --pink-glow:   0 0 8px #d946ef88;

  --font-display: 'Asimovian', 'Share Tech Mono', sans-serif;
  --font-body:    'Noto Sans JP', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;

  --radius:  4px;
  --radius-lg: 8px;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  /* Subtle grid texture */
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Typography ─────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  line-height: 1.1;
}

a {
  color: var(--rn);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}
a:hover { color: var(--text-bright); text-shadow: var(--rn-glow); }

code, .mono { font-family: var(--font-mono); }

/* ── Site Header / Nav ──────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #040710 0%, var(--bg) 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(6px);
}

.site-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-header .logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  color: var(--text-bright);
  text-shadow: var(--rn-glow);
}
.site-header .logo span { color: var(--rn); }

.site-nav {
  display: flex;
  gap: 6px;
  list-style: none;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  transition: all 0.2s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--rn);
  border-color: var(--rn-dim);
  background: rgba(0,229,204,0.05);
  text-shadow: none;
}

/* ── Page Hero (banner) ─────────────────────── */
.hero {
  width: 100%;
  max-height: 380px;
  overflow: hidden;
  position: relative;
}
.hero img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    var(--bg) 100%
  );
}

/* ── Page Wrapper ───────────────────────────── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Section Headers ────────────────────────── */
.section-title {
  font-size: 2rem;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.section-title.rn { color: var(--rn); text-shadow: var(--rn-glow); }
.section-title.ko { color: var(--ko); text-shadow: var(--ko-glow); }

.section-rule {
  height: 1px;
  border: none;
  margin-bottom: 32px;
}
.section-rule.rn { background: linear-gradient(90deg, var(--rn), transparent); }
.section-rule.ko { background: linear-gradient(90deg, var(--ko), transparent); }
.section-rule.dim { background: var(--border); }

/* ── Crew Pill Badge ─────────────────────────── */
.crew-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 2px;
  text-transform: uppercase;
}
.crew-badge.rn {
  background: rgba(0,229,204,0.1);
  border: 1px solid var(--rn-dim);
  color: var(--rn);
}
.crew-badge.ko {
  background: rgba(224,32,48,0.1);
  border: 1px solid var(--ko-dim);
  color: var(--ko);
}

/* ── Lorebook Entry Cards ────────────────────── */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.entry-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.entry-card.rn::before { background: var(--rn); box-shadow: var(--rn-glow); }
.entry-card.ko::before { background: var(--ko); box-shadow: var(--ko-glow); }

.entry-card:hover { transform: translateY(-2px); }
.entry-card.rn:hover { border-color: var(--rn-dim); }
.entry-card.ko:hover { border-color: var(--ko-dim); }

.entry-card h3 {
  font-size: 1.2rem;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.entry-card .handle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.entry-card .meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.entry-card .meta strong { color: var(--text); }
.entry-card p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── Character Sheet (char pages) ─────────────── */
.char-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 760px) {
  .char-layout { grid-template-columns: 1fr; }
}

.char-sidebar {
  position: sticky;
  top: 80px;
}

.char-id-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}
.char-id-card .char-name {
  font-size: 2rem;
  color: var(--text-bright);
  line-height: 1;
  margin-bottom: 4px;
}
.char-id-card .char-alias {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.char-id-card .divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.char-id-card .stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.char-id-card .stat-row .label {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.char-id-card .stat-row .value { color: var(--text-bright); font-weight: 600; }

.char-back-link {
  display: block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.char-back-link:hover {
  color: var(--rn);
  border-color: var(--rn-dim);
}

/* ── Data Sections (char page) ──────────────── */
.data-section {
  margin-bottom: 32px;
}
.data-section-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.data-section-title::before {
  content: '//';
  font-size: 0.8rem;
}

.data-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px 16px;
  margin-bottom: 8px;
  font-size: 0.92rem;
}
.data-row .key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-top: 1px;
}
.data-row .val { color: var(--text-bright); }

.speech-block {
  background: var(--bg-mid);
  border-left: 3px solid var(--pink);
  padding: 12px 16px;
  margin-top: 8px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.speech-block p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.5;
}
.speech-block p:last-child { margin-bottom: 0; }

.connection-item {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.connection-item .conn-name {
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.connection-item .conn-desc { color: var(--text); }

/* ── Lore Boxes (index page) ────────────────── */
.lore-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.75;
}
.lore-box p + p { margin-top: 12px; }

.crew-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
@media (max-width: 700px) { .crew-split { grid-template-columns: 1fr; } }

.crew-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.crew-panel.rn { border-top: 3px solid var(--rn); }
.crew-panel.ko { border-top: 3px solid var(--ko); }

.crew-panel h3 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.crew-panel.rn h3 { color: var(--rn); }
.crew-panel.ko h3 { color: var(--ko); }

.crew-panel .territory {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.4;
}
.crew-panel p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
}

/* ── Race Locations list ─────────────────────── */
.race-list {
  list-style: none;
  display: grid;
  gap: 12px;
}
.race-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 0.92rem;
}
.race-list li strong {
  display: block;
  color: var(--text-bright);
  margin-bottom: 4px;
}

/* ── Crew Index (crew.html) ─────────────────── */
.crew-index-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 700px) { .crew-index-grid { grid-template-columns: 1fr; } }

.crew-roster {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.crew-roster-header {
  padding: 16px 20px;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
}
.crew-roster.rn .crew-roster-header {
  background: rgba(0,229,204,0.08);
  color: var(--rn);
  border-bottom: 1px solid var(--rn-dim);
}
.crew-roster.ko .crew-roster-header {
  background: rgba(224,32,48,0.08);
  color: var(--ko);
  border-bottom: 1px solid var(--ko-dim);
}

.roster-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.roster-member:last-child { border-bottom: none; }
.roster-member:hover { background: rgba(255,255,255,0.02); }

.roster-member a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
}
.roster-member a:hover { color: var(--rn); }
.crew-roster.ko .roster-member a:hover { color: var(--ko); }

.roster-member .role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── Footer ─────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Utility ─────────────────────────────────── */
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mt32 { margin-top: 32px; }
.mb0  { margin-bottom: 0; }

.wip-note {
  background: rgba(217,70,239,0.08);
  border: 1px solid rgba(217,70,239,0.3);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--pink);
  display: inline-block;
  margin-bottom: 20px;
}
