:root {
  --bg: #0b0c10;
  --text: #e5e7eb;
  --muted: #9aa0a6;
  --primary: #420f99;
  --card: #111217;
  --border: #1f2330;
  --focus: #22c55e; 
  --topbar: #0b0c10; 
  --topbar-border: #1f2330;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}


.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 0 0 8px 8px;
}
.skip-link:focus {
  left: 1rem;
  z-index: 1000;
}

.site-header {
  padding: 2rem 1rem;
  max-width: 960px;
  margin: 0 auto;
}

/* App shell layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar);
  border-bottom: 1px solid var(--topbar-border);
}
.topbar, .topbar a { color: var(--text); }
.topbar .topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}
.topbar .brand h1 { margin: 0; font-size: 1.25rem; }
.topbar .brand p { margin: .25rem 0 0 0; color: var(--muted); font-size: .9rem; }
.topbar .utilities { display: flex; align-items: center; gap: .5rem; }
.search input {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .75rem;
  min-width: 220px;
}
.search .button { margin-left: .5rem; }
.button#themeToggle {
  position: fixed;
  top: .5rem;
  right: .5rem;
  z-index: 100;
  padding: .4rem .6rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-nav { max-width: 1200px; margin: 0 auto; padding: .5rem 1rem 1rem; }
.site-nav a { margin-right: 1rem; }

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 1rem;
  position: sticky;
  top: 64px; /* below topbar */
  height: calc(100vh - 64px);
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar a { color: var(--text); text-decoration: none; display: block; padding: .4rem 0; }
.sidebar a:hover { color: var(--primary); }

.site-header h1 { margin: 0 0 .25rem 0; font-size: 2rem; }
.site-header p { margin: 0 0 1rem 0; color: var(--muted); }
.site-nav a { color: var(--text); text-decoration: none; margin-right: 1rem; }
.site-nav a:hover { color: var(--primary); }

/* Focus styles to meet WCAG AA */
:where(a, button, input, select, textarea):focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
:where(a, button):focus-visible { outline: 3px solid var(--focus); }

.hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.section { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; border-top: 1px solid var(--border); }


#resume .card { align-items: center; text-align: center; }

.card-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.card .button:last-of-type { margin-top: auto; }
.card split-button { display:block; margin-top:auto; }

.button {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: .5rem .9rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { filter: brightness(1.1); }
.button:focus { outline: 3px solid var(--focus); outline-offset: 3px; }


.card .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}
.card .icon-button:hover { background: rgba(124, 58, 237, 0.12); border-color: var(--primary); }
.card .icon { width: 14px; height: 14px; fill: currentColor; }
.icon-row { display: inline-flex; gap: .25rem; align-items: center; }

.site-footer { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; border-top: 1px solid var(--border); color: var(--muted); }


.table-responsive { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.table th, .table td {
  padding: .75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table thead th { color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }

/* Sortable table styles */
.table thead th[role="button"] { cursor: pointer; user-select: none; }
.table thead th .sort-indicator { margin-left: .35rem; opacity: .7; }

.light {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #4f46e5;
  --card: #f9fafb;
  --border: #e5e7eb;
  --topbar: #ffffff;
  --topbar-border: #e5e7eb;
}


@media (prefers-color-scheme: light) {
  :root:not(.light) { /* if no explicit theme, allow OS to be light */ }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); display: none; }
  .sidebar.open { display: block; }
  .search input { min-width: 160px; }
}


