  html {
    --cream: #F5F1EA;
    --ink: #1A1814;
    --ink-muted: #5A5650;
    --ink-faint: #9A968F;
    --accent: #C85A2A;
    --accent-light: #F0D5C4;
    --rule: #D8D2C8;
    --card-bg: #FDFBF8;
    --table-oddrow-bg:#f2f2f2;
  }

  html.dark {
    --cream: #111010;
    --ink: #E8E4DC;
    --ink-muted: #9A9590;
    --ink-faint: #5A5650;
    --accent: #E07040;
    --accent-light: #2A1A12;
    --rule: #2A2825;
    --card-bg: #191816;
    --table-oddrow-bg:#2A2825;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html { transition: background 0.25s, color 0.25s; }

  body {
    font-family: 'DM Mono', monospace;
    background: var(--cream);
    color: var(--ink);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.7;
    transition: background 0.25s, color 0.25s;
  }
  
  /*override default text highlight color*/
  ::selection {
	background-color: var(--accent-light);
  }

  /* Browser Scrollbar */

  ::-webkit-scrollbar {
	width: 8px;
	background-color: var(--card-bg)
  }

  ::-webkit-scrollbar-thumb {
	background-color: var(--rule)
  }

  ::-webkit-scrollbar-thumb:hover {
	background-color: var(--ink-muted)
  }


  /* NAV */
  nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--rule);
    background: var(--cream);
    transition: background 0.25s, border-color 0.25s;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .nav-logo {
    font-family: 'Instrument Serif', serif;
    font-size: 1.25rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.01em;
  }

  .nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
  }

  .nav-links a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.15s;
  }

  .nav-links a:hover { color: var(--accent); }

  .btn-toggle {
    background: none;
    border: 1px solid var(--rule);
    color: var(--ink-muted);
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 5px 12px;
    border-radius: 2px;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    text-transform: uppercase;
    margin-left: 1.5rem;
    height: fit-content;
  }

  .btn-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  /* SECTIONS */
  section { padding: 4rem 2.5rem; max-width: 1400px; margin: 0 auto; }

  section + section { border-top: 1px solid var(--rule); }

  .section-label {
    font-size: 1.2em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 2rem;
  }

  /* HERO */
  #home {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 4rem;
    align-items: start;
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .hero-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--ink);
  }

  .hero-title em {
    font-style: italic;
    color: var(--accent);
  }

  .hero-bio {
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 480px;
    margin-bottom: 2rem;
  }

  .hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tag {
    background: var(--accent-light);
    color: var(--accent);
    font-size: .75rem;
    padding: 4px 12px;
    border-radius: 2px;
    letter-spacing: 0.05em;
  }

  .hero-photo {
    width: 220px;
    height: 280px;
    object-fit: cover;
    filter: grayscale(15%);
    border: 1px solid var(--rule);
  }

  /* EDUCATION */
  .edu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .edu-card {
    background: var(--card-bg);
    border: 1px solid var(--rule);
    padding: 1.5rem;
    transition: background 0.25s, border-color 0.25s;
  }

  .edu-degree {
    font-family: 'Instrument Serif', serif;
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 0.25rem;
  }

  .edu-school {
    color: var(--ink-muted);
    font-size: .8rem;
  }

  /* PROJECTS */
  .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
  }

  .project-card {
    background: var(--card-bg);
    padding: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
  }

  .project-card:hover { background: var(--accent-light); }

  .project-thumb-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 1rem;
  }

  .project-thumb {
    width: 100%;
    height: 98px;
    object-fit: cover;
    filter: grayscale(20%);
    border: 1px solid var(--rule);
    cursor: pointer;
    transition: transform 0.15s, filter 0.15s;
  }

  .project-thumb:hover { filter: none; transform: scale(1.05); }

  .project-title {
    font-family: 'Instrument Serif', serif;
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 0.25rem;
  }

  .project-desc {
    color: var(--ink-muted);
    font-size: .8rem;
    line-height: 1.6;
  }

  /* HOMELAB / EXTRAS */
  .extras-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }

  .extras-text p {
    color: var(--ink-muted);
    font-size: .8rem;
    line-height: 1.8;
    margin-bottom: 1rem;
  }

  .extras-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border: 1px solid var(--rule);
    filter: grayscale(15%);
  }

  /* MONITOR badge */
  .status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 1.5rem;
  }

  .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  .status-label {
    font-size: .75rem;
    color: var(--ink-muted);
  }

  .status-link {
    color: var(--accent);
    font-size: .75rem;
    text-decoration: none;
    margin-left: auto;
  }
  
  /* EXTRAS */
  .extras-link {
    color: var(--accent);
    font-size: 1rem;
    text-decoration: none;
    margin-left: auto;
  }

  /* FOOTER */
  footer {
    border-top: 1px solid var(--rule);
    padding: 2rem 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .footer-copy {
    color: var(--ink-faint);
    font-size: .7rem;
    letter-spacing: 0.06em;
  }

  .footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
  }

  .footer-links a {
    color: var(--ink-faint);
    text-decoration: none;
    font-size: .7rem;
    transition: color 0.15s;
  }

  .footer-links a:hover { color: var(--accent); }

  /* LIGHTBOX */
  #lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,24,20,0.92);
    z-index: 999;
    align-items: center;
    justify-content: center;
  }

  #lightbox.open { display: flex; }

  #lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border: 1px solid rgba(255,255,255,0.1);
  }

  #lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'DM Mono', monospace;
    opacity: 0.7;
  }

  #lightbox-close:hover { opacity: 1; }

  /* RESPONSIVE */
  @media (max-width: 680px) {
    nav { padding: 1rem 1.25rem; }
    section { padding: 3rem 1.25rem; }
    #home { grid-template-columns: 1fr; }
    .hero-photo { width: 100%; height: 240px; }
    .edu-grid { grid-template-columns: 1fr; }
    .extras-row { grid-template-columns: 1fr; }
    footer { flex-direction: column; gap: 1rem; }
  }

