:root {
  --bg: #000000;
  --panel: #0a0a0a;
  --border: #2e2e2e;
  --text: #ffffff;
  --muted: #a1a1aa;
  --secondary: #d4d4d8;
  --accent: #58a6ff;
  --red: #ff5f57;
  --yellow: #febc2e;
  --green: #28c840;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hover: var(--secondary);
  --cat-open-source: #58a6ff;
  --cat-apps: #fbbf24;
  --cat-graphics: #f9a8d4;
  --cat-web: #2dd4bf;
  --cat-hackathon: #fdba74;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cg font-family='monospace' fill='%23555555' text-anchor='middle' dominant-baseline='central'%3E%3Ctext x='140' y='20' font-size='14'%3EΣ%3C/text%3E%3Ctext x='20' y='60' font-size='14'%3Eλ%3C/text%3E%3Ctext x='180' y='100' font-size='14'%3Eπ%3C/text%3E%3Ctext x='60' y='140' font-size='15'%3E∫%3C/text%3E%3Ctext x='140' y='180' font-size='15'%3E∞%3C/text%3E%3Ctext x='20' y='180' font-size='13'%3E√%3C/text%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cpath d='M100 93v14M93 100h14' stroke='%23555555' stroke-width='1'/%3E%3C/svg%3E"),
    linear-gradient(to right, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 200px 200px, 200px 200px, 200px 200px, 200px 200px, 40px 40px, 40px 40px;
  /* one shared off-origin offset: symbols stay centered in their boxes at any viewport */
  background-position: 37px 29px, 37px 29px, 37px 29px, 37px 29px, 37px 29px, 37px 29px;
  -webkit-mask-image: radial-gradient(ellipse 120% 100% at 50% 0%, black 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 120% 100% at 50% 0%, black 70%, transparent 100%);
}

/* tech marquee — infinite icon banner under the hero */
.marquee {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 3rem;
  background: rgba(255, 255, 255, 0.02);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2.5rem;
  padding: 0.8rem 1.25rem;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--secondary);
  white-space: nowrap;
}

.marquee-item img {
  width: 18px;
  height: 18px;
  display: block;
}

