/* =========================
   Global Reset
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   Base Styles
   ========================= */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fafafa;
}

/* =========================
   Skip Link
   ========================= */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: white;
  padding: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* =========================
   Header (Grid Layout)
   ========================= */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}

/* Center headshot + name block */
header > div {
  grid-column: 1 / -1;
}

/* =========================
   Headshot
   ========================= */
.headshot {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.headshot:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.headshot-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* =========================
   Header Text
   ========================= */
header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.1rem;
  opacity: 0.95;
}

/* =========================
   Theme Toggle
   ========================= */
.theme-toggle {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0.25rem;
}

/* Toggle Track */
.toggle-track {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  position: relative;
  transition: background 0.25s ease;
}

/* Toggle Thumb */
.toggle-thumb {
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Hover affordance */
.theme-toggle:hover .toggle-track {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}

/* Focus styles */
.theme-toggle:focus-visible .toggle-track {
  outline: 3px solid white;
  outline-offset: 3px;
}

.toggle-label {
  font-size: 0.9rem;
}

/* =========================
   Navigation
   ========================= */
nav {
  background: #333;
  z-index: 50;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

nav a {
  display: block;
  color: white;
  padding: 1rem;
  text-decoration: none;
  transition: background 0.3s;
}

nav a:hover,
nav a:focus {
  background: #667eea;
  outline: none;
}

/* =========================
   Main Content
   ========================= */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

section {
  background: white;
  margin-bottom: 2rem;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

section h2 {
  color: #667eea;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  border-bottom: 3px solid #667eea;
  padding-bottom: 0.5rem;
}

/* =========================
   Contact
   ========================= */
.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.contact-info a {
  color: #4f5bd5;
  text-decoration: none;
  font-weight: 500;
}

.contact-info a:hover,
.contact-info a:focus {
  text-decoration: underline;
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* =========================
   Grid & Cards
   ========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 6px;
  border-left: 4px solid #667eea;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.project-card h3 {
  color: #667eea;
  margin-bottom: 0.5rem;
}

.project-card button {
  background: #4f5bd5;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 1rem;
  transition: background 0.3s;
}

.project-card button:hover,
.project-card button:focus {
  background: #764ba2;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* =========================
   Modals
   ========================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: #667eea;
}

.modal-close:hover,
.modal-close:focus {
  color: #764ba2;
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* =========================
   Lists
   ========================= */
ul,
ol {
  margin-left: 2rem;
  margin-top: 0.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 768px) {

  header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .theme-toggle {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;

    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    border-width: 1px;
  }

  .toggle-track {
    width: 26px;
    height: 14px;
  }

  .toggle-thumb {
    width: 9px;
    height: 9px;
    top: 2.5px;
    left: 2.5px;
  }

  .toggle-label {
    font-size: 0.65rem;
  }

  header h1 {
    font-size: 1.8rem;
  }

  nav ul {
    flex-direction: column;
  }

  nav a {
    border-bottom: 1px solid #555;
  }

  main {
    padding: 1rem;
  }

  section {
    padding: 1.5rem;
  }
}

/* =========================
   Focus Visible (Global)
   ========================= */
*:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* =========================
   Dark Mode
   ========================= */
.dark-mode {
  background-color: #0f172a;
  color: #e5e7eb;
}

.dark-mode a:link { 
  color: lightskyblue; 
}

.dark-mode a:visited {
  color: #93c5fd;
}

.dark-mode a:hover,
.dark-mode a:focus {
  color: #bfdbfe;
}


.dark-mode section {
  background: #111827;
  color: #e5e7eb;
}

.dark-mode nav {
  background: #020617;
}

.dark-mode .project-card {
  background: #020617;
}

.theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
}

.theme-toggle {
  border: 1.5px solid white;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  background: transparent;
  color: white;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.theme-toggle:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

.dark-mode header {
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e293b 100%
  );
  color: #e5e7eb;
}

/* =========================
   Dark Mode - Modals
   ========================= */

.dark-mode .modal-content {
  background-color: #1e293b;   /* dark slate */
  color: #e5e7eb;              /* light text */
}

.dark-mode .modal-close {
  color: #93c5fd;
}

.dark-mode .modal-close:hover,
.dark-mode .modal-close:focus {
  color: #bfdbfe;
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

/* =========================
   Resume Buttons
   ========================= */
.resume-actions {
  display: flex;
  gap: 1rem;
}

.resume-button {
  background: #4f5bd5;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 1rem;
  transition: background 0.3s;
}