/* Circuit 40s parent homepage
   Cinematic infrastructure narrative with white editorial systems sections. */

.parent-page {
  background: #11100e;
  color: var(--text);
}

.parent-page .site-header--dark {
  background: rgba(17, 16, 14, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.parent-page .nav-container,
.parent-page .container {
  max-width: 1760px;
  padding-left: clamp(24px, 4vw, 76px);
  padding-right: clamp(24px, 4vw, 76px);
}

.parent-page .nav-container {
  max-width: none;
}

.parent-page .btn,
.parent-page .nav-link,
.parent-page .nav-item-btn,
.parent-page .nav-dropdown,
.parent-page .nav-dropdown-row,
.parent-page .nav-dropdown-tag {
  border-radius: 0;
}

.parent-nav-logo img,
.parent-footer .footer-logo {
  filter: none;
  opacity: 1;
}

.parent-nav-logo img { height: 30px; }

.parent-page .nav-dropdown {
  background: #10100f;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 70px rgba(17, 16, 14, 0.44);
}

.parent-page .nav-dropdown-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.parent-page .nav-dropdown-row:hover .nav-dropdown-tag {
  border-color: rgba(193, 15, 29, 0.7);
  color: var(--accent);
}

.parent-page .nav-dropdown-tag {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: #a6a09a;
}

.parent-page .nav-dropdown-name { color: var(--text-inv); }
.parent-page .nav-dropdown-desc { color: var(--text-inv-dim); }

.parent-btn {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  padding: 15px 24px;
  border-radius: 0;
  border: 0;
  letter-spacing: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(17, 16, 14, 0.16);
}

.parent-btn::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  opacity: 0.7;
  pointer-events: none;
}

.parent-btn-primary {
  min-width: 278px;
  background: rgba(237, 233, 227, 0.15);
  backdrop-filter: blur(20px) saturate(1.08);
  -webkit-backdrop-filter: blur(20px) saturate(1.08);
  color: var(--text-inv);
}

.parent-btn-primary:hover {
  background: rgba(237, 233, 227, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 20px 48px rgba(17, 16, 14, 0.2),
    0 0 0 1px rgba(193, 15, 29, 0.2);
}

.parent-btn-secondary {
  background: rgba(237, 233, 227, 0.07);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  color: #d8d1c8;
}

.parent-btn-secondary:hover {
  background: rgba(237, 233, 227, 0.105);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 16px 40px rgba(17, 16, 14, 0.16),
    0 0 0 1px rgba(193, 15, 29, 0.18);
  color: var(--text-inv);
}

.parent-btn-light {
  min-width: 230px;
  background: rgba(17, 16, 14, 0.9);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 44px rgba(17, 16, 14, 0.14);
}

.parent-btn-light:hover {
  background: rgba(23, 22, 20, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(193, 15, 29, 0.2),
    0 18px 44px rgba(17, 16, 14, 0.16);
}

.parent-btn-light-secondary {
  background: rgba(17, 16, 14, 0.035);
  color: #111;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.parent-btn-light-secondary:hover {
  background: rgba(17, 16, 14, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 0 1px rgba(193, 15, 29, 0.28);
  color: #0d0d0d;
}

.parent-page .section-rule { margin-bottom: 22px; }

.parent-page .section-rule--inv { color: #89847d; }
.parent-page .section-rule--inv::before { background: rgba(237, 233, 227, 0.32); }

.section-rule--light {
  color: #727272;
}

.section-rule--light::before {
  background: #111;
}

/* Hero */

.parent-hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100dvh - var(--nav-h));
  padding: clamp(72px, 7vh, 98px) 0 54px;
  color: var(--text-inv);
  background: #11100e;
}

.parent-hero::before,
.parent-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.parent-hero::before {
  background-image:
    linear-gradient(rgba(237, 233, 227, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 233, 227, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, rgba(17, 16, 14, 0.9), transparent 82%);
}

.parent-hero::after {
  background: rgba(17, 16, 14, 0.18);
}

.hero-art {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, #11100e 0%, rgba(17, 16, 14, 0.78) 25%, rgba(17, 16, 14, 0.18) 70%, #11100e 100%),
    url("/images/generated/circuit-operational-layer-hero.webp");
  background-size: cover;
  background-position: center right;
  opacity: 0.82;
  filter: saturate(0.82) contrast(1.08);
}

.parent-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: min(640px, calc(100dvh - 176px));
}

.hero-statement {
  width: 100%;
  text-align: center;
  padding-top: 18px;
}

.hero-statement .section-rule {
  justify-content: center;
}

.hero-statement h1 {
  color: var(--text-inv);
  margin: 0 auto;
  max-width: 1500px;
  font-size: clamp(3.65rem, 8vw, 9rem);
  line-height: 0.86;
  font-weight: 600;
  letter-spacing: -0.055em;
}

.hero-lower {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(420px, 0.58fr);
  gap: clamp(48px, 8vw, 148px);
  align-items: end;
  margin-top: clamp(40px, 6vh, 72px);
}

.hero-copy {
  max-width: 690px;
  padding-bottom: 10px;
}

.hero-copy .hero-sub {
  max-width: 690px;
  margin-top: 0;
  color: #b8b0a5;
  font-size: clamp(1.05rem, 1.25vw, 1.22rem);
  line-height: 1.62;
}

.hero-system-panel {
  align-self: end;
  border: 0;
  background: linear-gradient(180deg, rgba(32, 31, 28, 0.74), rgba(18, 17, 15, 0.66));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 34px 90px rgba(17, 16, 14, 0.46);
}

.system-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(237, 233, 227, 0.1);
  color: #817b73;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.system-flow {
  display: grid;
  gap: 1px;
  background: rgba(237, 233, 227, 0.08);
}

.system-node {
  position: relative;
  padding: 18px 18px 18px 54px;
  background: rgba(12, 11, 10, 0.88);
}

.system-node::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(12, 104, 86, 0.48);
}

.system-node span {
  position: absolute;
  left: 14px;
  top: 18px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(12, 104, 86, 0.58);
  background: #0c0b0a;
  color: #6fb19d;
  font-size: 10px;
  font-family: var(--font-mono);
}

.system-node.is-active span {
  border-color: rgba(193, 15, 29, 0.7);
  color: var(--accent);
}

.system-node strong {
  display: block;
  color: var(--text-inv);
  font-size: var(--text-sm);
  font-weight: 600;
}

.system-node small {
  display: block;
  margin-top: 4px;
  color: #8f887f;
  font-size: var(--text-xs);
  line-height: 1.5;
}

/* Light editorial system */

.light-transition {
  position: relative;
  padding: 26px 0;
  background: #fff;
  border-top: 1px solid #d6d6d6;
}

.transition-line {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding-top: 22px;
  border-top: 1px solid #d9d9d9;
  color: #5b5b5b;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.light-section {
  background: #fff;
  color: #0c0c0b;
}

.problem-section,
.layer-section,
.operating-section,
.network-section,
.thesis-section,
.parent-cta {
  position: relative;
  border-top: 1px solid #e1e1e1;
}

.problem-section { padding: 122px 0 108px; }
.layer-section,
.operating-section,
.network-section,
.thesis-section { padding: 116px 0; }

.editorial-grid,
.layer-grid,
.operating-header,
.network-header,
.thesis-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1fr);
  gap: clamp(72px, 9vw, 180px);
  align-items: start;
}

