/* ==========================================================================
   EastWest Tech Space LLC — Design System & Styles
   ========================================================================== */

:root {
  /* Color Palette - Warm Editorial Paper & Deep Oceanic Slate */
  --bg-page: #faf9f6;
  --bg-surface: #ffffff;
  --bg-subtle: #f2efe9;
  --bg-accent-tint: #ebf3f3;

  --text-primary: #141a24;
  --text-secondary: #4a5568;
  --text-muted: #6b7280;

  --accent-primary: #0f5257;
  --accent-primary-hover: #0a3d41;
  --accent-warm: #b85d2b;

  --border-light: #e5e1d8;
  --border-medium: #d1cbc0;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing & Layout */
  --container-max: 1120px;
  --prose-max: 72ch;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(20, 26, 36, 0.04);
  --shadow-md: 0 4px 16px rgba(20, 26, 36, 0.06);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin-top: 0;
}

p {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

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

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

/* ==========================================================================
   Site Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-primary);
}

.nav-link.active {
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
  border: 1px solid transparent;
}

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

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

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

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

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* ==========================================================================
   Landing Page (index.html)
   ========================================================================== */

.hero {
  padding: 84px 0 68px;
  border-bottom: 1px solid var(--border-light);
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(2.1rem, 4.5vw, 3.25rem);
  font-weight: 700;
  max-width: 18ch;
  margin-bottom: 22px;
}

.hero-lead {
  font-size: 1.15rem;
  line-height: 1.68;
  color: var(--text-secondary);
  max-width: 58ch;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.section {
  padding: 68px 0;
  border-bottom: 1px solid var(--border-light);
}

.section:last-of-type {
  border-bottom: none;
}

.section-header {
  max-width: 60ch;
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.02rem;
  margin-bottom: 0;
}

/* Feature Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-warm);
  margin-bottom: 10px;
  display: block;
}

.card-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Developer & Legal Info Strip */
.info-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: center;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.info-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.info-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.info-value {
  font-weight: 500;
  color: var(--text-primary);
}

/* ==========================================================================
   Terms of Service Page (terms.html)
   ========================================================================== */

.doc-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-surface);
}

.doc-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.doc-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.doc-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 14px;
}

.doc-summary {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 64ch;
  margin-bottom: 0;
}

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  padding: 48px 0 80px;
  align-items: start;
}

/* Sticky Table of Contents */
.toc-sidebar {
  position: sticky;
  top: 92px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
}

.toc-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-link {
  display: block;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.35;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toc-link:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.toc-link.active {
  background-color: var(--bg-accent-tint);
  color: var(--accent-primary);
  font-weight: 600;
}

/* Legal Prose */
.legal-prose {
  max-width: var(--prose-max);
}

.legal-section {
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
  scroll-margin-top: 92px;
}

.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.legal-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.legal-section h3 {
  font-size: 1.06rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.legal-section p,
.legal-section li {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.72;
}

.legal-section ul,
.legal-section ol {
  padding-left: 1.35rem;
  margin-top: 0;
  margin-bottom: 1.15rem;
}

.legal-section li {
  margin-bottom: 0.55rem;
}

.callout-box {
  background-color: var(--bg-accent-tint);
  border-left: 3px solid var(--accent-primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 18px 0;
}

.callout-box p {
  margin-bottom: 0;
  color: var(--text-primary);
  font-size: 0.94rem;
}

.caps-notice {
  font-size: 0.92rem;
  background-color: var(--bg-subtle);
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 36px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

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

  .info-panel {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .doc-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .toc-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    gap: 14px;
    box-shadow: var(--shadow-md);
  }

  .site-nav.open {
    display: flex;
  }

  .hero {
    padding: 56px 0 48px;
  }

  .section {
    padding: 48px 0;
  }
}

/* Print Stylesheet for Legal Documents */
@media print {
  .site-header,
  .toc-sidebar,
  .doc-actions,
  .site-footer {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .doc-layout {
    display: block;
    padding: 0;
  }

  .legal-prose {
    max-width: 100%;
  }
}
