/* Core layout */
:root {
  --color-background: #0f172a;
  --color-surface: #111827;
  --color-surface-alt: #f4f6fb;
  --color-primary: #c08457;
  --color-secondary: #2563eb;
  --color-text: #0b1020;
  --color-text-light: #f8fafc;
  --color-muted: #5f6b85;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --radius-sm: 12px;
  --radius-md: 18px;
  --shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.18);
  --max-width: 1040px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

body {
  margin: 0;
  color: var(--color-text);
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
}

a {
  color: var(--color-secondary);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

.section {
  padding: var(--space-xl) 0;
  background-color: #ffffff;
}

.section.alt {
  background: var(--color-surface-alt);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.section-header p {
  color: var(--color-muted);
  max-width: 720px;
  margin: 0 auto;
}

/* Header */
.site-header {
  background: var(--color-surface);
  color: var(--color-text-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Language Switcher */
.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: var(--space-md);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  color: var(--color-text-light);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lang-toggle:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.12));
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lang-toggle:active {
  transform: translateY(0);
}

.lang-toggle .lang-current {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.lang-toggle .lang-icon {
  font-size: 1.1rem;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  min-width: 160px;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

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

.lang-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  color: var(--color-text-light);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.lang-option::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 15px;
  margin-right: var(--space-xs);
  background-size: cover;
  border-radius: 2px;
}

.lang-option[data-lang="en"]::before {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><rect width="60" height="30" fill="%23012169"/><path d="M0 0l60 30m0-30L0 30" stroke="%23fff" stroke-width="6"/><path d="M0 0l60 30m0-30L0 30" stroke="%23C8102E" stroke-width="4"/><path d="M30 0v30M0 15h60" stroke="%23fff" stroke-width="10"/><path d="M30 0v30M0 15h60" stroke="%23C8102E" stroke-width="6"/></svg>');
}

.lang-option[data-lang="tr"]::before {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><rect width="1200" height="800" fill="%23E30A17"/><circle cx="425" cy="400" r="200" fill="%23fff"/><circle cx="475" cy="400" r="160" fill="%23E30A17"/><path d="M580 400l60 40-20-65 20-65-60 40-60-40 20 65-20 65z" fill="%23fff"/></svg>');
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lang-option.active {
  background: rgba(192, 132, 87, 0.2);
  color: var(--color-primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .language-switcher {
    order: -1;
    align-self: flex-end;
    margin-left: 0;
    margin-bottom: var(--space-sm);
  }
  
  .lang-toggle {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.9rem;
  }
  
  .site-nav ul {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

.branding {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.6rem;
}

.site-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-md);
  padding: 0;
  margin: 0;
}

.site-nav a {
  color: var(--color-text-light);
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--color-primary);
}

/* Hero */
.hero {
  color: var(--color-text-light);
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.25), transparent 55%),
    radial-gradient(circle at bottom left, rgba(192, 132, 87, 0.35), transparent 65%),
    linear-gradient(120deg, #0f172a, #192238 65%, #0f172a);
  padding: calc(var(--space-xl) + 1.5rem) 0;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M80 2L83.8891 17.1119L98.5114 6.94713L92.9386 22.1935L109.672 19.2579L99.2378 31.659L115.277 35.9769L99.554 39.4375L109.416 52.0567L92.7081 49.0686L98.0697 64.2255L83.5555 53.8556L80 69.0002L76.4445 53.8556L61.9303 64.2255L67.2919 49.0686L50.5838 52.0567L60.446 39.4375L44.7233 35.9769L60.7622 31.659L50.3282 19.2579L67.0614 22.1935L61.4886 6.94713L76.1109 17.1119L80 2Z' fill='%23ffffff' fill-opacity='0.04'/%3E%3C/svg%3E") repeat;
  opacity: 0.7;
  pointer-events: none;
}

.hero-content {
  position: relative;
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hero-text h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: var(--space-md);
}

.hero-text p {
  max-width: 520px;
}

.hero-actions {
  margin-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--color-primary);
  color: #fff;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn.tertiary {
  background: rgba(255, 255, 255, 0.18);
  color: var(--color-text-light);
  border-color: rgba(255, 255, 255, 0.25);
}

.link-button {
  border: none;
  background: none;
  color: var(--color-secondary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-button:hover,
.link-button:focus {
  text-decoration: underline;
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(12, 17, 32, 0.3);
}

.hero-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-soft);
}

.hero-card h3 {
  margin-top: 0;
}

/* Cards & grid */
.grid {
  display: grid;
  gap: var(--space-md);
}

.overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.card h3 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

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

/* Project Cards */
.project-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
}

.project-icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
  text-align: center;
}

.project-card h3 {
  font-size: 1.25rem;
  color: #1e293b;
  margin-bottom: var(--space-sm);
}

