:root {
  color-scheme: light;
  --orange: #ff6b00;
  --ink: #121722;
  --muted: #687282;
  --line: #e6eaf0;
  --soft: #f6f8fb;
  --card: #ffffff;
  --shadow: 0 18px 42px rgba(17, 23, 34, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #fbfcfe;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

button,
input {
  font: inherit;
}

.top-line {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: 4px;
  background: linear-gradient(90deg, #ff5a00, #ff8a00 28%, #c95cff 66%, #1f8bff);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto auto minmax(280px, 640px) auto;
  align-items: center;
  gap: 28px;
  height: 94px;
  padding: 0 clamp(26px, 3.6vw, 50px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(230, 234, 240, 0.7);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--orange);
  font-size: 34px;
  line-height: 1;
}

.brand-name {
  font-size: 29px;
  font-weight: 860;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 15px;
}

.main-nav a {
  position: relative;
  padding: 36px 0 34px;
}

.main-nav .active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 22px;
  left: 0;
  height: 2px;
  background: var(--orange);
}

.search {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 48px;
  padding: 0 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
}

.search svg,
.header-icons svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: end;
}

.header-icons button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.header-icons button span {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.menu-button {
  border-radius: 12px;
  background: #fff !important;
  box-shadow: 0 8px 20px rgba(17, 23, 34, 0.12);
}

.dashboard {
  display: grid;
  grid-template-columns: 74px minmax(720px, 1fr) minmax(340px, 470px);
  grid-template-areas:
    "rail main right"
    "rail features features";
  gap: 20px;
  padding: 22px clamp(26px, 3.5vw, 50px) 28px;
}

.side-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
}

.rail-card,
.rail-action {
  display: grid;
  place-items: center;
  min-height: 82px;
  padding: 6px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.rail-card {
  color: #fff;
  overflow: hidden;
}

.rail-thumb,
.rail-card {
  position: relative;
}

.rail-thumb {
  position: absolute;
  inset: 0;
}

.rail-card strong,
.rail-card span:not(.rail-thumb) {
  z-index: 2;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
}

.rail-card span:not(.rail-thumb) {
  align-self: end;
}

.rail-action {
  color: var(--ink);
  font-size: 13px;
}

.rail-action span {
  color: var(--orange);
  font-size: 28px;
  line-height: 1;
}

.rail-action.active {
  color: var(--orange);
}

.main-column {
  grid-area: main;
  min-width: 0;
}

.hero-card {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-radius: 15px;
  background: #111923;
  box-shadow: var(--shadow);
}

.hero-scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 12, 18, 0.84), rgba(8, 12, 18, 0.22) 46%, rgba(8, 12, 18, 0.88)),
    radial-gradient(circle at 66% 18%, rgba(255, 162, 61, 0.2), transparent 24%),
    linear-gradient(135deg, #172232 0%, #24394b 40%, #071018 100%);
}

.hero-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 68px, rgba(255, 255, 255, 0.08) 70px 72px, transparent 74px 140px),
    linear-gradient(180deg, transparent 0 35%, rgba(0, 0, 0, 0.42));
  opacity: 0.38;
}

.rain {
  position: absolute;
  inset: -20% 0;
  background: repeating-linear-gradient(105deg, transparent 0 18px, rgba(255, 255, 255, 0.16) 19px 20px, transparent 21px 44px);
  opacity: 0.22;
}

.rain-b {
  transform: translateX(70px);
  opacity: 0.14;
}

.city-light {
  position: absolute;
  bottom: 34%;
  width: 110px;
  height: 160px;
  border-radius: 50%;
  filter: blur(34px);
}

.city-light.one {
  left: 47%;
  background: rgba(255, 111, 0, 0.46);
}

.city-light.two {
  right: 15%;
  background: rgba(37, 176, 255, 0.32);
}

.figure {
  position: absolute;
  bottom: 0;
  border-radius: 45% 45% 0 0;
  background: linear-gradient(180deg, rgba(28, 35, 42, 0.72), rgba(5, 8, 12, 0.95));
}

.figure.main {
  left: 42%;
  width: 210px;
  height: 300px;
  clip-path: polygon(42% 0, 62% 4%, 75% 35%, 100% 100%, 0 100%, 20% 38%);
}

.figure.main::before {
  content: "";
  position: absolute;
  left: 72px;
  top: 18px;
  width: 66px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, #32251d, #c7a58a);
}

