/* Homepage layout — additive to style.css */

/* Neutralize legacy hero entrance (style.css) so .reveal can own it */
.hero-logo,
.hero h1,
.hero p,
.hero-actions,
.hero .swiss-made {
  opacity: 1;
  animation: none;
  transform: none;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88dvh, 720px);
  display: grid;
  align-items: end;
  color: var(--white);
  overflow: hidden;
  background: var(--steel);
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(108deg, rgba(14, 20, 16, 0.93) 0%, rgba(14, 20, 16, 0.62) 48%, rgba(14, 20, 16, 0.28) 100%),
    url("../assets/images/Nema17_Nema23.jpg") center 40% / cover no-repeat;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  padding: 5.5rem 0 4.25rem;
}

.swiss-made {
  display: inline-flex;
  margin: 0 0 0.95rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  margin: 0 0 0.45rem;
  color: var(--mint);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(2.15rem, 5vw, 3.4rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 12ch;
}

.hero-lead {
  margin: 0 0 1.5rem;
  max-width: 40ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Quiet entrance — opacity + short rise only */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 520ms var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 55ms);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-inview] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 480ms var(--ease-out),
    transform 480ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 50ms);
}

[data-inview].is-inview {
  opacity: 1;
  transform: translateY(0);
}

/* Tech / FOC */
.tech {
  padding: var(--section) 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.tech-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker-light { color: var(--mint); }

.tech h2,
.products .section-head h2,
.control .section-head h2,
.close h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-transform: none;
}

