/* ============================================
   ArcheMotion — Design System & Styles
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --color-base: #FAFAF7;
  --color-surface: #FFFFFF;
  --color-gold: #C9A84C;
  --color-gold-light: #E8C547;
  --color-gold-glow: rgba(201, 168, 76, 0.25);
  --color-purple: #6B3FA0;
  --color-purple-light: #8B5CF6;
  --color-purple-glow: rgba(107, 63, 160, 0.15);
  --color-black: #1A1A2E;
  --color-black-soft: #2D2D44;
  --color-muted: #6B7280;
  --color-muted-light: #9CA3AF;
  --color-border: #E5E5E0;
  --color-border-hover: #D4D4CF;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.04), 0 1px 2px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 26, 46, 0.06), 0 2px 4px rgba(26, 26, 46, 0.04);
  --shadow-lg: 0 12px 32px rgba(26, 26, 46, 0.08), 0 4px 8px rgba(26, 26, 46, 0.04);
  --shadow-gold: 0 8px 32px rgba(201, 168, 76, 0.2);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1200px;
  --nav-height: 72px;
}


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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-black);
  background-color: var(--color-base);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

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


/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-black);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.01em; }

p {
  color: var(--color-muted);
  max-width: 65ch;
}


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


/* ============================================
   AdSense Banner (Top)
   ============================================ */
.adsense-banner {
  width: 100%;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adsense-banner .ad-placeholder {
  color: var(--color-muted-light);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}


/* ============================================
   Navigation
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--color-black);
  letter-spacing: -0.02em;
}

.nav-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-purple), var(--color-gold));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-purple), var(--color-gold));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.nav-links a:hover {
  color: var(--color-black);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-black);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


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

/* Background decorations */
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-purple-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-gold-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

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

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--color-purple), var(--color-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--color-muted);
  margin: 0 auto var(--space-2xl);
  max-width: 550px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-purple), var(--color-purple-light));
  color: white;
  box-shadow: 0 4px 16px rgba(107, 63, 160, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(107, 63, 160, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-black);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn .arrow {
  transition: transform var(--transition-fast);
}

.btn:hover .arrow {
  transform: translateX(3px);
}


/* ============================================
   Projects Section
   ============================================ */
.projects {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  margin: 0 auto;
  font-size: 1.05rem;
}

/* Category filter */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.filter-btn {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-black);
}

.filter-btn.active {
  background: var(--color-black);
  color: white;
  border-color: var(--color-black);
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-xl);
}

/* Project Card */
.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  cursor: pointer;

  /* For scroll animation */
  opacity: 0;
  transform: translateY(30px);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              border-color var(--transition-base),
              box-shadow var(--transition-base);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-purple), var(--color-gold));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.project-card:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-gold-glow);
  transform: translateY(-4px);
}

.project-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--color-base);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.project-card:hover .card-icon {
  border-color: var(--color-gold);
  box-shadow: 0 0 16px var(--color-gold-glow);
}

.card-status {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-status.live {
  background: #ECFDF5;
  color: #059669;
}

.card-status.coming-soon {
  background: #FFF7ED;
  color: #D97706;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: var(--space-sm);
}

.card-tagline {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

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

.card-category {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-purple);
  background: rgba(107, 63, 160, 0.08);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
}

.card-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-base);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  transition: all var(--transition-base);
}

.project-card:hover .card-arrow {
  background: var(--color-black);
  border-color: var(--color-black);
  color: white;
  transform: translateX(3px);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  color: var(--color-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state p {
  margin: 0 auto;
}


/* ============================================
   Disqus Section
   ============================================ */
.disqus-section {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--color-border);
}

.disqus-section .section-header {
  margin-bottom: var(--space-xl);
}

#disqus_thread {
  max-width: 800px;
  margin: 0 auto;
}


/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--color-black);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .nav-brand {
  color: white;
  margin-bottom: var(--space-md);
}

.footer-brand p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
}

.footer-links {
  display: flex;
  gap: var(--space-3xl);
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

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

/* Buy Me a Coffee */
.bmc-wrapper {
  margin-top: var(--space-lg);
}

.bmc-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.65rem 1.4rem;
  background: #FFDD00;
  color: #000000;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(255, 221, 0, 0.3);
}

.bmc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 221, 0, 0.4);
}

.bmc-btn svg {
  width: 20px;
  height: 20px;
}

/* Footer bottom */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-bottom-links a {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  transition: color var(--transition-fast);
}

.footer-bottom-links a:hover {
  color: var(--color-gold);
}


/* ============================================
   Legal Pages (Privacy & Terms)
   ============================================ */
.legal-page {
  padding: var(--space-3xl) 0 var(--space-4xl);
  min-height: calc(100vh - var(--nav-height) - 200px);
}

.legal-page h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: var(--space-sm);
}

.legal-page .last-updated {
  font-size: 0.85rem;
  color: var(--color-muted-light);
  margin-bottom: var(--space-3xl);
}

.legal-content {
  max-width: 800px;
}

.legal-content h2 {
  font-size: 1.35rem;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--color-black);
}

.legal-content p {
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
  line-height: 1.8;
}

.legal-content ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.legal-content ul li {
  font-size: 0.95rem;
  color: var(--color-muted);
  line-height: 1.8;
  list-style: disc;
}

.legal-content a {
  color: var(--color-purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: var(--color-gold);
}


/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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


/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

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

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(250, 250, 247, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    gap: var(--space-sm);
  }

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

  .nav-links a {
    padding: var(--space-sm) 0;
    font-size: 1rem;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: var(--space-3xl) 0;
    min-height: auto;
  }

  .hero::before {
    width: 350px;
    height: 350px;
    top: -15%;
    right: -20%;
  }

  .hero::after {
    width: 300px;
    height: 300px;
    bottom: -15%;
    left: -15%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
  }

  .footer-links {
    width: 100%;
    justify-content: space-between;
  }

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

/* Mobile small */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .footer-links {
    flex-direction: column;
    gap: var(--space-xl);
  }

  .filter-bar {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
