:root {
  --bg: #fafaf8;          /* near-white, soft warm */
  --bg-hero: #ffffff;     /* pure white */
  --ink: #1a1a1a;
  --ink-soft: #5a5a58;
  --ink-mute: #a6a29a;
  --line: #d9d2c4;
  --accent: #c64f39;       /* terracotta for the arrow */
  --serif: 'Cormorant Garamond', 'Didot', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --max: 1280px;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }

/* -------- NAV -------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 44px;
  z-index: 20;
  mix-blend-mode: multiply;
}
.brand-mark { font-family: var(--serif); font-size: 22px; letter-spacing: 4px; color: var(--ink); }
.brand-mark .dot { opacity: .5; }
.nav-links { display: flex; gap: 44px; }
.nav-links a {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .5px;
  position: relative;
  padding: 2px 0;
  transition: color .2s ease;
}
.nav-links a::after {
  content:""; position:absolute; left:0; right:0; bottom:-2px;
  height:1px; background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .35s ease;
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* -------- HERO -------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-hero);
  overflow: hidden;
  text-align: center;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 11vw, 180px);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1;
  position: relative; z-index: 2;
}
.hero-title .italic { font-style: italic; font-weight: 300; }
.hero-sub {
  margin-top: 28px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(16px, 1.6vw, 22px);
  letter-spacing: .02em;
  color: var(--ink-soft);
  position: relative; z-index: 2;
}
.scroll-hint {
  position: absolute; bottom: 54px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; color: var(--ink-mute);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100%{transform:translate(-50%,0)} 50%{transform:translate(-50%,6px)} }

.stars { position:absolute; inset:0; pointer-events:none; }
.stars span {
  position: absolute;
  left: var(--x); top: var(--y);
  font-family: var(--serif);
  font-size: clamp(14px, 1.6vw, 22px);
  color: #b9b2a3;
  animation: twinkle 3.6s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes twinkle {
  0%, 100% { opacity:.2; transform: rotate(0) scale(1); }
  50%      { opacity:.75; transform: rotate(25deg) scale(1.15); }
}

/* -------- WORK -------- */
.work {
  padding: 140px 44px 120px;
  max-width: var(--max); margin: 0 auto;
}
.work-head { margin-bottom: 64px; max-width: 720px; }
.work-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.work-desc {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
}

.work-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 64px;
  align-items: start;
}
.filters { position: sticky; top: 120px; }
.filter-label {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  margin-bottom: 26px;
  text-transform: none;
  position: relative;
  padding-bottom: 14px;
}
.filter-label::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 26px;
  height: 1px;
  background: var(--ink);
  opacity: 0.35;
}
.filter-label .slash {
  color: var(--ink-mute);
  font-style: normal;
  margin: 0 8px;
  opacity: 0.5;
}

/* editorial-style category list: no chips, only typographic rhythm */
.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.filter-list li { position: relative; }
.chip {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0.005em;
  color: var(--ink-mute);
  padding: 6px 0 6px 22px;
  background: none;
  border: 0;
  border-radius: 0;
  text-align: left;
  width: 100%;
  cursor: pointer;
  position: relative;
  transition: color .28s ease, padding-left .28s ease;
}
.chip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 1px;
  background: currentColor;
  transform: translateX(-4px) scaleX(0.5);
  opacity: 0;
  transition: opacity .28s ease, transform .28s ease, width .28s ease, height .28s ease;
}
.chip:hover {
  color: var(--ink-soft);
  padding-left: 26px;
}
.chip:hover::before {
  opacity: 0.5;
  transform: translateX(0) scaleX(1);
}
.chip.active {
  color: var(--ink);
  font-style: italic;
  font-size: 20px;
  padding-left: 28px;
}
.chip.active::before {
  opacity: 1;
  transform: translateX(0) scaleX(1);
  width: 18px;
  height: 2px;
}