.tech-copy > p,
.products .section-head p,
.control .section-head p,
.close p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.tech-points {
  list-style: none;
  margin: 1.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.tech-points li {
  padding-left: 0.9rem;
  border-left: 2px solid var(--brand);
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.tech-points strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.15rem;
}

/* FOC d-q vector diagram — Id (flux), Iq (torque), Is */
.dq-panel {
  margin: 0;
  width: min(100%, 340px);
  justify-self: end;
}

.dq-svg {
  display: block;
  width: 100%;
  height: auto;
  background: #eef1ee;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dq-label-muted,
.dq-label-axis,
.dq-vec-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.dq-label-muted { fill: #7a877f; }
.dq-label-axis { fill: #4a574f; }

.dq-axis {
  stroke: #8a968c;
  stroke-width: 1;
}

.dq-guide {
  fill: rgba(0, 110, 15, 0.04);
  stroke: rgba(0, 110, 15, 0.14);
  stroke-width: 0.75;
  stroke-dasharray: 3 3;
}

.dq-vec {
  stroke-linecap: round;
  fill: none;
}

.dq-id {
  stroke: #3d8f4c;
  stroke-width: 1.35;
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
}

.dq-iq {
  stroke: #1a7a2e;
  stroke-width: 1.45;
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
}

.dq-is {
  stroke: #3a4540;
  stroke-width: 1.15;
  stroke-dasharray: 4 3;
  opacity: 0;
}

.dq-vec-label {
  opacity: 0;
}

.dq-vec-label-id { fill: #2a8a3a; }
.dq-vec-label-iq { fill: #006e0f; }
.dq-vec-label-is { fill: #0b100d; }

.dq-guide { opacity: 0; }

.dq-panel.is-inview .dq-id {
  animation: dq-stroke 600ms var(--ease-out) 80ms forwards;
}

.dq-panel.is-inview .dq-iq {
  animation: dq-stroke 600ms var(--ease-out) 180ms forwards;
}

.dq-panel.is-inview .dq-is {
  animation: dq-fade 400ms var(--ease-out) 320ms forwards;
}

.dq-panel.is-inview .dq-vec-label-id {
  animation: dq-fade 320ms var(--ease-out) 200ms forwards;
}

.dq-panel.is-inview .dq-vec-label-iq {
  animation: dq-fade 320ms var(--ease-out) 280ms forwards;
}

.dq-panel.is-inview .dq-vec-label-is {
  animation: dq-fade 320ms var(--ease-out) 360ms forwards;
}

.dq-panel.is-inview .dq-guide {
  animation: dq-fade 360ms var(--ease-out) 120ms forwards;
}

@keyframes dq-stroke {
  to { stroke-dashoffset: 0; }
}

@keyframes dq-fade {
  to { opacity: 1; }
}

/* Slow ωe rotation — once vectors are visible */
.dq-frame {
  transform-origin: 160px 160px;
  transform-box: view-box;
}

.dq-panel.is-inview .dq-frame {
  animation: dq-rotate 36s linear infinite;
}

@keyframes dq-rotate {
  to { transform: rotate(360deg); }
}

.dq-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
  line-height: 1.4;
}

.dq-caption strong { color: var(--ink-soft); font-weight: 600; }
.dq-caption i { font-style: italic; }

.dq-omega {
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Products — reset legacy .product card chrome from style.css */
.products {
  padding: var(--section) 0;
  background: var(--white);
}

.products .section-head {
  margin-bottom: 2.75rem;
  max-width: 36rem;
}

.section-head .kicker {
  margin-bottom: 0.65rem;
}

.product-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.75rem;
  align-items: stretch;
}

.product-rail .product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0 0 0.25rem;
  margin: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  transition: none;
}

.product-rail .product:hover {
  border-color: var(--line);
  box-shadow: none;
}

.product-rail .product-visual {
  display: grid;
  place-items: center;
  min-height: 200px;
  margin: 0 0 1.25rem;
  padding: 1.35rem 1rem;
  overflow: hidden;
  background: linear-gradient(165deg, #eef2ef, #f7f9f7);
}

.product-rail .product-featured .product-visual {
  background: linear-gradient(165deg, #e8efe9, #f5f8f5);
}

.product-rail .product-visual img {
  max-height: 168px;
  width: auto;
}

.product-rail .tag {
  display: block;
  margin: 0 0 0.45rem;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.product-rail .product h3 {
  margin: 0 0 0.55rem;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-transform: none;
}

.product-rail .product h3 b {
  font-weight: 700;
}

.product-rail .product > p {
  margin: 0 0 1.15rem;
  color: var(--muted);
  flex: 1;
  font-size: 0.97rem;
}

.product-rail .specs {
  margin: 0 0 1.15rem;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.product-rail .specs div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  font-family: var(--font-mono);
}

.product-rail .specs dt { margin: 0; color: var(--muted); font-family: var(--font); }
.product-rail .specs dd { margin: 0; font-weight: 500; text-align: right; }

.product-rail .btn {
  margin-top: 0;
  margin-bottom: 1.15rem;
  align-self: flex-start;
}

/* Control */
.control {
  padding: calc(var(--section) + 0.5rem) 0;
  background: var(--steel);
  color: var(--white);
}

.control .section-head {
  margin-bottom: 2.5rem;
}

.section-head-light p { color: rgba(255, 255, 255, 0.68); }

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.control-path {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 1.4rem 1.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.control-path::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--mint);
  opacity: 0.55;
}

@media (hover: hover) and (pointer: fine) {
  .control-path:hover {
    border-color: rgba(155, 201, 162, 0.4);
    background: rgba(255, 255, 255, 0.025);
  }
  .control-path:hover .control-arrow { transform: translateX(3px); }
}

.control-path:active { transform: scale(0.99); }

.control-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mint);
}

.control-path strong {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.control-path span:nth-child(3) {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.96rem;
}

.control-arrow {
  margin-top: 0.45rem;
  color: var(--mint);
  font-size: 1.05rem;
  transition: transform 160ms var(--ease-out);
}

/* Close */
.close {
  padding: var(--section) 0;
  background: var(--paper);
}

.close-inner { max-width: 34rem; }
.close .kicker { margin-bottom: 0.65rem; }
.close h2 { margin-bottom: 0.85rem; }
.close p { margin: 0 0 1.6rem; }



@media (max-width: 900px) {
  .tech-layout,
  .product-rail,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .product-rail {
    gap: 2.25rem;
  }

  .hero {
    min-height: 78dvh;
  }

  .hero-copy {
    padding: 4.5rem 0 3.75rem;
  }

  .hero h1 { max-width: none; }

  .hero-media {
    background:
      linear-gradient(180deg, rgba(14, 20, 16, 0.48) 0%, rgba(14, 20, 16, 0.82) 48%, rgba(14, 20, 16, 0.95) 100%),
      url("../assets/images/Nema17_Nema23.jpg") center 30% / cover no-repeat;
  }

  .dq-panel {
    width: min(100%, 300px);
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal,
  [data-inview],
  .dq-id,
  .dq-iq,
  .dq-is,
  .dq-vec-label,
  .dq-guide {
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }

  .dq-frame { animation: none !important; }
}
