body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background-color: #ffffff;
  color: #1f2937;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link styling */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #2563eb;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* Header with navigation */
header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  min-height: 60px;
  box-sizing: border-box;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f2937;
  text-decoration: none;
  transition: color 0.3s ease;
  white-space: nowrap;
  line-height: 1;
}

.logo:hover {
  color: #2563eb;
}

.logo:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.container {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 20px;
  text-align: center;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 12px;
  margin-top: 0;
  line-height: 1.2;
  color: #2563eb;
  letter-spacing: -0.02em;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subtitle {
  color: #6b7280;
  margin-bottom: 28px;
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

p {
  line-height: 1.6;
  color: #1f2937;
  margin: 8px 0;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.link {
  background: #2563eb;
  color: white;
  padding: 14px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-block;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.link:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.link:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.3);
}

.link:active {
  transform: translateY(0);
}

/* Error page specific styles */
.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-code {
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 20px 0;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.disclosure {
  margin-top: 28px;
  padding: 16px 18px;
  background: #f3f4f6;
  border-left: 4px solid #2563eb;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.6;
  text-align: left;
}

.disclosure strong {
  color: #1f2937;
  font-weight: 600;
}

footer {
  margin-top: 36px;
  font-size: 0.75rem;
  color: #9ca3af;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
}

footer p {
  margin: 6px 0;
  line-height: 1.5;
}

footer a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

footer a:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Mobile optimization */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  header {
    padding: 12px 16px;
    min-height: 56px;
  }

  .logo {
    font-size: 1rem;
  }

  .container {
    padding: 24px 16px;
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 10px;
  }

  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }

  .links {
    gap: 10px;
    margin: 20px 0;
  }

  .link {
    padding: 12px 14px;
    font-size: 0.9rem;
    border-radius: 6px;
  }

  .disclosure {
    font-size: 0.75rem;
    padding: 12px 14px;
    margin-top: 24px;
  }

  footer {
    font-size: 0.7rem;
    margin-top: 28px;
  }
}

/* Tablet optimization */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
    padding: 28px 20px;
  }

  h1 {
    font-size: 1.6rem;
  }
}

/* Reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