.section-kicker h2,
.layer-grid h2,
.operating-header h2,
.network-header h2,
.thesis-statement h2,
.parent-cta h2 {
  color: #0c0c0b;
}

.section-kicker h2,
.layer-grid h2,
.operating-header h2,
.network-header h2,
.thesis-statement h2 {
  max-width: 820px;
  font-size: clamp(1.95rem, 3.1vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -0.038em;
}

.editorial-copy p,
.layer-copy p,
.operating-header p,
.network-header p,
.thesis-statement p,
.parent-cta p {
  color: #4b4b49;
  font-size: clamp(1rem, 1.05vw, 1.15rem);
  line-height: 1.72;
}

.editorial-copy p + p,
.layer-copy p + p { margin-top: 24px; }

.failure-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 72px;
  margin-left: calc(clamp(24px, 4vw, 76px) * -0.28);
  margin-right: calc(clamp(24px, 4vw, 76px) * -0.28);
  border-top: 1px solid #d8d8d8;
  border-bottom: 1px solid #d8d8d8;
}

.failure-item {
  min-height: 190px;
  padding: 26px 24px;
  border-right: 1px solid #d8d8d8;
  background: #fff;
  transition: background 0.22s, border-color 0.22s;
}

.failure-item:last-child { border-right: 0; }

.failure-item span,
.operating-card span,
.thesis-line span {
  display: block;
  color: #767676;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  transition: color 0.22s;
}

.failure-item p {
  margin-top: 58px;
  color: #111;
  line-height: 1.55;
}

