/* ============================================================
   MAIN.CSS — Page Layout & Section-Specific Styles
   Resistor Technology · resistor.technology
   ============================================================ */

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  z-index: 1000;
  transition: background var(--duration-med), backdrop-filter var(--duration-med);
}

.nav.is-scrolled {
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: var(--ls-wider);
  color: var(--color-brass);
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  gap: var(--space-lg);
}

.nav__link {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  position: relative;
  transition: color var(--duration-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-brass);
  transition: width var(--duration-med) var(--ease-out);
}

.nav__link:hover {
  color: var(--color-text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  z-index: 1002;
}

.nav__toggle-bar {
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  transition: transform var(--duration-med), opacity var(--duration-fast);
}

.nav__toggle.is-open .nav__toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.is-open .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle.is-open .nav__toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile overlay */
.nav__mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.97);
  z-index: 1001;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
}

.nav__mobile-overlay.is-open {
  display: flex;
}

.nav__mobile-link {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 600;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  transition: color var(--duration-fast);
}

.nav__mobile-link:hover {
  color: var(--color-brass);
}

/* --- Hero Section (Simplified — title only) --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
  padding-bottom: calc(var(--space-3xl) + 80px);
  overflow: hidden;
}

/* --- Product Sections --- */
.section--raiveflier {
  background: linear-gradient(180deg,
    var(--color-bg) 0%,
    rgba(106, 74, 138, 0.03) 50%,
    var(--color-bg) 100%
  );
}

.section--resistor {
  background: linear-gradient(180deg,
    var(--color-bg) 0%,
    rgba(196, 166, 122, 0.03) 50%,
    var(--color-bg) 100%
  );
}

.section--technology {
  background: linear-gradient(180deg,
    var(--color-bg) 0%,
    rgba(74, 138, 122, 0.03) 50%,
    var(--color-bg) 100%
  );
}

.section--dr-fun {
  background: linear-gradient(180deg,
    var(--color-bg) 0%,
    rgba(196, 166, 122, 0.03) 50%,
    var(--color-bg) 100%
  );
}

.section--lakeshoredr {
  background: linear-gradient(180deg,
    var(--color-bg) 0%,
    rgba(90, 184, 160, 0.03) 50%,
    var(--color-bg) 100%
  );
}

/* --- Divider --- */
.section-divider {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-border) 20%,
    var(--color-border) 80%,
    transparent
  );
}

/* --- Product Mockup Placeholder Styles --- */
.mockup--raiveflier .mockup__inner {
  background:
    linear-gradient(135deg,
      rgba(106, 74, 138, 0.1),
      rgba(20, 20, 26, 0.95)
    );
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.mockup--raiveflier .mockup__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--color-amethyst-light);
}

.mockup--resistor .mockup__inner {
  background:
    linear-gradient(135deg,
      rgba(196, 166, 122, 0.1),
      rgba(20, 20, 26, 0.95)
    );
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.mockup--resistor .mockup__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--color-brass);
}

/* --- Technology Bento Section --- */
.tech-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: var(--space-md);
}

.tech-bento .card:nth-child(1) { grid-column: span 2; }
.tech-bento .card:nth-child(2) { grid-column: span 1; }
.tech-bento .card:nth-child(3) { grid-column: span 1; }
.tech-bento .card:nth-child(4) { grid-column: span 1; }
.tech-bento .card:nth-child(5) { grid-column: span 2; }
.tech-bento .card:nth-child(6) { grid-column: span 1; }

/* --- Contact Section --- */
.contact {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.contact__heading {
  font-size: var(--fs-h1);
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.contact__email {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 500;
  color: var(--color-brass);
  display: inline-block;
  position: relative;
  transition: color var(--duration-fast);
}

.contact__email::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-brass);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--duration-med) var(--ease-out);
}

.contact__email:hover::after {
  transform: scaleX(1);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-lg) + 80px);
  text-align: center;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.footer__links {
  display: flex;
  gap: var(--space-lg);
}

.footer__link {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
}

.footer__link:hover {
  color: var(--color-text-primary);
}

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

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

