/* LENAM — Sword of Legend — fan site
   Palette drawn from the MSX2 title screen:
     night sky navy  #002455
     royal blue      #0049aa
     sky blue        #0092ff
     crimson logo    #ff0000
     cover silk red  #c11823
     cream type      #f3eadb
*/

:root {
  --bg:        #070e22;  /* deeper than the in-game sky, for breathing room */
  --bg-soft:   #0f1a3a;
  --surface:   #14224a;  /* card */
  --surface-2: #1c2e63;  /* card hover / striped header */
  --border:    #243a78;
  --border-strong: #3a5cb3;

  --text:      #f3eadb;  /* cream, matches the cover logo */
  --text-dim:  #a8b6d4;
  --text-mute: #6e7ea3;

  --red:       #e02b2b;  /* primary accent */
  --red-hot:   #ff3838;  /* hover */
  --red-deep:  #8a0f17;  /* shadow / underline */

  --blue:      #3d7ce0;  /* secondary accent (section heads, role tags) */
  --blue-soft: #6ba8ff;  /* hover-blue */
  --blue-deep: #0049aa;  /* the title screen royal */

  --container: 1080px;

  /* Display face used for the wordmark and brand glyphs.
     MedievalSharp is the closest free Google Font to the original "Lenam"
     cover lettering — bold, sharp angular serifs, slightly hand-drawn. */
  --font-display: "MedievalSharp", "Cinzel Decorative", "Trajan Pro", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  /* moody night-sky gradient: navy at the top fading to near-black */
  background:
    radial-gradient(1200px 700px at 75% -200px, rgba(61, 124, 224, 0.18), transparent 70%),
    radial-gradient(900px 500px at -100px 100px, rgba(224, 43, 43, 0.10), transparent 70%),
    linear-gradient(180deg, #0a1638 0%, var(--bg) 60%, var(--bg) 100%);
  color: var(--text);
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-hot); }

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Top nav ---- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 14, 34, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topnav .inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.topnav .brand {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--red);
  font-size: 1.15rem;
  text-shadow: 0 1px 0 var(--red-deep);
}
.topnav .brand .sep { color: var(--text-mute); margin: 0 6px; font-family: inherit; }
.topnav nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 0.92rem;
}
.topnav nav a {
  color: var(--text-dim);
}
.topnav nav a:hover { color: var(--red); }

/* ---- Hero ---- */
.hero {
  padding: 90px 0 72px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
/* faint horizon stripe echoing the title screen's water line */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-deep) 30%, var(--blue-soft) 50%, var(--blue-deep) 70%, transparent);
  opacity: 0.55;
}
.hero .eyebrow {
  color: var(--blue-soft);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 9vw, 6.5rem);
  font-weight: 400;
  color: var(--red);
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow:
    0 2px 0 var(--red-deep),
    0 4px 0 rgba(138, 15, 23, 0.6),
    0 14px 40px rgba(224, 43, 43, 0.45);
}
.hero h1 .jp {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 0.18em;
  color: var(--text-dim);
  letter-spacing: 0.4em;
  margin-top: 18px;
  font-weight: 400;
  text-shadow: none;
}
.hero p.lead {
  max-width: 640px;
  margin: 24px auto 30px;
  color: var(--text-dim);
  font-size: 1.05rem;
}
.hero .cta {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--red);
  color: #fff5e8;
  border-color: var(--red-deep);
}
.btn-primary:hover { background: var(--red-hot); color: #fff5e8; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--blue-soft); color: var(--blue-soft); }

/* ---- Sections ---- */
section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
section.alt { background: var(--bg-soft); }
section h2 {
  font-size: 1.75rem;
  color: var(--blue-soft);
  margin: 0 0 6px;
  letter-spacing: 0.05em;
}
section h2::before {
  content: "§ ";
  color: var(--red);
  font-weight: 400;
}
section h3 {
  color: var(--red);
  margin: 22px 0 8px;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
section .lede {
  color: var(--text-dim);
  margin-bottom: 28px;
  max-width: 720px;
}

p { margin: 0 0 14px; }

/* ---- Two-column layouts ---- */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: start;
}
.split.reverse { grid-template-columns: 0.9fr 1.1fr; }
.split .figure img {
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}
@media (max-width: 800px) {
  .split, .split.reverse { grid-template-columns: 1fr; }
}

/* ---- Heroes cards ---- */
.heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  padding: 18px;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
}
.hero-card .portrait {
  align-self: center;
  width: 128px;
  height: auto;
  margin: -4px 0 12px;
  background: #000;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* 2x scale — MSX2 sprites read better at this size on modern displays */
  width: 144px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.hero-card.villain .portrait { border-color: var(--red-deep); }
.hero-card:hover {
  border-color: var(--border-strong);
  border-left-color: var(--blue-soft);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.hero-card .name {
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 2px;
}
.hero-card .role {
  color: var(--blue-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}
.hero-card .jp {
  color: var(--text-mute);
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.hero-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0;
}
.hero-card.villain {
  border-left-color: var(--red);
  background: linear-gradient(180deg, rgba(138, 15, 23, 0.18), var(--surface));
}
.hero-card.villain .role { color: var(--red-hot); }
.hero-card.villain:hover {
  border-color: var(--red-deep);
  border-left-color: var(--red-hot);
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 8px 0 18px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
th, td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--surface-2);
  color: var(--red);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-strong);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(61, 124, 224, 0.06); }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--blue-soft); }

/* ---- Editor teaser ---- */
.editor-card {
  background:
    linear-gradient(135deg, rgba(224, 43, 43, 0.10), transparent 50%),
    linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.editor-card h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: var(--text);
}
.editor-card p { color: var(--text-dim); margin: 0 0 14px; max-width: 540px; }
.editor-card .badge {
  display: inline-block;
  background: rgba(61, 124, 224, 0.18);
  color: var(--blue-soft);
  border: 1px solid rgba(61, 124, 224, 0.35);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
@media (max-width: 700px) {
  .editor-card { grid-template-columns: 1fr; }
}

/* ---- Tile lists ---- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
}
.tile .tile-name {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.tile .tile-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* ---- Screenshot strip ---- */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.shots img {
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---- Opening gallery ---- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.gallery-item {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 8px 0;
  transition: border-color 0.15s, transform 0.15s;
}
.gallery-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.gallery-item img {
  width: 100%;
  height: auto;
  background: #000;
  border-radius: 2px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}
.gallery-item figcaption {
  padding: 8px 4px 10px;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Footer ---- */
footer {
  padding: 36px 0 60px;
  color: var(--text-dim);
  font-size: 0.88rem;
  text-align: center;
}
footer p { margin: 6px 0; }
footer .small { font-size: 0.78rem; color: var(--text-mute); }
footer a { color: var(--blue-soft); }
footer a:hover { color: var(--red-hot); }

/* selection */
::selection { background: var(--red-deep); color: var(--text); }