.failure-item:hover { background: #fafafa; }
.failure-item:hover span { color: var(--accent); }

.coordination-matrix {
  margin-top: 76px;
  border: 1px solid #d9d9d9;
  display: grid;
}

.matrix-row {
  display: grid;
  grid-template-columns: 0.55fr 1fr 1fr;
  border-bottom: 1px solid #d9d9d9;
}

.matrix-row:last-child { border-bottom: 0; }

.matrix-row > span {
  padding: 22px;
  border-right: 1px solid #d9d9d9;
  color: #4f4f4d;
  font-size: var(--text-sm);
  line-height: 1.55;
}

.matrix-row > span:last-child { border-right: 0; }
.matrix-row > span:first-child {
  color: #0c0c0b;
  font-weight: 600;
}

.matrix-head > span {
  color: #777;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #f7f7f7;
}

.matrix-head > span:first-child { color: #777; }

.operating-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 60px;
  margin-left: calc(clamp(24px, 4vw, 76px) * -0.28);
  margin-right: calc(clamp(24px, 4vw, 76px) * -0.28);
  border-top: 1px solid #d8d8d8;
  border-bottom: 1px solid #d8d8d8;
}

.operating-card {
  min-height: 318px;
  padding: 30px 24px;
  border-right: 1px solid #d8d8d8;
  background: #fff;
  transition: background 0.22s;
}

.operating-card:last-child { border-right: 0; }
.operating-card:hover { background: #fbfbfb; }
.operating-card:hover span { color: var(--accent); }

.operating-card h3 {
  margin-top: 70px;
  color: #0c0c0b;
  font-size: var(--text-xl);
}

.operating-card p {
  margin-top: 16px;
  color: #575755;
  font-size: var(--text-sm);
  line-height: 1.65;
}

/* Interactive product portals */

.network-section {
  overflow: hidden;
}

.network-header {
  margin-bottom: 68px;
}

.product-portals {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 126px;
  gap: clamp(24px, 2.2vw, 42px);
  margin-left: calc(clamp(24px, 4vw, 76px) * -0.45);
  margin-right: calc(clamp(24px, 4vw, 76px) * -0.45);
}

.product-portal {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 460px;
  grid-column: span 5;
  grid-row: span 4;
  color: #fff;
  border: 1px solid #d8d8d8;
  background: #0b0b0a;
  isolation: isolate;
  cursor: pointer;
}

.product-portal--large {
  grid-column: 1 / span 8;
  grid-row: span 5;
}

.product-portal--tall {
  grid-column: 9 / span 4;
  grid-row: span 6;
}

.product-portal--wide {
  grid-column: 2 / span 7;
  grid-row: span 4;
  margin-top: -88px;
}

.product-portal:nth-child(4) {
  grid-column: 9 / span 3;
  grid-row: span 4;
}

.product-portal img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.55s ease, filter 0.55s ease;
}

.portal-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(17, 16, 14, 0.1), rgba(17, 16, 14, 0.64)),
    linear-gradient(90deg, rgba(17, 16, 14, 0.42), transparent 64%);
  transition: background 0.4s ease;
}

.product-portal::before,
.product-portal::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.product-portal::before {
  inset: 0;
  border-top: 2px solid var(--accent);
  opacity: 0;
  transform: scaleX(0.22);
  transform-origin: left;
}

.product-portal::after {
  right: 22px;
  top: 22px;
  width: 46px;
  height: 46px;
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-right: 1px solid rgba(255, 255, 255, 0.8);
  opacity: 0.42;
}

.portal-shell {
  min-height: 100%;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portal-label span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  transition: color 0.25s ease;
}

