/* CSS Variables */
:root {
  --background: #ffffff;
  --foreground: #171717;
  --muted: hsl(220, 14.3%, 95.9%);
  --muted-foreground: hsl(220, 8.9%, 46.1%);
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-500: #a855f7;
  --purple-800: #6b21a8;
  --purple-900: #581c87;
  --purple-950: #3b0764;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', Arial, Helvetica, sans-serif;
  color: var(--foreground);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100vh;
}

@media (min-width: 640px) {
  .container {
    padding: 2rem;
  }
}

/* Links */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--purple-800);
  border-radius: 0.375rem;
  transition: background-color 150ms ease;
}

a:hover {
  background-color: var(--purple-200);
}

/* Navigation */
.nav-header {
  border-bottom: 2px solid var(--foreground);
  width: 100%;
}

.nav-list {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  padding-top: 0.5rem;
  padding-bottom: 0.125rem;
}

.nav-link {
  font-size: 1.25rem;
  text-decoration-color: transparent;
}

.nav-link:hover {
  background-color: transparent;
}

/* Main Content */
main {
  max-width: 1024px;
  margin: 0 auto;
  width: 100%;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--purple-900);
}

.hero h3 {
  font-size: 1.25rem;
  color: var(--muted-foreground);
}

/* Info Section */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  list-style: none;
}

.info-item {
  display: flex;
  align-items: center;
}

.info-icon {
  width: 2rem;
  height: 2rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.info-item a.bold-black {
  font-weight: 700;
}

.info-item a.bold-blue {
  font-weight: 700;
  color: #1e40af;
}

/* About Section */
.about {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about p {
  font-size: 1.25rem;
}

/* GIF Section */
.gif-section {
  max-width: 100%;
}

.gif-section iframe {
  max-width: 100%;
}

.gif-section p {
  font-size: 0.875rem;
}

/* Section Headers */
.section-header {
  font-size: 2.25rem;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
}

.section-header a {
  text-decoration-color: var(--purple-950);
}

.section-header a:hover {
  background-color: transparent;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Project Card */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--muted);
  text-decoration: none;
  overflow: hidden;
}

.project-card:hover {
  background-color: transparent;
}

.project-image {
  height: 150px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-year {
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

.project-name {
  font-size: 1.5rem;
  font-weight: 600;
}

.project-description {
  font-size: 1rem;
}

.project-link {
  font-size: 0.875rem;
}

/* Toolkit Grid */
.toolkit-intro {
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .toolkit-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .toolkit-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Skill Card */
.skill-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid var(--muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.skill-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  background-color: var(--purple-300);
}

.skill-icon {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-icon svg {
  height: 100%;
  width: auto;
}

@media (min-width: 640px) {
  .skill-icon {
    height: 120px;
  }
}

.skill-name {
  font-size: 1.125rem;
  font-weight: 500;
  color: #1f2937;
  margin-top: 1rem;
}

.skill-category {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Working On Section */
.working-on {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.working-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.working-list p {
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Open Source Section */
.open-source {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contributions-link {
  font-size: 1.25rem;
}

.contributions-link a {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Reading Section */
.reading-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .reading-grid {
    grid-template-columns: 1fr;
  }
}

.book-card {
  display: flex;
  flex-direction: column;
  max-width: 250px;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--muted);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  background-color: transparent;
}

.book-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 0.375rem;
  background-color: var(--muted);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.book-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.book-author {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Blog Page */
.blog-header {
  text-align: center;
  margin-bottom: 3rem;
}

.blog-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .blog-header h1 {
    font-size: 3rem;
  }
}

.blog-header p {
  font-size: 1.25rem;
  color: var(--muted-foreground);
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Blog Card */
.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--muted);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-decoration: none;
}

.blog-card:hover {
  background-color: transparent;
}

.blog-card-image {
  height: 12rem;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.blog-card-date {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  transition: color 150ms ease;
}

.blog-card:hover .blog-card-title {
  color: var(--purple-500);
}

.blog-card-description {
  color: var(--muted-foreground);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.tag {
  font-size: 0.75rem;
  background-color: var(--muted);
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  font-size: 1.25rem;
  color: var(--muted-foreground);
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Blog Post Page */
.blog-post {
  max-width: 768px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.post-date {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.post-tags {
  display: flex;
  gap: 0.5rem;
}

.post-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.post-cover {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.post-content {
  font-size: 1.125rem;
  line-height: 1.8;
}

.post-content h2 {
  font-size: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.post-content code {
  font-family: monospace;
}

.post-content ul,
.post-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.comments-section {
  margin-top: 3rem;
}

.comments-card {
  border: 1px solid var(--muted);
  border-radius: 0.75rem;
  padding: 1rem;
  background: var(--background);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .comments-card {
    padding: 1.5rem;
  }
}

.comments-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--muted);
}

.comments-header h2 {
  font-size: 1.5rem;
}

.comments-header p {
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

.giscus-shell {
  margin-top: 1rem;
}

.giscus-shell iframe.giscus-frame {
  border-radius: 0.5rem;
}

/* Section padding */
section {
  padding: 1.5rem 0;
}

section#toolkit {
  padding: 2.5rem 0;
}
