:root {
  --bg: #ffffff;
  --mg: #dddddd;
  --fg: #000000;
  --hl: #f47c11;
  --alt-hl: #af5708;
  --bg-rgb: 255, 255, 255;
  --mg-rgb: 221, 221, 221;
  --fg-rgb: 0, 0, 0;
  --hl-rgb: 244, 124, 17;
  --alt-hl-rgb: 175, 87, 8;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #000000;
    --mg: #333333;
    --fg: #ffffff;
    --bg-rgb: 0, 0, 0;
    --mg-rgb: 51, 51, 51;
    --fg-rgb: 255, 255, 255;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --mg: #333333;
  --fg: #ffffff;
  --bg-rgb: 0, 0, 0;
  --mg-rgb: 51, 51, 51;
  --fg-rgb: 255, 255, 255;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, sans-serif;
}

body.scrollable {
  overflow-y: auto;
  height: auto;
  min-height: 100dvh;
  display: block;
  padding: 3rem 1.25rem;
}

@media (max-height: 480px) {
  body {
    overflow-y: auto;
    display: block;
    padding: 3rem 1.25rem;
  }
  .card { margin: 0 auto; }
}

#bg-fallback {
  background-color: var(--bg);
  background-image:
    linear-gradient(30deg, rgba(var(--fg-rgb), 0.08) 12%, transparent 12.5%, transparent 87%, rgba(var(--fg-rgb), 0.08) 87.5%, rgba(var(--fg-rgb), 0.08)),
    linear-gradient(150deg, rgba(var(--fg-rgb), 0.08) 12%, transparent 12.5%, transparent 87%, rgba(var(--fg-rgb), 0.08) 87.5%, rgba(var(--fg-rgb), 0.08)),
    linear-gradient(30deg, rgba(var(--fg-rgb), 0.08) 12%, transparent 12.5%, transparent 87%, rgba(var(--fg-rgb), 0.08) 87.5%, rgba(var(--fg-rgb), 0.08)),
    linear-gradient(150deg, rgba(var(--fg-rgb), 0.08) 12%, transparent 12.5%, transparent 87%, rgba(var(--fg-rgb), 0.08) 87.5%, rgba(var(--fg-rgb), 0.08)),
    linear-gradient(60deg, rgba(var(--fg-rgb), 0.05) 25%, transparent 25.5%, transparent 75%, rgba(var(--fg-rgb), 0.05) 75%, rgba(var(--fg-rgb), 0.05)),
    linear-gradient(60deg, rgba(var(--fg-rgb), 0.05) 25%, transparent 25.5%, transparent 75%, rgba(var(--fg-rgb), 0.05) 75%, rgba(var(--fg-rgb), 0.05));
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
}
#bg-root {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#bg-root canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#bg-root { display: none; }
#bg-fallback { display: block; }

html:not(.no-js) #bg-root { display: block; }
html:not(.no-js) #bg-fallback { display: none; }

.js-only { display: none; }
html:not(.no-js) .js-only { display: flex; }

#site-header {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.icon {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  background-color: var(--fg);
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.7rem;
  height: 2.7rem;
  font-size: 1rem;
  color: var(--fg);
  padding: 1rem;
  flex-shrink: 0;
  border: 1px solid rgba(var(--fg-rgb), 0.25);
  background: rgba(var(--bg-rgb), 0.5);
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.icon-btn:disabled {
  cursor: default;
  opacity: 0.4;
}

.bg-control {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.6rem;
  border: 1px solid rgba(var(--fg-rgb), 0.25);
  background: rgba(var(--bg-rgb), 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bg-control__label {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
}
.bg-control__eyebrow {
  font-size: 0.65rem;
  opacity: 0.6;
}
.bg-control__name {
  font-size: 0.85rem;
}
.bg-control .icon-btn {
  border: none;
  background: transparent;
  backdrop-filter: none;
}

.card {
  position: relative;
  z-index: 2;
  max-width: 30rem;
  max-height: calc(100dvh - 16rem);
  padding: 2.5rem;
  text-shadow: 0 2px 10px var(--bg), 0 -2px 10px var(--bg), 0 0 20px var(--bg);  
  /* background: rgba(var(--bg-rgb), 0.55);
  border: 1px solid rgba(var(--fg-rgb), 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); */
  overflow-y: auto;
  overscroll-behavior: none;
  text-align: left;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.card h1 { margin-top: 0; }
.card a {
  color: var(--hl);
  text-underline-offset: 2px;
}
.card a:hover { color: var(--alt-hl); }

.card::-webkit-scrollbar { display: none; }

.card--wide {
  max-width: 44rem;
}

.badge {
  display: inline-block;
  /* image-rendering: pixelated; */
  image-rendering: crisp-edges;
  zoom: 1.2;
}

.safe-inline-text {
  display: inline-block;
  overflow-wrap: break-word;
}

.page-section { margin-bottom: 2.5rem; }
.page-section:last-child { margin-bottom: 0; }
.page-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--fg);
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.entry {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.entry__logo {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--fg-rgb), 0.25);
  background: rgba(var(--fg-rgb), 0.05);
}
.entry__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.entry__body { flex: 1; min-width: 0; }
.entry__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.entry__title { font-weight: 600; }
.entry__dates {
  font-size: 0.85rem;
  white-space: nowrap;
}
.entry__desc {
  margin-top: 0rem;
  font-size: 0.9rem;
  line-height: 1.2;
  opacity: 0.9;
}

.project-card {
  margin-bottom: 1.0rem;
  display: flex;
}
.project-card__image {
  width: 12rem;
  flex-shrink: 0;
}
.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-card__body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.project-card__title { font-weight: 600; }
.project-card__desc {
  font-size: 0.85rem;
  line-height: 1.2;
}
.project-card__links {
  display: flex;
  gap: 0.9rem;
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.8rem;
}
.project-card__links a {
  color: var(--hl);
  text-decoration: underline;
  text-underline-offset: 2px;
}
