:root {
  --bg: #101012;
  --surface: #18181b;
  --surface-hover: #1e1e22;
  --border: #28282c;
  --border-strong: #38383e;
  --text: #e8e8ea;
  --text-secondary: #9a9aa0;
  --text-muted: #6b6b70;
  --purple: #8b7fe8;
  --purple-dim: #4d457a;
  --pink: #e0568f;
  --pink-bg: #2b1721;
  --purple-bg: #1c1a2b;
  --green: #6bbf8a;
  --accent: #f29ef5;
  --accent-bg: rgba(242, 158, 245, 0.14);
  --radius: 6px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* intro */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 40px;
}

.intro {
  margin-bottom: 32px;
}

.intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
  max-width: 60ch;
}

/* filters */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.pill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pill.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
}

/* grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.card {
  height: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: border-color .12s, transform .12s;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

/* when a project has p.image, it fills the whole card — this scrim keeps
   text readable over any photo without hardcoding per-element colors */
.card.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 14, 0.8);
  z-index: 0;
}

.card-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.card-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-status {
  font-size: 11px;
}

.card-status.shipped {
  color: var(--green);
}

.card-status.wip {
  color: var(--text-muted);
}

.card-status.other {
  color: var(--text-secondary);
}

/* icon box — shows a real image when provided, otherwise flat initials.
   No gradients here or anywhere else on the card. */
.card-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--surface-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card.has-image .card-icon {
  background: rgba(16, 16, 18, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 12.5px;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius);
  background: var(--accent-bg);
  color: var(--accent);
}

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 40px 0;
}

/* status bar */
.statusbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 10px 32px;
  font-size: 11px;
  color: var(--text-muted);
  max-width: 900px;
  margin: 0 auto;
}

/* detail page */
.detail-back {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.detail-back:hover {
  color: var(--accent);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.detail-logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--surface-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  overflow: hidden;
}

.detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.detail-desc {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 65ch;
  margin-bottom: 24px;
}

.detail-section {
  margin-bottom: 26px;
}

.detail-section h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  text-transform: lowercase;
  color: var(--text);
  margin: 0 0 8px;
  font-weight: 700;
}

.section-icon {
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
}

img.section-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
  display: inline-block;
}

.detail-section p {
  color: var(--text-secondary);
  font-size: 13.5px;
  max-width: 70ch;
  margin: 0 0 10px;
}

/* prose sections (about/problem/process/outcome): reading rule on the
   left, and roomier gaps between paragraphs */
.detail-prose {
  border-left: 2px solid var(--border-strong);
  padding-left: 16px;
}

.detail-prose p {
  line-height: 1.85;
  margin: 0 0 20px;
}

.detail-prose p:last-child {
  margin-bottom: 0;
}

pre.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
}

.detail-links {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.detail-links a,
.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--accent);
  background: var(--accent-bg);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--accent);
}

.detail-links a:hover,
.btn-accent:hover {
  background: rgba(242, 158, 245, 0.26);
}

.link-icon {
  font-size: 11px;
  line-height: 1;
}

img.link-icon {
  width: 13px;
  height: 13px;
  object-fit: contain;
  display: inline-block;
}

/* tags footer — sits at the very bottom of the page, below the link
   buttons, separated by a divider with room to breathe above it */
.detail-divider {
  border-top: 1px solid var(--border);
  margin-top: 36px;
}

.detail-tags-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}

/* carousel — used on detail pages for p.image (single or multiple).
   object-fit: contain + a fixed-height letterboxed box means vertical and
   horizontal images both display in full, never cropped. */
.carousel {
  position: relative;
  width: 100%;
  height: var(--carousel-height, 320px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(16, 16, 18, 0.6);
  border: 1px solid var(--border-strong);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

.carousel-arrow:hover {
  background: rgba(16, 16, 18, 0.85);
  border-color: var(--accent);
}

.carousel-arrow.prev {
  left: 10px;
}

.carousel-arrow.next {
  right: 10px;
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  cursor: pointer;
}

.carousel-dot.active {
  background: var(--accent);
}

/* electronics detail */
.spec-table {
  width: 100%;
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.spec-table tr td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.spec-table tr td:last-child {
  text-align: right;
  color: var(--text);
}

.media-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.media-box {
  flex: 1;
  height: 160px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  background-size: cover;
  background-position: center;
}

/* resume page — embedded like a centered image, not a document viewer */
.resume-embed {
  display: block;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 8.5 / 11;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.resume-download-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* responsive */
@media (max-width: 640px) {
  main {
    padding: 32px 20px;
  }

  .statusbar {
    padding: 10px 20px;
  }
}