/* ============================================
   SECTIONS
   Section-specific styles for the landing page.
   ============================================ */

/* Skip-to-content link (WCAG 2.4.1 Bypass Blocks) */
.skip-nav {
  position: absolute;
  top: -100%;
  left: var(--spacing-md);
  z-index: 1000;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-accent);
  transition: top 0.2s ease;
}

.skip-nav:focus {
  top: var(--spacing-sm);
}

/* Header with burnt orange accent bar */
#site-header {
  border-top: 3px solid var(--color-accent);
  padding: var(--spacing-md) 0;
}

.header__inner {
  display: flex;
  align-items: center;
}

.header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: var(--color-text);
}

.header__logo {
  display: block;
  border-radius: 6px;
}

.header__wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-lg);
  letter-spacing: -0.02em;
}

/* ---- Terminal Component ---- */
.terminal {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-code);
}

.terminal__titlebar {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(0, 0, 0, 0.2);
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal__dot--red { background: #FF5F57; }
.terminal__dot--yellow { background: #FFBD2E; }
.terminal__dot--green { background: #28C840; }

.terminal__body {
  display: flex;
  align-items: center;
  padding: var(--spacing-lg);
  gap: var(--spacing-sm);
}

.terminal__prompt {
  color: var(--color-accent);
  user-select: none;
}

.terminal__command {
  flex: 1;
  color: var(--color-text);
  font-size: var(--fs-lg);
}

.terminal__copy {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--spacing-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  min-width: 44px;
  min-height: 44px;
  opacity: 0.6;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.terminal__copy:hover {
  color: var(--color-text);
  opacity: 1;
}

.terminal__copy-success {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #28C840;
  font-family: var(--font-code);
  line-height: 1;
  margin-top: 2px;
}

/* Hero variant: prominent CTA terminal with glow */
.terminal--hero {
  border: 1px solid var(--color-accent);
  box-shadow:
    0 0 30px rgba(232, 93, 58, 0.3),
    0 0 80px rgba(232, 93, 58, 0.15),
    0 0 150px rgba(232, 93, 58, 0.08);
}

.terminal--hero .terminal__body {
  padding: var(--spacing-lg);
}

.terminal--hero .terminal__command {
  font-size: var(--fs-xl);
}

/* Compact variant: smaller sizing */
.terminal--compact .terminal__body {
  padding: var(--spacing-md) var(--spacing-lg);
}

.terminal--compact .terminal__command {
  font-size: var(--fs-base);
}

/* ---- Hero Section ---- */
#hero {
  padding: var(--spacing-lg) 0 var(--spacing-md);
  position: relative;
  overflow: hidden;
}

#hero::before {
  display: none;
}

#hero::after {
  display: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero__content {
  text-align: left;
}

.hero__cta {
  text-align: left;
}

#hero h1 {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--fs-3xl);
  font-family: var(--font-heading);
  color: var(--color-text);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

.hero__logo {
  display: block;
  border-radius: 8px;
  flex-shrink: 0;
}

.hero__tagline {
  font-size: var(--fs-xl);
  color: var(--color-text);
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

.hero__description {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  max-width: 500px;
  line-height: 1.6;
}

/* Demo video placeholder (inside side-by-side layout) */
.demo {
  width: 100%;
}

.demo__placeholder {
  aspect-ratio: 16 / 9;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(232, 93, 58, 0.5);
  box-shadow:
    0 0 30px rgba(232, 93, 58, 0.25),
    0 0 80px rgba(232, 93, 58, 0.12),
    0 0 150px rgba(232, 93, 58, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.demo__play-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

.demo__play-btn:hover {
  filter: brightness(1.1);
}

.demo__title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--color-text);
  margin-top: var(--spacing-md);
}

.demo__subtitle {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
}

.hero__cta-footer {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.hero__cta-label {
  font-size: var(--fs-sm);
  font-family: var(--font-heading);
  color: var(--color-text-muted);
  font-weight: 500;
}

.hero__github-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px var(--spacing-md);
  background: var(--color-accent);
  color: var(--color-bg);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--fs-sm);
  transition: opacity 0.2s ease;
}

.hero__github-btn:hover {
  opacity: 0.85;
}

.hero__github-btn img {
  display: inline-block;
}

#hero .terminal {
  max-width: 100%;
}

/* ---- How It Works Section ---- */
#how-it-works h2 {
  text-align: center;
  font-size: var(--fs-2xl);
  font-family: var(--font-heading);
  color: var(--color-text);
  margin-top: var(--spacing-md);
  margin-bottom: 2.5rem;
  font-weight: 700;
}

/* Side-by-side layout: video left, pipeline right */
.hiw__layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: var(--spacing-lg);
  align-items: center;
}

