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

:root {
  --primary-color: #333;
  --secondary-color: #4a90e2;
  --accent-color: #2563eb;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 8px;
  --max-width: 900px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
}

#microphone {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background-color: #764ba2;
  color: white;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  outline: none;
}

#microphone:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  background-color: #5a3780;
}

#microphone:active {
  transform: scale(0.95);
}

#microphone:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

#microphone:disabled:hover {
  transform: none;
}

.mic {
  font-size: 32px;
  color: white;
  transition: var(--transition);
}

.mic.active {
  animation: pulse 1.5s ease-in-out infinite;
  color: #ff4444;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.status-indicator {
  position: fixed;
  top: 5rem;
  right: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 0.75rem;
  z-index: 999;
  animation: slideIn 0.3s ease-out;
}

.status-indicator.show {
  display: flex;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { 
    opacity: 1; 
  }
  50% { 
    opacity: 0.3; 
  }
}

.status-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
}

article {
  background-color: var(--card-bg);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

article h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  line-height: 1.3;
}

article img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 2rem auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

article p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  font-size: 1.0625rem;
}

article p:last-child {
  margin-bottom: 0;
}

footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: auto;
}

footer p {
  font-size: 0.9375rem;
}

@media (max-width: 768px) {
  header {
    padding: 1rem 1.5rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  nav ul {
    gap: 1rem;
  }

  main {
    margin: 1rem auto;
    padding: 0 1rem;
  }

  article {
    padding: 1.5rem;
  }

  article h2 {
    font-size: 1.5rem;
  }

  #microphone {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
  }

  .mic {
    font-size: 28px;
  }

  .status-indicator {
    top: 4.5rem;
    right: 1rem;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  article h2 {
    font-size: 1.25rem;
  }
}

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

*:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}
