:root {
  --bg: #020617;
  --sec-bg: #0B1120;
  --card-bg: #111827;
  --accent: #3B82F6;
  --sec-accent: #8B5CF6;
  --highlight: #22D3EE;
  --text-main: #FFFFFF;
  --text-muted: #9CA3AF;
  --nav-height: 70px;
}

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

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Layout System */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.section {
  padding: 60px 0;
  background-color: var(--bg);
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 24px;
  background-color: var(--accent);
  border-radius: 2px;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background-color: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.nav-links a:focus {
  outline: 2px solid var(--highlight);
  outline-offset: 4px;
  border-radius: 2px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: #2563EB;
  transform: translateY(-2px);
}

.btn-primary:focus {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background-color: #1F2937;
  transform: translateY(-2px);
}

.hero-image-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Grid System */
.media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.media-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  transform: scale(1.05);
  z-index: 2;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.media-card:focus {
  outline: none;
  border-color: var(--highlight);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

.card-image-container {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #1F2937;
  position: relative;
  overflow: hidden;
}

.card-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.card-info {
  padding: 10px 12px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.app-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.2s ease;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.app-card:hover {
  transform: scale(1.05);
  background-color: #1F2937;
}

.app-card img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  margin-bottom: 12px;
}

.app-title {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Settings Slide-in Panel */
.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.settings-overlay.active {
  opacity: 1;
  visibility: visible;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background-color: var(--sec-bg);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-panel.active {
  transform: translateX(0);
}

.settings-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-header h2 {
  font-size: 1.25rem;
  color: var(--text-main);
}

.close-settings {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-settings:hover {
  color: var(--text-main);
}

.settings-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item span {
  font-size: 0.95rem;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background-color: var(--card-bg);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.toggle-switch.on {
  background-color: var(--accent);
  border-color: var(--accent);
}

.toggle-switch.on::after {
  transform: translateX(20px);
  background-color: #fff;
}

/* Footer */
footer {
  background-color: var(--sec-bg);
  padding: 60px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-main);
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-col ul a:hover {
  color: var(--text-main);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Legal Pages Format */
.legal-content {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 60px;
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: var(--accent);
}

.legal-content h2 {
  font-size: 1.5rem;
  margin-top: 30px;
  margin-bottom: 15px;
}

.legal-content p {
  color: var(--text-muted);
  margin-bottom: 15px;
}

.legal-content ul {
  color: var(--text-muted);
  margin-bottom: 15px;
  padding-left: 20px;
}

/* Responsiveness */
@media (max-width: 1280px) {
  .media-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .apps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-content p {
    margin: 0 auto 32px;
  }
  
  .hero-buttons {
    justify-content: center;
  }

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

@media (max-width: 640px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background-color: var(--sec-bg);
    flex-direction: column;
    gap: 0;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 99;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .nav-links li {
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 16px;
    font-size: 1.1rem;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

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

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

  .settings-panel {
    width: 100%;
  }

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