/* rail.css — the navigation rail, shared by every page.
 *
 * This is the source of truth for the rail on the homepage and every
 * subpage. The fallbacks keep it compatible with both the v2 homepage
 * palette and the legacy pages' theme variables.
 */
:root {
  --rail: 190px;
  --ok:   #7df0b0;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ============================================================
   Rail — numbered navigation
   ============================================================
   Numbering the sections is borrowed from the reference site; putting
   the rail on the side is not. It stays visible while you scroll, which
   a top bar cannot do without stealing height from the content. */

.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail);
  padding: 2rem 1.25rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 40;
}

.rail__brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--fg);
  text-decoration: none;
}
.rail__brand span {
  background: linear-gradient(100deg, var(--accent) 5%, var(--accent-2, var(--accent-hover)) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rail__role {
  display: block;
  font-family: var(--mono, monospace);
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .06em;
  margin-top: .2rem;
}

.rail__links { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.rail__links a {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  padding: .42rem .55rem;
  border-radius: 6px;
  font-family: var(--mono, monospace);
  font-size: .82rem;
  color: var(--fg-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.rail__links a:hover,
.rail__links a.is-active {
  background: var(--accent-dim, var(--accent-soft));
  color: var(--fg);
  border-left-color: var(--accent);
}
.rail__num {
  color: var(--muted);
  font-size: .7rem;
}
.rail__links a:hover .rail__num,
.rail__links a.is-active .rail__num { color: var(--accent); }

.rail__foot {
  margin-top: auto;
  font-family: var(--mono, monospace);
  font-size: .68rem;
  color: var(--muted);
  display: grid;
  gap: .5rem;
}
.rail__foot a { color: var(--fg-soft); text-decoration: none; }
.rail__clock::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: .45rem;
  vertical-align: middle;
}

.rail__lang {
  align-self: flex-start;
  font-family: var(--mono, monospace);
  font-size: .7rem;
  padding: .25rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-soft);
  cursor: pointer;
}
.rail__lang:hover { border-color: var(--accent); color: var(--accent); }

.page { margin-left: var(--rail); }

@media (max-width: 900px) {
  .rail {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .rail__role, .rail__foot { display: none; }
  .rail__links { grid-auto-flow: column; gap: .2rem; }
  .rail__links a { border-left: 0; border-bottom: 2px solid transparent; padding: .3rem .5rem; }
  .rail__links a.is-active { border-left: 0; border-bottom-color: var(--accent); }
  .rail__num { display: none; }
  .rail__lang { margin-left: auto; }
  .page { margin-left: 0; }
  .hero { min-height: auto; padding: 3rem 0 2rem; }
}
/* Frosted rail, so content scrolling behind it stays suggested. */
.rail {
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(8, 13, 24, .92), rgba(5, 8, 15, .92));
}
.rail__clock::before { animation: pulse-dot 2.4s ease-in-out infinite; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}
@media (prefers-reduced-motion: reduce) {
  .rail__clock::before { animation: none; }
}
