:root {
  --color-bg: #1a237e;
  --color-fg: #fff;
  --color-accent: #2196f3;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.6s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-accent);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
}

.speed-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.speed-display {
  font-size: clamp(2.5rem, 10vw, 10rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  display: flex;
  align-items: baseline;
  gap: clamp(0.5rem, 1vw, 2rem);
  user-select: none;
  transition: color 0.6s cubic-bezier(.4,0,.2,1);
}

#unit {
  font-size: clamp(1rem, 2vw, 3rem);
  font-weight: 400;
  opacity: 0.7;
}

#toggle-unit {
  margin-top: 4vh;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--color-fg);
  font-size: clamp(1rem, 1.2rem, 2rem);
  padding: 0.7em 2em;
  border-radius: 2em;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  outline: none;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.08);
}

#toggle-unit:active {
  background: var(--color-accent);
  color: #fff;
}

/* Navigation */
.app-nav {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.8rem;
  z-index: 100;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
}

.nav-button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--color-fg);
  font-size: 0.9rem;
  padding: 0.5em 1.2em;
  border-radius: 1.5em;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  backdrop-filter: blur(10px);
}

.nav-button:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.nav-button:active {
  background: var(--color-accent);
  transform: translateY(0);
}

/* Content Sections */
.content-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--color-bg);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(.4,0,.2,1);
  z-index: 200;
  padding: 2rem 0;
  box-sizing: border-box;
}

.content-section.active {
  transform: translateY(0);
}

.content-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  line-height: 1.6;
}

.content-container h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  color: var(--color-accent);
  text-align: center;
}

.content-container h3 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin: 1.5rem 0 0.5rem 0;
  color: var(--color-accent);
}

.content-container p {
  margin-bottom: 1rem;
  opacity: 0.9;
}

.content-container ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.content-container li {
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.content-container strong {
  color: var(--color-accent);
}

/* FAQ Items */
.faq-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.faq-item h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.faq-item p {
  margin-bottom: 0;
}

/* Close button for content sections */
.content-section::before {
  content: "✕";
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--color-fg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 210;
  backdrop-filter: blur(10px);
}

.content-section::before:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .content-container {
    padding: 1rem;
  }
  
  .app-nav {
    bottom: 1rem;
    gap: 0.5rem;
    max-width: 95vw;
  }
  
  .nav-button {
    font-size: 0.75rem;
    padding: 0.4em 0.8em;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}