.marquee-item img.invert {
  filter: invert(1);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* film grain to take the flatness off the solid background */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.topbar,
main,
footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.brand-cube {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 6;
  stroke-linejoin: round;
}

nav {
  display: flex;
  gap: 1.25rem;
}

nav a,
.links a,
.btn {
  color: var(--secondary);
  text-decoration: none;
}

nav a:hover,
.links a:hover {
  color: var(--text);
}

.hero {
  max-width: 1080px;
  margin: 2.5rem auto 0;
  padding: 0 1.25rem;
}

.window {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.window.compact {
  max-width: 720px;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.window-title {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.window-body {
  padding: 2.25rem 2rem 2rem;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
}

.lede {
  max-width: 42rem;
  color: var(--secondary);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.92rem;
}

.btn.primary {
  border-color: var(--accent);
  color: var(--accent);
}

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

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 1.25rem 0;
}

.section-head {
  margin-bottom: 1.4rem;
}

.section-head h2,
.contact h2 {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}

.section-head p,
.contact p {
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.chip {
  appearance: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.chip.is-active,
.chip:hover {
  color: var(--text);
  border-color: var(--secondary);
  background: var(--panel);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.contrib {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.2rem 1.15rem;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 0;
  transition: transform 0.18s ease-out, border-color 0.18s ease-out, box-shadow 0.18s ease-out;
}

/* each tile is its own little mac window */
.card-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.card-bar .dot {
  width: 10px;
  height: 10px;
}

.card-bar-title {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.18s ease-out;
}

.card:hover .card-bar-title,
.card.is-hot .card-bar-title {
  color: var(--hover);
}

.card-body {
  padding: 1.1rem 1.15rem 1.15rem;
}

.card[data-cat="open-source"] { --hover: var(--cat-open-source); }
.card[data-cat="apps"] { --hover: var(--cat-apps); }
.card[data-cat="graphics"] { --hover: var(--cat-graphics); }
.card[data-cat="web"] { --hover: var(--cat-web); }
.card[data-cat="hackathon"] { --hover: var(--cat-hackathon); }

.card:hover,
.card:focus-within,
.card.is-hot {
  transform: translateY(-5px);
  border-color: var(--hover);
  box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px var(--hover);
}

.grid .card:nth-child(odd):hover,
.grid .card:nth-child(odd).is-hot {
  rotate: -0.5deg;
}

.grid .card:nth-child(even):hover,
.grid .card:nth-child(even).is-hot {
  rotate: 0.5deg;
}

.card:active {
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.12);
}

.card:focus {
  outline: none;
}

.card:focus-visible {
  outline: 1px dashed var(--hover);
  outline-offset: 3px;
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-index {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--border);
  transition: color 0.18s ease-out;
  user-select: none;
}

.card:hover .card-index,
.card.is-hot .card-index {
  color: var(--hover);
}

.card h3 {
  position: relative;
  display: inline-block;
}

.card h3::before {
  content: "▸";
  position: absolute;
  left: -1.05rem;
  color: var(--hover);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.card:hover h3::before,
.card.is-hot h3::before {
  opacity: 1;
  transform: translateX(0);
}

/* ---- demo media well: 16:9 slot that wakes up on hover ---- */

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0.85rem 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.card-media video,
.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease-out, filter 0.25s ease-out;
}

.card-media.has-demo video,
.card-media.has-demo img {
  filter: saturate(0.85);
}

.card:hover .card-media.has-demo video,
.card.is-hot .card-media.has-demo video,
.card:hover .card-media.has-demo img,
.card.is-hot .card-media.has-demo img {
  filter: saturate(1.1);
}

.card-media.is-empty {
  border-style: dashed;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.15rem;
  padding: 0.7rem 0.75rem;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 10px,
    rgba(255, 255, 255, 0.06) 10px 11px
  );
}

.card:hover .card-media.is-empty,
.card.is-hot .card-media.is-empty {
  animation: stripe-crawl 1.2s linear infinite;
  border-color: var(--hover);
}

@keyframes stripe-crawl {
  to { background-position: 16px 0; }
}

.empty-dir {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--secondary);
}

.empty-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.card-media.is-empty.is-notice {
  justify-content: center;
}

.card-media.is-empty.is-notice .empty-note {
  margin: 0 -0.75rem;
}

.empty-note {
  align-self: stretch;
  margin: 0.6rem -0.75rem -0.7rem;
  padding: 0.4rem 0.5rem;
  background: var(--yellow);
  color: #111111;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  border-top: 2px dashed #111111;
  border-bottom: 2px dashed #111111;
  transform: rotate(-1.5deg) scale(1.03);
}

.card:hover .empty-hint,
.card.is-hot .empty-hint {
  color: var(--hover);
}

/* tags do a tiny staggered hop on hover — terminal stickers, not slop */

.tags li {
  transition: transform 0.16s ease-out, border-color 0.16s ease-out, color 0.16s ease-out;
}

.card:hover .tags li,
.card.is-hot .tags li {
  transform: translateY(-2px);
  border-color: var(--hover);
}

.card:hover .tags li:nth-child(2),
.card.is-hot .tags li:nth-child(2) { transition-delay: 0.03s; }
.card:hover .tags li:nth-child(3),
.card.is-hot .tags li:nth-child(3) { transition-delay: 0.06s; }
.card:hover .tags li:nth-child(4),
.card.is-hot .tags li:nth-child(4) { transition-delay: 0.09s; }
.card:hover .tags li:nth-child(5),
.card.is-hot .tags li:nth-child(5) { transition-delay: 0.12s; }

/* hero cursor + hint line */

.cursor-blink {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hint {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.hint kbd {
  font-family: inherit;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 0.35rem;
  color: var(--secondary);
  background: var(--panel);
}

/* hero photo — a sticky Polaroid on the terminal window */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 1.75rem;
  align-items: center;
}

.me {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  rotate: 2deg;
  transition: rotate 0.2s ease-out, transform 0.2s ease-out, border-color 0.2s ease-out;
}

.me:hover {
  rotate: 0deg;
  transform: scale(1.02);
  border-color: var(--secondary);
}

.me-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--muted);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 10px,
    rgba(48, 54, 61, 0.35) 10px 11px
  );
}

.me img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.me figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--secondary);
  background: rgba(13, 17, 23, 0.85);
  border-top: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .contrib,
  .card-media video,
  .card-media img,
  .tags li {
    transition: none;
  }

  .card:hover,
  .card.is-hot,
  .contrib:hover {
    transform: none;
    rotate: none;
    animation: none;
  }

  .card-media.is-empty {
    animation: none;
  }

  .cursor-blink {
    animation: none;
  }

  .marquee-track {
    animation: none;
  }
}

.card h3,
.contrib h3 {
  font-size: 1.12rem;
  margin: 0.2rem 0 0.55rem;
}

.contrib {
  position: relative;
  transition: transform 0.18s ease-out, border-color 0.18s ease-out, box-shadow 0.18s ease-out;
}

.contrib:hover,
.contrib:focus-within {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55), 0 0 0 1px var(--accent);
}

.contrib h3 {
  position: relative;
  display: inline-block;
}

.contrib h3::before {
  content: "▸";
  position: absolute;
  left: -1.05rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.contrib:hover h3::before {
  opacity: 1;
  transform: translateX(0);
}

.card p,
.contrib p {
  color: var(--secondary);
  font-size: 0.95rem;
}

.card-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.card-note {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}


.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin-top: 0.9rem;
  align-items: center;
}

.tags:empty {
  display: none;
}

.tags li.tag-icon {
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.tags li.tag-icon img {
  width: 22px;
  height: 22px;
  display: block;
}

.tags li.tag-icon img.invert {
  filter: invert(1);
}

.tags li.tag-icon svg {
  display: block;
}

.tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.contrib-list {
  display: grid;
  gap: 1rem;
}

.contact {
  padding-bottom: 2rem;
}

footer {
  display: flex;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .window-body {
    padding: 1.5rem 1.15rem 1.4rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .me {
    max-width: 220px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    gap: 0.35rem;
  }
}
