:root {
  --bg: #08090a;
  --panel: #0d0f11;
  --ink: #f1f2ef;
  --muted: #8b9198;
  --line: #25282c;
  --grid: #1b1e21;
  --accent: #82a9ff;
  --max-width: 768px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 56px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}
body::before { position: fixed; inset: 0; z-index: -1; pointer-events: none; content: ""; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 96px 96px; opacity: .22; }
a { color: inherit; text-decoration: none; }
.site-header, .section-shell, .site-footer { width: min(100%, var(--max-width)); margin-inline: auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brand { font-size: 14px; font-weight: 700; letter-spacing: .05em; }
.brand span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 20px; }
.nav-toggle { display: none; flex-direction: column; justify-content: center; align-items: stretch; gap: 5px; width: 26px; height: 26px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.nav-toggle-bar { display: block; height: 2px; background: var(--muted); border-radius: 1px; transition: transform 200ms ease, opacity 150ms ease, background 180ms ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--muted); font-size: 12px; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active { text-decoration: underline; text-underline-offset: 6px; }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.language-toggle { display: inline-flex; gap: 4px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: 10px; padding: 0 2px; }
.language-toggle .language-active { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.theme-toggle { border: 0; color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: 16px; line-height: 1; padding: 0 2px; }
.resume-menu { position: relative; }
.resume-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: 11px; padding: 6px 9px; transition: border-color 180ms ease, color 180ms ease; }
.resume-toggle:hover, .resume-menu.is-open .resume-toggle { border-color: #4c596b; color: var(--ink); }
.resume-icon { font-size: 12px; }
.resume-options { position: absolute; top: calc(100% + 8px); right: 0; z-index: 10; display: none; flex-direction: column; min-width: 88px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); overflow: hidden; }
.resume-menu.is-open .resume-options { display: flex; }
.resume-options a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; color: var(--ink); font-size: 11px; }
.resume-options a:hover { background: #15191d; color: var(--accent); }
.resume-options a span { color: var(--accent); }
.hero { padding: 8px 0 0; }
.activity-panel { padding: 32px 18px 26px; border-bottom: 1px solid var(--line); background-image: radial-gradient(var(--grid) 1px, transparent 1px); background-size: 10px 10px; }
.activity-label, .activity-months, .activity-footer, .profile-location, .section-label, .experience-meta { color: var(--muted); font-size: 11px; }
.activity-months { display: grid; grid-template-columns: repeat(12, 1fr); margin: 24px 0 7px 33px; text-align: center; }
.activity-grid { display: grid; grid-template-columns: repeat(52, 1fr); grid-template-rows: repeat(7, 10px); grid-auto-flow: column; gap: 4px; min-height: 94px; }
.activity-grid span { display: block; min-width: 0; background: #1b1e21; }
.activity-grid span.level-1 { background: #363b42; }
.activity-grid span.level-2 { background: #59616b; }
.activity-grid span.level-3 { background: #8e99a5; }
.activity-footer { display: flex; justify-content: space-between; margin-top: 16px; }
.github-contributions { display: block; width: 100%; height: auto; min-height: 94px; margin-top: 24px; filter: invert(.88) grayscale(1); }
.profile-card { min-height: 165px; display: grid; grid-template-columns: 166px 1fr auto; align-items: end; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.avatar { width: 150px; height: 150px; display: grid; place-items: center; align-self: center; overflow: hidden; border: 1px solid #444a50; border-radius: 50%; background: #171b20; }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.profile-main { padding-bottom: 27px; }
.profile-location { margin-bottom: 8px; }
.profile-location span { color: var(--accent); padding-inline: 3px; }
h1, h2, h3 { margin: 0; font-family: "Space Grotesk", "Arial Narrow", sans-serif; letter-spacing: 0; line-height: 1.1; }
h1 { font-size: 30px; }
.country-tags { display: flex; align-self: center; gap: 6px; }
.country-tags span { border: 1px solid var(--line); border-radius: 6px; padding: 8px 7px; color: var(--muted); font-size: 10px; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; padding: 25px 16px; border-bottom: 1px solid var(--line); }
.profile-details > div { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-width: 0; }
.profile-details strong, .profile-details a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.profile-details a { color: var(--muted); }
.profile-details a:hover { color: var(--accent); }
.detail-icon { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 11px; }
.about, .stack, .projects, .experience, .education, .contact { padding: 62px 30px; border-top: 1px solid var(--line); }
.section-label { display: flex; gap: 15px; margin-bottom: 32px; text-transform: uppercase; }
.section-label span:first-child { color: var(--accent); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.about-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
h2 { font-size: 28px; font-weight: 500; }
.read-aloud { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: 11px; padding: 6px 10px; transition: border-color 180ms ease, color 180ms ease; }
.read-aloud:hover { border-color: #4c596b; color: var(--ink); }
.read-aloud.is-playing { border-color: var(--accent); color: var(--accent); }
.read-aloud-icon { font-size: 10px; }
.about-copy, .experience-heading p, .contact-grid p { margin: 0; color: var(--muted); }
.about-copy p { margin: 0 0 18px; }
.skill-list, .tech-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.skill-list span, .tech-row span { border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; color: var(--muted); font-size: 10px; }
.stack { background: var(--panel); }
.stack-heading { display: grid; grid-template-columns: 1fr 220px; gap: 34px; align-items: end; margin-bottom: 42px; }
.stack-heading p { margin: 0; color: var(--muted); }
.stack-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.stack-group { min-width: 0; padding: 18px; background: var(--panel); }
.stack-group h3 { margin-bottom: 15px; color: var(--muted); font-size: 11px; font-weight: 400; text-transform: uppercase; }
.stack-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.stack-item { min-width: 0; min-height: 62px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #101316; transition: border-color 180ms ease, background 180ms ease, transform 180ms ease; }
.stack-item:hover { border-color: #4c596b; background: #15191d; transform: translateY(-2px); }
.stack-item i { height: 21px; color: #bdc7d2; font-size: 21px; }
.stack-item i.colored { filter: saturate(.7) brightness(1.15); }
.stack-item > span:last-child { overflow: hidden; color: var(--ink); font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.stack-mark { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid #566171; border-radius: 4px; color: var(--accent); font-family: "Space Grotesk", sans-serif; font-size: 10px; font-weight: 700; }
.projects { background: #0a0c0e; }
.projects-heading { display: grid; grid-template-columns: 1fr 220px; gap: 34px; align-items: end; margin-bottom: 42px; }
.projects-heading p { margin: 0; color: var(--muted); }
.project-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.project-card { min-width: 0; display: flex; flex-direction: column; min-height: 380px; background: var(--panel); }
.project-topline { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.project-topline span:first-child { color: var(--accent); }
.project-card-body { display: flex; flex: 1; gap: 14px; padding: 22px 16px; }
.project-symbol { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px solid #4c596b; border-radius: 7px; color: var(--accent); font-family: "Space Grotesk", sans-serif; font-size: 18px; }
.project-copy { min-width: 0; }
.project-copy h3 { font-size: 19px; }
.project-copy p { margin: 14px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.project-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.project-tags span { border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; color: var(--muted); font-size: 9px; }
.project-link { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--ink); font-size: 11px; }
.project-link i { color: var(--muted); font-size: 15px; }
.project-link span { margin-left: auto; color: var(--accent); font-size: 15px; }
.project-link:hover { background: #15191d; color: var(--accent); }
.experience { padding-top: 62px; padding-bottom: 40px; }
.experience-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 32px; }
.experience-top .section-label { margin-bottom: 0; }
.experience-heading { display: grid; grid-template-columns: 1fr 220px; gap: 34px; align-items: end; margin-bottom: 42px; }
.timeline { border-top: 1px solid var(--line); }
.experience-item { display: grid; grid-template-columns: 148px 1fr; gap: 28px; padding: 28px 0 32px; border-bottom: 1px solid var(--line); }
.experience-meta { display: flex; flex-direction: column; gap: 8px; line-height: 1.4; }
.company-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; min-height: 42px; margin-bottom: 8px; color: var(--ink); font-size: 10px; }
.company-brand img { display: block; width: auto; max-width: 116px; height: 25px; object-fit: contain; object-position: left center; }
.company-brand span { color: var(--muted); }
.experience-content { min-width: 0; }
h3 { font-size: 18px; font-weight: 500; }
.company { margin: 7px 0 18px; color: var(--accent); font-size: 12px; }
.experience-content ul { margin: 0; padding-left: 16px; color: var(--muted); }
.experience-content li { padding: 3px 0; }
.education { background: #0a0c0e; }
.education-card { display: grid; grid-template-columns: 120px 1fr; gap: 28px; align-items: center; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.education-logo { width: 88px; height: 88px; display: grid; place-items: center; justify-self: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f4f4f1; }
.education-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; transform: translate(2px, 1px); }
.education-period { margin: 0 0 9px; color: var(--muted); font-size: 11px; }
.education h2 { font-size: 21px; }
.education-school { margin: 9px 0 12px; color: var(--accent); font-size: 12px; }
.education-description { max-width: 470px; margin: 0; color: var(--muted); }
.contact { background: var(--panel); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.contact h2 { font-size: 30px; }
.contact h2 em { color: var(--accent); font-style: normal; }
.contact-grid > div { align-self: end; }
.contact-email { display: inline-block; margin: 20px 0; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.social-links { display: flex; gap: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.social-links a { color: var(--muted); font-size: 11px; }
.social-links a:hover { color: var(--ink); }
.site-footer { display: flex; justify-content: space-between; padding: 20px 16px; color: var(--muted); font-size: 10px; }
.back-to-top { position: fixed; right: max(20px, calc((100vw - var(--max-width)) / 2 - 60px)); bottom: 20px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 200ms ease, transform 200ms ease, border-color 180ms ease, color 180ms ease; z-index: 20; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: #4c596b; color: var(--ink); }
@media (max-width: 760px) {
  .site-header, .section-shell, .site-footer { border-left: 0; border-right: 0; }
  .site-header { padding-inline: 18px; }
  nav { gap: 12px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 15;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    transition: max-height 220ms ease, opacity 180ms ease, visibility 220ms;
  }
  nav.is-open .nav-links { max-height: 320px; visibility: visible; opacity: 1; }
  .nav-links a { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 13px; }
  .nav-links a.active { text-decoration: none; color: var(--accent); }
}
@media (max-width: 480px) {
  .site-header { padding-inline: 14px; }
  nav { gap: 8px; }
}
@media (max-width: 340px) {
  .site-header { padding-inline: 10px; }
  nav { gap: 6px; }
}
@media (max-width: 760px) {
  .activity-panel { padding-inline: 18px; }
  .activity-grid { grid-template-rows: repeat(7, 8px); gap: 3px; }
  .profile-card { grid-template-columns: 86px 1fr; min-height: 120px; padding-inline: 18px; }
  .avatar { width: 78px; height: 78px; font-size: 21px; }
  .profile-main { padding-bottom: 18px; }
  h1 { font-size: 22px; }
  .country-tags { display: none; }
  .profile-details, .about-grid, .experience-heading, .contact-grid { grid-template-columns: 1fr; gap: 8px; }
  .profile-details { padding-inline: 18px; }
  .about, .stack, .projects, .experience, .education, .contact { padding: 48px 18px; }
  .stack { padding: 48px 18px; }
  .stack-heading { grid-template-columns: 1fr; gap: 15px; margin-bottom: 30px; }
  .stack-groups { grid-template-columns: 1fr; }
  .projects-heading { grid-template-columns: 1fr; gap: 15px; margin-bottom: 30px; }
  .project-list { grid-template-columns: 1fr; }
  .project-card { min-height: 0; }
  .experience-heading { gap: 15px; margin-bottom: 30px; }
  .experience-item { grid-template-columns: 1fr; gap: 15px; }
  .experience-meta { flex-direction: row; justify-content: space-between; }
  .company-brand { align-items: flex-start; margin-bottom: 4px; }
  .education-card { grid-template-columns: 1fr; gap: 22px; }
  .education-logo { width: 76px; height: 76px; }
  .site-footer { display: block; padding-inline: 18px; }
  .site-footer span { display: block; margin: 4px 0; }
}

  body.light-theme {
    --bg: #d7dcda;
    --panel: #e3e7e4;
    --ink: #17201c;
    --muted: #59655f;
    --line: #aeb8b2;
    --grid: #c1c9c4;
    --accent: #2d61a5;
  }
  body.light-theme .activity-panel { background-image: radial-gradient(#c1c9c4 1px, transparent 1px); }
  body.light-theme .github-contributions { opacity: .8; filter: none; }
  body.light-theme .activity-grid span { background: #b9c2bc; }
  body.light-theme .activity-grid span.level-1 { background: #9daaa2; }
  body.light-theme .activity-grid span.level-2 { background: #788b80; }
  body.light-theme .activity-grid span.level-3 { background: #587064; }
  body.light-theme .avatar { background: #b9c2bc; }
  body.light-theme .stack-group, body.light-theme .project-card { background: var(--panel); }
  body.light-theme .stack-item { background: #d8dfdb; }
  body.light-theme .stack-item:hover, body.light-theme .project-link:hover { background: #cdd6d0; }
  body.light-theme .resume-options a:hover { background: #cdd6d0; }
  body.light-theme .projects, body.light-theme .education { background: #dce2de; }
  body.light-theme .contact { background: #cbd3ce; }
  body.light-theme .company-brand img[src*="actdigital"] { filter: invert(1); }
