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

body {
  background-color: #111;
  color: #ddd;
  font-family: "Rubik", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-left { text-align: left; }

.container-full { 
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container-page {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

.content-main {
  text-align: center;
  max-width: 600px;
  width: 90%;
  animation: fadeIn 1s ease-in;
  display: flex;
  flex-direction: column;
  gap: 3em;
}

.content-page {
  max-width: 800px;
  width: 90%;
  margin: 0 auto;
  text-align: left;
}

.gap-xs { gap: 0.5em; }
.gap-sm { gap: 0.8em; }
.gap-md { gap: 1em; }
.gap-lg { gap: 2em; }
.gap-xl { gap: 3em; }

.mb-xs { margin-bottom: 0.5em; }
.mb-sm { margin-bottom: 1em; }
.mb-md { margin-bottom: 1em; }
.mb-lg { margin-bottom: 2em; }
.mt-lg { margin-top: 2em; }
.pt-lg { padding-top: 2em; }

.text-display {
  font-size: 3.5em;
  font-weight: 700;
  letter-spacing: -1px;
  background: #fff;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.text-title {
  font-size: 2.5em;
  margin: 1em 0;
  text-align: center;
}

.text-subtitle {
  font-size: 2em;
  font-weight: 300;
  letter-spacing: -0.5px;
  animation: fadeInUp 1s ease-in-out;
}

.text-section {
  font-size: 1.5em;
  margin-bottom: 0.5em;
  color: #fff;
}

.text-body {
  font-size: 1.1em;
}

.text-small {
  font-size: 0.9em;
}

.text-primary { color: #fff; }
.text-secondary { color: #ddd; }
.text-muted { color: #aaa; }
.text-subtle { color: #999; }
.text-dim { color: #666; }

.bg-dark { background-color: #111; }
.border-subtle { border-top: 1px solid #333; }

.transition-color { transition: color 0.3s ease; }
.transition-fill { transition: fill 0.3s ease; }

.hover-primary:hover,
.hover-primary:focus { 
  color: #fff; 
  outline: none;
}

.hover-primary:hover .icon,
.hover-primary:focus .icon { 
  fill: #fff; 
}

.hover-primary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}

.header-group {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  font-size: 1.1em;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  color: #999;
  transition: color 0.3s ease, transform 0.2s ease;
}

.contact-item:hover,
.contact-item:focus {
  transform: translateY(-2px);
}

.footer-main {
  background-color: #111;
  padding: 20px;
  width: 100%;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-nav {
  display: flex;
  gap: 20px;
}

.link-footer {
  color: #999;
  text-decoration: none;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
}

.link-footer:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.link-page {
  color: #999;
  text-decoration: none;
  transition: color 0.3s ease;
  padding: 2px 4px;
  border-radius: 4px;
}

.link-page:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.back-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: #999;
  text-decoration: none;
  transition: color 0.3s ease;
  margin-bottom: 2em;
  padding: 8px 12px;
  border-radius: 6px;
}

.back-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.sections-list {
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.section-item {
  animation: fadeIn 0.5s ease-in;
  animation-fill-mode: both;
}

.page-footer {
  margin-top: 2em;
  padding-top: 2em;
  border-top: 1px solid #333;
}

/* Button styles for error pages and actions */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(45deg, #333, #555);
  color: #fff;
  border: 1px solid #666;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(45deg, #444, #666);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: transparent;
  color: #999;
  border: 1px solid #333;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #222;
  color: #fff;
  border-color: #555;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.error-actions {
  margin-top: 1.5em;
}

.icon {
  fill: #666;
  transition: fill 0.3s ease;
}

.animate-fade { animation: fadeIn 1s ease-in; }
.animate-fade-up { animation: fadeInUp 1s ease-in-out; }
.animate-stagger { animation: fadeIn 0.5s ease-in; animation-fill-mode: both; }

.animate-stagger:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger:nth-child(5) { animation-delay: 0.5s; }
.animate-stagger:nth-child(6) { animation-delay: 0.6s; }
.animate-stagger:nth-child(7) { animation-delay: 0.7s; }
.animate-stagger:nth-child(8) { animation-delay: 0.8s; }
.animate-stagger:nth-child(9) { animation-delay: 0.9s; }

@media screen and (max-width: 768px) {
  .container-full,
  .container-page {
    padding: 16px;
  }
  
  .content-main {
    gap: 2em;
    width: 95%;
  }
  
  .content-page {
    width: 95%;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    padding: 0 16px;
  }
  
  .footer-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .contact-grid {
    gap: 1.2em;
  }
  
  .contact-item {
    font-size: 1rem;
  }
  
  .back-nav {
    margin-bottom: 1.5em;
  }
  
  .sections-list {
    gap: 1.5em;
  }
}

@media screen and (max-width: 439px) {
  .text-display { 
    font-size: 2.5em; 
    line-height: 1.1;
  }
  
  .text-subtitle { 
    font-size: 1.5em;
    line-height: 1.2;
  }
  
  .text-title {
    font-size: 2em;
  }
  
  .text-section {
    font-size: 1.3em;
  }
  
  .contact-item {
    font-size: 0.95rem;
  }
  
  .footer-nav {
    gap: 12px;
  }
  
  .link-footer {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade,
  .animate-fade-up,
  .animate-stagger {
    animation: none;
  }
  
  .contact-item,
  .transition-color,
  .transition-fill {
    transition: none;
  }
}

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

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