/* CSS Variables for Theme Colors */
:root {
  --bg-color: #fdf6e3;
  --text-color: #073642;
  --text-muted: #586e75;
  --accent-color: #d33682;
  --accent-visited: #dc322f;
  --accent-hover: #b58900;
  --secondary-color: #2aa198;
  --border-color: #eee8d5;
  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.1);
}

:root.dark-theme {
  --bg-color: #002b36;
  --text-color: #839496;
  --text-muted: #657b83;
  --accent-color: #d33682;
  --accent-visited: #dc322f;
  --accent-hover: #b58900;
  --secondary-color: #2aa198;
  --border-color: #073642;
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.5);
}

:root.light-theme {
  --bg-color: #fdf6e3;
  --text-color: #073642;
  --text-muted: #586e75;
  --accent-color: #d33682;
  --accent-visited: #dc322f;
  --accent-hover: #b58900;
  --secondary-color: #2aa198;
  --border-color: #eee8d5;
  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.1);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Source Code Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0;
  padding: 0;
  line-height: 1.7;
  font-weight: 400;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease-out forwards;
}

body.loaded {
  opacity: 1;
  transform: translateY(0);
}

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

/* Layout */
main {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 2rem 1rem;
  max-width: 100%;
}

section {
  flex: none;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Typography */
h1 {
  font-family: "Source Code Pro", monospace;
  font-weight: 300;
  font-size: clamp(2.5rem, 8vw, 4rem);
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-color);
  line-height: 1.1;
}

p {
  font-size: clamp(1rem, 3vw, 1.1rem);
  line-height: 1.7;
  margin: 0;
  color: var(--text-color);
}

.title {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--text-muted);
  margin: 0.5rem 0 0 0;
  font-weight: 400;
}

/* Company Styling */
.company {
  color: var(--accent-color);
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
}

.company::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent-color);
  opacity: 0;
  transform: scaleX(0);
  transition: all 0.3s ease;
}

.company:hover::after {
  opacity: 0.6;
  transform: scaleX(1);
}

.company-mention {
  color: var(--accent-color);
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
  cursor: default;
}

.company-mention::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent-color);
  opacity: 0.3;
  transform: scaleX(0);
  transition: all 0.3s ease;
}

.company-mention:hover::after {
  transform: scaleX(1);
}

/* Links */
a {
  color: var(--accent-color);
  text-decoration: none;
  padding: 0.1rem 0.2rem;
  border-radius: 0.2rem;
  transition: all 0.3s ease;
  position: relative;
  font-weight: 500;
}

a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent-color);
  opacity: 0;
  border-radius: 0.2rem;
  transform: scaleY(0);
  transition: all 0.3s ease;
  z-index: -1;
}

a:hover::before {
  opacity: 0.1;
  transform: scaleY(1);
}

a:visited {
  color: var(--accent-visited);
}

a:hover,
a:focus {
  color: var(--accent-hover);
}

/* Language Link */
#language {
  font-size: 0.9rem;
  margin-top: 1rem;
}

#language a {
  color: var(--secondary-color);
  text-decoration: none;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
}

#language a::before {
  background-color: var(--secondary-color);
}

#language a:hover,
#language a:focus {
  color: var(--bg-color);
}

#language a:hover::before {
  opacity: 1;
}

#language a:visited {
  color: var(--secondary-color);
}

/* Focus States */
a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Improved Section Spacing */
.description {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.description p {
  margin: 0;
}

.contact {
  margin-top: 0.5rem;
}

.other {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.company {
  animation: pulse 4s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    padding: 1rem 0.5rem;
  }
  
  section {
    gap: 2rem;
    padding: 0 1rem;
  }
  
  h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }
  
  p {
    font-size: clamp(0.95rem, 3vw, 1.05rem);
  }
}

@media (max-width: 480px) {
  main {
    padding: 0.5rem 0.25rem;
  }
  
  section {
    gap: 1.5rem;
    padding: 0 0.5rem;
  }
  
  h1 {
    font-size: clamp(1.8rem, 12vw, 2.5rem);
  }
  
  p {
    font-size: clamp(0.9rem, 3vw, 1rem);
    line-height: 1.6;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  body {
    animation: none;
    opacity: 1;
    transform: none;
  }
}