/* ==========================================================================
   Switchyard Studio — Global Styles
   ========================================================================== */

:root {
  --color-bg: #0a0e17;
  --color-bg-elevated: #111827;
  --color-bg-card: #151d2e;
  --color-border: #1e2a3f;
  --color-border-light: #2a3a55;
  --color-text: #e8edf5;
  --color-text-muted: #8b9cb8;
  --color-accent: #2e86ff;
  --color-accent-hover: #5ca0ff;
  --color-accent-glow: rgba(46, 134, 255, 0.15);
  --color-success: #34d399;
  --color-error: #f87171;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --header-height: 64px;
  --transition: 0.2s ease;
  --container-max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background effects */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.streak {
  position: absolute;
  width: 1px;
  height: 120%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(46, 134, 255, 0.4) 30%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(46, 134, 255, 0.4) 70%,
    transparent 100%
  );
  opacity: 0.3;
  animation: streak-drift 12s ease-in-out infinite;
}

.streak--1 { left: 15%; top: -10%; }
.streak--2 { left: 55%; top: -10%; animation-delay: -4s; opacity: 0.18; }
.streak--3 { left: 82%; top: -10%; animation-delay: -8s; opacity: 0.22; }

.pulse {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: pulse-breathe 8s ease-in-out infinite;
}

.pulse--1 {
  width: 500px;
  height: 500px;
  top: -10%;
  right: -10%;
  background: radial-gradient(circle, rgba(46, 134, 255, 0.12) 0%, transparent 70%);
}

.pulse--2 {
  width: 400px;
  height: 400px;
  bottom: 10%;
  left: -5%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
  animation-delay: -4s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
}

@keyframes streak-drift {
  0%, 100% { transform: translateY(0) scaleY(1); opacity: 0.18; }
  50% { transform: translateY(5%) scaleY(1.05); opacity: 0.35; }
}

@keyframes pulse-breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  object-fit: contain;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: var(--color-bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-bg);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-light);
}

.btn-secondary:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.btn-full {
  width: 100%;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover {
  opacity: 0.92;
}

.logo-img {
  display: block;
  width: auto;
  object-fit: contain;
}

.logo-img--mark {
  height: 36px;
  max-width: 44px;
}

.logo-img--full {
  height: 72px;
  max-width: 240px;
}

/* Navigation */
.site-nav ul {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: calc(var(--header-height) + 4rem) 0 6rem;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.hero-lead {
  margin: 1.5rem 0 2rem;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  line-height: 1.7;
}

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

.hero-glow {
  position: absolute;
  top: 20%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(46, 134, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner h1 {
  background: linear-gradient(135deg, #ffffff 0%, #a8c8f0 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sections */
.section {
  padding: 6rem 0;
}

.section-header {
  margin-bottom: 3rem;
}

.section-subtitle {
  margin: 0.75rem 0 0;
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

/* About */
.about {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-content p {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

.about-values li {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.about-values li:first-child {
  padding-top: 0;
}

.about-values li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.value-icon {
  flex-shrink: 0;
  color: var(--color-accent);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.about-values strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.about-values p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* Products */
.product-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 2.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 1.5rem;
  background: transparent;
  border: none;
}

.product-logo {
  width: auto;
  height: auto;
  max-width: min(100%, 240px);
  max-height: 260px;
  object-fit: contain;
}

.product-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-glow);
  border-radius: 100px;
}

.product-details p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.product-features {
  margin: 0 0 2rem;
  padding: 0;
}

.product-features li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.product-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9rem;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
}

/* Contact */
.contact {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info p {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

.contact-email {
  margin-top: 1.5rem;
}

.contact-email a {
  font-weight: 600;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-group input.error,
.form-group textarea.error {
  border-color: var(--color-error);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--color-error);
  min-height: 1.25rem;
}

.form-status {
  margin: 0;
  font-size: 0.9375rem;
  text-align: center;
  min-height: 1.5rem;
}

.form-status.success {
  color: var(--color-success);
}

.form-status.error {
  color: var(--color-error);
}

/* Footer */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2rem 3rem;
}

.footer-brand {
  grid-column: 1;
}

.footer-tagline {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-nav {
  grid-column: 2;
  grid-row: 1;
}

.footer-nav ul {
  display: flex;
  gap: 2rem;
}

.footer-nav a {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

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

.footer-copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* 404 Page */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.error-main {
  position: relative;
  width: 100%;
  padding: 4rem 0;
  overflow: hidden;
}

.error-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 480px;
}

.error-code {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-border-light);
  letter-spacing: -0.04em;
}

.error-message {
  margin: 1rem 0 2rem;
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: rgba(10, 14, 23, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav li {
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1rem;
  }

  .about-grid,
  .product-card,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-card {
    padding: 1.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    grid-column: 1;
    grid-row: auto;
  }

  .footer-nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .product-image {
    min-height: 200px;
    padding: 1rem 0;
  }

  .product-logo {
    max-width: min(100%, 200px);
    max-height: 220px;
  }

  .logo-img--mark {
    height: 32px;
    max-width: 40px;
  }

  .logo-img--full {
    height: 56px;
    max-width: min(200px, 55vw);
  }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .streak,
  .pulse {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
