/* ========== CSS Custom Properties ========== */
:root {
  --color-primary: #1a1a2e;
  --color-primary-light: #16213e;
  --color-accent: #0077b6;
  --color-accent-hover: #005f8a;
  --color-bg: #f8f9fa;
  --color-bg-alt: #ffffff;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-border: #e0e0e0;
  --color-code-bg: #1e1e2e;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', 'Monaco', monospace;
  --max-width: 1100px;
  --header-height: 64px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

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

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

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

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

ul {
  list-style: none;
}

/* ========== Layout ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ========== Header ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-primary);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

.header.scrolled {
  background: rgba(26, 26, 46, 0.95);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover {
  color: #ffffff;
}

.logo-img {
  height: 50px;
  width: auto;
}

/* ========== Nav (mobile default: slide-out) ========== */
.nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--color-primary);
  display: flex;
  flex-direction: column;
  padding: 80px 32px 32px;
  gap: 4px;
  transition: right var(--transition);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.nav.open {
  right: 0;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 16px;
  width: 100%;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ========== Language (mobile default) ========== */
.lang-switch {
  display: none;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lang-link {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.lang-link:hover {
  color: #ffffff;
}

.lang-link.active {
  color: #ffffff;
  background: var(--color-accent);
}

.lang-mobile {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: auto;
  transition: color var(--transition);
}

.lang-mobile:hover {
  color: #ffffff;
}

/* ========== Hamburger (mobile default: visible) ========== */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

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

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

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

/* ========== Hero (mobile default) ========== */
.hero {
  padding: 100px 0 50px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, #0f3460 100%);
  color: #ffffff;
  text-align: center;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 16px;
}

.hero-description {
  font-size: 0.95rem;
  opacity: 0.75;
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
}

.stat {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 12px 20px;
  backdrop-filter: blur(4px);
  user-select: none;
  width: 100%;
  max-width: 240px;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ========== Sections ========== */
.section {
  padding: 50px 0;
}

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

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-intro {
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto 32px;
}

/* ========== Cards Grid ========== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  line-height: 1;
  column-gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.card-icon {
  font-size: 2rem;
  color: var(--color-accent);
  margin-bottom: 0;
}

.card p {
  color: var(--color-text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========== Timeline ========== */
.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-accent);
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -34px;
  top: 6px;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 3px solid var(--color-bg-alt);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.timeline-content p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ========== Components ========== */
.component-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.component-group {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
}

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

.group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

.component-list li {
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.component-list li:last-child {
  border-bottom: none;
}

.component-list li strong {
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.component-list li span {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ========== Guidelines ========== */
.guidelines-list {
  list-style: none;
}

.guidelines-list li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--color-text-light);
  position: relative;
  padding-left: 16px;
}

.guidelines-list li::before {
  content: '\203A';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* ========== About ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.about-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
}

.about-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.about-card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.about-links a {
  font-weight: 600;
}

/* ========== Footer ========== */
.footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.6);
  padding: 32px 0;
  text-align: center;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-meta {
  font-size: 0.8rem;
  opacity: 0.5;
}

/* ========== Desktop (768px+) ========== */
@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 10% 80% 10%;
    align-items: center;
    gap: 0;
  }

  .hamburger {
    display: none;
  }

  .lang-mobile {
    display: none;
  }

  .nav {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 4px;
    box-shadow: none;
    background: none;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 6px 10px;
    width: auto;
  }

  .lang-switch {
    display: flex;
    justify-content: flex-end;
  }

  .hero {
    padding: 140px 0 80px;
  }

  .hero-title {
    font-size: 3.2rem;
  }

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

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

  .hero-stats {
    flex-direction: row;
    gap: 32px;
  }

  .stat {
    width: auto;
    max-width: none;
    padding: 16px 28px;
  }

  .section {
    padding: 80px 0;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .section-intro {
    font-size: 1.05rem;
    margin-bottom: 48px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .card {
    padding: 32px;
  }

  .card h3 {
    font-size: 1.15rem;
  }

  .card p {
    font-size: 0.95rem;
  }

  .component-groups {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .component-group {
    padding: 24px;
  }

  .about-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .about-card {
    padding: 32px;
  }
}