/* Homepage-specific layout for the Orbitron landing page. */

body:has(.landing-hero) #title-block-header {
  display: none;
}

.landing-hero {
  position: relative;
  min-height: clamp(520px, 76vh, 760px);
  width: 100vw;
  margin: -2rem calc(50% - 50vw) 0;
  overflow: hidden;
  background: #101820;
  color: #fff;
}

.landing-hero::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(9, 14, 20, 0.96) 0%, rgba(9, 14, 20, 0.80) 32%, rgba(9, 14, 20, 0.28) 55%, rgba(9, 14, 20, 0.04) 100%),
    linear-gradient(0deg, rgba(9, 14, 20, 0.56) 0%, rgba(9, 14, 20, 0.03) 42%);
  pointer-events: none;
}

.landing-hero-media {
  position: absolute;
  top: 50%;
  right: max(1rem, calc((100vw - 1380px) / 2));
  z-index: 0;
  width: min(66vw, 1100px);
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.7rem;
  background: #2c313b;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.48);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(12rem, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.65rem;
}

.landing-hero-scene {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 0.45rem;
  background: #3d444c;
}

.landing-hero-scene-primary {
  grid-row: 1 / 3;
}

.landing-hero-scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-hero-scene span {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.3rem;
  color: #fff;
  background: rgba(9, 14, 20, 0.78);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
}

.landing-hero-copy {
  position: relative;
  z-index: 2;
  width: 50vw;
  padding: 6rem 0 6rem max(2rem, calc((100vw - 1180px) / 2));
}

.landing-hero-copy h1 {
  margin: 0 0 1rem;
  color: inherit;
  font-size: 6.5rem;
  line-height: 0.92;
  letter-spacing: 0;
}

.landing-hero-copy p {
  max-width: 620px;
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.25rem;
  line-height: 1.45;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.landing-actions .btn {
  border-radius: 0.35rem;
  font-weight: 650;
}

.landing-actions .btn-secondary {
  color: #101820;
  background: #f2c14e;
  border-color: #f2c14e;
}

.landing-actions .btn-secondary:hover {
  color: #101820;
  background: #f6d16e;
  border-color: #f6d16e;
}

.landing-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem) 0 4rem;
}

.landing-main h2 {
  margin-top: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0;
}

.local-preview-notice {
  margin: 0 0 2rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(242, 193, 78, 0.55);
  border-radius: 0.45rem;
  background: rgba(242, 193, 78, 0.12);
  color: var(--bs-body-color);
}

.local-preview-notice code {
  white-space: nowrap;
}

.workflow-grid,
.example-grid,
.next-step-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 3rem;
}

.workflow-grid {
  /* auto-fit rather than a fixed count: the card list has grown from three to
     four and will grow again, and a hard `repeat(3, …)` leaves the fourth card
     stranded alone on its own row with a large gap beside it. */
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.example-grid {
  /* Same reason as .workflow-grid: a fixed column count strands the last tile
     whenever the list length is not a multiple of it. */
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
}

.next-step-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workflow-card,
.next-step {
  padding: 1.25rem;
  border: 1px solid rgba(127, 127, 127, 0.22);
  border-radius: 0.5rem;
  background: var(--bs-body-bg);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.06);
}

.workflow-card h3,
.next-step h3 {
  margin-top: 0;
  font-size: 1.12rem;
  letter-spacing: 0;
}

.workflow-card p,
.next-step p {
  margin-bottom: 0;
}

.example-viewer {
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
  text-align: center;
}

.example-viewer-frame {
  position: relative;
  height: 400px;
  margin-bottom: 0.45rem;
}

.example-viewer iframe,
.example-viewer-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(127, 127, 127, 0.28);
  border-radius: 0.5rem;
  background: #101820;
  object-fit: cover;
}

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 1.25rem;
}

.format-list code {
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 0.35rem;
  background: rgba(127, 127, 127, 0.10);
  color: var(--bs-body-color);
  font-size: 0.92rem;
}

.next-step h3 a {
  text-decoration: none;
}

@media (max-width: 900px) {
  .landing-hero {
    min-height: 760px;
  }

  .landing-hero::before {
    background:
      linear-gradient(0deg, rgba(9, 14, 20, 0.92) 0%, rgba(9, 14, 20, 0.64) 55%, rgba(9, 14, 20, 0.26) 100%);
  }

  .landing-hero-copy {
    width: min(620px, calc(100% - 2.5rem));
    padding: 23rem 0 1.5rem 1.25rem;
  }

  .landing-hero-media {
    top: 1rem;
    right: auto;
    left: 1rem;
    width: calc(100% - 2rem);
    height: 19rem;
    aspect-ratio: auto;
    box-sizing: border-box;
    transform: none;
  }

  .landing-hero-media {
    grid-template-columns: minmax(0, 1.55fr) minmax(8rem, 1fr);
  }

  .landing-hero-copy h1 {
    font-size: 4.5rem;
  }

  .landing-hero-copy p {
    font-size: 1.1rem;
  }

  .workflow-grid,
  .example-grid,
  .next-step-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .landing-hero {
    min-height: 810px;
  }

  .landing-hero-copy {
    padding-top: 20rem;
  }

  .landing-hero-media {
    height: 16rem;
  }

  .landing-hero-copy h1 {
    font-size: 3.5rem;
  }
}

/* Terminal recordings. Two side by side on desktop, stacked when narrow;
   auto-fit for the same reason the other grids use it. */
.cast-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 3rem;
  grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr));
}

.cast-item p {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--bs-secondary-color, #666);
}

.cast-fallback {
  min-height: 18rem;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border-radius: 0.35rem;
  color: #f2f2f2;
  background: #121314;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
}

.cast-fallback code {
  color: inherit;
  background: transparent;
}

.cast-fallback-tui {
  color: #b5e8ff;
}