/* --- Detail Block (deep-dive subsections within product sections) --- */
.detail-block {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border-left: 3px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.accent-amethyst .detail-block {
  border-left-color: var(--color-amethyst);
  background: rgba(106, 74, 138, 0.04);
}

.accent-brass .detail-block {
  border-left-color: var(--color-brass-dark);
  background: rgba(196, 166, 122, 0.04);
}

.detail-block__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.accent-amethyst .detail-block__label { color: var(--color-amethyst-light); }
.accent-brass .detail-block__label { color: var(--color-brass); }

.detail-block__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

.detail-block__description {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  line-height: var(--lh-loose);
  margin-bottom: var(--space-md);
}

.detail-block__description:last-child {
  margin-bottom: 0;
}

.detail-block__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.detail-block__list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: var(--space-sm);
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  line-height: var(--lh-loose);
}

.detail-block__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border-light);
}

.accent-amethyst .detail-block__list li::before {
  background: var(--color-amethyst);
}

.accent-brass .detail-block__list li::before {
  background: var(--color-brass-dark);
}

/* --- Pipeline Flow Diagram (text-based) --- */
.pipeline-flow {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.pipeline-flow__step {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.accent-amethyst .pipeline-flow__step {
  border-color: var(--color-amethyst-dark);
  color: var(--color-amethyst-light);
}

.accent-brass .pipeline-flow__step {
  border-color: var(--color-brass-dark);
  color: var(--color-brass);
}

.pipeline-flow__arrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* --- Status Tag --- */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
}

.status-tag--active {
  color: #5aaa80;
  border: 1px solid rgba(90, 170, 128, 0.3);
  background: rgba(90, 170, 128, 0.08);
}

.status-tag--wip {
  color: #d0b468;
  border: 1px solid rgba(208, 180, 104, 0.3);
  background: rgba(208, 180, 104, 0.08);
}

.status-tag__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* --- CTA Row --- */
.cta-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet (768-1200px) */
@media (max-width: 1200px) {
  .editorial {
    grid-template-columns: 1fr;
  }

  .editorial--reversed {
    direction: ltr;
  }

  .editorial__sticky {
    position: static;
  }

  .tech-bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-bento .card:nth-child(1) { grid-column: span 2; }
  .tech-bento .card:nth-child(2) { grid-column: span 1; }
  .tech-bento .card:nth-child(3) { grid-column: span 1; }
  .tech-bento .card:nth-child(4) { grid-column: span 1; }
  .tech-bento .card:nth-child(5) { grid-column: span 2; }
  .tech-bento .card:nth-child(6) { grid-column: span 1; }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    gap: var(--space-lg);
  }

  .pipeline-flow {
    justify-content: flex-start;
  }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
  :root {
    --space-3xl: 4rem;
    --space-2xl: 3rem;
  }

  .nav__links {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }

  /* Dock: tighten spacing on mobile */
  .synth-dock {
    gap: var(--space-md);
    padding: 0 var(--space-sm);
    height: 64px;
  }

  .synth-dock__switches {
    flex-direction: column;
    gap: 2px;
  }

  .dock-switch {
    padding: 4px 8px;
    font-size: 7px;
  }

  .vu-meter {
    width: 80px;
    height: 48px;
  }

  .tech-bento {
    grid-template-columns: 1fr;
  }

  .tech-bento .card:nth-child(1),
  .tech-bento .card:nth-child(5) {
    grid-column: span 1;
  }

  .stats {
    flex-direction: column;
    gap: var(--space-md);
  }

  .cta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer__links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .detail-block {
    padding: var(--space-md);
  }

  .pipeline-flow {
    gap: var(--space-xs);
    padding: var(--space-sm);
  }

  .pipeline-flow__step {
    font-size: 0.65rem;
    padding: 3px var(--space-xs);
  }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
  :root {
    --space-3xl: 3rem;
    --space-2xl: 2rem;
  }

  .vu-meter {
    width: 64px;
    height: 40px;
  }

  .vu-meter__needle {
    height: 26px;
  }

  .synth-dock__knob {
    width: 30px;
    height: 30px;
  }

  .led-display__text {
    font-size: 1.25rem;
  }
}

/* Very Small Mobile (< 400px) */
@media (max-width: 400px) {
  .vu-meter {
    display: none;
  }
}
