: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); }
.cgt-clock {
  margin-left: auto;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.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; }
.identity-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.identity-link::after {
  content: "↗";
  color: var(--accent-2);
  font-size: 0.82rem;
  transform: translateY(-1px);
}
.identity-link:hover,
.identity-link:focus-visible {
  color: var(--accent);
}
.identity-link:focus-visible {
  outline: 2px solid rgba(127, 215, 255, 0.5);
  outline-offset: 4px;
  border-radius: 8px;
}
.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;
}
.roster-grid {
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.85rem;
}
.droid-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.person-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  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 {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.82rem;
}
.person-copy h3 {
  font-size: 1rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.person-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  font-size: 0.86rem;
}
.card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.7rem;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-more span {
  color: var(--accent);
  transition: transform 160ms ease;
}
.person-card:hover .card-more span,
.person-card:focus-visible .card-more span { transform: translateX(3px); }
.recruitment-panel { margin-top: 1rem; }
.subsection-heading { margin: 3rem 0 1rem; }
.subsection-heading h3 { margin: 0.25rem 0 0.45rem; font-size: 1.55rem; }
.subsection-heading p:last-child { color: var(--muted); line-height: 1.65; }
.pet-grid { margin-bottom: 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 {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--accent-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}
.log-meta time {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}
.log-entry h3 { margin-bottom: 0.65rem; }
.log-body { min-width: 0; }
.log-text,
.modal-text {
  display: grid;
  gap: 0.85rem;
}
.log-text p,
.modal-text p { margin: 0; }
.log-image {
  margin: 1rem 0 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}
.log-image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  text-align: left;
}
.log-image-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}
.log-image-button:hover img,
.log-image-button:focus-visible img {
  transform: scale(1.012);
  filter: brightness(1.06);
}
.log-image-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.log-image-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.42rem 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(5, 8, 15, 0.82);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.log-image figcaption {
  padding: 0.75rem 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.82rem;
}
.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;
}
.archive-updated {
  margin-top: 0.45rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.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.landscape-image .modal-card {
  width: min(1100px, 100%);
}
.modal.landscape-image .modal-grid {
  grid-template-columns: 1fr;
}
.modal.landscape-image .modal-image-wrap img {
  aspect-ratio: 4 / 3;
  max-height: min(68vh, 760px);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
}
.modal.no-image .modal-grid {
  grid-template-columns: 1fr;
}
.modal.no-image .modal-copy {
  padding-top: 0.2rem;
}
.modal-copy { padding: 0.4rem 0.2rem 0.2rem; }
.modal-links { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1rem 0 0.2rem; }
.modal-links[hidden] { display: none; }
.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 { 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: 1100px) {
  .cgt-clock { font-size: 0.64rem; letter-spacing: 0.04em; }
}
@media (max-width: 980px) {
  .hero-grid,
  .story-layout,
  .fleet-layout,
  .modal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .cgt-clock { display: none; }
  .menu-button { display: inline-flex; margin-left: auto; }
  .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); }
  .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .person-copy { padding: 0.72rem; }
  .person-copy h3 { font-size: 0.92rem; }
  .person-summary { -webkit-line-clamp: 3; line-clamp: 3; font-size: 0.8rem; }
  .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; }
}

/* Multi-page archive structure */
.page-main {
  min-height: calc(100vh - 210px);
  padding-top: 1rem;
}
.site-nav a.active,
.site-nav a[aria-current="page"] {
  color: var(--text);
  position: relative;
}
.site-nav a.active::after,
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.55rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}
@media (max-width: 820px) {
  .site-nav a.active::after,
  .site-nav a[aria-current="page"]::after { display: none; }
  .site-nav a.active,
  .site-nav a[aria-current="page"] { background: rgba(246, 179, 93, 0.11); }
}


/* Contact channels */
.page-title {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.98;
}
.contact-section { padding-bottom: 3rem; }
.contact-intro { max-width: 780px; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 280px;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.contact-card h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}
.contact-card p:not(.mini-label) {
  color: var(--muted);
  max-width: 48ch;
}
.contact-action {
  margin-top: auto;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.contact-note {
  margin-top: 1rem;
  padding: 1.2rem 1.4rem;
}
.contact-note p:last-child { color: var(--muted); }
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { min-height: 230px; }
  .contact-action { width: 100%; justify-content: center; text-align: center; }
}
