:root {
  --bg: #171512;
  --bg-soft: #1f1c18;
  --ink: #e9e2d2;
  --body: #9c9077;
  --dim: #9c9077;
  --muted: #9c9077;
  --accent: #e0a54e;
  --rule: rgba(224, 165, 78, .18);
  --interactive-rule: rgba(224, 165, 78, .18);
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--bg); }
body {
  background: var(--bg); color: var(--ink);
  font: 18px/1.7 Georgia, 'Times New Roman', serif;
  padding: 2rem 1.2rem 4rem;
}
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(224,165,78,.35); }
a:hover { border-bottom-color: var(--accent); }
img { max-width: 100%; height: auto; }

/* One knob for page width: main and footer always agree. */
body { --page-w: 820px; }
body { --back-offset: 500px; }
body.page-wide { --page-w: 1120px; --back-offset: 650px; }
main { max-width: var(--page-w); width: 100%; margin: 0 auto; }

h1 { font-size: 2.2rem; line-height: 1.25; }
h2 {
  font-size: .95rem; text-transform: uppercase; letter-spacing: .15em;
  color: var(--dim); margin: 2.4rem 0 .8rem; font-weight: normal;
}
p { margin-bottom: 1rem; }
ul { list-style: none; padding: 0; }
li { padding: .35rem 0; }

/* ---- top bar: back link + contact line ---- */
.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem 1.4rem; flex-wrap: wrap;
  padding-bottom: .9rem; margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
.topbar .spacer { flex: 1 1 0; }
.contact { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .9rem; }
.contact a { color: var(--dim); border-bottom-color: rgba(156,144,119,.3); }
.contact a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.back { display: inline-block; font-size: .95rem; color: var(--dim); border-bottom-color: rgba(156,144,119,.35); }
.back:hover { color: var(--accent); }
.floating-back {
  position: fixed; left: max(1.25rem, calc(50% - var(--back-offset))); top: 1.25rem; z-index: 20;
  padding: .55rem .85rem; border: 1px solid var(--accent); border-radius: 999px;
  background: var(--bg-soft); color: var(--ink); font: .9rem/1.2 Georgia, 'Times New Roman', serif;
  cursor: pointer; box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.floating-back:hover { background: var(--accent); color: var(--bg); }

/* ---- project header ---- */
.proj-head { margin-bottom: 1.4rem; }
.meta { color: var(--dim); font-size: .95rem; margin-top: .5rem; }
.meta span + span::before { content: " · "; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tag {
  font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--dim); border: 1px solid var(--rule); border-radius: 999px;
  padding: .2rem .7rem; font-family: system-ui, sans-serif;
}
.lede { color: var(--dim); font-size: 1.05rem; }

/* Never upscale: width/height attributes give the natural size, and max-width
   only ever shrinks the image on narrow screens. */
.cover {
  display: block; max-width: 100%; height: auto;
  border-radius: 6px; margin: 1.8rem auto .5rem; border: 1px solid var(--rule);
}
.project-inline-video { margin: 1.2rem 0; }
.project-inline-video video { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; background: #100f0d; }
.project-hero-caption { color: var(--dim); font-size: .9rem; margin: .45rem 0 1.2rem; }
.media-caption { color: var(--dim); font-size: .85rem; line-height: 1.4; margin: .4rem 0 1.2rem; }
.project-inline-gif { margin: 1.2rem 0; }
.project-inline-gif img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; }

/* ---- content lists ---- */
.bullets li {
  padding: .6rem 0 .6rem 1.4rem; position: relative;
  border-bottom: 1px solid rgba(156,144,119,.14);
}
.bullets li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.bullets b { color: var(--ink); }
.bullets .bullet-with-media {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  align-items: center; gap: 1rem; padding-right: 0;
}
.bullet-with-media figure { margin: 0; }
.bullet-with-media img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; }

