@import './tokens.css';

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  transition: background var(--duration-short), color var(--duration-short);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: min(100% - var(--space-8), var(--container));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - var(--space-8), var(--container-wide));
  margin-inline: auto;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.text-muted {
  color: var(--text-muted);
}

.text-pulse {
  color: var(--pulse);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background var(--duration-short), box-shadow var(--duration-short), border-color var(--duration-short);
}

.site-header.is-scrolled,
body:not(.has-hero) .site-header {
  background: var(--header-bg-scrolled);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
}

body.has-hero .site-header:not(.is-scrolled) {
  background: transparent;
}

body.has-hero .site-header:not(.is-scrolled) .brand-text {
  color: var(--header-on-hero-brand);
}

body.has-hero .site-header:not(.is-scrolled) .nav-link {
  color: var(--header-on-hero-text);
}

body.has-hero .site-header:not(.is-scrolled) .mobile-toggle {
  color: var(--header-on-hero-brand);
}

body.has-hero .site-header:not(.is-scrolled) .theme-toggle {
  border-color: var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-icon);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-4) 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--header-brand);
  letter-spacing: -0.01em;
  transition: color var(--duration-short);
}

.brand-accent {
  color: var(--pulse);
}

.site-header.is-scrolled .brand-text,
body:not(.has-hero) .site-header .brand-text {
  color: var(--header-brand);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--header-text);
  transition: color var(--duration-short);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--pulse);
}

.site-header.is-scrolled .nav-link,
body:not(.has-hero) .site-header .nav-link {
  color: var(--header-text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-icon);
  cursor: pointer;
  transition: border-color var(--duration-short), background var(--duration-short);
}

.theme-toggle:hover {
  border-color: var(--pulse);
  color: var(--pulse);
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

[data-theme='light'] .theme-toggle .icon-moon {
  display: block;
}

[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform var(--duration-short), background var(--duration-short), box-shadow var(--duration-short);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--pulse);
  color: white;
}

.btn-primary:hover {
  background: var(--pulse-dim);
  box-shadow: 0 4px 20px var(--pulse-glow);
}

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

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

.btn-dark {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-dark:hover {
  border-color: var(--pulse);
  color: var(--pulse);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: var(--text-base);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--header-brand);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-2);
  transition: color var(--duration-short);
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
  }

  .nav-desktop.is-open {
    display: flex;
  }

  .nav-desktop .nav-link {
    color: var(--text-primary);
    padding: var(--space-3) var(--space-4);
  }

  .nav-desktop .btn {
    margin-top: var(--space-4);
  }

  .mobile-toggle {
    display: block;
  }
}

/* Hero — command center */
.hero-command {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-hero);
  color: var(--hero-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-command::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-gradient);
  pointer-events: none;
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-12);
  align-items: center;
  padding-top: 6rem;
  padding-bottom: var(--space-16);
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 34rem;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.hero-eyebrow img {
  width: 48px;
  height: 48px;
}

.hero-eyebrow span {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pulse);
}

.hero-title {
  font-size: var(--text-hero);
  margin-bottom: var(--space-6);
}

.hero-lead {
  font-size: var(--text-lg);
  color: var(--hero-text-muted);
  margin-bottom: var(--space-8);
  max-width: 32rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.hero-visual {
  position: relative;
}

.command-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.command-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--panel-divider);
  font-size: var(--text-sm);
  color: var(--panel-header-text);
}

.command-panel-header strong {
  color: var(--panel-header-strong);
  font-weight: 600;
}

.pulse-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--pulse);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--pulse);
  border-radius: 50%;
  animation: pulse-beat 2s var(--ease-out) infinite;
}

@keyframes pulse-beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.command-panel-body {
  padding: var(--space-6);
}

.command-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.command-stat {
  padding: var(--space-4);
  background: var(--bg-panel-stat);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--pulse);
}

.command-stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--panel-stat-value);
  line-height: 1.2;
}

.command-stat-label {
  font-size: var(--text-xs);
  color: var(--panel-stat-label);
  margin-top: var(--space-1);
}

.command-screenshot {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.command-screenshot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
}

.pulse-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pulse), transparent);
  opacity: 0.6;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    padding-top: 5.5rem;
    text-align: center;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-lead {
    margin-inline: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-eyebrow {
    justify-content: center;
  }
}

/* Proof strip */
.proof-strip {
  background: var(--bg-proof);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-6) 0;
}

.proof-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4) var(--space-8);
}

