:root {
  --bg: #f5f4f0;
  --surface: #eeecea;
  --surface2: #e8e6e2;
  --border: #d8d5d0;
  --text: #1a1917;
  --muted: #3a3835; 
  --faint: #8a877f;
  --accent: #2d6a4f;
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
}

.embed-area iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ─── HEADER ─── */
header {
  padding: 120px 0 100px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 32px;
}

h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 28px;
}

h1 em {
  font-style: normal;
  color: var(--muted);
}

.hero-bio {
  font-size: 16px;
  color: var(--muted);
  max-width: 420px;
  line-height: 1.8;
  margin-bottom: 40px;
}

.hero-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--faint);
  transition: color 0.2s, border-color 0.2s;
}
.hero-links a:hover { color: var(--text); border-color: var(--text); }

/* ─── NAV ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  isolation: isolate;
  background: rgba(245,244,240,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
}

nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 16px 20px 16px 0;
  margin-right: 24px;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
nav a:hover, nav a.active { color: var(--text); border-bottom-color: var(--text); }

/* ─── SECTIONS ─── */
section {
  padding: 100px 0;
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 56px;
}

h2 {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.section-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
}

/* ─── PUBLISHED PROJECTS ─── */
.project-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto;
  gap: 0;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.project-row:last-child { border-bottom: none; }

.project-name {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.project-platform {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}


.project-contributions {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  padding-right: 40px;
}

.project-contributions strong {
  font-weight: 500;
  color: var(--text);
}

.project-contributions ul { list-style: none; }
.project-contributions li { padding-left: 14px; position: relative; }
.project-contributions li::before { content: '–'; position: absolute; left: 0; color: var(--faint); }

.project-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  padding-top: 2px;
}
.project-links a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.project-links a:hover { color: var(--text); border-bottom-color: var(--text); }
.project-links a::after {
  content: ' ↗';
  color: var(--faint);
}
/* ─── PROJECT THUMB ─── */
.project-thumb {
  margin-top: 14px;
  width: 100%;
  max-width: 160px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--border);
  display: block;
}

/* ─── SHOWCASE ─── */
.showcase-list { display: flex; flex-direction: column; gap: 2px; }

.showcase-card {
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
}

.card-header {
  padding: 24px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.card-header:hover { background: var(--surface2); }

.card-summary { display: flex; align-items: baseline; gap: 14px; }

.card-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.card-chevron {
  font-size: 9px;
  color: var(--faint);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.showcase-card.open .card-chevron { transform: rotate(90deg); }
.showcase-card.open .card-body {
  grid-template-rows: 1fr;
}

/* collapsed: body hidden */
.card-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
  min-width: 0;
}

.card-body-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-body-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 480px;
  padding: 0 36px 20px;
}

.card-tags {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.tag-pill {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  white-space: nowrap;
}

/* ─── EMBED ─── */
.embed-area {
  margin: 0 36px 24px;
  border: 1px solid var(--border);
  border-radius: 2px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}
.embed-area iframe, .embed-area img, .embed-area video { width: 100%; display: block; border: none; }
.embed-hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 24px;
  text-align: center;
  line-height: 1.8;
}

/* ─── SCRIPTS TOGGLE ─── */
.scripts-toggle { margin: 0 36px 32px; }

.toggle-btn {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s;
}
.toggle-btn:hover { color: var(--text); }
.toggle-btn .arrow { display: inline-block; transition: transform 0.2s; font-size: 9px; }
.toggle-btn.open .arrow { transform: rotate(90deg); }

/* ─── SCRIPTS PANEL ─── */
.scripts-panel {
  display: none;
  margin: 12px 36px 36px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg);
  min-width: 0;
  overflow: hidden;
}
.scripts-panel.visible { display: block; }

.file-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface2);
}
.file-tabs::-webkit-scrollbar { display: none; }

.file-tab {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 10px 18px;
  cursor: pointer;
  color: var(--muted);
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.file-tab:hover { color: var(--text); }
.file-tab.active { color: var(--text); background: var(--bg); border-bottom-color: var(--accent); }

.file-content {
  display: none;
  padding: 20px 24px;
  min-width: 0;
}
.file-content.active { display: block; }

.file-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.file-content pre {
  width: 100%;
  max-height: 400px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 300;
  line-height: 1.75;
  padding: 16px 18px;
  overflow-x: auto;
  overflow-y: auto;
  white-space: pre;
  margin: 0;
  box-sizing: border-box;
}

.file-content pre code {
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  /* remove color: inherit — let hljs color the tokens */
}

/* ─── FOOTER ─── */
footer {
  padding: 60px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
footer p { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--faint); padding-bottom: 1px; transition: color 0.2s; }
footer a:hover { color: var(--text); }
.si {
  font-size: 12px;
  vertical-align: middle;
  margin-right: 4px;
}

svg.lucide {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-right: 4px;
}

.itch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 16px;
  background: #fa5c5c; /* itch.io red — swap to match your palette */
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.itch-btn:hover { opacity: 0.85; }

.embed-area img {
  width: 100%;
  border-radius: 4px;
}

.avail-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 680px) {
  .wrap, nav { padding-left: 24px; padding-right: 24px; }
  .project-row { grid-template-columns: 1fr; gap: 16px; }
  .project-contributions { padding-right: 0; }
  .project-links { flex-direction: row; align-items: flex-start; }
  .project-thumb { max-width: 100%; }
  .card-header { flex-direction: column; align-items: flex-start; padding: 20px 24px; gap: 12px; }
  .card-header-right { flex-direction: row; flex-wrap: wrap; }
  .card-tags { justify-content: flex-start; }
  .card-desc { padding: 0 24px 20px; }
  .scripts-toggle, .embed-area, .scripts-panel { margin-left: 24px; margin-right: 24px; }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.fade { animation: fadeUp 0.5s ease forwards; opacity: 0; }
.d1 { animation-delay: 0.08s; }
.d2 { animation-delay: 0.16s; }
.d3 { animation-delay: 0.24s; }

section, .wrap { position: relative; z-index: 1; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.project-row.reveal { transition-delay: calc(var(--i, 0) * 0.08s); }
.showcase-card.reveal { transition-delay: calc(var(--i, 0) * 0.07s); }

/* ─── NAME FLIP ─── */
.name-flip-outer {
  perspective: 800px;
}

.name-flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.name-flip-outer.flipped .name-flip-inner {
  transform: rotateX(180deg);
}

.name-front,
.name-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.name-back {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotateX(180deg);
  color: var(--muted);
}
.name-hint-icon {
  width: 22px;
  height: 22px;
  color: var(--faint);
  vertical-align: middle;
  margin-left: 8px;
  transition: color 0.2s;
}
.name-flip-inner:hover .name-hint-icon {
  color: var(--muted);
}

nav {
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}
nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}