/* ---- screenshots ---- */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, max-content)); gap: .9rem 1.2rem; margin-top: 1rem; justify-content: start; }
.shots img { max-width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--rule); }
.shots img.zoomable, .highlight-item img.zoomable { cursor: zoom-in; transition: transform .15s; }
.shots img.zoomable:hover, .highlight-item img.zoomable:hover { transform: scale(1.02); }
figure { margin: 0; }
figcaption { color: var(--dim); font-size: .85rem; margin-top: .4rem; }
.steam-media-story { max-width: 600px; }
.steam-media { margin: 1rem 0; }
.steam-media video { display: block; height: auto; border-radius: 6px; border: 1px solid var(--rule); background: #100f0d; }
.steam-media-pair { display: flex; gap: .75rem; align-items: flex-start; }
.steam-media-pair video { width: 270px; max-width: calc((100% - .75rem) / 2); }
.steam-media-trio { display: flex !important; flex-wrap: nowrap; gap: .75rem; }
.steam-media-trio video { flex: 1 1 0; min-width: 0; width: 0; aspect-ratio: 270 / 338; object-fit: cover; }
.steam-media-wide video { width: 600px; max-width: 100%; }
.steam-media-copy { color: var(--dim); font-size: .95rem; margin: 1.5rem 0 1rem; }

/* ---- portfolio chapters ---- */
.eyebrow { color: var(--accent); font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 .35rem; }
.chapter-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 2.2rem 0 3.5rem; }
.chapter-link { display: flex; align-items: center; gap: .65rem; padding: .9rem 1rem; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); text-decoration: none; }
.chapter-link:hover { border-color: var(--accent); background: rgba(197, 149, 72, .06); }
.chapter-link small { color: var(--dim); font-size: .8rem; }
.chapter-link span { color: var(--accent); margin-left: auto; }
.chapter-head { margin: 2.5rem 0 1.6rem; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.chapter-grid-detail { margin-bottom: 2rem; }
.highlight-list { border-top: 1px solid var(--rule); }
.highlight-item { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 1.2rem; align-items: start; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.highlight-item h3 { color: var(--ink); font-size: 1.08rem; line-height: 1.3; margin: 0 0 .45rem; }
.highlight-item p { color: var(--dim); font-size: .92rem; line-height: 1.48; margin: 0; }
.highlight-item strong { color: var(--accent); font-weight: 700; }
.highlight-item img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; }
.highlight-item-text { grid-template-columns: 1fr; }
.chapter-card { display: flex; flex-direction: column; padding: 1.15rem 1.1rem 1.2rem; border: 1px solid var(--rule); border-radius: 6px; color: inherit; text-decoration: none; background: rgba(255, 255, 255, .015); transition: border-color .15s, transform .15s, background .15s; }
.chapter-card:hover { border-color: var(--accent); background: rgba(197, 149, 72, .06); transform: translateY(-2px); }
.chapter-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; margin: -1.15rem -1.1rem 1rem; border-radius: 5px 5px 0 0; background: #100f0d; }
.chapter-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chapter-card h3 { color: var(--ink); font-size: 1.12rem; line-height: 1.28; margin: .45rem 0 .65rem; }
.chapter-card p { color: var(--dim); font-size: .92rem; line-height: 1.48; margin: 0; }
.chapter-card-cta { display: block; margin-top: auto; padding-top: 1rem; color: var(--accent); font-size: .84rem; font-weight: 700; }
.case-video { margin: 0 0 1.8rem; }
.case-video video { display: block; width: 320px; max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; background: #100f0d; }
.case-top-image { max-width: 820px; margin: 0 0 1.4rem; }
.case-top-image img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; }
.case-inline-image { max-width: 820px; margin: 1rem 0; }
.case-inline-image img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; }
.case-inline-video { max-width: 820px; margin: 1rem 0; }
.case-inline-video video { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; background: #100f0d; }

/* Responsive 16:9 embeds for project videos. */
.video-embed { aspect-ratio: 16 / 9; max-width: 820px; margin-top: 1rem; }
.video-embed iframe { width: 100%; height: 100%; border: 1px solid var(--rule); border-radius: 6px; }
.project-hero-video { margin: 1.8rem 0 .5rem; }

#lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(23,21,18,.94);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 2vh 2vw;
}
#lightbox[hidden] { display: none; }
#lightbox img {
  /* Show the source at its natural size unless the viewport needs to constrain it. */
  width: auto;
  height: auto;
  max-width: 96vw;
  max-height: 96vh;
  object-fit: contain;
  border-radius: 6px;
}

