/* Rail Intel – dropdown navigation, lightbox and interior pages */

/* ---------- Dropdown navigation ---------- */

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-group {
  position: relative;
}

.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

/* The panel sits directly beneath the trigger, so bridge the gap to stop the
   pointer crossing dead space and closing the menu on the way down. */
.nav-group::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.7rem;
}

.nav-trigger:hover,
.nav-trigger[aria-expanded="true"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-trigger__chevron {
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.2s ease;
}

.nav-trigger[aria-expanded="true"] .nav-trigger__chevron {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.nav-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  translate: -50% 0;
  min-width: min(38rem, 90vw);
  background: #10151d;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  padding: 0.85rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 60;
}

.nav-panel--product {
  min-width: min(42rem, 92vw);
  max-height: min(78vh, 40rem);
  overflow-y: auto;
}

.nav-panel__label {
  margin: 0.55rem 0.7rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-panel__label:first-child {
  margin-top: 0.15rem;
}

.nav-panel__grid--apps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.35rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.nav-group[data-open="true"] .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
}

.nav-panel__item {
  display: flex;
  gap: 0.7rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.nav-panel__item:hover {
  background: rgba(245, 158, 11, 0.08);
}

.nav-panel__dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--accent);
}

.nav-panel__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.nav-panel__desc {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.nav-panel__footer {
  margin-top: 0.5rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.nav-panel__all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.25rem 0.7rem;
}

.nav-panel__all:hover {
  color: var(--accent-hover);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ---------- Interior pages ---------- */

.page-hero {
  padding: calc(8rem + var(--dev-banner-height)) 0 3rem;
  position: relative;
  isolation: isolate;
}

/* A quieter version of the homepage hero treatment, so interior pages share
   the same look without competing with it. */
.page-hero::before {
  content: "";
  position: absolute;
  inset: -2rem 0 0;
  background:
    linear-gradient(90deg, rgba(9, 12, 18, 0.93) 0%, rgba(9, 12, 18, 0.74) 60%, rgba(9, 12, 18, 0.6) 100%),
    linear-gradient(180deg, rgba(9, 12, 18, 0.88) 0%, rgba(9, 12, 18, 0.82) 55%, rgba(12, 15, 20, 0.82) 100%);
  /* Faded out rather than overhanging: the hero is a positioned stacking
     context and would otherwise paint over the section below. */
  mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
  z-index: -2;
  pointer-events: none;
}

.page-hero::after {
  content: "";
  position: absolute;
  top: -18%;
  right: 4%;
  width: 34rem;
  height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.24), transparent 68%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}

.page-hero__inner {
  max-width: 54rem;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.page-badge--addon {
  color: var(--accent);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.page-badge--app {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.page-badge--core {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.page-title {
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 1rem;
}

.page-lead {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 46rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.page-section__head {
  max-width: 46rem;
  margin-bottom: 2rem;
}

.page-section h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.page-section p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.page-section p:last-child {
  margin-bottom: 0;
}

.spec-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem 2rem;
}

.spec-list li {
  position: relative;
  padding-left: 1.3rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.spec-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.spec-list strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Screenshot figures ---------- */

.shot-grid {
  display: grid;
  gap: 1.75rem;
  margin-top: 2rem;
}

.shot-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

.shot {
  margin: 0;
  min-width: 0;
}

.shot__frame {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.shot__frame img {
  display: block;
  width: 100%;
  height: auto;
}

.shot__expand {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  background: rgba(12, 15, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  backdrop-filter: blur(4px);
}

.shot__frame:hover .shot__expand,
.shot__expand:focus-visible {
  opacity: 1;
}

.shot__expand:hover {
  background: rgba(245, 158, 11, 0.9);
  color: #0c0f14;
}

.shot__expand svg {
  width: 16px;
  height: 16px;
}

.shot__caption {
  margin-top: 0.7rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Touch devices have no hover, so the control stays visible. */
@media (hover: none) {
  .shot__expand {
    opacity: 1;
  }
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 5rem 2.5rem 2.5rem;
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(6px);
}

.lightbox[open],
.lightbox.is-open {
  display: flex;
}

.lightbox__stage {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
}

.lightbox__img {
  display: block;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox__bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lightbox__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(12, 15, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
}

.lightbox__controls {
  display: flex;
  gap: 0.5rem;
}

.lightbox__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(20, 25, 34, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
}

/* display on .lightbox__btn would otherwise beat the hidden attribute. */
.lightbox__btn[hidden] {
  display: none;
}

.lightbox__btn:hover {
  background: var(--accent);
  color: #0c0f14;
  border-color: var(--accent);
}

body.lightbox-open {
  overflow: hidden;
}

/* ---------- Index cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
}

.card__kicker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

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

.card__more {
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 4.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.5rem;
  top: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: #0c0f14;
  background: var(--accent);
  border-radius: 9px;
}

.steps h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.steps p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem 1.5rem 1.5rem;
    background: #10151d;
    border-top: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    display: none;
  }

  .nav-menu[data-open="true"] {
    display: flex;
  }

  .nav-trigger {
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
  }

  .nav-panel {
    position: static;
    translate: none;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: transparent;
    border: 0;
    border-left: 2px solid var(--border);
    border-radius: 0;
    margin: 0 0 0.5rem 0.5rem;
    padding: 0 0 0 0.5rem;
    display: none;
  }

  .nav-group[data-open="true"] .nav-panel {
    display: block;
  }

  .nav-panel__grid {
    grid-template-columns: 1fr;
  }

  .nav-menu .nav-link {
    display: block;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
  }

  .nav-menu .btn {
    margin-top: 0.5rem;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .page-hero {
    padding: calc(6.5rem + var(--dev-banner-height)) 0 2.5rem;
  }

  .page-section {
    padding: 2.5rem 0;
  }

  .lightbox {
    padding: 3.75rem 1rem 1rem;
  }
}

/* ---------- Tunnel Mode demo ---------- */

.tunnel {
  padding: 3.5rem 0 4rem;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse 50% 60% at 80% 40%, rgba(245, 158, 11, 0.08), transparent 70%),
    linear-gradient(180deg, #10151d, #0c0f14);
}

.tunnel__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 3rem;
  align-items: center;
}

.tunnel__copy h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 0.9rem;
}

.tunnel__copy > p {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

/* Daylight / dark / dim are filters on the video, plus the tablet overlay. */
.tunnel__stage {
  position: relative;
  --world-light: 1;
  --world-sat: 1;
  --night: 0;
}

.tunnel__frame {
  position: relative;
  container-type: inline-size;
}

.tunnel-scene {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b0e13;
  filter: brightness(var(--world-light)) saturate(var(--world-sat));
  transition: filter 0.5s ease;
}

.tunnel-scene__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.tunnel-scene__night {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 8, 16, 0.92), rgba(6, 10, 18, 0.75));
  opacity: var(--night);
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.tunnel-device {
  position: absolute;
  right: 4%;
  top: 5%;
  width: 33cqw;
  z-index: 2;
}

.tunnel-device__bezel {
  padding: 1.2cqw;
  border-radius: 3cqw;
  background: #0b0e14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.tunnel-device__screen {
  border-radius: 2cqw;
  padding: 2cqw 1.9cqw 2.3cqw;
  background: #f4f7fb;
  color: #0f172a;
  transition: background 0.35s ease, color 0.35s ease, filter 0.35s ease;
}

.tunnel-device__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.5cqw;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  transition: color 0.35s ease;
}

.tunnel-device__title {
  margin: 0.95cqw 0 1.9cqw;
  font-size: 2.3cqw;
  font-weight: 700;
}

.tunnel-device__bars {
  display: grid;
  gap: 0.95cqw;
  margin-bottom: 2cqw;
}

.tunnel-device__bars span {
  display: block;
  height: 1.05cqw;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.35s ease, opacity 0.35s ease;
}

.tunnel-device__bars span:nth-child(1) { width: 92%; }
.tunnel-device__bars span:nth-child(2) { width: 74%; }
.tunnel-device__bars span:nth-child(3) { width: 83%; }

.tunnel-device__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.35cqw;
}

.tunnel-device__pill {
  font-size: 1.7cqw;
  font-weight: 700;
  padding: 0.76cqw 1.5cqw;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  transition: background 0.35s ease, color 0.35s ease;
}

.tunnel-device__slider {
  position: relative;
  flex: 1;
  height: 0.95cqw;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.35s ease;
}

.tunnel-device__slider i {
  position: absolute;
  top: 50%;
  left: 78%;
  width: 1.9cqw;
  height: 1.9cqw;
  border-radius: 50%;
  background: #f59e0b;
  translate: -50% -50%;
  transition: left 0.35s ease;
}

.tunnel__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.tunnel__btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.tunnel__btn:hover {
  color: var(--text);
  border-color: rgba(245, 158, 11, 0.4);
}

.tunnel__btn.is-active {
  color: #0c0f14;
  background: var(--accent);
  border-color: var(--accent);
}

.tunnel__caption {
  margin: 0.7rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Modes change the light on the video; the clip keeps looping. */
.tunnel__stage[data-mode="tunnel"] {
  --world-light: 0.46;
  --world-sat: 0.62;
  --night: 0.48;
}

.tunnel__stage[data-mode="dim"] {
  --world-light: 0.3;
  --world-sat: 0.4;
  --night: 0.7;
}

.tunnel__stage[data-mode="tunnel"] .tunnel-device__screen {
  background: #0f172a;
  color: #e2e8f0;
}

.tunnel__stage[data-mode="tunnel"] .tunnel-device__label {
  color: #94a3b8;
}

.tunnel__stage[data-mode="tunnel"] .tunnel-device__bars span {
  background: #334155;
}

.tunnel__stage[data-mode="tunnel"] .tunnel-device__pill {
  background: #f59e0b;
  color: #0c0f14;
}

.tunnel__stage[data-mode="tunnel"] .tunnel-device__slider {
  background: #334155;
}

.tunnel__stage[data-mode="dim"] .tunnel-device__screen {
  background: #0b1220;
  color: #cbd5e1;
  filter: brightness(0.55);
}

.tunnel__stage[data-mode="dim"] .tunnel-device__label {
  color: #64748b;
}

.tunnel__stage[data-mode="dim"] .tunnel-device__bars span {
  background: #1e293b;
  opacity: 0.85;
}

.tunnel__stage[data-mode="dim"] .tunnel-device__pill {
  background: #b45309;
  color: #fff7ed;
}

.tunnel__stage[data-mode="dim"] .tunnel-device__slider {
  background: #1e293b;
}

.tunnel__stage[data-mode="dim"] .tunnel-device__slider i {
  left: 28%;
}

@media (max-width: 900px) {
  .tunnel__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .tunnel-device {
    width: 36cqw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tunnel-scene,
  .tunnel-scene__night,
  .tunnel-device__screen,
  .tunnel-device__slider i {
    transition: none;
  }
}
