:root {
  /* Simple Light Theme Variables */
  --bg-color: #fdfdfd;
  --text-color: #222222;
  --link-color: #0056b3;
  --focus-outline: #ffaa00;
}

body {
  /* Uses the default system font for optimal performance and legibility */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0 1rem; /* Creates breathing room on mobile screens */
  
  /* Centers the content wrapper on the screen */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 
  CORE REQUIREMENT: 60 characters per line.
  Applies to header, main, and footer so everything aligns nicely.
*/
header, main, footer {
  width: 100%;
  max-width: 60ch; 
}

/* Spacing and Layout */
header {
  padding: 2rem 0 1rem;
  border-bottom: 2px solid #eaeaea;
  margin-bottom: 2rem;
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.5rem; /* Flexbox makes responsive nav menus effortless */
}

/* Typography and Links */
h1, h2 {
  line-height: 1.2;
}

a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Accessibility: High-contrast focus state for keyboard users */
a:focus-visible {
  outline: 3px solid var(--focus-outline);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Accessibility: Hide skip link off-screen until focused */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--text-color);
  color: var(--bg-color);
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* 1. Card Container */
.project-card {
  position: relative; /* Crucial for the clickable overlay */
  display: flex;
  flex-direction: column;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  overflow: hidden; /* Ensures the image respects the rounded corners */
  background-color: var(--bg-color);
  
  /* Smoothly animate the hover effects */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 2. Hover and Focus State for the Card */
/* :focus-within ensures the card lifts even when tabbing via keyboard */
.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* 3. Image Styling */
.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover; /* Prevents the image from squishing */
  display: block;
}

/* 4. Content Padding */
.project-card-content {
  padding: 1.5rem;
}

.project-card-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.project-card-content p {
  margin: 0;
  font-size: 0.95rem;
  color: #555555; /* Slightly muted text for the description */
}

/* 5. The Accessible Overlay Trick */
.card-link {
  color: var(--text-color);
  text-decoration: none;
}

/* 
  This invisible pseudo-element stretches over the entire .project-card
  because the .project-card has position: relative.
*/
.card-link::before {
  content: "";
  position: absolute;
  inset: 0; /* Shorthand for top: 0, right: 0, bottom: 0, left: 0 */
  z-index: 1;
}

/* 6. Keyboard Focus Indicator */
/* Applies the focus ring to the entire card, not just the text */
.card-link:focus-visible::before {
  outline: 3px solid var(--focus-outline);
  outline-offset: 2px;
  border-radius: 8px;
}