/* ===== Design tokens ===== */

/* img.lucide -- реальна завантажена SVG-робота, показана замість
   декоративної іконки (клас .lucide навмисно спільний з іконками,
   щоб успадкувати вже наявні правила розміру нижче для кожного
   контексту -- картка/сітка/деталі). object-fit потрібен лише для
   <img>, на справжні inline-SVG іконки він не впливає. */
img.lucide { object-fit: contain; }

:root {
  --bg: #0b0f1a;
  --bg-elevated: #121826;
  --bg-card: #151d2e;
  --gold: #c9a227;
  --gold-bright: #e8c468;
  --ink: #ece5d3;
  --muted: #8b93a7;
  --line: rgba(201, 162, 39, 0.18);
  --glass-bg: rgba(18, 24, 38, 0.55);
  --glass-border: rgba(232, 196, 104, 0.16);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 18px;
  --rail-w: 76px;
  --rail-w-open: 220px;
}

@view-transition {
  navigation: auto;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geologica', system-ui, sans-serif;
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(201, 162, 39, 0.10), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(201, 162, 39, 0.06), transparent 40%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--gold); color: #0b0f1a; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ===== Sidebar (frosted glass rail) ===== */
.sidebar {
  position: fixed;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: var(--rail-w);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0;
  z-index: 100;
  transition: width 0.25s ease;
}

.rail-sep {
  width: 28px;
  height: 1px;
  background: var(--line);
  margin: 8px 0 10px;
}

.rail-item {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex: 0 0 auto;
}

.rail-icon .lucide {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.rail-home .rail-icon .lucide { width: 19px; height: 19px; }

.rail-item:hover {
  background: rgba(232, 196, 104, 0.08);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.rail-item.active {
  background: rgba(201, 162, 39, 0.16);
  color: var(--gold-bright);
}

.rail-item.active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--gold);
  border-radius: 3px;
}

.rail-item[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  font-size: 12.5px;
  font-family: 'IBM Plex Mono', monospace;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: var(--shadow);
}

.rail-item:hover[data-tip]::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ===== Layout ===== */
.main {
  margin-left: calc(var(--rail-w) + 40px);
  padding: 64px 48px 80px;
  min-height: 100vh;
  max-width: 1180px;
}

.hero { margin-bottom: 44px; max-width: 640px; }
.hero-compact { display: flex; flex-direction: column; align-items: flex-start; }

