html {
  font-size: 87.5%;
}

:root {
  --color-navy: #16213E;
  --color-indigo: #1F4E8C;
  --color-violet: #2E6FBE;
  --color-violet-light: #5B9BD8;
  --gradient-primary: linear-gradient(135deg, var(--color-navy) 0%, var(--color-indigo) 50%, var(--color-violet) 100%);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: white;
  color: #222;
}

header {
  background-image: linear-gradient(135deg, rgba(22, 33, 62, 0.86) 0%, rgba(31, 78, 140, 0.82) 50%, rgba(46, 111, 190, 0.78) 100%), url('assets/background.png');
  background-size: 200% 200%, cover;
  background-position: 0% 50%, center center;
  background-repeat: no-repeat, no-repeat;
  animation: gradientShift 18s ease infinite;
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%, center center; }
  50% { background-position: 100% 50%, center center; }
  100% { background-position: 0% 50%, center center; }
}

.header-inner {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

header h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0.5px;
}

header h1.signature {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 600;
  font-size: 2.6rem;
  letter-spacing: 1px;
  color: #F5F5FA;
}

.tagline {
  margin: 0.5rem 0 1.5rem 0;
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

.header-profile-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0.6rem 0 1rem 0;
}

.header-profile-links a {
  display: flex;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-profile-links a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.header-profile-links img,
.header-profile-links svg {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

nav {
  margin-top: 0.5rem;
}

nav a {
  position: relative;
  color: white;
  margin: 0 1rem;
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 0.2rem;
}

nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: white;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

nav a.active::after, nav a:hover::after {
  transform: scaleX(1);
}

main {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.home .intro {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 3rem;
  margin-top: 1rem;
}

.profile-photo {
  width: 300px;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.intro-text {
  flex: 1;
}

.hello {
  font-size: 1.8rem;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--color-navy);
}

.intro-text p {
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.cta-row {
  margin: 2rem 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  transition: background-position 0.4s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46, 111, 190, 0.3);
}

.button-secondary {
  background: transparent;
  color: var(--color-navy);
  border: 2px solid var(--color-violet);
}

.button-secondary:hover {
  background: #f5f1fd;
  transform: translateY(-2px);
}

.quick-facts {
  list-style: none;
  padding: 1.5rem;
  background: #fff;
  border-left: 4px solid var(--color-violet);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin: 2rem 0;
}

.quick-facts li {
  margin-bottom: 0.8rem;
}

.quick-facts li:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-violet);
}

a:hover {
  color: var(--color-indigo);
}

@media (max-width: 768px) {
  .home .intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo {
    width: 200px;
    margin-right: 0;
    margin-bottom: 2rem;
  }

  .cta-row {
    justify-content: center;
  }

  .quick-facts {
    text-align: left;
  }
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: #eee;
  margin-top: 2rem;
  clear: both;
}

.cv section, main section {
  margin-bottom: 2.5rem;
}

.cv h2, main h2 {
  color: var(--color-navy);
  border-bottom: 2px solid var(--color-violet-light);
  padding-bottom: 0.3rem;
  margin-bottom: 1.5rem;
}

.entry {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: center;
  flex-wrap: nowrap; /* Prevent wrapping unless on mobile */
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
}

a.entry {
  cursor: pointer;
}

.entry:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(31, 78, 140, 0.12);
}

.entry-logo {
  flex: 0 0 70px; /* Don't grow, don't shrink, stay at 70px */
  width: 70px;
  height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  overflow: hidden;
}

.entry-logo img {
  max-width: 60px; /* Force strict width */
  max-height: 60px; /* Force strict height */
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (max-width: 600px) {
  .entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .entry-logo {
    width: 60px;
    height: 60px;
  }

  .entry-logo img {
    max-width: 50px;
    max-height: 50px;
  }
}

.entry-content {
  flex-grow: 1;
}

.entry-content h3 {
  margin: 0;
  font-size: 1.15rem;
}

.entry-content p {
  margin: 0.2rem 0 0.6rem 0;
  font-style: italic;
  color: #555;
}

.entry-content ul {
  margin: 0;
  padding-left: 1.2rem;
}

.skill {
  margin-bottom: 1rem;
}

.skill span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.bar {
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  height: 24px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.level {
  height: 100%;
  background: linear-gradient(90deg, var(--color-navy), var(--color-violet));
  color: white;
  text-align: right;
  padding-right: 8px;
  font-size: 0.85rem;
  font-weight: bold;
  line-height: 24px;
  border-radius: 10px 0 0 10px;
  transition: width 1s ease;
}

/* Scroll-reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  header {
    animation: none;
  }

  .button, .entry, .level {
    transition: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
