:root {
  --bg: #0b1116;
  --bg-2: #141c25;
  --panel: rgba(12, 18, 24, 0.92);
  --panel-2: rgba(255, 255, 255, 0.06);
  --text: #eef1f5;
  --muted: #a9b5c4;
  --accent: #c79b5b;
  --accent-2: #7fb9c8;
  --accent-3: #d07a5a;
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 22px 52px rgba(5, 8, 12, 0.6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(199, 155, 91, 0.2), transparent 42%),
    radial-gradient(circle at 80% 8%, rgba(127, 185, 200, 0.18), transparent 38%),
    radial-gradient(circle at 60% 80%, rgba(208, 122, 90, 0.12), transparent 40%),
    linear-gradient(160deg, #0a1016 0%, #121b25 50%, #0b1116 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(transparent 94%, rgba(255, 255, 255, 0.04) 94%),
    linear-gradient(90deg, transparent 92%, rgba(255, 255, 255, 0.035) 92%),
    radial-gradient(circle at 20% 30%, rgba(127, 185, 200, 0.08), transparent 55%);
  background-size: 140px 140px, 180px 180px, 100% 100%;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px);
}

header.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: start;
  gap: clamp(20px, 4vw, 46px);
  padding: clamp(24px, 4vw, 50px) 0 10px;
}

.hero__content { display: grid; gap: 12px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 6vw, 56px);
  margin: 0 0 6px;
  line-height: 1.05;
}

h2 {
  font-family: "Cormorant Garamond", serif;
  margin: 0 0 10px;
  font-size: clamp(22px, 4vw, 34px);
}

p { margin: 0; color: var(--muted); line-height: 1.7; }

.hero__lead {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 0;
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #141c25;
  border: none;
  box-shadow: var(--shadow);
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.meta-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text);
}

.hero__panel {
  display: grid;
  gap: 16px;
  max-width: 420px;
  justify-self: end;
  align-self: start;
}

.hero-visual {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
  overflow: hidden;
  justify-self: center;
  max-width: 360px;
}

.hero-visual img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 6, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__frame {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox__frame img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0c100f;
  box-shadow: var(--shadow);
}

.lightbox__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(17, 22, 18, 0.9);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}

.hero-card {
  position: relative;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(19, 27, 36, 0.96), rgba(12, 18, 25, 0.92));
  border: 1px solid var(--border);
  padding: 14px;
  min-height: 160px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(199, 155, 91, 0.22), transparent 60%);
  filter: blur(8px);
}

.hero-card--spec::before {
  inset: auto -10% -20% auto;
  background: radial-gradient(circle, rgba(127, 185, 200, 0.22), transparent 60%);
}

.panel-list { margin-top: 12px; display: grid; gap: 10px; }

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.spec-row:last-of-type { border-bottom: none; }

.bootline {
  margin-top: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--accent-2);
}

.panel {
  margin-top: 28px;
  background: linear-gradient(150deg, rgba(12, 18, 24, 0.94), rgba(16, 22, 30, 0.9));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.search {
  width: 260px;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip.active {
  background: linear-gradient(120deg, rgba(199, 155, 91, 0.25), rgba(127, 185, 200, 0.25));
  color: var(--text);
  border-color: rgba(199, 155, 91, 0.6);
}

.stat {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
  animation: rise 0.5s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(199, 155, 91, 0.6);
  box-shadow: 0 18px 50px rgba(10, 12, 9, 0.6);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(199, 155, 91, 0.1), rgba(127, 185, 200, 0.08));
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
}

.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  font-size: 12px;
}

.index { color: var(--accent); font-weight: 700; }
.card h3 { margin: 0; font-size: 20px; color: var(--text); }
.card__meta { font-size: 13px; color: var(--muted); }
.card__desc { font-size: 14px; color: var(--muted); line-height: 1.5; }
.card__specs {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text);
}

.card__cta {
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card__cta::after {
  content: "\2197";
  display: inline-flex;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.card:hover .card__cta::after { transform: translateX(2px) translateY(-2px); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.info-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  font-size: 13px;
}

footer {
  margin: 32px 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 720px) {
  .hero__actions { flex-direction: column; align-items: flex-start; }
  header.hero { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  header.hero { grid-template-columns: 1fr; }
  .hero__panel {
    max-width: 100%;
    justify-self: stretch;
  }
}

body.character-page {
  background:
    radial-gradient(circle at 12% 20%, rgba(199, 155, 91, 0.16), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(127, 185, 200, 0.16), transparent 30%),
    linear-gradient(150deg, #0a1016 0%, #121b25 50%, #0a1016 100%);
}

.character-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px);
  position: relative;
  z-index: 1;
}

.character-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(20px, 4vw, 46px);
  align-items: center;
  padding: clamp(22px, 4vw, 38px);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(19, 27, 36, 0.94), rgba(13, 19, 26, 0.9));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.character-hero__subtitle {
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  margin: 0 0 10px;
  font-size: 13px;
}

.character-hero__lead {
  color: var(--text);
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 18px;
}

.character-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.character-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.character-hero__panel {
  display: grid;
  gap: 16px;
}

.hero-card__title {
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-card__chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
}

.hero-card__lines { display: grid; gap: 8px; }
.code-line {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--text);
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.hero-stat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.label {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.character-section {
  margin-top: 28px;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(12, 18, 15, 0.86);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-lede { max-width: 70ch; }

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.fact-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.fact-card h3 { margin: 0 0 6px; }

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.text-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.text-card p { color: var(--muted); }
.text-card h3 { margin: 0; }

.contrib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.contrib-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(199, 155, 91, 0.1), rgba(127, 185, 200, 0.06));
  box-shadow: var(--shadow);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.timeline li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.timeline__year {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-weight: 700;
}

.legacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.legacy-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.quote {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(127, 185, 200, 0.4);
  background: rgba(127, 185, 200, 0.12);
  font-size: 16px;
  color: var(--text);
}

.quote span {
  display: block;
  margin-top: 10px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  font-size: 12px;
}

.character-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin: 28px 0 10px;
}

.character-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

@media (max-width: 800px) {
  .character-hero { padding: 20px; }
  .section-head { align-items: flex-start; }
}
