/* Header & navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  border-bottom: 1px solid var(--border);
}

.nav-wrapper {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.nav-menu-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.is-nav-open .nav-menu-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.site-header.is-nav-open .nav-menu-bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .nav-menu-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

body.nav-open {
  overflow: hidden;
}

.logo {
  flex-shrink: 0;
}

.logo img {
  width: 140px;
  height: auto;
  display: block;
}

.main-nav {
  margin-left: auto;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  min-width: 0;
}

.main-nav-primary {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-left: 48px;
}

.main-nav-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.main-nav a {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.main-nav-primary > a:hover,
.nav-dropdown > a:hover {
  color: var(--orange);
}

.nav-sign-in-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 10px 22px;
  border: 1px solid var(--orange);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.nav-sign-in-btn:hover {
  background: rgba(244, 124, 32, 0.12);
  border-color: var(--orange-light);
}

.nav-auth-link[hidden],
.nav-dashboard-link[hidden] {
  display: none;
}

/* Engines dropdown */

.nav-dropdown {
  position: relative;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 32px;
}

.dropdown-panel {
  position: fixed;
  top: 72px;
  left: 32px;
  right: 32px;
  padding-top: 16px;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    transform 0.18s ease,
    visibility 0s linear 0.18s;
}

.nav-dropdown:hover .dropdown-panel,
.dropdown-panel:hover {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.dropdown-engine {
  display: grid;
  grid-template-columns: 440px 240px 1fr 300px;
  gap: 20px;
  min-height: 360px;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-primary);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.dropdown-engine .engine-icon {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  min-height: 100px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.dropdown-engine .engine-icon::after {
  content: "POLE";
  font-family: var(--sans);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  line-height: 1;
  color: var(--text-primary);
}

.dropdown-engine .engine-icon svg {
  width: 50px;
  height: 50px;
}

.dropdown-engine > div {
  display: contents;
}

.dropdown-engine strong {
  display: none;
}

.dropdown-engine small {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  margin-top: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--orange);
}

.dropdown-engine p {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  max-width: 420px;
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.65;
}

.dropdown-engine ul {
  grid-column: 4;
  grid-row: 1;
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-engine li {
  padding: 8px 0;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dropdown-engine li::before {
  content: "✓";
  margin-right: 12px;
  color: var(--orange);
}

.engine-card {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.engine-card:hover {
  transform: translateY(-2px);
}

.engine-card .engine-icon {
  width: 100%;
}

.engine-link {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  color: var(--orange);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.engine-link:hover {
  color: var(--orange-light);
}

/* Shared UI elements */

.section-kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.68rem;
  color: var(--orange);
  margin: 0 0 12px;
}

.page-eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.68rem;
  color: var(--orange);
  margin: 0 0 12px;
}

.small-gold-line {
  width: 28px;
  height: 2px;
  background: var(--orange);
  margin-bottom: 24px;
}

.lead-text {
  max-width: 560px;
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 14px 28px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--mono);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.button-primary {
  border: 1px solid var(--orange);
  background: transparent;
  color: var(--text-primary);
}

.button-primary:hover {
  background: rgba(244, 124, 32, 0.12);
}

.button-secondary {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
}

.button-secondary:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
}

.button-gold {
  border: 1px solid var(--orange);
  background: var(--orange);
  color: var(--black);
}

.button-gold:hover {
  background: var(--orange-light);
}

/* Contact CTA section (home, pole) */

.home-contact-section {
  padding: 100px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.home-contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 80px;
  align-items: start;
}

.home-contact-section h2 {
  max-width: 520px;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 1.08;
}

.home-contact-section > .container > div > p,
.home-contact-section p {
  max-width: 520px;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

.home-contact-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  background: var(--surface);
}

.home-contact-card article {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-bottom: 28px;
}

.home-contact-card article:first-child {
  border-top: none;
  padding-top: 0;
}

.home-contact-card span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--orange);
}

.home-contact-card h3 {
  margin-top: 14px;
  font-size: 1.1rem;
}

