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

:root {
  --primary-color: #EE5253;
  --primary-hover: #d63031;
  --bg-color: #fafafa;
  --bg-secondary: #f0f0f0;
  --text-primary: #2d2d2d;
  --text-secondary: #5a5a5a;
  --text-muted: #888888;
  --border-color: #e0e0e0;
  --card-bg: #ffffff;
  --card-hover: #fff5f5;
  --gradient-start: #EE5253;
  --gradient-end: #ff7675;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Language Picker */
.lang-picker {
  position: absolute;
  top: 24px;
  right: 0;
  z-index: 100;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

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

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

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  min-width: 120px;
}

.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.lang-option:hover {
  background: var(--bg-secondary);
}

.lang-option.active {
  color: var(--primary-color);
  font-weight: 600;
  background: rgba(238, 82, 83, 0.08);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center top, rgba(238, 82, 83, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

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

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 20px rgba(238, 82, 83, 0.4));
}

.logo-text {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 24px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 500;
}

.subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Apps Section */
.apps-section {
  padding: 40px 0 80px;
  flex: 1;
}

.section-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 40px;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  border-radius: 2px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

/* App Card */
.app-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.app-card:hover {
  background: var(--card-hover);
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(238, 82, 83, 0.12);
}

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

.app-card.coming-soon {
  opacity: 0.6;
  cursor: default;
}

.app-card.coming-soon:hover {
  transform: none;
  box-shadow: none;
  background: var(--card-bg);
  border-color: var(--border-color);
}

.app-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.app-icon svg {
  width: 100%;
  height: 100%;
  stroke: white;
}

.app-icon.opensnipping-icon,
.app-icon.openmathboard-icon {
  background: transparent;
  padding: 0;
}

.app-icon.opensnipping-icon img,
.app-icon.openmathboard-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-icon.placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
}

.app-icon.placeholder svg {
  stroke: var(--text-muted);
}

.app-info {
  flex: 1;
}

.app-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.app-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.app-arrow {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  align-self: center;
}

.app-card:hover .app-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--primary-color);
}

/* Footer */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero {
    padding: 80px 0 60px;
  }

  .lang-picker {
    top: 16px;
    right: 0;
  }

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

  .logo-icon {
    font-size: 56px;
  }

  .logo-text {
    font-size: 36px;
  }

  .tagline {
    font-size: 20px;
  }

  .subtitle {
    font-size: 16px;
  }

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

  .app-card {
    padding: 20px;
  }

  .section-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

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

  .lang-picker {
    top: 12px;
  }

  .lang-btn {
    width: 36px;
    height: 36px;
  }

  .lang-btn svg {
    width: 18px;
    height: 18px;
  }

  .logo-text {
    font-size: 28px;
  }

  .app-card {
    flex-direction: column;
    text-align: center;
  }

  .app-icon {
    margin: 0 auto;
  }

  .app-arrow {
    display: none;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content {
  animation: fadeInUp 0.8s ease-out;
}

.app-card {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.app-card:nth-child(1) {
  animation-delay: 0.1s;
}

.app-card:nth-child(2) {
  animation-delay: 0.2s;
}

.app-card:nth-child(3) {
  animation-delay: 0.3s;
}

.app-card:nth-child(4) {
  animation-delay: 0.4s;
}