.project-desc {
  color: #475569;
  line-height: 1.6;
  margin-bottom: var(--space-md);
  flex-grow: 1;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.project-scientist {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
  font-size: 0.875rem;
}

.scientist-icon {
  font-size: 1.25rem;
}

.project-scientist strong {
  color: #1e293b;
}

.project-footer .badge {
  background: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.card ul li + li {
  margin-top: 0.5rem;
}

/* Timeline */
/* Hero Timeline - 8 Milestone Cards */
.hero-timeline {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  padding: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
}

.hero-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-timeline .section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 1;
}

.hero-timeline .section-header h2 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-timeline .section-header p {
  color: rgba(255,255,255,0.9);
  font-size: 1.2rem;
  font-weight: 300;
}

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 1;
}

.milestone-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.milestone-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.milestone-card:hover::before {
  transform: translateX(0);
}

.milestone-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.milestone-icon {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: var(--space-sm);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
  animation: float 3s ease-in-out infinite;
}

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

.milestone-year {
  font-size: 0.85rem;
  font-weight: 700;
  color: #764ba2;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-xs);
  text-align: center;
}

.milestone-card h3 {
  font-size: 1.4rem;
  margin: 0 0 var(--space-sm) 0;
  color: var(--color-primary);
  text-align: center;
}

.milestone-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.milestone-tag {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

/* Timeline Journey Line */
.timeline-journey {
  position: relative;
  margin-top: var(--space-xl);
  padding: var(--space-lg) 0;
}

.journey-line {
  height: 8px;
  background: linear-gradient(90deg, 
    #4ade80 0%,
    #60a5fa 25%,
    #a78bfa 50%,
    #f472b6 75%,
    #fb923c 100%);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

.journey-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.journey-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-md);
  color: white;
  font-weight: 600;
}

.journey-start,
.journey-end {
  font-size: 1.2rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.journey-middle {
  font-size: 1.4rem;
  text-align: center;
  flex-grow: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Milestone Statistics */
.milestone-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
  position: relative;
  z-index: 1;
}

.stat-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.5);
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  margin-bottom: var(--space-xs);
  background: linear-gradient(135deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
  .milestone-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-timeline .section-header h2 {
    font-size: 1.8rem;
  }
  
  .journey-text {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .journey-middle {
    font-size: 1.1rem;
  }
  
  .milestone-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-md);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 3px solid rgba(37, 99, 235, 0.3);
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0;
  bottom: 0;
  width: 7px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.4), rgba(192, 132, 87, 0.4));
}

.timeline-event {
  position: relative;
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.timeline-event::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 1.5rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.timeline-event h3 {
  margin: 0 0 var(--space-xs) 0;
  font-size: 1.25rem;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
  color: var(--color-muted);
}

.timeline-description {
  margin: 0;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 160px;
}

.filters select,
.filters input {
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.1);
  font-size: 1rem;
}

.search-group {
  flex-grow: 1;
}

/* Scientist cards */
.scientist-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-soft);
  border-left: 4px solid rgba(192, 132, 87, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scientist-card:hover,
.scientist-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.scientist-card.highlight {
  outline: 3px solid var(--color-secondary);
  outline-offset: 3px;
}

.scientist-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
}

.scientist-name {
  font-size: 1.35rem;
  margin: 0;
}

.scientist-era {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.scientist-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.scientist-fields span {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-secondary);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.scientist-summary {
  margin: 0;
}

.scientist-contributions {
  margin: 0;
  padding-left: 1.25rem;
}

.scientist-links {
  margin: 0;
  font-size: 0.9rem;
}

.scientist-links a + a {
  margin-left: 0.75rem;
}

.mission-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.mission-runtime {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
  max-width: 420px;
}

.mission-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.mission-card {
  position: relative;
  padding-bottom: calc(var(--space-md) + 48px);
}

.mission-card header {
  margin-bottom: var(--space-sm);
}

.mission-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(192, 132, 87, 0.18);
  color: var(--color-primary);
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
  color: var(--color-muted);
}

.mission-actions {
  position: absolute;
  left: var(--space-md);
  right: var(--space-md);
  bottom: var(--space-md);
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 0.9rem;
}

.mission-coach ul {
  margin: 0;
  padding-left: 1.2rem;
}