/* ---- project nav (prev/next) ---- */
.more { margin-top: 3rem; }
.more ul li { padding: .3rem 0; }
.more .role { color: var(--dim); font-size: .95rem; }

/* ---- footer ---- */
.site-footer {
  max-width: var(--page-w); margin: 3.5rem auto 0; padding-top: 1.5rem;
  border-top: 1px solid var(--rule); color: var(--dim); font-size: .95rem;
}
.site-footer .copy { font-size: .85rem; }

/* ---- index page: profile header ---- */
body.home-page { padding-top: 0; }
.home-main { flex: none; padding: 64px 72px 0; }
.profile-header { margin: 0; }
.profile-identity {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: start;
}
.profile-main { display: flex; gap: 32px; align-items: flex-start; min-width: 0; }
.portrait {
  width: 104px; height: 104px; border-radius: 50%; object-fit: cover;
  flex: none; border: 1px solid var(--rule);
}
.profile-text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.profile-text h1 {
  margin: 0; color: var(--ink); font-size: 2.2rem; font-weight: bold; line-height: 1.25;
  letter-spacing: normal; white-space: nowrap;
}
.profile-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .75em; }
.profile-location { color: #6f6653; font-size: .9rem; letter-spacing: .02em; white-space: nowrap; }
.profile-role {
  color: var(--accent); font: 12px/1.3 Georgia, 'Times New Roman', serif; letter-spacing: .2em;
  text-transform: uppercase; margin: 0;
}
.profile-text .lede {
  max-width: 62ch; color: var(--dim); font-size: 1.05rem; line-height: 1.7;
  margin: 0; text-wrap: pretty;
}
.profile-contact { color: var(--dim); font-size: .9rem; line-height: 1.45; padding-top: 2px; }
.profile-contact p { margin: 0; }
.profile-links { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 5px !important; }
.profile-links a { color: inherit; border-bottom-color: rgba(156,144,119,.3); text-underline-offset: 3px; }
.profile-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.profile-links span { color: var(--interactive-rule); }
.profile-logistics { margin-top: 9px; }
.profile-logistics p + p { margin-top: 5px; }

/* ---- career proof points (index) ---- */
.proof-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px;
  margin: 48px 0 0; padding: 0 0 56px;
}
.proof-strip li { padding: 0; }
.proof-strip strong { display: block; color: var(--accent); font-size: 1.1rem; font-weight: bold; line-height: 1.25; }
.proof-strip span { display: block; color: var(--dim); font-size: .82rem; line-height: 1.4; margin-top: .25rem; }

.chapter-links {
  gap: 20px; margin: 0; padding-bottom: 56px;
}
.chapter-link {
  justify-content: space-between; gap: 24px; padding: 26px 28px; border-color: var(--interactive-rule);
  border-radius: 0; background: var(--bg-soft); transition: border-color .15s, background .15s;
}
.chapter-link:hover { border-color: var(--accent); background: rgba(197, 149, 72, .06); }
.chapter-link-text { display: flex; flex-direction: column; gap: 5px; }
.chapter-link strong { color: var(--ink); font-size: 1.1rem; font-weight: bold; line-height: 1.35; }
.chapter-link small { color: var(--dim); font-size: .8rem; line-height: 1.35; }
.chapter-link .chapter-arrow { margin-left: auto; color: var(--accent); font-size: 22px; }
.home-main > h2 {
  color: var(--dim); font: normal .95rem/1.25 Georgia, 'Times New Roman', serif; letter-spacing: .15em;
  text-transform: uppercase; margin: 0 0 40px; padding: 0;
}
.home-main > .proj-grid + h2 { margin-top: 56px; }
/* ---- project card grid (index) ---- */
.proj-grid {
  display: grid; gap: 1.6rem 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin-bottom: 1rem;
}
.card-link {
  display: block; border: none; color: var(--ink);
  padding: .6rem; margin: -.6rem; border-radius: 8px;
  transition: background .15s;
}
.card-link:hover { background: var(--bg-soft); }
/* Fixed box: the image sits inside at its natural size and is only scaled DOWN. */
.card-shot {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 460 / 215; overflow: hidden;
  background: #100f0d; border: 1px solid var(--rule); border-radius: 6px;
}
.card-shot img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.card-title {
  display: block; margin-top: .7rem; font-size: 1.15rem; color: var(--accent);
  border-bottom: 1px solid transparent; line-height: 1.35;
}
.card-link:hover .card-title { border-bottom-color: rgba(224,165,78,.5); }
.card-desc { display: block; color: var(--ink); font-size: .95rem; }
.card-meta { display: block; color: var(--dim); font-size: .85rem; }