/* Pipeline: horizontal timeline with alternating content above/below */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
  padding: 0;
  overflow: visible;
  height: 220px;
}

/* Horizontal connecting line through the middle */
.pipeline__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--color-accent);
  z-index: 0;
  transform: translateY(-50%);
}

/* Arrow at the end of the line */
.pipeline__line::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--color-accent);
}

.pipeline__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
  gap: 8px;
  padding: 0 6px;
}

/* Above steps: content on top, dot aligned to center line */
.pipeline__step--above {
  justify-content: flex-end;
  align-self: start;
  height: calc(50% + 16px);
}

/* Below steps: dot aligned to center line, content below */
.pipeline__step--below {
  justify-content: flex-start;
  align-self: end;
  height: calc(50% + 16px);
}

.pipeline__content {
  max-width: 200px;
}

.pipeline__dot {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--color-bg);
  flex-shrink: 0;
}

.pipeline__title {
  font-size: 1.2rem;
  font-family: var(--font-heading);
  color: var(--color-text);
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pipeline__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.pipeline__icon {
  display: none;
}

.pipeline__title-icon {
  width: 31px;
  height: 31px;
  flex-shrink: 0;
  color: var(--color-accent);
}

/* Hide old SVG line */
.pipeline__line-svg {
  display: none;
}

.pipeline__line-path {
  display: none;
}

/* ---- Integrations Section ---- */
#integrations {
  margin-top: -2rem;
  padding-bottom: 5rem;
  position: relative;
}

@media (max-width: 768px) {
  #integrations {
    margin-top: var(--spacing-lg);
  }
}

#integrations h2 {
  font-size: var(--fs-2xl);
  font-family: var(--font-heading);
  color: var(--color-text);
  margin-bottom: var(--spacing-xs);
  font-weight: 700;
}

.integrations__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: center;
}

.integrations__text {
  text-align: left;
}

.integrations__text h2 {
  text-align: left;
}

.integrations__text .integrations__subtitle {
  margin-bottom: var(--spacing-md);
}

.integrations__subtitle {
  color: var(--color-text-muted);
  font-size: var(--fs-lg);
  margin-bottom: var(--spacing-xl);
}

/* Spider / Hub Diagram */
.spider {
  position: relative;
  top: 6rem;
  width: 460px;
  height: 460px;
  margin: 0 auto;
}

.spider__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-accent);
  z-index: 2;
}

.spider__hub-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: none;
  border: none;
  filter: drop-shadow(0 0 12px rgba(232, 93, 58, 0.5))
          drop-shadow(0 0 40px rgba(232, 93, 58, 0.25));
}

