:root {
  --bg: #f5f5f5;
  --text: #222;
  --primary: #2d6cdf;
  --card-bg: #fff;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.05);
  --link: #2d6cdf;
  --link-hover: #1a4a9e;
}

[data-theme="dark"] {
  --bg: #181a1b;
  --text: #f5f5f5;
  --primary: #7aa2f7;
  --card-bg: #23272e;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.2);
  --link: #7aa2f7;
  --link-hover: #a6adba;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

header, nav, main, footer {
  max-width: 900px;
  margin: auto;
  padding: 1rem;
}

nav {
  display: flex;
  gap: 1.5rem;
  justify-content: flex-end;
  align-items: center;
}

nav a {
  position: relative;
  padding: 0.5em 1.2em;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  color: #0078d7;
  text-decoration: none;
  z-index: 1;
  font-weight: bold; /* <-- Add this line */
}

nav a::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  border-radius: 999px;
  background: #0078d7;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s;
  z-index: -1;
}

nav a:hover::before,
nav a:focus::before {
  opacity: 1;
  transform: scale(1);
}

nav a:hover,
nav a:focus {
  color: #fff;
  outline: none;
}

.dark-toggle {
  margin-left: auto;
  cursor: pointer;
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 1.5rem;
  padding: 0.3rem 1rem;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}

h1, h2, h3 {
  color: var(--primary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

.card a {
  margin-top: auto;
  color: var(--primary);
  text-decoration: underline;
}

.card {
  transition: transform 0.2s cubic-bezier(.4,2,.3,1), box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
}
.card:hover, .card:focus {
  transform: scale(1.04) translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  outline: none;
}

/* Optional: for keyboard accessibility */
.card:focus {
  border: 2px solid #0078d7;
}

.timeline {
  display: flex;
  overflow-x: auto;
  gap: 2rem;
  padding: 2rem 0;
  align-items: flex-end;
}

.timeline-milestone {
  background: var(--card-bg);
  border-radius: 0.5rem;
  box-shadow: var(--card-shadow);
  padding: 1rem 1.5rem;
  min-width: 180px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
  outline: none;
}

.timeline-milestone:focus, .timeline-milestone:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 4px 16px rgba(45,108,223,0.15);
}

.timeline-milestone.selected {
  border: 2px solid var(--primary);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin: 2rem auto;
}

label {
  font-weight: 500;
}

input, textarea {
  padding: 0.5rem;
  border: 1px solid #bbb;
  border-radius: 0.3rem;
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
}

input:focus, textarea:focus {
  border-color: var(--primary);
  outline: none;
}

button[type="submit"] {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0.3rem;
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover, button[type="submit"]:focus {
  background: var(--link-hover);
}

.error {
  color: #d32f2f;
  font-size: 0.95em;
  margin-top: -0.5rem;
}

[aria-live] {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Vertical Timeline */
.vertical-timeline {
  position: relative;
  margin: 2em auto;
  padding-left: 40px;
  max-width: 600px;
  min-height: 80vh;
}

.vertical-timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.timeline-milestone {
  position: relative;
  margin-bottom: 3em;
  min-height: 60px;
}

.timeline-dot {
  position: absolute;
  left: -2px;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.timeline-milestone:hover .timeline-dot,
.timeline-milestone:focus .timeline-dot {
  transform: scale(1.2);
  background: var(--link-hover, #1a4a9e);
}

.timeline-content {
  background: var(--card-bg);
  padding: 1em 1.5em;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  margin-left: 40px;
  transition: box-shadow 0.2s;
}

.timeline-milestone:hover .timeline-content,
.timeline-milestone:focus .timeline-content {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Make timeline cards look like cards, not links */
.timeline-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--card-bg);
  padding: 1em 1.5em;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  margin-left: 40px;
  transition: box-shadow 0.2s, background 0.2s;
}

.timeline-card-link:hover,
.timeline-card-link:focus {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  background: #676b72;
  outline: none;
}

.contact-logos {
  display: flex;
  gap: 1.5em;
  list-style: none;
  padding: 0;
  margin: 1em 0;
  align-items: center;
}
.contact-icon {
  width: 40px;
  height: 40px;
  transition: transform 0.2s;
}
.contact-icon:hover,
.contact-icon:focus {
  transform: scale(1.15);
}

/* Make contact icons lighter in dark mode */
[data-theme="dark"] .contact-icon {
  filter: brightness(2) drop-shadow(0 0 2px #fff);
}

@media (max-width: 600px) {
  header, nav, main, footer {
    padding: 0.7rem;
  }
  .timeline {
    gap: 1rem;
    padding: 1rem 0;
  }
}
