/* ==========================================================================
   Predictvia - Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'WhyteInktrap';
  src: url('../fonts/WhyteInktrap-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'WhyteInktrap';
  src: url('../fonts/WhyteInktrap-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'WhyteInktrap';
  src: url('../fonts/WhyteInktrap-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/Gilroy-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/Gilroy-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
}

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg-primary: #0B0D10;
  --bg-secondary: #12151a;
  --bg-elevated: #1a1d24;
  --text-primary: #F5F7FA;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #3B82F6;
  --accent-dim: rgba(59, 130, 246, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  
  /* Typography */
  --font-display: 'WhyteInktrap', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 10rem;
  
  /* Layout */
  --max-width: 1200px;
  --content-width: 720px;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.2;
  margin: 0 0 var(--space-md);
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 400;
}

p {
  margin: 0 0 var(--space-md);
  color: var(--text-secondary);
}

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

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

/* Link underline animation */
.link-animated {
  display: inline-block;
  position: relative;
}

.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent);
  transition: width 0.2s ease;
}

.link-animated:hover::after {
  width: 100%;
}

strong {
  font-weight: 500;
  color: var(--text-primary);
}

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

.text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--content-width);
}

section {
  padding: var(--space-3xl) 0;
}

/* --------------------------------------------------------------------------
   Top Bar (Secondary Navigation)
   -------------------------------------------------------------------------- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  padding: var(--space-xs) 0;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  .top-bar {
    font-size: 0.75rem;
  }
}

.top-bar__inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.top-bar__link {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: color 0.2s ease;
}

.top-bar__link:hover {
  color: var(--accent);
}

.top-bar__link::before {
  content: '◆';
  font-size: 0.5em;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 32px;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-md) 0;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, top 0.3s ease;
}

.nav.scrolled {
  top: 0;
  background-color: rgba(11, 13, 16, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-bar.hidden {
  transform: translateY(-100%);
}

.nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.nav__logo img {
  height: 32px;
  width: auto;
  display: block;
}

.nav__links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

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

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

/* Mobile menu */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-xs);
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  .nav__toggle {
    display: block;
  }
  
  .nav__links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  .nav__links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--space-3xl);
  position: relative;
  overflow: hidden;
}

.hero__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.hero__text {
  max-width: 600px;
}

.hero__title {
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.hero__meta {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.hero__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.hero__animation {
  position: relative;
  height: 400px;
  min-width: 320px;
}

#agent-network-diagram {
  width: 100%;
  height: 100%;
}

@media (max-width: 968px) {
  .hero__content {
    grid-template-columns: 1fr;
  }
  
  .hero__animation {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
}

/* --------------------------------------------------------------------------
   Content Blocks
   -------------------------------------------------------------------------- */
.content-block {
  margin-bottom: var(--space-2xl);
}

.content-block h3 {
  margin-bottom: var(--space-sm);
}

/* Highlight block (for "What we are not" section) */
.highlight-block {
  background-color: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  border-radius: 0 8px 8px 0;
}

.highlight-block p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */
.list-plain {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
}

.list-plain li {
  position: relative;
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.list-plain li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Steps / Process
   -------------------------------------------------------------------------- */
.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-lg);
  position: relative;
}

.step__number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  padding-top: 0.25rem;
}

.step__content h3 {
  margin-bottom: var(--space-xs);
}

.step__content p {
  margin-bottom: 0;
}

/* Connecting line */
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 1rem;
  top: 2rem;
  bottom: calc(-1 * var(--space-xl) + 0.5rem);
  width: 1px;
  background: linear-gradient(to bottom, var(--border), transparent);
}

/* --------------------------------------------------------------------------
   Rules / Principles
   -------------------------------------------------------------------------- */
.rules {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.rule {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.rule:last-child {
  border-bottom: none;
}

.rule__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.rule__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.rule__description {
  color: var(--text-secondary);
  margin: 0;
}

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

/* --------------------------------------------------------------------------
   Contact Section
   -------------------------------------------------------------------------- */
.contact-intro {
  max-width: 600px;
  margin-bottom: var(--space-xl);
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 500px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-card:hover {
  background-color: var(--bg-elevated);
  border-color: var(--accent);
  transform: translateX(4px);
}

.contact-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}

.contact-card__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.contact-card__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.contact-card__title {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-primary);
}

.contact-card__desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.contact-card__arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.contact-card:hover .contact-card__arrow {
  color: var(--accent);
  transform: translateX(4px);
}

.contact-form {
  max-width: 500px;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background-color: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

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

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__logo {
  display: flex;
  align-items: center;
}

.footer__logo img {
  height: 24px;
  width: auto;
}

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

.footer__link {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

.footer__copy {
  width: 100%;
  text-align: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Agent Network Animation
   -------------------------------------------------------------------------- */
.network-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* --------------------------------------------------------------------------
   Page Transitions
   -------------------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

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

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

