/* --- Global Styles & Resets --- */
:root {
  --bg-color: #151515;

  --text-color: #ddd;
  --heading-color: #ffb454;
  --primary-color: #7fe46a;

  --card-bg: #222;
  --border-color: #444;
  --text-muted: #aaa;
}

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

html {
  /* Enables smooth scrolling */
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
}

/* --- Layout --- */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

header, main {
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

/* --- Typography --- */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
  color: var(--heading-color);
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--heading-color);
}

.bio {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* --- Social Links --- */
.social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
}

.social a:hover,
.social a:focus {
  color: var(--primary-color);
  background-color: var(--card-bg);
}

.social svg {
  width: 20px;
  height: 20px;
  /* Use 'currentColor' to match the link's color */
  fill: currentColor; 
}

.divider {
  color: var(--border-color);
  font-size: 1.25rem;
}

/* --- Projects Table --- */
.table-wrap {
  overflow-x: auto;
}

.projects {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.projects th,
.projects td {
  padding: 1rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color);
}

.projects th {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* Ensure table cell text uses main text color by default */
.projects td {
  color: var(--text-color);
}

.project-name a {
  font-weight: 600;
  color: var(--heading-color);
  text-decoration: none;
  font-size: 1.1rem;
}

.project-name a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.codebox {
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background-color: var(--card-bg);
  color: #f1f1f1;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  white-space: pre-wrap; /* Allows long text to wrap */
  word-break: break-all;
}

/* --- Mobile & Responsive Support --- */
@media (max-width: 768px) {
  .page {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }

  /* Responsive Table: 
    Convert table to a "card" layout on small screens.
  */
  .projects thead {
    /* Hide table headers */
    display: none;
  }

  .projects tr {
    /* Each row becomes a card */
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
  }
  
  .projects td {
    display: block;
    border-bottom: 1px dashed var(--border-color);
    padding: 1rem;
  }
  
  .projects tr td:last-child {
     border-bottom: none;
  }

  /* Add back headers as labels using ::before */
  .projects td.project-name::before {
    content: "Project: ";
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
  }
  
  .projects td.project-desc::before {
    content: "Description: ";
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
  }
}