.mission-coach li + li {
  margin-top: 0.45rem;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Project Generator Form */
.project-generator-form {
  max-width: 800px;
  margin: 0 auto;
  background: #ffffff;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.form-group .required {
  color: #ef4444;
  font-size: 1.1rem;
}

.form-group .optional {
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.form-group select {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(15, 23, 42, 0.15);
  font-size: 1rem;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group select:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-large {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Project Result */
.project-result {
  max-width: 900px;
  margin: var(--space-lg) auto 0;
}

.project-result[hidden] {
  display: none;
}

.project-result-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  border: 2px solid var(--color-secondary);
}

.project-result-header {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #ffffff;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.project-result-header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.result-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.result-close-btn:hover,
.result-close-btn:focus {
  background: rgba(255, 255, 255, 0.35);
  outline: none;
}

.result-close-btn svg {
  display: block;
  transition: transform 0.2s ease;
}

.result-close-btn:hover svg {
  transform: rotate(90deg);
}

.project-result-content {
  padding: var(--space-lg);
  line-height: 1.7;
}

.project-result-content h4 {
  color: var(--color-secondary);
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: 1.15rem;
}

.project-result-content ul,
.project-result-content ol {
  margin: var(--space-sm) 0;
  padding-left: 1.5rem;
}

.project-result-content li {
  margin: 0.5rem 0;
}

.project-result-content p {
  margin: var(--space-sm) 0;
}

.project-result-content strong {
  color: var(--color-text);
}

/* Old project styles - keep for compatibility */
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
  padding-bottom: var(--space-md);
}

.project-duration {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-secondary);
}

.project-steps {
  margin: 0;
  padding-left: 1.2rem;
}

.project-outcome {
  font-size: 0.95rem;
  margin: 0;
  color: var(--color-muted);
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.project-card-footer > div {
  flex: 1 1 220px;
}

.toolkit-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.toolkit-grid ul {
  margin: 0;
  padding-left: 1.2rem;
}

.toolkit-grid li + li {
  margin-top: 0.5rem;
}

.chatbot-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.chatbot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.4);
  transition: all 0.3s ease;
}

.chatbot-toggle::before {
  content: "💬";
  font-size: 1.2rem;
}

.chatbot-toggle:hover,
.chatbot-toggle:focus {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.5);
}

.chatbot-panel {
  width: 420px;
  max-height: 640px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  min-height: 0;
}

.chatbot-panel[hidden] {
  display: none !important;
}

.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.15);
}

.chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.chatbot-close svg {
  display: block;
  transition: transform 0.2s ease;
}

.chatbot-close:hover,
.chatbot-close:focus {
  background: rgba(255, 255, 255, 0.35);
  outline: none;
}

.chatbot-close:hover svg,
.chatbot-close:focus svg {
  transform: rotate(90deg);
}

.chatbot-message .loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
}

.chatbot-message .loading-dots::after {
  content: '●';
  animation: dots 1.2s ease-in-out infinite;
  font-size: 0.5rem;
  color: var(--color-muted);
}

@keyframes dots {
  0%, 20% { 
    content: '●';
    opacity: 0.3;
  }
  40% { 
    content: '● ●';
    opacity: 0.6;
  }
  60%, 100% { 
    content: '● ● ●';
    opacity: 1;
  }
}

.chatbot-messages {
  flex: 1;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: auto;
  min-height: 0;
  background: linear-gradient(to bottom, #f8fafc, #ffffff);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.2);
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.3);
}

.chatbot-message {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 85%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-shrink: 0;
  animation: messageSlide 0.3s ease-out;
}

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

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

.chatbot-message p {
  margin: 0;
  padding: 0.85rem 1.1rem;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
  font-size: 0.95rem;
}

.chatbot-message.user {
  align-self: flex-end;
  text-align: right;
}

.chatbot-message.user p {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #ffffff;
  font-weight: 500;
}

.chatbot-message ul {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.1rem;
  text-align: left;
}

.chatbot-quick-replies {
  display: none;
}

.chatbot-form {
  display: flex;
  gap: 0.65rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

.chatbot-form input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 2px solid rgba(15, 23, 42, 0.12);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-form input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chatbot-form button {
  border: none;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  border-radius: 14px;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 80px;
}

.chatbot-form button:hover,
.chatbot-form button:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

/* Atlas Guide page adjustments */
body.atlas-guide-page .chatbot-widget {
  position: static;
  width: min(640px, 100%);
  margin: 0 auto var(--space-lg);
  align-items: stretch;
}

body.atlas-guide-page .chatbot-toggle {
  display: none; /* Hide toggle button on dedicated page */
}

body.atlas-guide-page .chatbot-close {
  display: none; /* Hide close button on dedicated page */
}

body.atlas-guide-page .chatbot-panel {
  width: 100%;
  max-height: none;
  display: flex !important; /* Always show panel */
}

body.atlas-guide-page #chatbot-panel[hidden] {
  display: flex !important; /* Override hidden attribute */
}

/* Footer */
.site-footer {
  background: #0b1020;
  color: rgba(255, 255, 255, 0.72);
  padding: var(--space-lg) 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .site-nav ul {
    gap: var(--space-sm);
  }

  .site-header {
    position: static;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .hero {
    padding-top: var(--space-xl);
  }

  .timeline-event {
    margin-left: var(--space-md);
  }

  .mission-actions,
  .project-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .chatbot-widget {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    align-items: stretch;
  }

  .chatbot-panel {
    width: 100%;
    max-width: none;
    max-height: 500px;
  }

  .chatbot-toggle {
    width: 100%;
    justify-content: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .project-result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-result-content {
    padding: var(--space-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

