:root {
  --bg: #071827;
  --bg-deep: #04101d;
  --panel: rgba(10, 34, 55, 0.82);
  --panel-strong: rgba(15, 52, 78, 0.92);
  --paper: #f5ead0;
  --text: #fff7df;
  --muted: #bdd7df;
  --line: rgba(172, 229, 255, 0.22);
  --accent: #6bd7ff;
  --accent-2: #ffd57a;
  --ink: #062032;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(78, 193, 255, 0.2), transparent 32%),
    radial-gradient(circle at 76% 22%, rgba(255, 213, 122, 0.12), transparent 26%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.75) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(107,215,255,0.45) 0 1px, transparent 1px);
  background-position: 0 0, 28px 42px;
  background-size: 86px 86px, 132px 132px;
  opacity: 0.38;
}

a {
  color: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(20px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(4, 16, 29, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 213, 122, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff2bc 0 10%, transparent 11%),
    linear-gradient(145deg, #ffe19a, #a56d27);
  color: #092033;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 0 26px rgba(255, 213, 122, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 24px;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.nav a,
.button,
.tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--text);
  text-decoration: none;
  background: rgba(107, 215, 255, 0.08);
  font: inherit;
}

.nav a:hover,
.nav a.is-active,
.button:hover,
.tab:hover {
  border-color: rgba(255, 213, 122, 0.85);
  background: rgba(255, 213, 122, 0.12);
}

.nav-group {
  position: relative;
}

.submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 22, 36, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: 0.18s ease;
}

.nav-group:hover .submenu,
.nav-group:focus-within .submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.button,
.tab {
  cursor: pointer;
}

.primary {
  border-color: transparent;
  background: linear-gradient(145deg, #9ee8ff, #39b9ef);
  color: var(--ink);
  font-weight: 700;
}

.ghost {
  background: rgba(255, 255, 255, 0.03);
}

.page,
.footer {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.page {
  display: none;
  min-height: calc(100vh - 84px);
  padding: 54px 0 0;
}

.page.is-active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
  align-items: center;
  gap: 52px;
  min-height: 620px;
}

.hero h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(58px, 10vw, 124px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(107, 215, 255, 0.26);
}

.lead {
  max-width: 600px;
  color: #d8eff5;
  font-size: clamp(21px, 2.4vw, 30px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.hero-scene {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 213, 122, 0.22), transparent 18%),
    radial-gradient(circle at 28% 30%, rgba(107, 215, 255, 0.22), transparent 26%),
    rgba(6, 25, 42, 0.7);
  box-shadow: inset 0 0 80px rgba(107, 215, 255, 0.08), 0 30px 90px rgba(0, 0, 0, 0.24);
}

.stars-layer {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.9) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(255,213,122,0.9) 0 1px, transparent 1px);
  background-size: 58px 58px, 97px 97px;
  opacity: 0.44;
}

.ship {
  position: absolute;
  top: 58px;
  right: 58px;
  width: 210px;
  height: 116px;
  transform: rotate(-12deg);
  filter: drop-shadow(0 0 22px rgba(107, 215, 255, 0.55));
}

.ship-body,
.ship-nose,
.ship-wing,
.ship-window,
.ship-flame {
  position: absolute;
  display: block;
}

.ship-body {
  left: 46px;
  top: 36px;
  width: 112px;
  height: 42px;
  border-radius: 50% 42% 42% 50%;
  background: linear-gradient(180deg, #e9fbff, #6bd7ff 55%, #28779d);
}

.ship-nose {
  left: 134px;
  top: 38px;
  width: 54px;
  height: 38px;
  border-radius: 0 80% 80% 0;
  background: linear-gradient(180deg, #fff2bc, #d99f48);
}

.ship-window {
  left: 100px;
  top: 45px;
  width: 24px;
  height: 24px;
  border: 3px solid #07314b;
  border-radius: 50%;
  background: #d9fbff;
}

.ship-wing.left,
.ship-wing.right {
  left: 78px;
  width: 54px;
  height: 26px;
  background: linear-gradient(145deg, #ffd57a, #ad6b2c);
}

.ship-wing.left {
  top: 18px;
  border-radius: 60% 40% 0 80%;
}

.ship-wing.right {
  top: 72px;
  border-radius: 80% 0 40% 60%;
}

.ship-flame {
  left: 14px;
  top: 43px;
  width: 48px;
  height: 26px;
  border-radius: 60% 0 0 60%;
  background: linear-gradient(90deg, rgba(255, 213, 122, 0), #ffd57a, #6bd7ff);
}

.hero-photo {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 32px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 213, 122, 0.32);
  border-radius: 22px;
  background: rgba(3, 13, 22, 0.78);
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 1.8;
  object-fit: cover;
  filter: sepia(0.2) saturate(0.8);
}

.hero-photo figcaption {
  padding: 11px 14px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

.home-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.home-menu a,
.book-card,
.panel,
.route-grid article,
.media-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.home-menu a {
  display: grid;
  gap: 4px;
  min-height: 116px;
  padding: 18px;
  text-decoration: none;
}

.home-menu span {
  color: var(--accent-2);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
}

.home-menu strong {
  align-self: end;
  font-size: 19px;
  line-height: 1.2;
}

h2 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1;
}

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

.search,
input[type="file"],
label input {
  width: min(360px, 100%);
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: 16px "Segoe UI", Arial, sans-serif;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.tab.is-active {
  background: var(--accent-2);
  color: var(--ink);
  font-weight: 700;
}

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

.book-card {
  min-height: 178px;
  padding: 18px;
}

.book-card h3 {
  min-height: 68px;
  margin: 10px 0;
  color: var(--paper);
  font-size: 20px;
  line-height: 1.18;
}

.book-card p,
.hint {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
}

.book-tag {
  display: inline-flex;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font: 12px "Segoe UI", Arial, sans-serif;
}

.text-link {
  color: var(--accent-2);
  font: 700 15px "Segoe UI", Arial, sans-serif;
}

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

.media-item {
  min-height: 240px;
  overflow: hidden;
  text-decoration: none;
}

.media-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--panel-strong);
}

.media-item span {
  display: block;
  padding: 10px;
  color: var(--muted);
  font: 13px "Segoe UI", Arial, sans-serif;
}

.route-grid,
.account-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.route-grid article {
  overflow: hidden;
}

.route-grid img {
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: cover;
}

.route-grid h3,
.route-grid p {
  margin-inline: 18px;
}

.route-grid h3 {
  color: var(--paper);
  font-size: 25px;
}

.route-grid p {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
}

.account-layout {
  grid-template-columns: 360px minmax(0, 1fr);
}

.panel {
  padding: 18px;
}

.panel h3 {
  margin: 0 0 16px;
  color: var(--paper);
}

.panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
}

.panel label input,
.panel input[type="file"] {
  width: 100%;
}

.panel-head,
.upload-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head {
  justify-content: space-between;
}

.is-muted {
  opacity: 0.72;
}

.uploads-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.upload-row {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
}

.upload-row span {
  color: var(--muted);
  font: 13px "Segoe UI", Arial, sans-serif;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 72px;
  padding: 30px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: "Segoe UI", Arial, sans-serif;
}

@media (max-width: 920px) {
  .topbar,
  .section-head,
  .panel-head,
  .upload-form,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hero,
  .route-grid,
  .account-layout,
  .home-menu {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 20px;
  }

  .hero-scene {
    min-height: 480px;
  }

  .search {
    width: 100%;
  }
}
