@font-face {
  font-family: "Patrick Hand";
  src: url("assets/fonts/PatrickHand-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: Kalam;
  src: url("assets/fonts/Kalam-Regular.ttf") format("truetype");
  font-display: swap;
}
* { box-sizing: border-box; }
html { color-scheme: light; background: #fff; color: #171717; }
body { margin: 0; padding: 18px; font: 20px/1.35 "Patrick Hand", cursive; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
:focus-visible { outline: 2px dashed currentColor; outline-offset: 5px; }
.skip-link { position: fixed; top: -100px; left: 24px; z-index: 10; background: #fff; padding: 10px; }
.skip-link:focus { top: 8px; }
.sketchbook {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  max-width: 1600px;
  margin: auto;
  border: 2px solid transparent;
  border-image: url("assets/ink-frame.svg") 12 / 11px / 2px stretch;
}
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 0 18px;
  padding: 9px 12px 10px;
  background: url("assets/ink-line.svg") center bottom / 100% 8px no-repeat;
  font-size: 26px;
}
.brand { font-family: Kalam, cursive; text-decoration: none; }
.github { margin-left: auto; text-decoration-line: underline; }
.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100dvh / 1.25 - 110px);
  padding: 38px 16px 20px;
}
nav { display: grid; gap: 10px; }
nav button {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 65px;
  padding: 12px 15px;
  border: 0;
  background: transparent;
  color: #171717;
  text-align: left;
  font: inherit;
  font-size: 25px;
  cursor: pointer;
}
nav button::before, nav button::after {
  content: "";
  position: absolute;
  inset: -4px -5px -4px -7px;
  z-index: -1;
  background: url("assets/tab.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}
nav button::after { background-image: url("assets/tab-active.svg"); opacity: 0; }
nav button:nth-child(2n)::before, nav button:nth-child(2n)::after { transform: rotate(-.6deg); }
nav button:nth-child(3n)::before, nav button:nth-child(3n)::after { transform: rotate(.5deg); }
nav button[aria-pressed="true"] { color: #fff; text-shadow: 1px 0 #171717, -1px 0 #171717, 0 1px #171717, 0 -1px #171717; }
nav button[aria-pressed="true"]::after { opacity: 1; }
nav button:focus-visible { outline-color: #171717; }
.contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 2px solid transparent;
  border-image: url("assets/ink-frame.svg") 12 / 7px / 1px stretch;
  background-color: #fff;
  box-shadow: 2px 3px 0 #17171726;
  font-size: 22px;
  text-decoration: none;
  white-space: nowrap;
}
.contact img { width: 26px; height: 26px; object-fit: contain; }
.contact:focus-visible { box-shadow: 3px 5px 0 #17171740; }
.contact:active { box-shadow: 1px 1px 0 #17171740; }
main { min-width: 0; padding: 18px 20px 16px; background: url("assets/ink-divider.svg") left top / 9px 100% no-repeat; container-type: inline-size; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 108px; }
.intro-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
h1 { position: relative; margin: 0; font: 62px/1.25 Kalam, cursive; white-space: nowrap; }
h1::after {
  content: "";
  position: absolute;
  left: 0;
  right: -4px;
  bottom: 4px;
  height: 9px;
  background: url("assets/ink-line.svg") center / 100% 100% no-repeat;
  transform: rotate(-2deg);
}
.intro > p { margin: 0; font-size: 25px; }
.heading-art { flex: 0 0 140px; width: 140px; aspect-ratio: 2; background: url("assets/projects-more.png") 100% 100% / 300% 400% no-repeat; }
.result { margin: 7px 0 10px; font-size: 16px; color: #555; }
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; scroll-margin-top: 16px; }
.project {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  padding: 13px 17px 10px;
  border: 2px solid transparent;
  border-image: url("assets/ink-frame.svg") 12 / 10px / 1px stretch;
  background-color: #fff;
}
.project[hidden] { display: none; }
.project-art { aspect-ratio: 2; width: 100%; background-repeat: no-repeat; margin: 0 0 8px; }
.art-main { background-image: url("assets/projects-main.png"); background-size: 300% 200%; }
.art-more { background-image: url("assets/projects-more.png"); background-size: 300% 400%; }
.art-seatly, .art-ledgerly { background-position: 0 0; }
.art-flowboard, .art-django { background-position: 50% 0; }
.art-pulsewatch, .art-approval { background-position: 100% 0; }
.art-echomap { background-position: 0 100%; }
.art-echomap, .art-roastory, .art-dental { clip-path: inset(3% 0 0); }
.art-roastory { background-position: 50% 100%; }
.art-dental { background-position: 100% 100%; }
.art-lumenwatch { background-position: 0 33.333333%; }
.art-quorum { background-position: 50% 33.333333%; }
.art-nestly { background-position: 100% 33.333333%; }
.art-afterglow { background-position: 0 66.666667%; }
.art-morrow { background-position: 50% 66.666667%; }
.art-domaine { background-position: 100% 66.666667%; }
.art-real-estate { background-position: 0 100%; }
.art-cardiologist { background-position: 50% 100%; }
h2 { margin: 0; font: 30px/1.15 "Patrick Hand", cursive; }
.project > p { margin: 2px 0 16px; font-size: 21px; }
.links { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; font-size: 20px; }
.links a { padding: 5px 0 7px; white-space: nowrap; }
.links a, .github, footer a { text-decoration: none; background: url("assets/ink-line.svg") center bottom / 100% 6px no-repeat; }
.links a + a { position: relative; padding-left: 16px; }
.links a + a::before { content: ""; position: absolute; left: 0; top: 15%; bottom: 15%; width: 6px; background: url("assets/ink-divider.svg") center / 100% 100% no-repeat; }
footer { display: flex; justify-content: flex-end; gap: 16px; padding-top: 25px; font-size: 18px; }
@container (max-width: 920px) {
  .intro { align-items: flex-start; flex-direction: column; gap: 4px; padding-bottom: 7px; }
  .intro > p { max-width: none; font-size: 23px; }
  h1 { font-size: 58px; }
  .heading-art { width: 120px; flex-basis: 120px; }
}
@container (max-width: 740px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 480px) {
  .projects { grid-template-columns: minmax(0, 1fr); }
  .heading-art { width: 100px; flex-basis: 100px; }
  h1 { font-size: 49px; }
}
@media (min-width: 801px) { html { --page-zoom: 1.25; zoom: var(--page-zoom); } }
@media (max-width: 800px) {
  body { padding: 10px; }
  .sketchbook { grid-template-columns: minmax(0, 1fr); }
  .topbar { gap: 8px 14px; margin: 0 12px; padding: 8px 4px; font-size: 26px; }
  .sidebar { position: static; min-height: 0; padding: 18px 14px 13px; gap: 15px; }
  nav { display: flex; flex-wrap: wrap; gap: 10px; }
  nav button { width: auto; min-height: 44px; padding: 5px 13px; font-size: 21px; }
  .contact { font-size: 20px; padding-inline: 10px; }
  main { background: url("assets/ink-line.svg") center top / 100% 9px no-repeat; padding: 17px 14px 14px; }
  .intro { min-height: 0; }
  .intro-title { width: 100%; justify-content: space-between; gap: 8px; }
  .result { margin-top: 13px; }
}
@media (max-width: 360px) {
  .heading-art { width: 70px; flex-basis: 70px; }
  h1 { font-size: 44px; }
  .project { padding-inline: 14px; }
  .links { font-size: 19px; }
}

/* Ink and paper feedback stays anchored: no scaling or moving hit targets. */
.project::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid transparent;
  border-image: url("assets/ink-frame.svg") 12 / 10px / 1px stretch;
  box-shadow: 0 8px 18px #17171726;
  opacity: 0;
  pointer-events: none;
}
.project h2 {
  width: fit-content;
  padding-bottom: 5px;
  background: url("assets/ink-line.svg") left bottom / 0% 5px no-repeat;
}
.links a, .github, footer a { background-position: left bottom; background-size: 65% 6px; }
.brand { background: url("assets/ink-line.svg") left bottom / 0% 5px no-repeat; }
.project:focus-within::after { opacity: .8; }
.project:focus-within h2, a:not(.skip-link):focus-visible { background-size: 100% 5px; }
nav button::after { clip-path: inset(0 100% 0 0); }
nav button[aria-pressed="true"]::after { clip-path: inset(0); }
nav button:active { filter: contrast(1.2); }
a:not(.skip-link):active { background-size: 100% 7px; }
@media (hover: hover) and (pointer: fine) {
  .project:hover::after { opacity: .8; }
  .project:hover h2, a:not(.skip-link):hover { background-size: 100% 5px; }
  nav button:not([aria-pressed="true"]):hover::after { opacity: .1; clip-path: inset(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .project::after { transition: opacity 400ms ease; }
  .topbar .contact { transition: box-shadow 200ms ease; }
  .project h2, a:not(.skip-link) { transition: background-size 360ms cubic-bezier(.22, 1, .36, 1); }
  nav button { transition: color 240ms ease, text-shadow 240ms ease, filter 160ms ease; }
  nav button::after { transition: clip-path 380ms cubic-bezier(.22, 1, .36, 1), opacity 240ms ease; }
  .project { animation: paper-appear 320ms ease-out; }
  @keyframes paper-appear { from { opacity: .35; } to { opacity: 1; } }
}
