/*
 * sylang.org - Main Stylesheet
 * A clean, academic/technical style for the Sylang language website
 */

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --text-color: #333;
  --code-bg: #f8f9fa;
  --border-color: #dee2e6;
  --font-main: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-heading: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'Source Code Pro', Menlo, Monaco, Consolas, 'Courier New', monospace;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--text-color);
  background-color: #fff;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--light-color);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

code {
  font-family: var(--font-mono);
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
}

pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

pre code {
  padding: 0;
  background-color: transparent;
}

blockquote {
  border-left: 4px solid var(--secondary-color);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: #555;
}

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

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -1rem;
}

.col {
  flex: 1;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background-color: var(--primary-color);
  padding: 0.5rem 0; /* Reduced padding */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
}

.site-logo img {
  height: 32px; /* Reduced height */
  margin-right: 0.5rem;
}

.site-logo h1 {
  color: white;
  font-size: 1.25rem; /* Reduced font size */
  margin: 0;
}

/* Navigation */
.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li {
  margin-left: 1rem; /* Reduced margin */
}

.main-nav a {
  color: white;
  font-weight: 600;
  text-decoration: none;
  padding: 0.25rem 0; /* Reduced padding */
  position: relative;
  font-size: 0.9rem; /* Reduced font size */
}

.main-nav a:hover {
  color: var(--light-color);
}

.main-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px; /* Adjusted position */
  left: 0;
  background-color: var(--light-color);
  transition: width 0.3s ease;
}

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

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.menu-toggle:focus {
  outline: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--light-color) 0%, #f8f9fa 100%);
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.hero-visual {
  position: absolute;
  top: 50%;
  right: -10%;
  transform: translateY(-50%);
  opacity: 0.1;
  width: 60%;
  max-width: 800px;
}

.hero-diagram {
  width: 100%;
  height: auto;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.25rem;
  max-width: 800px;
  margin: 0 auto 3rem;
  color: var(--text-color);
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

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

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-color);
  text-decoration: none;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Legacy button support */
.btn:not(.btn-primary):not(.btn-secondary) {
  background-color: var(--secondary-color);
  color: white;
}

.btn:not(.btn-primary):not(.btn-secondary):hover {
  background-color: var(--accent-color);
  text-decoration: none;
  color: white;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-visual {
  margin: -1.5rem -1.5rem 1rem -1.5rem;
  overflow: hidden;
}

.feature-visual img {
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-visual img {
  transform: scale(1.05);
}

.feature-icon {
  font-size: 2rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
  display: inline-block;
}

.feature-stats {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--light-color);
}

.stat-highlight {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
}

/* Token Comparison */
.comparison-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}

.comparison-side {
  flex: 1;
  min-width: 300px;
  max-width: 400px;
}

.comparison-title {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.comparison-title.english {
  color: #666;
}

.comparison-title.sylang {
  color: var(--secondary-color);
}

.token-example {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.token-example:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.comparison-side:first-child .token-example {
  border-color: #e0e0e0;
}

.comparison-side:last-child .token-example {
  border-color: var(--secondary-color);
}

.token-text {
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.token-count {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--light-color);
}

.token-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.token-label {
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.comparison-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
}

.arrow-icon {
  font-size: 2rem;
  color: var(--secondary-color);
  font-weight: bold;
}

.reduction-badge {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

/* Examples */
.example-block {
  background-color: var(--code-bg);
  border-radius: 5px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.example-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Footer */
.site-footer {
  background-color: var(--dark-color);
  color: white;
  padding: 2rem 0;
  margin-top: 4rem;
}

.site-footer a {
  color: var(--light-color);
}

.site-footer a:hover {
  color: white;
}

.footer-links {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.footer-links li {
  margin: 0 1rem;
}

.copyright {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 768px) {
  .row {
    flex-direction: column;
    margin: 0;
  }

  .col {
    margin-bottom: 2rem;
    padding: 0;
  }

  /* Mobile Navigation */
  .site-header .container {
    flex-direction: row; /* Keep as row for mobile */
  }

  .menu-toggle {
    display: block; /* Show hamburger menu */
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .main-nav.active {
    max-height: 300px; /* Adjust based on menu size */
  }

  .main-nav ul {
    flex-direction: column;
    padding: 0.5rem 0;
  }

  .main-nav li {
    margin: 0;
    width: 100%;
    text-align: center;
  }

  .main-nav a {
    display: block;
    padding: 0.75rem 1rem;
  }

  .main-nav a::after {
    display: none; /* Remove underline animation on mobile */
  }

  pre, code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  .example-block {
    padding: 1rem;
  }

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

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

  .site-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .site-logo h1 {
    font-size: 1.2rem;
  }

  .site-logo span {
    font-size: 0.8rem;
    margin-left: 0.5rem !important;
  }

  /* Hero responsive */
  .hero {
    min-height: 60vh;
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }

  .hero-stats {
    gap: 2rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .hero-visual {
    display: none;
  }

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

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

  /* Comparison responsive */
  .comparison-container {
    flex-direction: column;
    gap: 1.5rem;
  }

  .comparison-side {
    min-width: auto;
    max-width: none;
    width: 100%;
  }

  .comparison-arrow {
    transform: rotate(90deg);
    min-width: auto;
  }

  .arrow-icon {
    font-size: 1.5rem;
  }

  .reduction-badge {
    transform: rotate(-90deg);
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .token-example {
    padding: 1.5rem;
  }

  .token-number {
    font-size: 2rem;
  }
}
