@import url("https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --bg: #070708;
  --rail: #0c0c0e;
  --panel: #121214;
  --panel-2: #18181b;
  --text: #f4f4f5;
  --muted: #8b8b93;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #f5c518;
  --accent-soft: rgba(245, 197, 24, 0.14);
  --rail-w: 72px;
  --rail-w-open: 260px;
  --dock-h: 64px;
  --radius-panel: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
}

body.app {
  background:
    radial-gradient(ellipse 70% 45% at 15% -10%, rgba(245, 197, 24, 0.09), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(40, 120, 255, 0.07), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

a { color: inherit; }

/* ——— Shell ——— */
.shell {
  min-height: 100vh;
  display: flex;
}

.rail {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16px 10px;
  gap: 8px;
  transition: width 0.28s var(--ease);
}

.rail.is-open {
  width: min(var(--rail-w-open), 280px);
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px 6px;
  border-radius: 14px;
  margin-bottom: 6px;
}

.rail-brand img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: block;
}

.rail-brand-name {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.rail.is-open .rail-brand-name {
  opacity: 1;
  width: auto;
}

.rail-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  width: 100%;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  font: 600 12px/1 "Manrope", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.rail-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.rail-toggle-label {
  display: none;
}

.rail.is-open .rail-toggle-label {
  display: inline;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  flex: 1;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--muted);
  border-radius: 14px;
  padding: 11px 12px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.rail-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.rail-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.rail-ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
}

.rail-item span.label {
  white-space: nowrap;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.rail.is-open .rail-item span.label {
  opacity: 1;
  width: auto;
}

/* ——— Language dropdown ——— */
.lang-dd {
  position: relative;
}

.lang-dd-btn {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: 600 13px/1.2 "Manrope", sans-serif;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lang-dd-btn:hover,
.lang-dd.is-open .lang-dd-btn {
  border-color: rgba(245, 197, 24, 0.4);
  background: var(--accent-soft);
}

.lang-dd-code {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  min-width: 1.6em;
}

.lang-dd-name {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail:not(.is-open) .rail-lang-dd .lang-dd-name,
.rail:not(.is-open) .rail-lang-dd .lang-dd-chevron {
  display: none;
}

.rail:not(.is-open) .rail-lang-dd .lang-dd-btn {
  justify-content: center;
  padding: 10px 0;
}

.lang-dd-chevron {
  color: var(--muted);
  font-size: 11px;
}

.lang-dd-menu {
  list-style: none;
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  background: #1a1a1e;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.lang-dd-menu-up {
  bottom: calc(100% + 8px);
  top: auto;
}

.panel-lang-dd .lang-dd-menu {
  bottom: auto;
  top: calc(100% + 6px);
  min-width: 180px;
  right: 0;
  left: auto;
}

.lang-dd-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.lang-dd-menu a:hover,
.lang-dd-menu [aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.rail-lang-dd {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.panel-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.panel-lang-dd {
  width: auto;
}

.panel-lang-dd .lang-dd-btn {
  width: auto;
  min-width: 120px;
}

.stage {
  flex: 1;
  min-width: 0;
  margin-left: var(--rail-w);
  padding: 16px 16px 16px 12px;
  transition: margin-left 0.28s var(--ease);
}

.rail.is-open ~ .stage,
body:has(.rail.is-open) .stage {
  margin-left: min(var(--rail-w-open), 280px);
}

.panel {
  min-height: calc(100vh - 32px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 120px),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  animation: panel-in 0.55s var(--ease) both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hero {
  margin-bottom: clamp(28px, 4vw, 40px);
  max-width: 720px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero h1 {
  font-family: "Syne", sans-serif;
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.18s ease, border-color 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-accent {
  background: linear-gradient(135deg, #ff7a18, #f5c518);
  color: #111;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(245, 197, 24, 0.35);
}

.section-title {
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

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

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease;
}

a.card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 197, 24, 0.4);
  background: #1d1d22;
}

.emoji {
  font-size: 28px;
  margin-bottom: 12px;
  line-height: 1;
}

.card h2 {
  font-family: "Syne", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.25;
}

.card span {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 24px 0;
}

.panel-foot {
  margin-top: auto;
  padding-top: 36px;
  color: var(--muted);
  font-size: 13px;
}

/* Mobile dock — hidden on desktop */
.dock {
  display: none;
}

/* ——— < 1200px: bottom dock, no side rail ——— */
@media (max-width: 1199.98px) {
  .rail {
    display: none;
  }

  .stage {
    margin-left: 0 !important;
    padding: 12px 12px calc(var(--dock-h) + 20px);
  }

  .panel {
    min-height: calc(100vh - 24px - var(--dock-h));
    border-radius: 22px;
    padding: 22px 18px 28px;
  }

  .dock {
    display: flex;
    position: fixed;
    z-index: 50;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: var(--dock-h);
    background: rgba(18, 18, 20, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: 20px;
    align-items: stretch;
    justify-content: space-around;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  }

  .dock a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 14px;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .dock a .dock-ico {
    font-size: 18px;
    line-height: 1;
  }

  .dock a.is-active,
  .dock a:hover {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .dock-lang-dd {
    flex: 1;
    display: flex;
    align-items: stretch;
    position: relative;
  }

  .dock-lang-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
  }

  .dock-lang-dd.is-open .dock-lang-btn,
  .dock-lang-btn:hover {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .dock-lang-dd .lang-dd-menu {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 160px;
    bottom: calc(100% + 10px);
  }

  .panel-lang-dd {
    display: none;
  }
}

@media (min-width: 1200px) {
  body.app.rail-open .stage {
    margin-left: min(var(--rail-w-open), 280px);
  }
}