.spider__hub-logo svg,
.spider__hub-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.spider__hub::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(
    circle at center,
    rgba(232, 93, 58, 0.35) 0%,
    rgba(232, 93, 58, 0.18) 30%,
    rgba(232, 93, 58, 0.06) 55%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.spider__node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: rgba(50, 45, 42, 0.9);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.spider__node:hover {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.spider__node--1 { top: 5%; left: 50%; }
.spider__node--2 { top: 30%; left: 90%; }
.spider__node--3 { top: 75%; left: 80%; }
.spider__node--4 { top: 75%; left: 20%; }
.spider__node--5 { top: 30%; left: 10%; }

.spider__logo {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: block;
  object-fit: contain;
}


.spider__lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.spider__lines line {
  stroke: rgba(232, 93, 58, 0.4);
  stroke-width: 0.6;
}

.spider__label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.spider__node--1 .spider__label {
  bottom: auto;
  top: -22px;
}

.integrations__more {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  margin-top: var(--spacing-sm);
  font-style: italic;
}

/* ---- Footer ---- */
#site-footer {
  padding: var(--spacing-md) 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#site-footer .container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.footer__github-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  text-decoration: none;
  font-weight: 500;
  font-size: var(--fs-sm);
  transition: background 0.2s ease;
}

.footer__github-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.footer__github-btn img {
  display: inline-block;
  opacity: 0.8;
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
}

.footer__social-link:hover {
  color: var(--color-accent);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer__logo {
  display: block;
  border-radius: 4px;
}

.footer__text {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
}

.footer__license {
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   Desktop-first: base styles above are 1024px+.
   Media queries below scale down for smaller viewports.
   ============================================ */

/* ---- Tablet: max-width 768px ---- */
@media (max-width: 768px) {
  section {
    padding: var(--spacing-xl) 0;
  }

  /* Hero scaling */
  #hero {
    padding: var(--spacing-md) 0;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    text-align: center;
  }

  .hero__content {
    text-align: center;
  }

  .hero__cta {
    text-align: center;
  }

  #hero h1 {
    font-size: var(--fs-2xl);
    justify-content: center;
  }

  .hero__tagline {
    font-size: var(--fs-lg);
  }

  .hero__description {
    font-size: var(--fs-base);
  }

  .terminal--hero .terminal__command {
    font-size: var(--fs-base);
  }

  .terminal--hero,
  .terminal--compact {
    max-width: 100%;
  }

  /* How It Works: stack vertically */
  .hiw__layout {
    grid-template-columns: 1fr;
  }

  .pipeline {
    grid-template-columns: 1fr;
    height: auto;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
  }

  .pipeline__line {
    display: none;
  }

  .pipeline__step,
  .pipeline__step--above,
  .pipeline__step--below {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    padding: 0;
    gap: 12px;
    align-self: auto;
  }

  .pipeline__step--above {
    flex-direction: row;
  }

  .pipeline__step--above .pipeline__content {
    order: 2;
  }

  .pipeline__step--above .pipeline__dot {
    order: 1;
  }

  .pipeline__content {
    max-width: none;
  }

  .pipeline__title {
    justify-content: flex-start;
  }

  #hero::after {
    height: 80px;
  }

  /* Integrations: stack on tablet */
  .integrations__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .integrations__text {
    text-align: center;
  }

  .integrations__text h2 {
    text-align: center;
  }

  .spider {
    top: 0;
  }

  /* Spider diagram: scale down */
  .spider {
    width: 340px;
    height: 340px;
  }

  .spider__hub::before {
    width: 250px;
    height: 250px;
  }

  .spider__node {
    width: 60px;
    height: 60px;
  }

  .spider__logo {
    width: 34px;
    height: 34px;
  }

}

/* ---- Mobile: max-width 480px ---- */
@media (max-width: 480px) {
  section {
    padding: var(--spacing-sm) 0;
  }

  #hero {
    padding: var(--spacing-sm) 0;
  }

  #hero h1 {
    font-size: var(--fs-xl);
    justify-content: center;
  }

  .hero__logo {
    width: 36px;
    height: 36px;
  }

  .hero__tagline {
    font-size: var(--fs-lg);
  }

  /* Section headings: smaller on mobile */
  #how-it-works h2,
  #integrations h2 {
    font-size: var(--fs-xl);
  }

  .terminal--hero .terminal__command {
    font-size: var(--fs-sm);
  }

  .terminal--hero .terminal__body {
    padding: var(--spacing-md);
  }

  .pipeline__title-icon {
    width: 20px;
    height: 20px;
  }

  .pipeline__title {
    font-size: var(--fs-base);
  }

  .pipeline__desc {
    font-size: var(--fs-xs);
  }

  .spider__label {
    font-size: 8px;
    bottom: -18px;
  }

  .spider__node--1 .spider__label {
    top: -18px;
  }

  /* Spider diagram: proportional scale to fit 320px viewport */
  .spider {
    width: 280px;
    height: 280px;
  }

  .spider__hub::before {
    width: 180px;
    height: 180px;
  }

  .spider__node {
    width: 50px;
    height: 50px;
  }

  .spider__logo {
    width: 28px;
    height: 28px;
  }

  /* Container: tighter side padding */
  .container {
    padding: 0 var(--spacing-md);
  }
}
