:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --ink: #0f172a;
  --body: #475569;
  --muted: #94a3b8;
  --line: #e6eaf2;
  --line-strong: #cbd5e1;
  --blue: #0ea5e9;
  --orange: #ff6a3d;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.02em; line-height: 1.15; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); width: 100%; }

/* ─── TOPBAR ─── */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(246, 248, 252, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 48px);
  max-width: 920px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  background: linear-gradient(120deg, #0ea5e9 0%, #ff6a3d 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; color: #fff; font-size: 1rem;
  letter-spacing: -0.05em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: 'Space Grotesk', sans-serif; font-size: 0.95rem; letter-spacing: 0.04em; }
.brand-text em { font-style: normal; font-size: 0.72rem; color: var(--muted); }
.ext-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--blue);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #fff;
  transition: all 0.2s;
}
.ext-link:hover { border-color: var(--blue); transform: translateY(-1px); }

/* ─── HERO ─── */
.hero { padding: clamp(48px, 8vw, 84px) 0 clamp(28px, 4vw, 44px); }
.eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 16px; }
.hero > .wrap > p { max-width: 580px; color: var(--body); font-size: 1.05rem; }

/* ─── DIRECTORY LIST ─── */
.dir { padding-bottom: 48px; flex: 1; }
.dir-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: item;
}
.dir-item {
  display: grid;
  grid-template-columns: 60px 1fr 40px;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
}
.dir-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--line-strong);
  transition: background 0.25s;
}
.dir-item[data-theme="horizon"]::before { background: linear-gradient(180deg, #0ea5e9 0%, #ff6a3d 100%); }
.dir-item[data-theme="aurora"]::before  { background: linear-gradient(180deg, #8b5cf6 0%, #06b6d4 50%, #ec4899 100%); }
.dir-item[data-theme="mono"]::before    { background: linear-gradient(180deg, #14110d 0%, #c2410c 100%); }
.dir-item[data-theme="prism"]::before   { background: linear-gradient(180deg, #c8a24a 0%, #7c6f9c 100%); }
.dir-item[data-theme="vela"]::before     { background: linear-gradient(180deg, #0d1014 0%, #b6f000 100%); }
.dir-item[data-theme="pulse"]::before    { background: linear-gradient(180deg, #22d3ee 0%, #6366f1 50%, #a855f7 100%); }

.dir-item:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
.dir-item:hover .dir-arrow { color: var(--blue); transform: translateX(4px); }
.dir-item[data-theme="aurora"]:hover .dir-arrow { color: #06b6d4; }
.dir-item[data-theme="mono"]:hover .dir-arrow { color: #c2410c; }
.dir-item[data-theme="prism"]:hover .dir-arrow { color: #c8a24a; }
.dir-item[data-theme="vela"]:hover .dir-arrow { color: #6f9300; }
.dir-item[data-theme="pulse"]:hover .dir-arrow { color: #6366f1; }

.dir-no {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.05em;
}
.dir-body { min-width: 0; }
.dir-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.dir-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 500;
}
.dir-path strong { color: var(--blue); font-weight: 600; }
.dir-item[data-theme="aurora"] .dir-path strong { color: #8b5cf6; }
.dir-item[data-theme="mono"] .dir-path strong { color: #c2410c; }
.dir-item[data-theme="prism"] .dir-path strong { color: #9a7c2e; }
.dir-item[data-theme="vela"] .dir-path strong { color: #6f9300; }
.dir-item[data-theme="pulse"] .dir-path strong { color: #6366f1; }

.dir-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.dir-status .dot { width: 6px; height: 6px; border-radius: 50%; }
.dir-status-live { color: #15803d; background: #dcfce7; }
.dir-status-live .dot { background: #22c55e; }
.dir-status-draft { color: var(--muted); background: #f1f5f9; }
.dir-status-draft .dot { background: #94a3b8; }

.dir-body p {
  color: var(--body);
  font-size: 0.92rem;
  margin-bottom: 10px;
  max-width: 620px;
}
.dir-body p strong { color: var(--ink); font-weight: 600; }
.dir-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dir-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: transform 0.25s var(--ease), color 0.25s;
}

/* ─── ASIDE LINK ─── */
.dir-aside { margin-top: 28px; }
.dir-aside-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--body);
  transition: all 0.2s;
}
.dir-aside-item:hover {
  background: #fff;
  border-color: var(--blue);
  border-style: solid;
  color: var(--ink);
}
.dir-aside-item:hover code { color: var(--blue); }
.dir-aside-no {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--blue);
}
.dir-aside-item strong {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}
.dir-aside-item span { font-size: 0.85rem; }
.dir-aside-item code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s;
}

/* ─── FOOTER ─── */
.lab-footer { border-top: 1px solid var(--line); padding: 24px 0; }
.lab-footer .wrap {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .dir-item { grid-template-columns: 36px 1fr 32px; padding: 20px; gap: 16px; }
  .dir-head { gap: 8px; }
  .dir-path { font-size: 0.95rem; }
  .dir-url { font-size: 0.68rem; }
  .dir-aside-item { grid-template-columns: 32px 1fr; }
  .dir-aside-item code { grid-column: 1 / -1; padding-left: 48px; }
  .lab-footer .wrap { flex-direction: column; gap: 6px; text-align: center; }
  .brand-text em { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
