/* Project reader */
.drawer h1 { font-size: clamp(58px, 8vw, 112px); }
.drawer h1 em { transform: rotate(-3deg); }

#study {
  --reader-paper: #fffdf8;
  --reader-ink: #29233c;
  --reader-muted: #554e64;
  --reader-line: #ddd5df;
  --reader-gutter: clamp(24px, 5vw, 58px);
  --reader-mat: #eee6f7;
  box-sizing: border-box;
  width: min(1080px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--reader-line);
  border-radius: 20px;
  background: var(--reader-paper);
  color: var(--reader-ink);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #857696 var(--reader-paper);
  box-shadow: 0 20px 70px #21182d44;
}
#study[data-project="pontune"] { --reader-mat: #e8e2f1; }
#study[data-project="roblox"] { --reader-mat: #ffe6a6; }
#study[data-project="naturalai"] { --reader-mat: #f0e6fa; }
#study::backdrop { background: #211b35aa; }
#study .study-top {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 2px var(--reader-gutter);
  border-bottom: 1px solid var(--reader-line);
  background: var(--reader-paper);
}
#study .study-top-label { color: var(--reader-muted); font-size: 13px; font-weight: 650; }
#study #close-study {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 9px;
  margin-right: -9px;
  color: var(--reader-ink);
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}
#study #close-study span { margin: 0; font-size: inherit; }
#study #close-study span:first-child { font-size: 19px; line-height: 1; }
#study #close-study:hover { background: #eee7f4; }
#study :is(button, a):focus-visible {
  outline: 2px solid #48368a;
  outline-offset: 3px;
}
#study-content { padding: clamp(30px, 4vw, 46px) var(--reader-gutter) clamp(40px, 5vw, 60px); }
#study .personal-study-hero {
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  gap: clamp(30px, 4.4vw, 54px);
  align-items: start;
  margin: 0;
}
#study .study-intro { padding-top: 0; }
#study .study-byline {
  margin: 0 0 16px;
  color: #5b4673;
  font-size: 13px;
  font-weight: 700;
}
#study .study-byline span { padding-inline: 4px; }
#study-title {
  margin: 0 0 18px;
  font: 850 clamp(38px, 5vw, 66px)/.98 var(--display);
  letter-spacing: -.06em;
  text-wrap: balance;
}
#study .study-deck {
  margin: 0;
  max-width: 40ch;
  color: var(--reader-muted);
  font-size: 16px;
  line-height: 1.7;
}
#study .study-external {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0;
  background: transparent;
  color: #433383;
  font-size: 14px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
}
#study .study-external:hover { color: #291664; }
#study .study-figure {
  min-width: 0;
  margin: clamp(24px, 4vw, 48px) 0 0;
  padding: clamp(10px, 1.4vw, 16px);
  border-radius: 10px 30px 10px 10px;
  background: var(--reader-mat);
  box-shadow: 4px 5px 0 #30234219;
}
#study .study-figure .project-visual {
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  margin: 0;
  border: 0;
  border-radius: 5px 20px 5px 5px;
  overflow: hidden;
}
#study .study-figure figcaption {
  margin: 10px 4px 0;
  color: var(--reader-muted);
  font-size: 12px;
  line-height: 1.4;
}
#study .project-visual.image-pontune { background: #292541; }
#study .project-visual.image-pontune img { width: min(54%, 155px); height: auto; }
#study .project-visual.image-roblox img { width: 100%; height: 100%; object-fit: contain; }
#study .project-visual.image-naturalai { background: #fffaf5; padding: 12px; aspect-ratio: 1.75; }
#study .project-visual.image-naturalai img { width: auto; height: 100%; min-height: 0; object-fit: contain; }
#study .project-story {
  margin-top: clamp(34px, 4.5vw, 48px);
  padding-top: clamp(25px, 3.5vw, 36px);
  border-top: 1px solid var(--reader-line);
}
#study-story-title {
  margin: 0 0 18px;
  color: #5b4673;
  font: 750 clamp(21px, 3vw, 30px)/1.1 var(--display);
  letter-spacing: -.035em;
}
#study .study-notes {
  display: grid;
  grid-template-columns: minmax(0, 1.23fr) minmax(0, .77fr);
  gap: clamp(28px, 5vw, 54px);
  align-items: start;
}
#study .study-note {
  padding: 14px 0 0;
  border-top: 2px solid #d9cce5;
}
#study .study-note + .study-note {
  margin-top: 24px;
  padding: 18px 22px;
  border: 0;
  border-radius: 4px 18px 18px 18px;
  background: #f8edcf;
}
#study .study-note h4 {
  margin: 0 0 9px;
  font: 750 clamp(19px, 2.5vw, 25px)/1.15 var(--display);
  letter-spacing: -.025em;
}
#study .study-note p {
  margin: 0;
  max-width: 57ch;
  color: var(--reader-muted);
  font-size: 15px;
  line-height: 1.68;
}

@media (max-width: 760px) {
  #study {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  #study .personal-study-hero, #study .study-notes { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  #study .study-figure { margin: 0 0 0 min(4vw, 18px); }
  #study .study-note + .study-note { margin: 0 0 0 min(4vw, 18px); }
}
@media (forced-colors: active) {
  #study { scrollbar-color: auto; }
}
