/* TradeForgeSystems - Style Guide Implementation */
/* Based on docs/design/Style Guide.txt */

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
  /* Backgrounds */
  --bg-primary: #0F131A;
  --bg-secondary: #141A23;
  --bg-card: #1A2029;

  /* Text */
  --text-primary: #E6E9EE;
  --text-secondary: #AEB6C3;
  --text-muted: #7A8494;

  /* Accent */
  --accent-orange: #F38B2A;
  --accent-ember: #E26A2C;

  /* Status (system meaning only) */
  --status-safe: #4CAF50;
  --status-caution: #F5C451;
  --status-halt: #D9534F;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: var(--accent-orange);

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 64px;
  --space-2xl: 96px;

  /* Layout */
  --max-width: 1140px;
  --max-width-text: 900px;

  /* Typography */
  --font-family: 'Inter', 'Source Sans 3', system-ui, -apple-system, sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

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

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

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  font-size: 1rem;
  line-height: 1.6;
  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-weight: var(--font-weight-semibold);
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: 2.75rem; /* 44px */
}

h2 {
  font-size: 1.875rem; /* 30px */
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.25rem; /* 20px */
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

a {
  color: var(--accent-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-ember);
  text-decoration: underline;
}

ul, ol {
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
}

li {
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
}

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

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

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

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

.section--large {
  padding: var(--space-2xl) 0;
}

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

/* ============================================
   Header & Navigation
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(15, 19, 26, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.header__logo img {
  height: 40px;
  width: auto;
}

.header__logo-text {
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

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

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

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

.nav__link--cta {
  color: var(--accent-orange);
}

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

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

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding-top: calc(72px + var(--space-2xl));
  padding-bottom: var(--space-2xl);
  text-align: center;
}

.hero__title {
  font-size: 3.25rem;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

.hero__cta {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.hero__logo {
  margin-bottom: var(--space-lg);
}

.hero__logo-video {
  width: 180px;
  height: auto;
  border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
  .hero__logo-video {
    width: 140px;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

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

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

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

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

.btn--small {
  padding: 10px 20px;
  font-size: 0.9375rem;
}

/* ============================================
   Feature Cards
   ============================================ */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.feature-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color 0.2s ease;
}

.feature-card:hover {
  border-color: var(--accent-orange);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  color: var(--accent-orange);
}

.feature-card__title {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

.feature-card__text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
  max-width: var(--max-width-text);
  margin: 0 auto;
}

.content-section__header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

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

.content-section__subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* ============================================
   Process/Flow Steps
   ============================================ */
.steps {
  display: grid;
  gap: var(--space-lg);
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-md);
  align-items: start;
}

.step__number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--accent-orange);
  border-radius: 50%;
  font-weight: var(--font-weight-semibold);
  color: var(--accent-orange);
  flex-shrink: 0;
}

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

.step__content p {
  margin-bottom: 0;
}

/* ============================================
   Info Box / Callout
   ============================================ */
.info-box {
  background-color: var(--bg-secondary);
  border-left: 3px solid var(--accent-orange);
  padding: var(--space-md);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-lg) 0;
}

.info-box--note {
  border-left-color: var(--accent-orange);
}

.info-box--risk {
  border-left-color: var(--status-caution);
}

.info-box p {
  margin-bottom: 0;
  font-size: 0.9375rem;
}

/* ============================================
   Two Column Layout
   ============================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.two-col--reverse {
  direction: rtl;
}

.two-col--reverse > * {
  direction: ltr;
}

/* ============================================
   List Styles
   ============================================ */
.list--check {
  list-style: none;
  padding-left: 0;
}

.list--check li {
  position: relative;
  padding-left: 28px;
  margin-bottom: var(--space-sm);
}

.list--check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F38B2A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
}

.list--x {
  list-style: none;
  padding-left: 0;
}

.list--x li {
  position: relative;
  padding-left: 28px;
  margin-bottom: var(--space-sm);
}

.list--x li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8494' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
}

/* ============================================
   Waitlist Form
   ============================================ */
.waitlist-form {
  display: flex;
  gap: var(--space-sm);
  max-width: 480px;
  margin: 0 auto;
}

.waitlist-form__input {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease;
}

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

.waitlist-form__input:focus {
  border-color: var(--accent-orange);
}

.waitlist-form__success {
  text-align: center;
  padding: var(--space-md);
  color: var(--status-safe);
}

.waitlist-form__error {
  text-align: center;
  padding: var(--space-sm);
  color: var(--status-halt);
  font-size: 0.875rem;
}

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
  text-align: center;
  padding: var(--space-2xl) 0;
  background-color: var(--bg-secondary);
}

.cta-section__title {
  margin-bottom: var(--space-sm);
}

.cta-section__text {
  max-width: 500px;
  margin: 0 auto var(--space-lg);
}

.cta-section__links {
  margin-top: var(--space-md);
}

.cta-section__links a {
  font-size: 0.9375rem;
}

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

.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;
  gap: var(--space-sm);
}

.footer__logo img {
  height: 32px;
  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__copyright {
  width: 100%;
  text-align: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================
   Legal Pages
   ============================================ */
.legal-content {
  padding-top: calc(72px + var(--space-xl));
}

.legal-content h1 {
  margin-bottom: var(--space-lg);
}

.legal-content h2 {
  margin-top: var(--space-xl);
  font-size: 1.5rem;
}

.legal-content h3 {
  margin-top: var(--space-lg);
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  max-width: 75ch;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 968px) {
  .features {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .two-col--reverse {
    direction: ltr;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero__title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--bg-primary);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-md);
  }

  .nav--open {
    display: flex;
  }

  .nav__toggle {
    display: block;
  }

  .header__inner {
    flex-wrap: wrap;
  }

  .hero {
    padding-top: calc(72px + var(--space-xl));
    padding-bottom: var(--space-xl);
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__subtitle {
    font-size: 1.125rem;
  }

  .section {
    padding: var(--space-lg) 0;
  }

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

  .waitlist-form {
    flex-direction: column;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

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

@media (max-width: 480px) {
  .hero__cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }
}
