:root {
  --bg: #0f1115;
  --bg-card: #161922;
  --text: #e6e8eb;
  --text-dim: #9aa1ac;
  --accent: #5eb1ff;
  --border: #262a35;
  --max-width: 880px;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main p a,
main figcaption a {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

main p a:hover,
main figcaption a:hover {
  text-decoration-color: var(--accent);
}

a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem 1.5rem;
}

header.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

header.site-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

header.site-header p {
  margin: 0;
  color: var(--text-dim);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

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

.project-card a.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: var(--bg);
  display: block;
}

.project-card .card-body {
  padding: 1rem;
}

.status-badge {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.project-detail .status-badge {
  margin-bottom: 0.75rem;
}

.project-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.project-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.project-detail h1 {
  margin-top: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

figure {
  margin: 1.5rem 0;
}

figure img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
}

.site-nav a {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.95rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

@media (max-width: 480px) {
  .site-nav {
    gap: 0.75rem;
  }
}

.text-dim {
  color: var(--text-dim);
}

.project-section {
  margin-bottom: 2.5rem;
}

.project-section h2 {
  margin-bottom: 0.25rem;
}

.about {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.75rem;
}

.about h2 {
  margin-top: 0;
}

.about-text {
  flex: 1;
  min-width: 0;
  max-width: 640px;
}

.toolkit {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  list-style: none;
  text-align: left;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.toolkit li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
}

.toolkit-label {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}

.toolkit-items {
  flex: 1 1 14rem;
}

@media (max-width: 480px) {
  .toolkit li {
    flex-direction: column;
    gap: 0.1rem;
  }

  .toolkit-label {
    white-space: normal;
  }
}

.headshot {
  width: min(500px, 45vw);
  height: min(500px, 45vw);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
  flex-shrink: 0;
}

.resume-section {
  margin-bottom: 2.5rem;
}

.resume-entry {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.resume-entry:last-child {
  border-bottom: none;
}

.resume-entry-content {
  flex: 1;
  min-width: 0;
}

.resume-logo-badge {
  flex-shrink: 0;
  height: 52px;
  max-width: 150px;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px 10px;
}

.resume-logo {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.logo-invert {
  filter: invert(1);
}

@media (max-width: 480px) {
  .resume-logo-badge {
    height: 40px;
    max-width: 110px;
  }
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resume-entry-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.resume-org {
  color: var(--text-dim);
  font-weight: 400;
}

.resume-dates {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
}

.resume-entry ul {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-dim);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.skill-tag {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.skill-tag:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.skill-group-heading {
  margin: 2rem 0 0.5rem;
}

.skill-group-heading:first-of-type {
  margin-top: 0;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
}

.skill-accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}

.skill-accordion summary {
  cursor: pointer;
  padding: 0.9rem 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
}

.skill-accordion summary::-webkit-details-marker {
  display: none;
}

.skill-name {
  flex: 1;
  min-width: 0;
}

.skill-accordion summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.3rem;
  margin-left: 1rem;
  flex-shrink: 0;
  width: 1ch;
  text-align: center;
}

.skill-accordion[open] summary::after {
  content: "\2212";
}

.skill-count {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.85rem;
  flex-shrink: 0;
  min-width: 6rem;
  text-align: right;
  margin-left: 0.5rem;
}

.skill-accordion .project-grid {
  margin-top: 0;
  padding: 0 1.25rem 1.25rem;
}

a.lightbox-trigger {
  display: block;
  cursor: zoom-in;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
  z-index: 1000;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.step-viewer-wrapper {
  margin: 1.5rem 0;
}

.step-viewer {
  position: relative;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
}

.step-viewer canvas {
  display: block;
}

.step-viewer-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  width: 100%;
}

.step-viewer-caption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

.pdf-embed {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
}

.pdf-embed iframe {
  width: 100%;
  height: 800px;
  border: none;
  display: block;
}

.pdf-embed-caption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}
