/* 
  TAI One Design System 
  Pure CSS implementation
*/

:root {
  /* Colors */
  --c-bg: #0F1112;
  --c-bg-alt: #111314;
  --c-surface: #1A1C1E;
  --c-border: #2A2D30;
  --c-border-hover: #3A3D40;

  --c-amber: #F6A623;
  --c-amber-muted: rgba(246, 166, 35, 0.15);
  --c-amber-subtle: rgba(246, 166, 35, 0.08);

  --c-text-primary: #FAFAFA;
  --c-text-secondary: #A1A1A6;
  --c-text-tertiary: #6B6B70;
  --c-text-quaternary: #4A4A4F;

  --c-code-block: #0A0B0C;

  /* Typography */
  --font-sans: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'DM Mono', 'SF Mono', Consolas, monospace;

  /* Spacing & Sizes */
  --max-w-section: 900px;
  --max-w-content: 640px;
  --max-w-prose: 540px;
}

/* Reset & Base */
html {
  scroll-behavior: smooth;
}

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

body {
  background-color: var(--c-bg);
  color: var(--c-text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.15s ease;
}

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
}

/* Typography Utilities */
.font-mono {
  font-family: var(--font-mono);
}

.font-medium {
  font-weight: 500;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.italic {
  font-style: italic;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-widest {
  letter-spacing: 0.08em;
}

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

.text-secondary {
  color: var(--c-text-secondary);
}

.text-tertiary {
  color: var(--c-text-tertiary);
}

.text-quaternary {
  color: var(--c-text-quaternary);
}

.text-amber {
  color: var(--c-amber);
}

/* Text Sizes */
.type-hero {
  font-size: 72px;
  line-height: 1.0;
  letter-spacing: -0.03em;
  font-weight: 500;
}

.type-hero-mobile {
  font-size: 48px;
  line-height: 1.0;
  letter-spacing: -0.03em;
  font-weight: 500;
}

.type-section {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.type-section-mobile {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.type-subhead {
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.type-body {
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0;
}

.type-small {
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

.type-caption {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.type-code {
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0;
}

.type-label {
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.type-footer {
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0;
}

.type-copyright {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
}

/* Layout Utilities */
.container {
  width: 100%;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.max-w-section {
  max-width: var(--max-w-section);
}

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

.max-w-prose {
  max-width: var(--max-w-prose);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

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

.justify-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-7 {
  margin-bottom: 1.75rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mb-10 {
  margin-bottom: 2.5rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mt-7 {
  margin-top: 1.75rem;
}

.mt-10 {
  margin-top: 2.5rem;
}

.mt-12 {
  margin-top: 3rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.py-24 {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.py-30 {
  padding-top: 7.5rem;
  padding-bottom: 7.5rem;
}

.py-34 {
  padding-top: 8.5rem;
  padding-bottom: 8.5rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

/* Responsive overrides */
@media (min-width: 768px) {
  .md-text-hero {
    font-size: 72px;
  }

  .md-text-section {
    font-size: 40px;
  }

  .md-p-12 {
    padding: 3rem;
  }

  .md-py-30 {
    padding-top: 7.5rem;
    padding-bottom: 7.5rem;
  }

  .md-py-38 {
    padding-top: 9.5rem;
    padding-bottom: 9.5rem;
  }

  .md-py-42 {
    padding-top: 10.5rem;
    padding-bottom: 10.5rem;
  }
}

/* Components */

/* Separators */
.separator {
  width: 5rem;
  height: 1px;
  background-color: var(--c-border);
}

.separator-long {
  width: 4rem;
  height: 1px;
  background-color: var(--c-border);
}

.separator-full {
  width: 100%;
  height: 1px;
  background-color: var(--c-border);
}

/* Hero */
.min-h-screen {
  min-height: 100vh;
}

.relative {
  position: relative;
}

/* Link Button style (CTA) */
.cta-link {
  color: var(--c-text-tertiary);
  font-size: 15px;
  line-height: 1.5;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-link:hover {
  color: var(--c-text-secondary);
}

/* Code Block */
.code-block {
  background-color: var(--c-code-block);
  border: 1px solid var(--c-border);
  border-radius: 0.375rem;
  padding: 1.25rem;
  overflow-x: auto;
}

@media (min-width: 768px) {
  .code-block {
    padding: 1.5rem;
  }
}

.code-content {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
}

/* Capabilities Grid */
.capabilities-grid {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--c-border);
}

@media (min-width: 768px) {
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cap-item {
  padding: 2rem;
  border-bottom: 1px solid var(--c-border);
}

@media (min-width: 768px) {
  .cap-item {
    padding: 3rem;
  }

  /* Right border for odd items in desktop */
  .cap-item:nth-child(odd) {
    border-right: 1px solid var(--c-border);
  }

  /* Remove bottom border for last row (last 2 items) */
  .cap-item:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

@media (max-width: 767px) {
  /* Remove bottom border for very last item in mobile */
  .cap-item:last-child {
    border-bottom: none;
  }
}

/* Footer Links */
.footer-nav a {
  color: var(--c-text-tertiary);
  font-size: 13px;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

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

/* Animation Utilities */
.fade-section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
    transform 500ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

/* Keyframes */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* Hero Elements Animation */
.hero-logo {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 600ms ease-out 100ms forwards;
}

.hero-title-el {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 600ms ease-out 300ms forwards;
}

.hero-tagline-el {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 600ms ease-out 500ms forwards;
}

.hero-cta-el {
  opacity: 0;
  animation: fadeIn 600ms ease-out 700ms forwards;
}

.comet-shimmer {
  animation: shimmer 4s ease-in-out infinite;
}

.cta-arrow {
  transition: transform 200ms ease-out;
}

.cta-link:hover .cta-arrow {
  transform: translateX(4px);
}

/* Scrollbar */
.code-block::-webkit-scrollbar {
  height: 6px;
}

.code-block::-webkit-scrollbar-track {
  background: var(--c-code-block);
}

.code-block::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 3px;
}

/* Selection */
::selection {
  background: rgba(246, 166, 35, 0.2);
  color: var(--c-text-primary);
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  background: var(--c-amber);
  color: var(--c-bg);
  font-weight: 500;
  z-index: 100;
  transition: top 200ms ease;
}

.skip-link:focus {
  top: 0;
}

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

/* Misc spacing helpers for specific layout needs */
.space-y-5>*+* {
  margin-top: 1.25rem;
}

.space-y-8>*+* {
  margin-top: 2rem;
}

.gap-x-8 {
  column-gap: 2rem;
}

.gap-y-4 {
  row-gap: 1rem;
}
