:root {
  --primary-color: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary-color: #475569;
  --accent-color: #d97706;
  --success-color: #059669;
  --warning-color: #d97706;
  --error-color: #dc2626;
  --bg-color: #fafbfc;
  --surface-color: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --accent-primary: #1e40af;
  --accent-secondary: #334155;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header {
  background: var(--surface-color);
  padding: 12px 0;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.logo:hover {
  color: var(--primary-dark);
}

.logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: all 0.3s ease;
  position: relative;
  padding: 4px 0;
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

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

/* Hero Section */
.hero {
  background: var(--primary-color);
  color: white;
  padding: 60px 0 70px;
  text-align: center;
  position: relative;
  border-bottom: 3px solid var(--primary-dark);
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 20px;
  opacity: 0.95;
  margin-bottom: 32px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

.btn-primary {
  background: white;
  color: var(--primary-color);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--bg-color);
  border-color: white;
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Section Styles */
.section {
  padding: 50px 0;
}

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

.section-subtitle {
  font-size: 18px;
  text-align: center;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 32px;
  line-height: 1.6;
  font-weight: 400;
}

/* Training Tracks */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.track-card {
  background: var(--surface-color);
  padding: 28px;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.track-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.track-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.08);
}

.track-card:hover::before {
  transform: scaleX(1);
}

.track-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 24px;
  color: white;
  transition: background 0.2s ease;
}

.track-card:hover .track-icon {
  background: var(--primary-dark);
}

.track-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.track-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
  font-size: 15px;
}

.btn-track {
  background: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  width: fit-content;
  font-size: 15px;
  border: none;
}

.btn-track:hover {
  background: var(--primary-dark);
}

/* Archive Section */
.archive-section {
  background: var(--surface-color);
}

.archive-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.archive-filter {
  padding: 8px 16px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.archive-filter:hover,
.archive-filter.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.archive-card {
  background: var(--surface-color);
  padding: 20px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  position: relative;
}

.archive-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.archive-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.08);
  text-decoration: none;
  color: inherit;
}

.archive-card:hover::before {
  transform: scaleX(1);
}

.archive-year {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.archive-info {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Problem of the Week */
.potw-section {
  background: var(--bg-color);
}

.potw-container {
  background: var(--surface-color);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08);
  border: 1px solid var(--border-color);
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.potw-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
}

.potw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.potw-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.potw-badge {
  background: var(--primary-color);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

.potw-content {
  margin-bottom: 24px;
}

.potw-problem {
  background: var(--bg-color);
  padding: 24px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.7;
}

.potw-submit {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.potw-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.2s ease;
  background: var(--surface-color);
  color: var(--text-primary);
}

.potw-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.1);
}

.leaderboard {
  margin-top: 24px;
}

.leaderboard-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.leaderboard-list {
  list-style: none;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-color);
  border-radius: 8px;
  margin-bottom: 8px;
}

.leaderboard-rank {
  width: 28px;
  height: 28px;
  background: var(--primary-color);
  color: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.leaderboard-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.leaderboard-score {
  color: var(--success-color);
  font-weight: 600;
}

/* Operational Section */
.operational-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.operational-card {
  background: var(--surface-color);
  padding: 28px;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}

.operational-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.operational-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.08);
}

.operational-card:hover::before {
  transform: scaleX(1);
}

.operational-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 24px;
  color: white;
  transition: background 0.2s ease;
}

.operational-card:hover .operational-icon {
  background: var(--primary-dark);
}

.operational-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.operational-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 15px;
}

/* Proof Tiles */
.proof-section {
  background: var(--surface-color);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.proof-tile {
  background: var(--surface-color);
  padding: 24px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: all 0.2s ease;
  position: relative;
}

.proof-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.proof-tile:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.08);
}

.proof-tile:hover::before {
  transform: scaleX(1);
}

.proof-number {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.proof-label {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
}

/* Footer */
.footer {
  background: var(--surface-color);
  padding: 40px 0 32px;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  text-align: center;
}

.footer p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--text-primary);
  padding: 8px;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-nav {
    display: block;
  }
  
  .hero {
    padding: 60px 0;
  }

  .hero {
    padding: 40px 0 50px;
  }

  .hero h1 {
    font-size: 32px;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
  }
  
  .hero p {
    font-size: 18px;
    margin-bottom: 24px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

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

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 28px;
    letter-spacing: -0.01em;
  }

  .section-subtitle {
    font-size: 16px;
  }

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

  .potw-container {
    padding: 32px 20px;
  }

  .potw-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .proof-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

