/* A little more life, with the original paper-and-ink palette. */
body { overflow-x: clip; }
button, a { touch-action: manipulation; }
.header-right { gap: 27px; }
.nav-link { padding: 12px 0; font-size: 12px; color: var(--muted); transition: color .2s; }
.nav-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.hero { padding-bottom: 94px; }
.hero-copy { animation: arrive .75s both; }
.hero-footnote { margin: 27px 0 0; font: 9px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 7px; }
.hero-footnote .status-dot { width: 5px; height: 5px; }
.playground { animation: arrive 1s .12s both; }
.browser-toy { transform: rotate(-4deg) rotateY(var(--tilt-y, 0deg)) rotateX(var(--tilt-x, 0deg)); transition: transform .4s ease-out, box-shadow .4s; }
.browser-bar { position: relative; z-index: 5; transform-origin: 0 100%; transition: transform .65s cubic-bezier(.2,.8,.2,1); }
.toy-stage { height: 320px; background: #f0f2e3; }
.stage-serial { position: absolute; left: 23px; top: 35px; font: 7px var(--mono); letter-spacing: 1px; color: var(--muted); writing-mode: vertical-rl; }
.mascot-float { position: relative; z-index: 2; max-width: 100%; animation: none; }
.mascot { position: relative; display: block; width: 280px; max-width: 100%; height: auto; aspect-ratio: 1; border: 0; padding: 0; background: transparent; cursor: pointer; -webkit-appearance: none; transform: none; }
.mascot:focus-visible { outline-offset: -8px; border-radius: 40%; }
.stage-caption { font-size: 9px; color: var(--muted); }
.browser-bottom { font-size: 8px; }
.speech-bubble { font-size: 10px; max-width: 90%; }
.chaos-button { padding: 14px 20px; font-size: 12px; background: var(--green); min-height: 46px; position: relative; }
.chaos-button:hover { background: var(--purple); }
#button-hint { font-size: 9px; max-width: 110px; }
.button-spark { position: absolute; right: -13px; top: -15px; font: 28px Arial,sans-serif; color: var(--ink); transform: rotate(12deg); transition: transform .35s; }
.chaos-button:hover .button-spark { transform: rotate(100deg) scale(1.25); }
.vacancy { position: absolute; display: grid; text-align: center; gap: 8px; opacity: 0; transition: opacity .3s; transform: rotate(-9deg); }
.vacancy>span { font: 800 55px Bricolage,sans-serif; letter-spacing: -3px; }
.vacancy small { font: 10px var(--mono); }
.playground.party .browser-toy { transform: rotate(1deg); box-shadow: 9px 11px 0 var(--purple); }
.playground.party .browser-bar { transform: translateY(-9px) rotate(-7deg); }
.playground.party .mascot-float, .playground.party .mascot-shadow { opacity: 0; pointer-events: none; }
.playground.party .vacancy { opacity: 1; }
.playground.party .speech-bubble { background: var(--purple); }

.curiosity-strip { overflow: hidden; background: var(--green); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin: 0 -16px 50px; transform: rotate(-1.2deg); }
.curiosity-track { display: flex; width: max-content; animation: ticker 44s linear infinite; }
.curiosity-track>span { display: flex; align-items: center; gap: 38px; padding: 13px 19px; white-space: nowrap; font: 10px var(--mono); letter-spacing: 1.3px; }
.curiosity-track b { font: 23px Arial,sans-serif; line-height: 1; }
.projects { border-top: 0; padding-top: 0; }
.section-heading h2 { font-size: 25px; }
.project { transition: background .25s; }
.project:hover .icon-jolt { animation: jolt .4s ease-in-out; }
.project:hover .icon-cortex { transform: rotate(10deg) scale(1.1); }
.project:hover .icon-lily { transform: rotate(-8deg) translateY(-4px); }
.project:hover .icon-kiln { transform: rotate(-5deg) scale(1.1); }
.project:focus-visible { outline-offset: -4px; }

.articles { padding-top: 65px; margin-top: 12px; border-top: 1px solid var(--line); scroll-margin-top: 30px; }
.articles-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 42px; }
.articles-heading .eyebrow { margin-bottom: 16px; font-size: 9px; gap: 15px; }
.articles-heading h2 { font: 750 52px/1.03 Bricolage,sans-serif; letter-spacing: -2.4px; margin: 0; }
.ink-dot { color: #71893e; }
.articles-heading>p { margin: 0 0 2px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.articles-heading>p>span { display: block; font: 9px/1.7 var(--mono); margin-top: 12px; }
.article-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: 37px; align-items: stretch; }
.article-feature { position: relative; display: flex; flex-direction: column; background: #e1d7ef; padding: 27px 28px 24px; border: 1px solid var(--ink); border-radius: 3px; transform: rotate(-1.6deg); box-shadow: 5px 6px 0 #d9d4df; transition: transform .3s,box-shadow .3s; }
.article-feature:hover, .article-feature:focus-visible { transform: rotate(0) translateY(-5px); box-shadow: 7px 10px 0 #d9d4df; }
.paper-tape { position: absolute; left: 41%; top: -13px; width: 82px; height: 26px; background: #eeedc6b3; border-left: 2px dotted #d5d4ab; border-right: 2px dotted #d5d4ab; transform: rotate(7deg); }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font: 8px/1.5 var(--mono); letter-spacing: .6px; color: #505349; }
.article-feature .article-meta { justify-content: space-between; }
.article-art { margin: 5px -13px 6px; }
.article-art svg { width: 100%; height: auto; display: block; }
.article-feature h3 { font: 750 33px/1.05 Bricolage,sans-serif; letter-spacing: -1.3px; margin: 0 0 14px; max-width: 290px; }
.article-feature>p { font-size: 13px; line-height: 1.65; margin: 0 0 21px; color: #505349; }
.article-bottom { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: auto; padding-top: 16px; border-top: 1px solid #bdb4ca; font: 8px var(--mono); }
.read-article { font: 600 11px 'DM Sans',sans-serif; white-space: nowrap; }
.read-article b { margin-left: 10px; font-size: 18px; font-weight: 400; }
.article-stack { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.article-row { position: relative; display: grid; grid-template-columns: 22px 1fr 20px; gap: 17px; align-items: start; flex: 1; padding: 24px 0; border-bottom: 1px solid var(--line); transition: background .2s; }
.article-row:hover { background: #eeeee3; }
.article-row>div { min-width: 0; }
.article-index { font: 10px var(--mono); padding-top: 2px; color: var(--muted); }
.article-row h3 { font: 700 25px/1.12 Bricolage,sans-serif; letter-spacing: -.8px; margin: 10px 0 9px; transition: transform .2s; }
.article-row:hover h3 { transform: translateX(3px); }
.article-row p { font-size: 12px; line-height: 1.6; margin: 0; color: var(--muted); }
.article-arrow { font-size: 23px; transition: transform .2s; }
.article-row:hover .article-arrow { transform: translate(3px,-3px); }
.articles .more-projects { margin-top: 18px; }
.closing-note { padding: 67px 0 58px; text-align: center; position: relative; }
.closing-note p { font: 650 33px/1.15 Bricolage,sans-serif; letter-spacing: -1px; margin: 18px 0 14px; }
.closing-note em { font-style: normal; background: linear-gradient(transparent 67%,var(--green) 67%,var(--green) 94%,transparent 94%); }
.closing-note>span:last-child { font: 9px var(--mono); color: var(--muted); }
.closing-doodle { display: inline-block; font: 54px Arial,sans-serif; transform: rotate(-12deg); color: var(--ink); }

/* Only the toys capture pointers. The page remains scrollable and clickable. */
.toy-world { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.toy-world[hidden] { display: none; }
.toy-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.loose-toy { position: absolute; top: 0; left: 0; width: var(--toy-size); height: var(--toy-size); cursor: grab; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; filter: drop-shadow(2px 7px 5px #282b2526); will-change: transform; }
.loose-toy.is-dragging { cursor: grabbing; z-index: 2; filter: drop-shadow(4px 12px 9px #282b2533); }
.toy-toolbar { position: absolute; bottom: max(20px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; background: var(--ink); border: 1px solid var(--ink); border-radius: 12px; box-shadow: 5px 6px 0 #282b2526; color: var(--paper); pointer-events: auto; width: max-content; max-width: calc(100% - 28px); animation: toolbar-in .35s both; }
.toy-toolbar-copy { display: flex; flex-direction: column; gap: 3px; padding-right: 12px; }
.toy-toolbar-copy strong { font: 650 19px Bricolage,sans-serif; }
.toy-toolbar-copy>span { font: 9px var(--mono); color: #d3d7c7; }
.toy-toolbar button { border: 1px solid #7c8170; border-radius: 6px; background: transparent; color: var(--paper); padding: 11px 13px; min-height: 44px; font-size: 11px; white-space: nowrap; }
.toy-toolbar button:hover { background: #42483b; }
.toy-toolbar #tidy-toys { background: var(--green); color: var(--ink); border-color: var(--green); font-weight: 650; }
.toy-toolbar #tidy-toys:hover { background: #d4f691; }
.toy-toolbar button:focus-visible { outline-color: var(--purple); outline-offset: 3px; }
.toy-toolbar button>span { font-size: 17px; margin: 0 4px; }
.toy-world.is-closing .loose-toy { transition: transform .5s cubic-bezier(.6,-.15,.75,.6),opacity .45s; opacity: 0; pointer-events: none; }
.toy-world.is-closing .toy-toolbar { opacity: 0; transition: opacity .2s; pointer-events: none; }

@keyframes arrive { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ticker { to { transform: translateX(-50%); } }
@keyframes jolt { 20%,60% { transform: rotate(-12deg) translateX(-3px); } 40%,80% { transform: rotate(10deg) translateX(3px); } }
@keyframes toolbar-in { from { opacity: 0; bottom: 0; } to { opacity: 1; } }
html.motion-paused .hero-copy, html.motion-paused .playground { animation: none; }
html.motion-paused .browser-toy { transform: rotate(-4deg); }
@media (min-width: 1440px) {
  .hero { padding-top: 73px; padding-bottom: 101px; }
  .toy-stage { height: 350px; }
  .mascot { width: 310px; }
}
@media (max-width: 1050px) {
  .hero h1 { font-size: clamp(55px,6.6vw,70px); }
  .hero-footnote { font-size: 8px; margin-top: 22px; }
  .header-right { gap: 22px; }
  .project p { font-size: 12px; }
  .project-category { font-size: 7px; }
  .article-layout { gap: 25px; grid-template-columns: 1fr 1.1fr; }
  .article-feature { padding: 24px 22px; }
  .article-feature h3 { font-size: 30px; }
  .article-row { gap: 10px; grid-template-columns: 18px 1fr 18px; padding: 21px 0; }
  .article-row h3 { font-size: 22px; }
  .article-meta { font-size: 7px; gap: 8px; }
  .articles-heading h2 { font-size: 47px; }
  .articles-heading>p { font-size: 12px; }
  .articles-heading>p>span { font-size: 8px; }
}
@media (max-width: 760px) {
  .header-right { gap: 16px; }
  .nav-link { font-size: 10px; }
  .hero { padding-top: 43px; padding-bottom: 56px; }
  .hero h1 { font-size: clamp(61px,10vw,83px); }
  .hero-footnote { margin-top: 23px; }
  .playground { margin-top: 31px; padding-bottom: 78px; }
  .useless-control { left: 31px; bottom: 0; }
  .chaos-button { font-size: 11px; padding: 13px 17px; }
  #button-hint { font-size: 8px; max-width: 105px; }
  .sticker-bug { bottom: 96px; }
  .toy-stage { height: 300px; }
  .mascot { width: 260px; }
  .speech-bubble { font-size: 9px; }
  .stage-caption { font-size: 8px; }
  .curiosity-strip { margin: 0 -8px 37px; }
  .curiosity-track>span { font-size: 9px; padding: 11px 18px; gap: 30px; }
  .section-heading h2 { font-size: 22px; }
  .project p { font-size: 12px; }
  .articles { margin-top: 9px; padding-top: 44px; }
  .articles-heading { display: block; margin-bottom: 32px; }
  .articles-heading h2 { font-size: 43px; letter-spacing: -1.8px; }
  .articles-heading>p { font-size: 13px; margin-top: 21px; }
  .articles-heading>p>span { font-size: 8px; margin-top: 8px; }
  .article-layout { grid-template-columns: 1fr; gap: 30px; }
  .article-feature { margin: 0 5px; padding: 25px 24px; }
  .article-feature h3 { font-size: 32px; max-width: none; }
  .article-art { max-width: 340px; align-self: center; width: 100%; margin-top: 0; }
  .article-feature .article-meta { font-size: 8px; }
  .article-feature>p { font-size: 13px; }
  .article-row { padding: 24px 0; gap: 12px; grid-template-columns: 19px 1fr 18px; }
  .article-row h3 { font-size: 24px; }
  .article-row .article-meta { font-size: 7px; }
  .article-row p { font-size: 12px; }
  .articles .more-projects { margin-top: 0; }
  .articles .more-projects>span { max-width: 112px; }
  .articles .more-projects>a { white-space: normal; max-width: 180px; line-height: 1.7; }
  .closing-note { padding: 40px 0; }
  .closing-note p { font-size: 28px; }
  .closing-note>span:last-child { font-size: 8px; }
  .toy-toolbar { flex-wrap: wrap; gap: 8px; padding: 14px; justify-content: center; }
  .toy-toolbar-copy { width: 100%; flex-direction: row; align-items: center; justify-content: center; gap: 10px; padding: 0 0 3px; }
  .toy-toolbar-copy strong { font-size: 18px; }
  .toy-toolbar-copy>span { font-size: 8px; max-width: 150px; line-height: 1.5; }
  .toy-toolbar button { font-size: 10px; padding: 9px 12px; }
}
@media (max-width: 420px) {
  .header-right { gap: 12px; }
  .nav-link:first-child { display: none; }
  .wordmark { font-size: 19px; }
  .brand-spark { font-size: 28px; margin-right: 7px; }
  .site-header { gap: 10px; }
  .nav-link { font-size: 10px; }
  .project p { font-size: 11px; }
  .project-category { font-size: 7px; }
  .article-meta { letter-spacing: .25px; }
  .article-row h3 { font-size: 22px; }
  .articles-heading h2 { font-size: 40px; }
}
@media (max-width: 370px) {
  .hero h1 { font-size: 57px; }
  .wordmark { font-size: 17px; }
  .header-right { gap: 10px; }
  .github-top { font-size: 10px; }
  .brand-spark { font-size: 25px; }
  .project-category { font-size: 6px; }
  .article-feature { padding: 22px 19px; }
  .article-feature .article-meta { font-size: 7px; }
  .article-feature h3 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-copy, .playground { animation: none; }
  .browser-toy { transform: rotate(-4deg); }
}