/* ---- prototype board (index) ---- */
.prototype-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.prototype-card-link { color: inherit; border-bottom: 0; text-decoration: none; }
.prototype-card-link:hover .prototype-shot { border-color: var(--accent); }
.prototype-card-link:hover .prototype-title { text-decoration: underline; text-decoration-color: rgba(224,165,78,.5); text-underline-offset: 3px; }
.prototype-shot { display: block; position: relative; aspect-ratio: 460 / 215; overflow: hidden; border: 1px solid var(--rule); border-radius: 6px; background: #100f0d; }
.prototype-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.prototype-title { display: block; color: var(--accent); font-size: .9rem; line-height: 1.3; margin-top: .45rem; }
.prototype-desc { display: block; color: var(--dim); font-size: .78rem; line-height: 1.35; margin-top: .4rem; }
.prototype-more { margin-top: 1rem; font-size: .9rem; }

/* ---- icon row (Party Hard games) ---- */
.icon-row {
  display: grid; gap: 1.4rem 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin-bottom: 1rem;
}
.icon-link {
  display: block; border: none; color: var(--ink); text-align: center;
  padding: .6rem; margin: -.6rem; border-radius: 8px; transition: background .15s;
}
.icon-link:hover { background: var(--bg-soft); }
/* Steam headers are 460×215, so every series tile has the same native ratio. */
.icon-shot {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 460 / 215; overflow: hidden;
  background: #100f0d; border: 1px solid var(--rule); border-radius: 8px;
}
.icon-shot img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.icon-title {
  display: block; margin-top: .6rem; font-size: 1.02rem; color: var(--accent);
  border-bottom: 1px solid transparent;
}
.icon-link:hover .icon-title { border-bottom-color: rgba(224,165,78,.5); }
.icon-year { display: block; color: var(--dim); font-size: .85rem; }

/* The "other projects" list on detail pages stays text-only */
.index-list li { padding: .3rem 0; }
.index-list .role { color: var(--dim); font-size: .95rem; }
.note { color: var(--dim); font-size: .95rem; margin-top: 2.5rem; }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .bullets .bullet-with-media { grid-template-columns: 1fr; }
  h1 { font-size: 1.8rem; }
  .proof-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter-links { grid-template-columns: 1fr; }
  .chapter-grid { grid-template-columns: 1fr; }
  .highlight-item { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .home-main { padding: 40px 24px 0; }
  .profile-identity { grid-template-columns: 1fr; gap: 28px; }
  .profile-main { gap: 20px; }
  .profile-text h1 { font-size: 2.2rem; white-space: normal; }
  .profile-text .lede { font-size: 1.05rem; }
  .profile-contact { max-width: 560px; }
  .proof-strip { gap: 28px 20px; margin-top: 40px; padding-bottom: 40px; }
  .chapter-links { padding-bottom: 40px; }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steam-media-pair { flex-direction: column; }
  .steam-media-pair video { width: 100%; max-width: 100%; }
}

@media (max-width: 520px) {
  .profile-main { flex-direction: column; }
  .portrait { width: 92px; height: 92px; }
  .profile-text h1 { font-size: 1.8rem; }
  .chapter-link { padding: 22px 20px; }
  .chapter-link strong { font-size: 23px; }
  .proj-grid { grid-template-columns: 1fr; }
}
