:root {
  --bg: #090b12;
  --bg-soft: #0e1220;
  --panel: rgba(16, 21, 35, 0.88);
  --panel-2: rgba(22, 29, 46, 0.95);
  --border: rgba(255, 255, 255, 0.12);
  --text: #edf2ff;
  --muted: #b2bdd6;
  --accent: #f6b35d;
  --accent-2: #7fd7ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(76, 108, 161, 0.16), transparent 32%),
    radial-gradient(circle at 20% 10%, rgba(246, 179, 93, 0.08), transparent 22%),
    linear-gradient(180deg, #06070d 0%, #0a0d16 40%, #090b12 100%);
  color: var(--text);
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(127, 215, 255, 0.08) 0, transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(246, 179, 93, 0.08) 0, transparent 22%);
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(7, 10, 18, 0.78);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 2vw, 2rem);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.88rem;
}
.brand-mark { color: var(--accent); }
.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--text); }
.menu-button {
  display: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}
.shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
}
.section { padding: 2rem 0 1rem; }
.hero { padding: 2rem 0 1rem; }
.hero-grid,
.story-layout,
.fleet-layout,
.modal-grid {
  display: grid;
  gap: 1.5rem;
}
.hero-grid { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); align-items: stretch; }
.story-layout { grid-template-columns: 0.9fr 1.1fr; }
.fleet-layout { grid-template-columns: 1.4fr 0.8fr; align-items: start; }
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.accent-panel {
  background: linear-gradient(160deg, rgba(23, 31, 49, 0.98), rgba(13, 18, 28, 0.94));
}
.hero-portrait {
  position: relative;
  overflow: hidden;
}
.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 540px;
}
.status-strip {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(7, 10, 18, 0.82);
  border: 1px solid var(--border);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #87ffb0;
  box-shadow: 0 0 12px #87ffb0;
}
.hero-copy { padding: clamp(1.5rem, 3vw, 2.5rem); }
.eyebrow,
.mini-label {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}
.mini-label { color: var(--accent-2); font-size: 0.72rem; }
h1, h2, h3, h4, p, dl { margin: 0; }
h1 {
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 0.95;
  margin-bottom: 1rem;
}
h1 span { color: var(--accent); }
.lede { font-size: 1.14rem; color: var(--text); margin-bottom: 0.85rem; }
.quote {
  color: var(--muted);
  font-size: 1.06rem;
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.2rem;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 14px 14px 0;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}
.button.primary {
  background: linear-gradient(135deg, rgba(246, 179, 93, 0.22), rgba(246, 179, 93, 0.1));
  border-color: rgba(246, 179, 93, 0.45);
}
.identity-grid,
.ship-stats,
.modal-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.identity-grid div,
.ship-stats div,
.modal-stats div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 0.9rem;
}
dt {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
dd { margin: 0; font-weight: 600; }
.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-number {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(246, 179, 93, 0.12);
  color: var(--accent);
  border: 1px solid rgba(246, 179, 93, 0.22);
  font-weight: 700;
}
h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}
.section-intro,
.story-card p,
.ship-card p,
.support-panel p,
.person-copy p,
.log-entry p,
.salvage-card p,
.recruitment-grid p,
.modal-text p {
  color: var(--muted);
  line-height: 1.65;
}
.story-card,
.support-panel,
.recruitment-panel,
.ship-card { padding: 1.4rem; }
.story-card h3,
.support-panel h3,
.ship-card h3,
.recruitment-panel h3 { margin-bottom: 0.8rem; font-size: 1.45rem; }
.story-card .lead { color: var(--muted); }
.fleet-grid {
  display: grid;
  gap: 1.25rem;
}
.ship-card {
  display: grid;
  gap: 1rem;
}
.ship-image {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ship-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.ship-role { color: var(--text) !important; font-weight: 600; margin-bottom: 0.6rem; }
.ship-stats { margin-top: 1.35rem; }
.bullet-list {
  padding-left: 1.1rem;
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.droid-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.person-card {
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.clickable { cursor: pointer; }
.clickable:hover,
.clickable:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(246, 179, 93, 0.32);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.34);
}
.person-image {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}
.person-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.person-copy { padding: 1rem; }
.person-copy h3 { font-size: 1.08rem; margin-bottom: 0.45rem; }
.recruitment-panel { margin-top: 1rem; }
.recruitment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.recruitment-grid article {
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.recruitment-grid h4 { margin-bottom: 0.5rem; }
.log-list {
  display: grid;
  gap: 1rem;
}
.log-entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.1rem;
  padding: 1.2rem 1.3rem;
}
.log-meta {
  color: var(--accent-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}
.log-entry h3 { margin-bottom: 0.5rem; }
.salvage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.salvage-card { padding: 1.2rem; }
.salvage-card h3 { margin-bottom: 0.5rem; font-size: 1.18rem; }
.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem 4rem;
}
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 1rem;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 11, 0.78);
  backdrop-filter: blur(10px);
}
.modal-card {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.2rem;
  z-index: 1;
}
.modal-grid { grid-template-columns: minmax(260px, 360px) 1fr; align-items: start; }
.modal-image-wrap {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.modal-image-wrap img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.modal-copy { padding: 0.4rem 0.2rem 0.2rem; }
.modal-copy h3 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 0.25rem; }
.modal-role { color: var(--text); font-weight: 600; margin-bottom: 1rem; }
.modal-text { display: grid; gap: 0.8rem; margin-bottom: 1rem; }
.modal-stats { margin-top: 1rem; }
.modal-stats:not(.active) { display: none; }
.modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  z-index: 2;
}
.simple-page { min-height: 100vh; display: grid; place-items: center; }
.simple-shell { padding: 2rem 0; }
.simple-panel { padding: 2rem; text-align: center; }
.simple-panel h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin-bottom: 0.8rem; }
.simple-panel p { color: var(--muted); margin-bottom: 1rem; }

@media (max-width: 980px) {
  .hero-grid,
  .story-layout,
  .fleet-layout,
  .modal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .menu-button { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1rem;
    flex-direction: column;
    align-items: stretch;
    min-width: 200px;
    background: rgba(10, 13, 22, 0.96);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0.6rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.55rem 0.7rem; border-radius: 12px; }
  .site-nav a:hover { background: rgba(255,255,255,0.05); }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 1rem, 1240px); }
  .section-number { width: 54px; height: 54px; }
  .identity-grid,
  .ship-stats,
  .modal-stats { grid-template-columns: 1fr; }
  .log-entry { grid-template-columns: 1fr; }
  .hero-copy { padding: 1.2rem; }
  .story-card,
  .ship-card,
  .support-panel,
  .recruitment-panel { padding: 1rem; }
}