.figure.back {
  right: 25%;
  width: 92px;
  height: 205px;
  opacity: 0.75;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 470px;
  padding: 52px 48px;
  color: #fff;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(44px, 4.1vw, 62px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0 0 22px;
  font-size: 18px;
  line-height: 1.45;
}

.continue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 45px;
  padding: 0 23px;
  color: #fff;
  background: var(--orange);
  border-radius: 8px;
  font-weight: 750;
}

.continue span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--orange);
  background: #fff;
  border-radius: 50%;
  font-size: 10px;
}

.current-book {
  position: absolute;
  top: 26px;
  right: 26px;
  z-index: 3;
  width: 218px;
  padding: 17px;
  color: #fff;
  background: rgba(8, 12, 18, 0.73);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  backdrop-filter: blur(12px);
}

.current-book p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.42;
}

.current-body {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

.current-body h2 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.15;
}

.current-body strong {
  color: var(--orange);
  font-size: 13px;
  line-height: 1.2;
}

.mini-cover {
  flex: 0 0 58px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background: linear-gradient(145deg, #132233, #226bb0 50%, #f0a34a);
}

.progress-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font-size: 13px;
}

i {
  display: block;
  height: 4px;
  overflow: hidden;
  background: rgba(114, 124, 140, 0.26);
  border-radius: 4px;
}

i b {
  display: block;
  height: 100%;
  background: var(--orange);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.story-card {
  position: relative;
  min-height: 205px;
  overflow: hidden;
  padding: 126px 14px 14px;
  color: #fff;
  border-radius: 10px;
  background: #111;
  box-shadow: var(--shadow);
}

.story-art,
.story-art::before,
.story-art::after {
  position: absolute;
}

.story-art {
  inset: 0;
  background: var(--story-bg);
}

.story-art::before {
  content: "";
  inset: 0;
  background:
    linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.72)),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.4), transparent 18%);
}

.story-art::after {
  content: "";
  left: 48%;
  bottom: 34px;
  width: 55px;
  height: 92px;
  border-radius: 40% 40% 0 0;
  background: rgba(0, 0, 0, 0.42);
}

.story-card strong,
.story-card span:not(.story-art),
.story-card i,
.story-card em {
  position: relative;
  z-index: 2;
}

.story-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 17px;
  line-height: 1.12;
}

.story-card span:not(.story-art) {
  display: block;
  margin-bottom: 9px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.story-card em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 13px;
}

