* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --background: #fff;
  --surface: #f9fafb;
  --border: #e5e7eb;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px 0 rgb(0 0 0 / 6%);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -2px rgb(0 0 0 / 5%);
}

body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.hero-image {
  position: relative;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid rgb(255 255 255 / 40%);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
}

.hero-text h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-text h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.tagline {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  opacity: 0.95;
  max-width: 600px;
}

.location {
  font-size: 1rem;
  opacity: 0.8;
}

.location a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.location a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

main {
  padding: 4rem 0;
}

.about {
  margin-bottom: 4rem;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.bio-section {
  background: var(--surface);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.bio-section h3 {
  color: var(--primary-color);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.bio-section p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.bio-section p.indent {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.links {
  background: var(--surface);
  padding: 4rem 0;
  margin-bottom: 4rem;
}

.links h3 {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

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

.link-card {
  display: block;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text-primary);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-color);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1;
}

.link-card:hover::before {
  transform: translateY(0);
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.link-card h4,
.link-card p {
  position: relative;
  z-index: 2;
  transition: color 0.3s ease;
}

.link-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.link-card p {
  font-size: 0.875rem;
  opacity: 0.8;
  margin: 0;
}

/* Hover/focus text colors after base heading/paragraph rules to satisfy specificity ordering */
.link-card:hover h4,
.link-card:hover p {
  color: white;
}

.contact {
  text-align: center;
  padding: 2rem 0;
  background: white;
}

.contact h3 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.contact p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.contact a:hover {
  text-decoration: underline;
}

footer {
  background: linear-gradient(315deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 2rem 0;
}

footer p {
  opacity: 0.8;
}

/* Accessibility & Dark Mode */
.skip-link {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

.skip-link:focus {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 1000;
  border-radius: 4px;
  text-decoration: none;
}

a:focus-visible,
.link-card:focus-visible {
  outline: 3px solid var(--primary-hover);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --background: #111827;
    --surface: #1f2937;
    --border: #374151;
  }

  .link-card {
    background: var(--surface);
  }

  .contact {
    background: var(--background);
  }
}

@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;
  }
}

@media (width >= 768px) {
  .hero-content {
    flex-direction: row;
    text-align: left;
    gap: 3rem;
  }

  .hero-text {
    flex: 1;
  }

  .hero-text h1 {
    font-size: 3.5rem;
  }

  .hero-text h2 {
    font-size: 1.75rem;
  }

  .profile-photo {
    width: 140px;
    height: 140px;
  }

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

@media (width >= 1024px) {
  .hero {
    padding: 5rem 0;
  }

  .hero-text h1 {
    font-size: 4rem;
  }

  .hero-text h2 {
    font-size: 2rem;
  }

  .section-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .links-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (width <= 640px) {
  .hero {
    padding: 3rem 0;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-text h2 {
    font-size: 1.25rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .profile-photo {
    width: 100px;
    height: 100px;
  }

  .bio-section {
    padding: 1.5rem;
  }

  .link-card {
    padding: 1.25rem;
  }

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

  .github-tabs {
    flex-direction: column;
    gap: 0.5rem;
  }

  .github-tab {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }

  .github-repos {
    grid-template-columns: 1fr;
  }

  .github-commit-item,
  .github-repo-item {
    padding: 1rem;
  }
}

/* Activity Section - Simplified */
.activity {
  background: var(--surface);
  padding: 4rem 0;
  margin-bottom: 4rem;
}

.activity h3 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--text-primary);
}

.activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
  transition: all 0.3s ease;
  color: #111827; /* ensure strong contrast in light mode */
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Card content readability */

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgb(0 0 0 / 15%);
}

.card h4 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.card a {
  display: block;
  margin-top: auto; /* pin link to bottom */
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  text-align: center;
}

.card a:hover {
  color: var(--primary-hover);
}

/* Utility text styles within cards for better contrast */
.card .stat-line {
  color: #111827;
  font-weight: 600;
  font-size: 1.05rem;
}

.card .muted {
  color: #4b5563; /* darker muted for readability */
}

.card .small {
  font-size: 0.9em;
}

/* Small live/fallback badge used in Beehiiv card */

/* Widget state label in top-right of card */
.widget-state {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: rgb(255 255 255 / 90%);
  border: 1px solid;
  line-height: 1;

  /* Ensure consistent rendering across browsers */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1;
}

.widget-state.fallback {
  color: #d97706;
  border-color: #fbbf24;
  background: rgb(254 243 199 / 90%);
}

.widget-state.live {
  color: #059669;
  border-color: #34d399;
  background: rgb(209 250 229 / 90%);
}

/* Responsive adjustments */
@media (width <= 600px) {
  .activity-grid {
    grid-template-columns: 1fr;
  }
}

/* Ensure three columns for widgets on desktop, aligning with links grid */
@media (width >= 1024px) {
  .activity-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* end */
