/* ===== Design tokens inherited from the Tridents project ===== */
: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;
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }

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

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, input { font: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--gold); color: #0b0f1a; }

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

/* ===== Sidebar ===== */
.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;
}

.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 svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.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: 12.5px '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);
}

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

.home-main,
.listing-main,
.case-main { max-width: none; }

.hero {
  margin-bottom: 44px;
  max-width: 760px;
}

.catalog-hero {
  margin-bottom: 26px;
}

.catalog-hero .title {
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.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 svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.5;
  filter: drop-shadow(0 24px 60px rgba(201, 162, 39, 0.22));
}

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

.title {
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
  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: 56ch;
}

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

.card {
  min-height: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  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-media {
  aspect-ratio: 16 / 11;
  background: #101827;
  border-bottom: 1px solid var(--line);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.card-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.card-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14.5px;
}

/* ===== Case page ===== */
.case-main {
  padding: 28px 44px 80px calc(var(--rail-w) + 56px);
  margin-left: 0;
}

.case-content {
  display: grid;
  gap: 42px;
  min-width: 0;
}

.case-hero {
  min-height: calc(100dvh - 56px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 14px;
}

.case-hero-copy {
  max-width: none;
  display: grid;
  gap: 8px;
}

.case-title {
  font-size: clamp(2rem, 4.2vw, 4.6rem);
  max-width: none;
  margin-bottom: 0;
}

.case-hero-copy .eyebrow {
  margin-bottom: 0;
}

.compare {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #101827;
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.compare * {
  user-select: none;
  -webkit-user-select: none;
}

.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.compare-after {
  clip-path: inset(0 0 0 var(--split, 50%));
}

.compare-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 2px;
  background: var(--gold-bright);
  transform: translateX(-1px);
  box-shadow: 0 0 0 999px transparent;
}

.compare-handle {
  position: absolute;
  left: var(--split, 50%);
  top: 50%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(18, 24, 38, 0.82);
  color: var(--gold-bright);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.compare-handle svg {
  width: 26px;
  height: 26px;
}

.compare-label {
  position: absolute;
  top: 18px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(18, 24, 38, 0.72);
  color: var(--ink);
  border: 1px solid var(--glass-border);
  font: 12px 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0;
  pointer-events: none;
}

.compare-label.before { left: 18px; }
.compare-label.after { right: 18px; color: var(--gold-bright); }
.compare.is-before .compare-label.after,
.compare.is-after .compare-label.before,
.compare.is-before .compare-line,
.compare.is-after .compare-line,
.compare.is-before .compare-handle,
.compare.is-after .compare-handle {
  opacity: 0;
}
.compare-line { pointer-events: none; }
.compare-range { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.info-grid > section {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: rgba(21, 29, 46, 0.72);
}

.info-grid h3 {
  margin: 0;
  font-size: 15px;
  color: var(--gold-bright);
}

.problem-list,
.people-list,
.plain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.problem-list li,
.people-list li,
.plain-list li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.people-list strong {
  display: block;
  color: var(--gold);
  font: 11px 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 3px;
}

.content-block {
  width: min(100%, 1180px);
  display: grid;
  gap: 18px;
}

.content-block h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.process-list {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.process-list li {
  counter-increment: step;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(21, 29, 46, 0.72);
  color: var(--muted);
  line-height: 1.55;
}

.process-list li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 32px;
  color: var(--gold);
  font: 13px 'IBM Plex Mono', monospace;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gallery-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.gallery-copy {
  padding: 18px;
}

.gallery-copy h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.gallery-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14.5px;
}

.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 svg { width: 20px; height: 20px; stroke: currentColor; }

/* ===== Mobile ===== */
@media (max-width: 920px) {
  .process-list { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .compare { min-height: 440px; }
}

@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,
  .case-main {
    margin-left: 0;
    padding: 40px 20px 100px;
  }

  .home-hero { min-height: calc(100vh - 140px); }
  .grid { grid-template-columns: 1fr; }
  .case-hero { min-height: auto; }
  .compare { min-height: 340px; height: 58vh; border-radius: 18px; }
  .case-title { max-width: none; }
  .nav-arrow { width: 44px; height: 44px; top: auto; bottom: 90px; transform: none; }
  .nav-arrow.nav-prev { left: 16px; }
  .nav-arrow.nav-next { right: 16px; }
}

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