/* Портал starboy. Палитра та же, что на de.starboy.app, — разделы должны
   ощущаться одним сайтом, а не набором разных. */

:root {
  color-scheme: dark;
  --bg: #0b0b0f;
  --surface: #15151c;
  --surface-2: #1d1d26;
  --line: #2a2a36;
  --text: #e7e7ea;
  --muted: #8b8b96;
  --dim: #5c5c66;
  --accent: #6d6df0;
  --easy: #4ec98a;

  --side-w: 236px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

/* ---------- небо ---------- */

/* Фон намеренно скромный: звёзды мелкие и приглушённые, движение почти незаметное.
   Задник не должен спорить с содержимым. */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.sky-dust {
  position: absolute;
  inset: -320px;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(1px 1px   at 62% 8%,  rgba(255, 255, 255, .40), transparent 60%),
    radial-gradient(1px 1px   at 32% 62%, rgba(255, 255, 255, .30), transparent 60%),
    radial-gradient(1.4px 1.4px at 82% 44%, rgba(255, 255, 255, .45), transparent 60%),
    radial-gradient(1px 1px   at 47% 88%, rgba(255, 255, 255, .26), transparent 60%),
    radial-gradient(1px 1px   at 92% 76%, rgba(255, 255, 255, .34), transparent 60%);
  background-size: 320px 320px;
  /* Сдвиг ровно на размер плитки — иначе на стыке появится шов. */
  animation: drift 260s linear infinite;
}
@keyframes drift { to { transform: translate3d(-320px, -320px, 0); } }

.sky-stars { position: absolute; inset: 0; }
.sky-stars i {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--dur, 5s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .18; transform: scale(.9); }
  50%      { opacity: .85; transform: scale(1); }
}

/* Подсветка сверху, чтобы фон не был плоским пятном. */
.sky::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 50% -15%, rgba(109, 109, 240, .16), transparent 62%);
}

@media (prefers-reduced-motion: reduce) {
  .sky-dust, .sky-stars i { animation: none; }
  .sky-stars i { opacity: .5; }
}

/* ---------- каркас ---------- */

.shell { display: flex; min-height: 100dvh; }

.side {
  width: var(--side-w);
  flex: none;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  padding: 22px 14px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.side-head { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.mark {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  background: linear-gradient(150deg, var(--accent), #9b6df0);
  position: relative;
}
.mark::after {
  content: '★';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 13px; color: #fff;
}
.wordmark { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--muted); font-size: 14.5px; cursor: pointer;
  background: none; border: 0; font-family: inherit; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.on { background: var(--surface-2); color: var(--text); }
.nav-item.on .nav-icon { filter: none; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex: none; }
.nav-item.soon { opacity: .45; cursor: default; }
.nav-item.soon:hover { background: none; color: var(--muted); }
.nav-tag {
  margin-left: auto; font-size: 10.5px; letter-spacing: .04em;
  color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}

.side-foot {
  margin-top: auto; padding: 0 10px;
  font-size: 12.5px; color: var(--dim);
  display: flex; align-items: center; gap: 7px;
}
.dot-ok { width: 6px; height: 6px; border-radius: 50%; background: var(--easy); flex: none; }

.main {
  flex: 1;
  min-width: 0;
  padding: 54px 32px calc(48px + env(safe-area-inset-bottom));
}
.wrap { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }

/* ---------- приветствие ---------- */

.hello { display: flex; flex-direction: column; gap: 8px; }
.hello h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.hello .sub { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 46em; }
.wave { display: inline-block; }

/* ---------- разделы ---------- */

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

.tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color .16s ease, transform .16s ease;
}
a.tile:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); }
.tile-top { display: flex; align-items: center; gap: 10px; }
.tile-icon { font-size: 20px; }
.tile-name { font-size: 16px; font-weight: 600; }
.tile-sub { color: var(--muted); font-size: 13.5px; }
.tile-foot { margin-top: 6px; font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.tile.soon { opacity: .5; }
.tile.soon .tile-foot { color: var(--dim); }

.sec-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; letter-spacing: .01em; }

/* ---------- мобильные ---------- */

.burger {
  display: none;
  position: fixed; left: 14px; top: 14px; z-index: 30;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); font-size: 16px; cursor: pointer;
}

.scrim {
  position: fixed; inset: 0; z-index: 18;
  background: rgba(0, 0, 0, .5);
  border: 0; padding: 0;
}

@media (max-width: 860px) {
  .burger { display: block; }
  .side {
    position: fixed; z-index: 20; top: 0; left: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    background: var(--bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, .5);
  }
  .side.open { transform: none; }
  .main { padding: 68px 18px calc(40px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
  a.tile:hover { transform: none; }
}