/* -------- LIST -------- */
.work-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.work-group {
  padding: 18px 0 6px;
  border-bottom: 1px solid transparent;
}
.group-label {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-mute);
  font-size: 18px;
}
.work-item {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  gap: 28px;
  align-items: baseline;
  padding: 28px 4px;
  border-bottom: 1px solid var(--line);
  cursor: none;
  position: relative;
  transition: padding .4s ease;
}
.work-item.is-link { cursor: pointer; }
.work-item:hover { padding-left: 16px; }
.wi-year {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-mute);
}
.wi-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 44px);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  transition: color .3s ease, transform .4s ease;
}
.work-item:hover .wi-title { font-style: italic; }
.wi-desc {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 6px;
  max-width: 62ch;
}
.wi-meta {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}
.wi-arrow {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink-mute);
  transform: translateX(-8px);
  opacity: 0;
  transition: opacity .4s ease, transform .4s ease, color .3s;
}
.work-item:hover .wi-arrow { opacity: 1; transform: translateX(0); color: var(--accent); }

/* -------- CURSOR FOLLOWER --------
   Sits *behind* the text (z-index below .work), scaled ~80% of the original
   frame, soft paper-frame border + muted opacity so the words on top stay
   perfectly legible. */
.cursor-image {
  position: fixed;
  top: 0; left: 0;
  width: 224px; height: 288px;       /* 80% of the earlier 280 × 360 frame */
  padding: 10px;
  background-color: var(--bg-hero);
  background-origin: content-box;
  background-clip: content-box;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 18px 36px rgba(40,30,10,0.10),
    0 2px 6px rgba(40,30,10,0.05);
  pointer-events: none;
  z-index: 1;                        /* below text */
  opacity: 0;
  transition: opacity .35s ease, transform .1s linear;
  will-change: transform;
}
.cursor-image.is-active { opacity: 0.78; }

/* Lift the real content above the cursor image so text is never covered. */
.work     { position: relative; z-index: 2; }
.hero     { position: relative; z-index: 2; }
.foot     { position: relative; z-index: 2; }

/* -------- FOOTER -------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 52px 44px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  align-items: end;
  background: var(--bg-hero);
}
.foot-name { font-family: var(--serif); font-size: 22px; margin: 0; }
.foot-sub  { font-family: var(--serif); font-style: italic; color: var(--ink-soft); margin: 4px 0 0; }
.foot-links { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-copy { font-size: 11px; color: var(--ink-mute); letter-spacing: 0.12em; text-align: right; margin: 0; }

/* -------- ABOUT page -------- */
.about-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 160px 44px 120px;
}
.about-wrap h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 96px);
  margin: 0 0 40px;
  letter-spacing: -0.01em;
}
.about-wrap h1 .italic { font-style: italic; }
.about-bio p {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 22px;
  font-weight: 300;
}
.about-section { margin-top: 80px; }
.about-section h2 {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 22px;
  font-weight: 500;
}
.edu-item { border-top: 1px solid var(--line); padding: 20px 0; }
.edu-item h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 6px; }
.edu-item p  { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); margin: 2px 0; }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px 20px;
}
.skills-grid span {
  font-family: var(--serif); font-style: italic; font-size: 18px;
  color: var(--ink);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.contact-list { display: grid; gap: 4px; font-family: var(--serif); font-size: 18px; }
.contact-list .label { color: var(--ink-mute); margin-right: 10px; font-style: italic; }

/* -------- PLAY page -------- */
.play-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 150px 44px 80px;
}
.play-head { margin-bottom: 40px; }
.play-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 80px);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.play-head .italic { font-style: italic; }
.play-head p {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 18px;
  margin: 0;
  max-width: 62ch;
}
.game-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
#game-canvas { width: 100%; height: 100%; display: block; }
.game-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: rgba(10,10,10,0.55);
  color: #fff;
  font-family: var(--serif);
  text-align: center;
  padding: 24px;
  gap: 18px;
  transition: opacity .3s ease;
}
.game-overlay.hidden { opacity: 0; pointer-events: none; }
.game-overlay h3 { font-size: 42px; margin: 0; font-weight: 400; }
.game-overlay p  { margin: 0; font-size: 16px; max-width: 420px; line-height: 1.5; opacity: .85; }
.game-overlay button {
  padding: 10px 28px;
  border: 1px solid #fff;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: background .2s, color .2s;
}
.game-overlay button:hover { background: #fff; color: #111; }

.play-notes {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.play-notes div { border-top: 1px solid var(--line); padding-top: 16px; }
.play-notes h4 {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-mute); margin: 0 0 10px; font-weight: 500;
}
.play-notes p { font-family: var(--serif); font-size: 17px; margin: 0; color: var(--ink); }

/* -------- DETAIL PAGE -------- */
.detail {
  max-width: 1080px;
  margin: 0 auto;
  padding: 150px 44px 80px;
  position: relative; z-index: 2;
}
.detail-back {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  transition: color .2s;
}
.detail-back:hover { color: var(--ink); }

.detail-head { margin-bottom: 60px; max-width: 760px; }
.detail-meta {
  margin: 40px 0 14px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex; gap: 10px; align-items: center;
}
.detail-meta .dot { color: var(--line); }
.detail-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.detail-type {
  font-family: var(--serif); font-style: italic;
  color: var(--ink-soft); font-size: 22px;
  margin: 0 0 32px;
}
.detail-type .detail-tool {
  font-style: normal;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-left: 4px;
}

/* ---- Play CTA inside detail page ---- */
.detail-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  padding: 16px 32px 17px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background .24s ease, color .24s ease, transform .24s ease, padding .24s ease;
}
.detail-cta:hover {
  background: transparent;
  color: var(--ink);
  padding-left: 38px;
  padding-right: 26px;
}
.detail-cta--ext {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.detail-cta--ext:hover {
  background: var(--ink);
  color: var(--bg);
  padding-left: 32px;
  padding-right: 32px;
}
.detail-cta--soon {
  background: transparent;
  color: var(--ink-mute);
  border: 1px dashed var(--ink-mute);
  cursor: not-allowed;
  font-style: italic;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 28px;
}
.detail-cta--soon .detail-cta__meta {
  font-family: var(--sans);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  opacity: 0.8;
}
.detail-desc {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
  max-width: 64ch;
}

.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 72px;
  margin: 100px 0 80px;
}
.m-figure { margin: 0; }
.m-figure img, .m-figure video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--bg-hero);
}
.m-image {
  display: block; width: 100%;
  padding: 0; border: 0; background: none;
  cursor: zoom-in;
  transition: opacity .25s ease;
}
.m-image:hover { opacity: 0.9; }
.m-figure figcaption {
  margin-top: 14px;
  font-family: var(--serif); font-style: italic;
  color: var(--ink-soft); font-size: 15px;
  text-align: center;
}
.m-embed {
  display: block;
  padding: 40px 32px;
  border: 1px solid var(--line);
  background: var(--bg-hero);
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  text-align: center;
  transition: background .25s ease, color .25s ease;
}
.m-embed:hover { background: var(--ink); color: var(--bg); }

