/* css/global.css */

/* 1. Base Reset & Variables */
:root {
  --bg-color: #f4f4f5;
  --card-bg: #ffffff;
  --text-color: #18181b;
  --subtext-color: #71717a;
  --accent-color: #2563eb;
  --card-radius: 16px;
  --gap: 1rem;
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 1.5rem 1rem;
  line-height: 1.5;
}

header {
  margin-bottom: 2rem;
  text-align: center;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
}

p.subtitle {
  color: var(--subtext-color);
  margin: 0;
}

/* 2. The Grid System (Mobile First) */
.work-grid {
  display: grid;
  /* Default: 1 column for mobile */
  grid-template-columns: 1fr;
  gap: var(--gap);
  max-width: 1000px;
  margin: 0 auto;
}

/* Tablet: 2 columns */
@media (min-width: 600px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3 or 4 columns depending on width */
@media (min-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 3. The Card (Link) Styling */
.work-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s;
  border: 1px solid transparent;
  min-height: 180px; /* Ensures uniform height */
  position: relative;
  overflow: hidden;
}

/* Hover Effects (Desktop) */
@media (hover: hover) {
  .work-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #e5e7eb;
  }

  .work-card:hover .card-icon {
    transform: scale(1.1);
  }
}

/* Active/Focus State for Accessibility */
.work-card:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* 4. Icon & Text Styling */
.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  transition: transform 0.2s ease;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--subtext-color);
  text-align: center;
  max-width: 90%;
}

/* Optional: External link indicator */
.link-icon {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}