.portal-label strong {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-size: clamp(1.35rem, 2.05vw, 2.25rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.portal-copy {
  max-width: 440px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.portal-copy h3 {
  color: #fff;
  font-size: clamp(1.25rem, 1.85vw, 2rem);
  line-height: 1.05;
}

.portal-copy p {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.portal-copy > span {
  display: inline-flex;
  margin-top: 22px;
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
}

.product-portal:hover img,
.product-portal:focus-visible img {
  transform: scale(1.055);
  filter: saturate(0.86) contrast(1.08);
}

.product-portal:hover .portal-scrim,
.product-portal:focus-visible .portal-scrim {
  background:
    linear-gradient(180deg, rgba(17, 16, 14, 0.26), rgba(17, 16, 14, 0.9)),
    linear-gradient(90deg, rgba(17, 16, 14, 0.58), transparent 64%);
}

.product-portal:hover::before,
.product-portal:focus-visible::before {
  opacity: 1;
  transform: scaleX(1);
}

.product-portal:hover .portal-label span,
.product-portal:focus-visible .portal-label span {
  color: var(--accent);
}

.product-portal:hover .portal-copy,
.product-portal:focus-visible .portal-copy {
  opacity: 1;
  transform: translateY(0);
}

.product-portal:focus-visible {
  outline: 3px solid rgba(193, 15, 29, 0.45);
  outline-offset: 4px;
}

.thesis-statement {
  position: sticky;
  top: 108px;
}

.thesis-stack {
  border-top: 1px solid #d8d8d8;
}

.thesis-line {
  display: grid;
  grid-template-columns: 0.4fr 1fr;
  gap: 32px;
  padding: 34px 0;
  border-bottom: 1px solid #d8d8d8;
}

.thesis-line:hover span { color: var(--accent); }

.thesis-line p {
  color: #242422;
  font-size: var(--text-lg);
  line-height: 1.6;
}

.parent-cta {
  padding: 128px 0 116px;
  overflow: hidden;
}

.parent-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(17, 16, 14, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 16, 14, 0.035) 1px, transparent 1px);
  background-size: 96px 96px;
  pointer-events: none;
}

.parent-cta-inner {
  position: relative;
  max-width: 1080px;
}

.parent-cta h2 {
  font-size: clamp(2.15rem, 4vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.parent-cta p {
  max-width: 720px;
  margin-top: 28px;
}

.parent-cta .hero-ctas { margin-top: 38px; }

.parent-footer {
  background: #fff;
  border-top-color: #e1e1e1;
  color: #111;
}

.parent-footer .footer-copy,
.parent-footer .footer-links a {
  color: #60605d;
}

.parent-footer .footer-links a:hover {
  color: #111;
}

@media (prefers-reduced-motion: reduce) {
  .product-portal,
  .product-portal *,
  .failure-item,
  .operating-card,
  .thesis-line {
    transition: none !important;
  }

  .product-portal:hover img,
  .product-portal:focus-visible img {
    transform: scale(1.01);
  }
}

@media (max-width: 1100px) {
  .hero-lower,
  .editorial-grid,
  .layer-grid,
  .operating-header,
  .network-header,
  .thesis-grid {
    grid-template-columns: 1fr;
  }

  .parent-hero-inner {
    min-height: auto;
  }

  .hero-lower {
    gap: 48px;
  }

  .hero-system-panel,
  .thesis-statement {
    position: relative;
    top: auto;
  }

  .failure-strip,
  .operating-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .failure-item:nth-child(2),
  .operating-card:nth-child(2) {
    border-right: 0;
  }

  .failure-item:nth-child(-n + 2),
  .operating-card:nth-child(-n + 2) {
    border-bottom: 1px solid #d8d8d8;
  }

  .product-portals {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 96px;
    margin-left: 0;
    margin-right: 0;
  }

  .product-portal,
  .product-portal--large,
  .product-portal--tall,
  .product-portal--wide,
  .product-portal:nth-child(4) {
    grid-column: span 3;
    grid-row: span 4;
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .parent-hero { padding: 82px 0 56px; }

  .hero-art {
    opacity: 0.5;
    background-position: 64% center;
  }

  .hero-statement {
    text-align: left;
    padding-top: 28px;
  }

  .hero-statement .section-rule {
    justify-content: flex-start;
  }

  .hero-statement h1 {
    font-size: clamp(2.7rem, 14vw, 4.8rem);
    line-height: 0.9;
  }

  .hero-copy .hero-sub { font-size: var(--text-base); }
  .hero-lower { margin-top: 56px; }

  .hero-ctas { align-items: stretch; }
  .parent-btn { width: 100%; }

  .transition-line {
    flex-direction: column;
    gap: 12px;
  }

  .problem-section,
  .layer-section,
  .operating-section,
  .network-section,
  .thesis-section,
  .parent-cta {
    padding: 78px 0;
  }

  .failure-strip,
  .operating-grid {
    grid-template-columns: 1fr;
    margin-left: 0;
    margin-right: 0;
  }

  .failure-item,
  .operating-card {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #d8d8d8;
  }

  .failure-item:last-child,
  .operating-card:last-child {
    border-bottom: 0;
  }

  .failure-item p,
  .operating-card h3 {
    margin-top: 34px;
  }

  .matrix-row {
    grid-template-columns: 1fr;
  }

  .matrix-head { display: none; }

  .matrix-row > span {
    border-right: 0;
    border-bottom: 1px solid #d9d9d9;
  }

  .matrix-row > span:last-child {
    border-bottom: 0;
  }

  .product-portals {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .product-portal,
  .product-portal--large,
  .product-portal--tall,
  .product-portal--wide,
  .product-portal:nth-child(4) {
    grid-column: 1;
    grid-row: auto;
    min-height: 420px;
  }

  .portal-copy {
    opacity: 1;
    transform: translateY(0);
  }

  .portal-shell {
    padding: 24px;
  }

  .thesis-line {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .parent-nav-logo img { height: 19px; }
}