.detail-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0 0;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.detail-nav a { display: flex; flex-direction: column; gap: 4px; }
.detail-nav .dn-next { text-align: right; }
.detail-nav .dn-label {
  font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-mute);
}
.detail-nav .dn-title {
  font-family: var(--serif); font-size: 22px; color: var(--ink);
  transition: font-style .25s;
}
.detail-nav a:hover .dn-title { font-style: italic; }
.detail-nav .dn-index {
  font-family: var(--serif); font-style: italic;
  color: var(--ink-mute); font-size: 16px;
  text-align: center;
}
.detail-nav .dn-index:hover { color: var(--ink); }

.detail-notfound { text-align: center; padding: 80px 0; }
.detail-notfound h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: 64px; margin: 0 0 16px;
}

/* -------- LIGHTBOX -------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20, 18, 14, 0.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 40;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,0.15);
}
.lightbox-close {
  position: absolute; top: 24px; right: 32px;
  font-size: 36px; color: rgba(255,255,255,0.8);
  font-family: var(--serif); line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { color: #fff; }

/* -------- RESPONSIVE -------- */
@media (max-width: 900px) {
  .nav { padding: 18px 22px; }
  .nav-links { gap: 22px; }
  .nav-links a { font-size: 18px; }
  .work { padding: 100px 22px 80px; }
  .work-layout { grid-template-columns: 1fr; gap: 32px; }
  .filters { position: static; }
  .work-item { grid-template-columns: 60px 1fr 20px; gap: 16px; padding: 22px 0; }
  .cursor-image { width: 180px; height: 230px; }
  .foot { grid-template-columns: 1fr; padding: 40px 22px; }
  .foot-copy { text-align: left; }
  .about-wrap, .play-wrap { padding: 100px 22px 60px; }
  .play-notes { grid-template-columns: 1fr; }
  .detail { padding: 100px 22px 60px; }
  .detail-gallery { gap: 48px; margin: 60px 0 50px; }
  .detail-nav { grid-template-columns: 1fr 1fr; }
  .detail-nav .dn-index { display: none; }
}