.art-arvendale { --story-bg: linear-gradient(145deg, #795b32, #213849 52%, #0c1118); }
.art-glass { --story-bg: linear-gradient(145deg, #0c1018, #1453a3 45%, #00c2ff); }
.art-vesperia { --story-bg: linear-gradient(145deg, #5f3c1f, #c49243 44%, #283948); }
.art-neon { --story-bg: linear-gradient(145deg, #120d25, #e0129d 47%, #0ee7ff); }
.art-surface { --story-bg: linear-gradient(145deg, #0d1615, #315241 48%, #d2f4ff); }

.library-strip,
.panel,
.feature-row article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.library-strip {
  margin-top: 16px;
  padding: 19px 24px 18px;
}

.section-title,
.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h2,
.panel-title h2 {
  margin: 0;
  font-size: 20px;
}

.section-title span,
.orange-icon {
  color: var(--orange);
  font-size: 22px;
}

.section-title a,
.panel-title a {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.mini-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.mini-book {
  min-width: 0;
  color: #141922;
  font-size: 11px;
  text-align: center;
}

.mini-book::before {
  content: "";
  display: block;
  width: 64px;
  max-width: 100%;
  aspect-ratio: 2 / 3;
  margin: 0 auto 8px;
  border-radius: 5px;
  background: var(--thumb-bg);
  box-shadow: 0 8px 16px rgba(17, 23, 34, 0.14);
}

.mini-book i {
  width: 44px;
  height: 3px;
  margin: 5px auto 0;
}

.thumb-midnight { --thumb-bg: linear-gradient(145deg, #182231, #315f9f 55%, #f0a34a); background: var(--thumb-bg); }
.thumb-ember { --thumb-bg: linear-gradient(145deg, #141821, #1757a4 46%, #0fd5ff); background: var(--thumb-bg); }
.thumb-city { --thumb-bg: linear-gradient(145deg, #5e371d, #c59042 50%, #27384a); background: var(--thumb-bg); }
.thumb-forest { --thumb-bg: linear-gradient(145deg, #0f1715, #315441 54%, #c7f2df); background: var(--thumb-bg); }
.thumb-neon { --thumb-bg: linear-gradient(145deg, #120d25, #e0129d 47%, #0ee7ff); background: var(--thumb-bg); }
.thumb-blue { --thumb-bg: linear-gradient(145deg, #0c1322, #1481a3 52%, #78ffe1); background: var(--thumb-bg); }
.thumb-gold { --thumb-bg: linear-gradient(145deg, #20160e, #bd7f39 52%, #ffe0a3); background: var(--thumb-bg); }
.thumb-violet { --thumb-bg: linear-gradient(145deg, #1a1231, #7a4bff 52%, #35d9ff); background: var(--thumb-bg); }
.thumb-table { --thumb-bg: linear-gradient(145deg, #2c1d13, #b37d45 58%, #f8ddb1); background: var(--thumb-bg); }
.thumb-paper { --thumb-bg: linear-gradient(145deg, #eee1c4, #b9864a 58%, #22140b); background: var(--thumb-bg); }
.thumb-door { --thumb-bg: linear-gradient(145deg, #0a1118, #1c3a46 58%, #dbf5ff); background: var(--thumb-bg); }

.right-column {
  grid-area: right;
  display: grid;
  gap: 20px;
  align-content: start;
  min-width: 0;
}

.panel {
  padding: 23px 24px;
}

.catalog-profile {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 22px;
  margin-top: 18px;
}

.profile-art {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 56% 26%, #d7a27f 0 12%, transparent 13%),
    linear-gradient(145deg, #111821, #33495d 48%, #bd7d45);
}

.profile-art::after {
  content: "Shelf 12";
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 8px 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  font-weight: 800;
}

.catalog-stats {
  display: grid;
  gap: 12px;
}

.catalog-stats div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.catalog-stats strong {
  font-weight: 700;
}

.catalog-stats span {
  color: var(--muted);
}

.catalog-stats i {
  grid-column: 1 / -1;
}

.red { background: #ef233c; }
.blue { background: #0077ff; }
.violet { background: #9d4edd; }
.green { background: #1fae4b; }

.hint {
  margin: 18px 0 0;
  padding-top: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.updates-panel {
  padding-bottom: 13px;
}

.update-item {
  display: grid;
  grid-template-columns: 106px 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.update-item:first-of-type {
  margin-top: 12px;
}

.update-thumb {
  display: block;
  height: 62px;
  border-radius: 7px;
}

.update-item strong,
.update-item em {
  display: block;
}

.update-item strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.update-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.update-item b {
  color: var(--orange);
  font-size: 24px;
}

.feature-row {
  grid-area: features;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-left: 94px;
}

.feature-row article {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 0 18px;
  padding: 20px 28px;
  min-height: 92px;
}

.feature-row span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 50%;
  font-size: 28px;
}

.feature-row strong {
  align-self: end;
  font-size: 14px;
  text-transform: uppercase;
}

.feature-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 1300px) {
  .app-header {
    grid-template-columns: auto 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .dashboard {
    grid-template-columns: 74px minmax(0, 1fr);
    grid-template-areas:
      "rail main"
      "rail right"
      "rail features";
  }

  .right-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-row {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .app-header {
    height: auto;
    min-height: 76px;
    grid-template-columns: 1fr auto;
    gap: 14px;
  }

  .search {
    grid-column: 1 / -1;
    order: 3;
  }

  .dashboard {
    display: block;
    padding: 18px;
  }

  .side-rail {
    display: none;
  }

  .current-book {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    margin: 0 18px 18px;
  }

  .hero-card {
    padding-bottom: 1px;
  }

  .hero-copy {
    padding: 40px 28px 28px;
  }

  .story-grid,
  .right-column,
  .feature-row {
    grid-template-columns: 1fr;
  }

  .story-card {
    min-height: 190px;
  }

  .library-strip,
  .right-column,
  .feature-row {
    margin-top: 18px;
  }

  .mini-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .brand-name {
    font-size: 24px;
  }

  .header-icons {
    gap: 8px;
  }

  .header-icons button {
    width: 38px;
    height: 38px;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-copy p {
    font-size: 16px;
  }

  .catalog-profile {
    grid-template-columns: 1fr;
  }

  .profile-art {
    max-width: 180px;
  }

  .feature-row article {
    padding: 18px;
  }
}