.home-contact-card p {
  margin-top: 8px;
  font-size: 0.9rem;
}

.home-contact-card .button {
  margin-top: 8px;
}

/* Footer */

.site-footer {
  background: var(--black);
  color: var(--text-secondary);
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 48px;
}

.footer-logo {
  width: 160px;
  height: auto;
  margin-bottom: 20px;
}

.site-footer h4 {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  color: var(--orange);
  margin: 0;
}

.site-footer a {
  display: block;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--text-primary);
}

.site-footer p {
  max-width: 320px;
  font-size: 0.9rem;
  line-height: 1.65;
}

@media (min-width: 1280px) {
  .main-nav-primary {
    margin-left: 64px;
    gap: 56px;
  }

  .dropdown-panel {
    left: max(32px, calc((100vw - var(--container-max)) / 2));
    right: max(32px, calc((100vw - var(--container-max)) / 2));
  }

  .home-contact-grid {
    gap: 96px;
  }

  .home-contact-section h2,
  .home-contact-section > .container > div > p,
  .home-contact-section p {
    max-width: 620px;
  }

  .footer-grid {
    gap: 64px;
  }
}

@media (min-width: 1536px) {
  .home-contact-section {
    padding: 112px 0;
  }

  .site-footer {
    padding: 80px 0;
  }

  .lead-text {
    max-width: 640px;
  }
}

/* Responsive */

@media (max-width: 1024px) {
  .home-contact-section {
    padding: 80px 0;
  }

  .home-contact-grid {
    gap: 48px;
  }

  .site-footer {
    padding: 56px 0;
  }
}

@media (max-width: 900px) {
  .home-contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .dropdown-panel {
    left: 16px;
    right: 16px;
  }

  .dropdown-engine {
    grid-template-columns: 1fr;
    padding: 28px;
    min-height: auto;
  }

  .dropdown-engine .engine-icon,
  .engine-card {
    grid-column: 1;
    grid-row: auto;
  }

  .dropdown-engine small,
  .dropdown-engine p,
  .dropdown-engine ul,
  .engine-link {
    grid-column: 1;
    grid-row: auto;
  }

  .button {
    min-width: 0;
    width: 100%;
    max-width: 320px;
  }

  .home-contact-card {
    padding: 28px;
  }
}

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

  .logo img {
    width: 118px;
  }

  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    margin-left: 0;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 20px 24px 32px;
    background: rgba(9, 9, 9, 0.98);
    border-top: 1px solid var(--border);
    overflow-y: auto;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition:
      transform 0.24s ease,
      opacity 0.24s ease,
      visibility 0s linear 0.24s;
  }

  .site-header.is-nav-open .main-nav {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }

  .main-nav-primary,
  .main-nav-actions {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .main-nav-primary {
    gap: 0;
  }

  .main-nav-primary > a,
  .nav-dropdown > a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }

  .main-nav-actions {
    margin-top: 20px;
  }

  .nav-sign-in-btn {
    width: 100%;
    max-width: none;
    min-height: 48px;
  }

  .nav-dropdown::after {
    display: none;
  }

  .dropdown-panel {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    padding-top: 0;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }

  .nav-dropdown.is-open .dropdown-panel {
    max-height: 900px;
    opacity: 1;
    margin-bottom: 12px;
  }

  .nav-dropdown:hover .dropdown-panel {
    transform: none;
  }

  .dropdown-engine {
    margin-top: 8px;
    padding: 20px;
  }

  .dropdown-engine li {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .site-footer {
    padding: 48px 0;
  }

  .footer-logo {
    width: 132px;
  }

  .home-contact-section {
    padding: 56px 0;
  }

  .home-contact-section h2 {
    font-size: clamp(1.75rem, 8vw, 2.4rem);
  }
}

@media (max-width: 480px) {
  .nav-wrapper {
    height: 64px;
  }

  .main-nav {
    top: 64px;
    padding-inline: 16px;
  }

  .logo img {
    width: 104px;
  }
}