.home-hero {
  min-height: calc(100vh - 144px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-mark {
  width: clamp(76px, 12vw, 136px);
  height: clamp(76px, 12vw, 136px);
  color: var(--gold-bright);
  margin-bottom: 28px;
}

.home-mark .lucide {
  width: 100%;
  height: 100%;
  stroke-width: 1.5;
  filter: drop-shadow(0 24px 60px rgba(201, 162, 39, 0.22));
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

.title {
  font-family: 'Geologica', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.95;
  margin: 0 0 16px;
  color: var(--ink);
}

.lede {
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 52ch;
}

.hero-compact {
  max-width: 760px;
}

.hero-compact .cat-roundel,
.hero-compact .eyebrow {
  display: none;
}

.hero-compact + .grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.hero-compact + .grid .card {
  min-height: 196px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  justify-content: center;
}

.hero-compact + .grid .card:hover {
  background: transparent;
  border-color: transparent;
  transform: translateY(-3px);
}

.hero-compact + .grid .card-roundel {
  width: clamp(116px, 14vw, 184px);
  height: clamp(116px, 14vw, 184px);
  border: 0;
  border-radius: 0;
}

.hero-compact + .grid .card:hover .card-roundel {
  border-color: transparent;
  box-shadow: none;
}

.hero-compact + .grid .card-roundel .lucide {
  width: clamp(68px, 9vw, 116px);
  height: clamp(68px, 9vw, 116px);
  stroke: var(--gold);
  stroke-width: 1.75;
}

.hero-compact + .grid .card-name {
  display: none;
}

.cat-roundel {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: radial-gradient(circle, rgba(201,162,39,0.10), transparent 70%);
}
.cat-roundel .lucide { width: 24px; height: 24px; stroke: var(--gold-bright); }

/* ===== Grid & Cards ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  background: #182035;
}

.card-roundel {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover .card-roundel {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.08);
}

.card-roundel .lucide { width: 24px; height: 24px; stroke: var(--gold); }
.card:hover .card-roundel .lucide { stroke: var(--gold-bright); }

.card-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.card:hover .card-name { color: var(--ink); }

.home-main {
  max-width: none;
}

.listing-main {
  max-width: none;
}

.trident-icon-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.trident-icon-grid .card {
  min-height: 196px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  justify-content: center;
}

.trident-icon-grid .card:hover {
  background: transparent;
  border-color: transparent;
  transform: translateY(-3px);
}

.trident-icon-grid .card-roundel {
  width: clamp(116px, 14vw, 184px);
  height: clamp(116px, 14vw, 184px);
  border: 0;
  border-radius: 0;
}

.trident-icon-grid .card:hover .card-roundel {
  border-color: transparent;
  box-shadow: none;
}

.trident-icon-grid .card-roundel .lucide {
  width: clamp(68px, 9vw, 116px);
  height: clamp(68px, 9vw, 116px);
  stroke: var(--gold);
  stroke-width: 1.75;
}

.trident-icon-grid .card-name {
  display: none;
}

/* ===== Detail page ===== */
.detail {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

.main.detail {
  margin-left: 0;
  max-width: none;
  padding: 40px 56px 44px calc(var(--rail-w) + 64px);
}

.detail-card {
  width: min(100%, 1180px);
  min-height: calc(100vh - 84px);
  min-height: calc(100dvh - 84px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.detail-roundel {
  order: 1;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--gold-bright);
}

.detail-roundel .lucide {
  width: min(72vw, 72dvh, 620px);
  height: min(72vw, 72dvh, 620px);
  stroke: currentColor;
  stroke-width: 1.65;
  filter: drop-shadow(0 28px 70px rgba(201, 162, 39, 0.20));
}

.detail .eyebrow {
  order: 2;
  margin: 0 0 8px;
  color: var(--gold);
}

.detail .title {
  order: 3;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 18px;
}

.chips {
  order: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 0;
}

.chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.2s ease;
}
.chip::before { content: '#'; color: var(--gold); }
.chip:hover { color: var(--gold-bright); }

.roles {
  order: 4;
  width: min(100%, 820px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.role {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  font-size: 14px;
}

.role-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.role-name {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}
/* ===== Nav arrows ===== */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  z-index: 90;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nav-arrow:hover { background: rgba(232, 196, 104, 0.12); color: var(--gold-bright); }
.nav-arrow.nav-prev { left: calc(var(--rail-w) + 28px); }
.nav-arrow.nav-next { right: 28px; }
.nav-arrow .lucide { width: 20px; height: 20px; stroke: currentColor; }
.nav-arrow[disabled] { opacity: 0.25; pointer-events: none; }

/* ===== Mobile ===== */
@media (max-width: 720px) {
  :root { --rail-w: 60px; }

  .sidebar {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    height: 64px;
    flex-direction: row;
    justify-content: space-around;
    padding: 0 8px;
  }
  .rail-sep { display: none; }
  .rail-item[data-tip]::after { display: none; }
  .rail-item { width: 42px; height: 42px; }

  .main {
    margin-left: 0;
    padding: 40px 20px 100px;
  }

  .trident-icon-grid,
  .hero-compact + .grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 24px 18px;
  }

  .trident-icon-grid .card,
  .hero-compact + .grid .card {
    min-height: 150px;
  }

  .trident-icon-grid .card-roundel,
  .hero-compact + .grid .card-roundel {
    width: clamp(96px, 34vw, 132px);
    height: clamp(96px, 34vw, 132px);
  }

  .trident-icon-grid .card-roundel .lucide,
  .hero-compact + .grid .card-roundel .lucide {
    width: clamp(58px, 22vw, 84px);
    height: clamp(58px, 22vw, 84px);
  }

  .home-hero {
    min-height: calc(100vh - 140px);
  }

  .main.detail { padding: 28px 20px 112px; }
  .detail-card {
    min-height: calc(100vh - 140px);
    min-height: calc(100dvh - 140px);
  }
  .detail-roundel .lucide {
    width: min(82vw, 54dvh, 440px);
    height: min(82vw, 54dvh, 440px);
  }
  .chips { margin-top: 16px; }
  .roles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
  }
  .role { font-size: 13px; }

  .nav-arrow { width: 44px; height: 44px; top: auto; bottom: 90px; transform: none; }
  .nav-arrow.nav-prev { left: 16px; }
  .nav-arrow.nav-next { right: 16px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