.proof-item {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.proof-item span {
  color: var(--pulse);
}

/* Sections */
.section {
  padding: var(--space-24) 0;
}

.section-header {
  max-width: 40rem;
  margin-bottom: var(--space-12);
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

.section-lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
}

.section-dark {
  background: var(--bg-section-alt);
  color: var(--section-alt-text);
}

.section-dark .section-lead,
.section-dark .text-muted,
.section-dark .journey-panel p {
  color: var(--section-alt-text-muted);
}

.section-dark .journey-panel h3 {
  color: var(--section-alt-text);
}

.section-dark .screenshot-card figcaption {
  color: var(--section-alt-text);
}

.section-dark .module-group-title {
  color: var(--section-alt-text);
}

/* Platform story */
.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.platform-problem {
  padding-left: var(--space-6);
  border-left: 3px solid var(--error);
}

.platform-solution {
  padding-left: var(--space-6);
  border-left: 3px solid var(--pulse);
}

.platform-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

.platform-problem .platform-label {
  color: var(--error);
}

.platform-solution .platform-label {
  color: var(--pulse);
}

@media (max-width: 768px) {
  .platform-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* Journey theater */
.journey-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.journey-tab {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-short);
}

.journey-tab:hover,
.journey-tab.is-active {
  border-color: var(--pulse);
  color: var(--pulse);
  background: rgba(0, 163, 163, 0.06);
}

.journey-panel {
  display: none;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-12);
  align-items: center;
  animation: fade-in var(--duration-medium) var(--ease-out);
}

.journey-panel.is-active {
  display: grid;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.journey-panel h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.journey-panel p {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.journey-modules {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.journey-module-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-muted);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.journey-visual img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .journey-panel.is-active {
    grid-template-columns: 1fr;
  }
}

/* Specialty teaser */
.specialty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-4);
}

.specialty-item {
  padding: var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid transparent;
  transition: border-color var(--duration-short), color var(--duration-short);
}

.specialty-item:hover {
  color: var(--pulse);
  border-color: var(--pulse);
}

/* Why grid */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-8);
}

.why-item h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--section-alt-text);
}

.why-item p {
  font-size: var(--text-sm);
  color: var(--section-alt-text-muted);
  line-height: 1.7;
}

/* CTA band */
.cta-band {
  background: var(--bg-cta);
  color: var(--section-alt-text);
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.cta-band .display {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

.cta-band p {
  color: var(--cta-text-muted);
  margin-bottom: var(--space-8);
  max-width: 32rem;
  margin-inline: auto;
}

/* Page hero (inner pages) */
.page-hero {
  padding: 8rem 0 var(--space-16);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
}

.page-hero .display {
  font-size: var(--text-4xl);
  max-width: 28rem;
  margin-bottom: var(--space-4);
}

.page-hero .section-lead {
  max-width: 36rem;
}

/* Module lists */
.module-group {
  margin-bottom: var(--space-16);
}

.module-group-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--pulse);
  display: inline-block;
  color: var(--text-primary);
}

.section-title {
  color: inherit;
}

.module-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.module-item {
  padding: var(--space-5) var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-short), box-shadow var(--duration-short);
}

.module-item:hover {
  border-color: var(--pulse);
  border-left-color: var(--pulse);
  box-shadow: var(--shadow-sm);
}

.module-item h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  line-height: 1.35;
}

.module-item p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Standards grid */
.standards-category {
  margin-bottom: var(--space-12);
}

.standards-category h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
  color: var(--pulse);
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.tag {
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

/* Screenshot gallery */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

.screenshot-card {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font: inherit;
}

.screenshot-card img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-short), box-shadow var(--duration-short);
}

.screenshot-card:hover img {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.screenshot-card figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

/* Contact form */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-16);
  align-items: start;
}

.contact-info-block h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.contact-detail {
  margin-bottom: var(--space-6);
}

.contact-detail dt {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.contact-detail dd {
  font-size: var(--text-lg);
  font-weight: 600;
}

.contact-detail dd a:hover {
  color: var(--pulse);
}

.contact-form {
  background: var(--bg-elevated);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
}

.form-row {
  margin-bottom: var(--space-6);
}

.form-row label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  color: var(--text-primary);
  transition: border-color var(--duration-short);
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--pulse);
}

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

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: start;
}

.about-card {
  padding: var(--space-8);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  border-top: 4px solid var(--pulse);
}

.about-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
  background: var(--bg-footer);
  color: var(--footer-text);
  padding: var(--space-16) 0 var(--space-8);
  border-top: 1px solid var(--border-footer);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand .brand-text {
  color: var(--footer-heading);
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.footer-brand p {
  font-size: var(--text-sm);
  max-width: 20rem;
}

.footer-col h4 {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--footer-heading);
  margin-bottom: var(--space-4);
}

.footer-col a {
  display: block;
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  transition: color var(--duration-short);
}

.footer-col a:hover {
  color: var(--pulse);
}

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-footer);
  font-size: var(--text-sm);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-bottom a {
  color: var(--pulse);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-modal);
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.modal.is-open {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-content img {
  max-height: 85vh;
  width: auto;
  margin-inline: auto;
  border-radius: var(--radius-lg);
}

.modal-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: var(--text-inverse);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.modal-caption {
  color: var(--text-inverse);
  text-align: center;
  margin-top: var(--space-4);
  font-weight: 600;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-medium) var(--ease-out), transform var(--duration-medium) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .pulse-dot {
    animation: none;
  }

  .journey-panel {
    animation: none;
  }

  .btn:hover {
    transform: none;
  }
}
