:root {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --border: #334155;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  padding: 3rem 1rem;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Sidebar is completely hidden by default (mobile view) */
.sidebar {
  display: none;
}

/* Header context visible only on mobile view to explain the site */
.mobile-heading {
  margin-bottom: 3rem;
}

.mobile-heading h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
}

.mobile-heading p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Main Content Styles */
.main-content {
  width: 100%;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.project-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  color: var(--text-main);
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  transition: transform 0.2s, border-color 0.2s;
  scroll-margin-top: 2rem;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-content h2 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.card-content p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.card-links-grouped {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
}

.link-btn {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s, color 0.2s;
}

.github-btn {
  background-color: #334155;
  color: var(--text-main);
}

.github-btn:hover {
  background-color: #475569;
}

.firefox-btn {
  background-color: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.firefox-btn:hover {
  background-color: rgba(56, 189, 248, 0.2);
  color: var(--accent-hover);
}

.btn-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag {
  background-color: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.card-links a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.browsers-links {
  display: flex;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.browsers-icon {
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
}

.browsers-icon:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.browsers-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

footer {
  margin-top: 4rem;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Desktop Widescreen Media Query */
@media (min-width: 768px) {
  body {
    padding: 5rem 2rem;
  }

  .container {
    flex-direction: row;
    gap: 5rem;
  }

  /* Hide the mobile placeholder text on desktops */
  .mobile-heading {
    display: none;
  }

  /* Bring back the desktop-specific sticky sidebar layout */
  .sidebar {
    display: block;
    position: -webkit-sticky;
    position: sticky;
    top: 5rem;
    width: 30%;
    height: fit-content;
  }

  .sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }

  h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.2;
    margin-bottom: 0.25rem;
  }

  .sidebar p {
    color: var(--text-muted);
    font-size: 1.1rem;
  }

  /* Sidebar Grouped Navigation Layout */
  .project-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .nav-group h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.5rem;
  }

  .project-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .project-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
  }

  .project-nav a:hover {
    color: var(--text-main);
  }

  .social-links {
    display: flex;
    gap: 1.25rem;
    color: var(--text-muted);
  }

  .social-icon {
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
  }

  .social-icon:hover {
    color: var(--accent);
    transform: translateY(-1px);
  }

  .social-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
  }

  .main-content {
    width: 70%;
  }

  html {
    scroll-padding-top: 5rem;
  }
}
