/* Shared page layout and interaction refinements. */
html { scroll-behavior: smooth; }
body { min-width: 0; }
main { min-height: 60vh; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.button { min-height: 48px; line-height: 1.3; align-items: center; justify-content: center; }
.hero-buttons { align-items: flex-start; gap: 18px; }
.hero-buttons .button { min-height: 54px; padding: 16px 22px; border-radius: 10px; font-size: 14px; }
.hero-buttons .pop-button { background: #f5dce8; color: #382b32; }
.hero-buttons .pop-button:first-child { background: #e8deed; }
.hero { min-height: 0; padding-block: clamp(46px, 7vw, 90px); }
.hero h1 { font-size: clamp(54px, 6.1vw, 92px); }
.hero-detail { line-height: 1.7; max-width: 48ch; }
.home-overview { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 90px); }
.home-overview h2 { font-size: clamp(32px, 4vw, 54px); line-height: 1.1; margin-block: 16px; }
.home-overview p { color: var(--muted); font-size: 17px; line-height: 1.7; margin-block: 16px 24px; max-width: 40ch; }
body[data-page]:not([data-page=home]) h1 { font-size: clamp(42px, 5.2vw, 76px); letter-spacing: -.045em; line-height: 1.08; }
body[data-page=work] #work, body[data-page=playground] #playground, body[data-page=about] #about, body[data-page=hiring] #hiring { scroll-margin-top: 90px; }
.section-heading p, .project-content p { line-height: 1.75; }
#work > .section-heading { margin-bottom: 35px; }
.hiring-profile-link { padding-block: 0 60px; }
.animated-footer .footer-links { gap: 4px; }
.footer-links button, .footer-links a { min-height: 44px; font-size: 14px; }
.footer-invitation > .eyebrow { color: #dcc9d9; }
.footer-bottom { flex-wrap: wrap; }
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle svg { width: 25px; height: 25px; overflow: visible; }
.toggle-sun, .toggle-moon { transform-origin: 12px 12px; transition: transform .3s cubic-bezier(.22,1,.36,1), opacity .24s ease; }
.toggle-sun { transform: rotate(0) scale(1); opacity: 1; }
.toggle-moon { transform: rotate(-55deg) scale(.5); opacity: 0; }
html[data-theme=dark] .toggle-sun { transform: rotate(70deg) scale(.5); opacity: 0; }
html[data-theme=dark] .toggle-moon { transform: rotate(0) scale(1); opacity: 1; }
.theme-toggle:hover .toggle-sun { transform: rotate(20deg); }
html[data-theme=dark] .theme-toggle:hover .toggle-sun { transform: rotate(70deg) scale(.5); }
.contact-page { display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(32px, 6vw, 90px); align-items: start; }
.contact-intro { position: sticky; top: 125px; }
.contact-intro h1 { margin-block: 25px; }
.contact-intro p { font-size: 18px; line-height: 1.8; color: var(--muted); max-width: 35ch; }
.contact-direct { display: grid; gap: 6px; margin-top: 25px; font-size: 15px; }
.contact-direct :is(a,button) { min-height: 44px; display: flex; align-items: center; width: fit-content; text-align: left; }
.contact-direct a { text-decoration: underline; text-underline-offset: 4px; }
.contact-direct button { color: var(--muted); }
.contact-plate { min-height: 235px; display: grid; align-content: center; gap: 18px; text-align: center; padding: 30px; border: 1px solid var(--soft-border); border-radius: 26px; box-shadow: inset 0 0 0 9px var(--surface), inset 0 0 0 10px var(--soft-border); background: repeating-linear-gradient(0deg, transparent, transparent 2px, #00000005 3px), var(--surface-2); }
.contact-plate > span, .contact-plate > small { font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.contact-plate strong { font-size: clamp(23px, 2.5vw, 32px); line-height: 1.3; }
.contact-plate em { font-family: Instrument, Georgia, serif; font-weight: 400; font-size: 1.3em; overflow-wrap: anywhere; }
#contactForm { margin-top: 28px; }
.coffee-form label { font-size: 14px; line-height: 1.5; color: var(--ink); }
.coffee-form :is(input,textarea,select) { font-size: 16px; min-height: 48px; color: var(--ink); background: var(--surface); border-color: var(--soft-border); }
.coffee-form [aria-invalid=true] { border: 2px solid #ae264e; }
.field-error { color: #a72548; font-size: 13px; }
html[data-theme=dark] .field-error { color: #ffabc2; }
.contact-trap { display: none; }
.contact-consent { display: flex !important; flex-direction: row; align-items: flex-start; gap: 10px; }
.contact-consent input { width: 22px; min-height: 22px; flex-shrink: 0; margin-top: 1px; }
.form-success { border: 1px solid #71916d; background: #e2f0de; color: #21471c; padding: 18px; border-radius: 12px; font-size: 16px; line-height: 1.7; }
html[data-theme=dark] .form-success { background: #243623; color: #def5d8; }
.contact-fallback { padding: 18px; border: 1px solid var(--soft-border); border-radius: 12px; line-height: 1.7; }
.contact-fallback .button { margin: 15px 10px 10px 0; }
.case-page { max-width: 1000px; }
.case-page .case-hero { padding: 35px 0 40px; }
.case-page .case-content { padding: 0; max-width: 760px; }
.case-page .case-block h2 { font: 600 15px Inter, sans-serif; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 12px; }
.case-page .case-block p, .case-page .case-block li { font-size: 17px; line-height: 1.85; }
.case-page .case-hero > p { max-width: 60ch; }
.case-page .case-meta { flex-wrap: wrap; }
.case-actions { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 30px; }
.prose-page { max-width: 850px; }
.prose-page h1 { margin-bottom: 35px; }
.prose-page h2 { font-size: 25px; margin-block: 32px 12px; }
.prose-page p { font-size: 17px; line-height: 1.85; color: var(--muted); }
.book-section { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.book-section h2 { font-size: clamp(32px, 4vw, 55px); line-height: 1.1; margin-block: 20px; }
.book-section > div > p { color: var(--muted); font-size: 17px; line-height: 1.7; max-width: 36ch; }
.interactive-book { perspective: 2000px; position: relative; min-height: 405px; max-width: 390px; width: 100%; justify-self: center; }
.book-cover { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; width: 100%; padding: 35px; border: 1px solid #77536a; border-radius: 5px 18px 18px 5px; color: #fff2fa; background: linear-gradient(90deg,#6b3d62 0%,#9e6c91 5%,#79516f 9%,#4f3454 100%); box-shadow: 7px 6px 0 #e7d8bf, 12px 13px 30px #25142625; text-align: left; transform-origin: left center; transform-style: preserve-3d; backface-visibility: hidden; transition: transform .65s cubic-bezier(.25,0,0,1); }
.book-cover strong { font-family: Instrument, Georgia, serif; font-size: 46px; font-weight: 400; line-height: 1.15; }
.book-cover span, .book-cover small { font-size: 12px; }
.interactive-book.is-open .book-cover { transform: rotateY(-110deg); pointer-events: none; visibility: hidden; }
.book-content { min-height: 405px; background: var(--surface); padding: 30px; border: 1px solid var(--soft-border); border-radius: 5px 18px 18px 5px; box-shadow: 5px 5px 0 var(--surface-2); }
#bookPage { min-height: 240px; }
#bookPage h3 { font-size: 30px; margin-bottom: 20px; }
#bookPage p { font-size: 17px; line-height: 1.75; }
.book-range { display: flex; align-items: center; gap: 15px; font-size: 13px; margin-block: 10px; }
.book-range input { width: 100%; }
.book-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.book-controls button { min-width: 44px; min-height: 44px; padding-inline: 6px; border-radius: 6px; border: 1px solid var(--soft-border); }
.book-controls button:disabled { opacity: .4; }
.creepy-button { position: relative; min-width: 190px; height: 56px; background: #29212e; border: 0; border-radius: 12px; }
.creepy-cover { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid #73566d; background: #e5cadc; color: #35243b; border-radius: 12px; transform-origin: 1.25em 50%; transition: transform .28s cubic-bezier(.22,1,.36,1); }
.creepy-button:is(:hover,:focus-visible) .creepy-cover { transform: rotate(-12deg); }
.creepy-eyes { display: flex; position: absolute; right: 16px; bottom: 7px; gap: 5px; }
.creepy-eyes i { display: block; position: relative; width: 12px; height: 12px; border-radius: 50%; background: white; overflow: hidden; animation: eye-blink 4s linear infinite; }
.creepy-eyes i::after { content: ''; width: 6px; height: 6px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: #17111d; transform: translate(var(--eye-x,0px),var(--eye-y,0px)); }
@keyframes eye-blink { 0%,92%,100% { scale: 1 1; } 96% { scale: 1 .05; } }
.inbox-page { max-width: 1100px; }
#inboxLogin { max-width: 440px; margin-block: 30px; }
.inbox-toolbar { display: flex; flex-wrap: wrap; gap: 15px; margin-block: 30px 15px; }
.inbox-toolbar :is(button,select) { padding: 10px; min-height: 44px; border: 1px solid var(--soft-border); border-radius: 6px; background: var(--surface); color: var(--ink); }
.inbox-message { padding: 24px; margin-block: 18px; border-radius: 15px; background: var(--surface); border: 1px solid var(--soft-border); }
.inbox-message h2 { font-size: 24px; }
.inbox-message p { margin-top: 10px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-message select { min-height: 44px; padding: 5px; color: var(--ink); background: var(--surface); }
.inbox-message a { text-decoration: underline; text-underline-offset: 3px; }
.credits-body h1 { margin-bottom: 40px; }
.credits-body h2 { margin-top: 28px; }
.credits-body p { max-width: 70ch; }
#assistantPanel { width: min(390px,calc(100vw - 28px)); }
.assistant-launcher[hidden] { display: none; }
.tab-hidden *, .motion-paused * { animation-play-state: paused !important; }
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width:900px) {
  .contact-page { grid-template-columns: 1fr; max-width: 720px; }
  .contact-intro { position: static; }
  .contact-intro p { max-width: 50ch; }
  .book-section { grid-template-columns: 1fr; }
}
@media (max-width:640px) {
  .hero-buttons .button { font-size: 13px; padding-inline: 16px; min-height: 52px; }
  .home-overview { grid-template-columns: 1fr; }
  .nav-contact { font-size: 11px; padding-inline: 10px; }
  .footer-links a, .footer-links button { font-size: 13px; }
  .contact-plate { min-height: 200px; }
  .book-section { gap: 35px; }
  .book-cover, .book-content { padding: 25px; }
  .creepy-button { min-width: 170px; }
}
@media print {
  .site-header, .animated-footer, .assistant-launcher, .profile-actions, .toast { display: none !important; }
}

html:not([data-theme=dark]) { --muted: #5f5955; }
.project-art .art-label, .illustration-caption { color: #463d4b; opacity: 1; }
.mini-search, .result-row small { color: #51594c; }
.pipeline-graphic i { color: #4e5b68; }
.automation-note { color: #6a4436; }
.game-card > small { color: #62555b; }
html:not([data-theme=dark]) .about-photo .hand,
html:not([data-theme=dark]) .about-portrait .hand,
html:not([data-theme=dark]) #expPanel > span { color: #6a503e; }

html:not([data-theme=dark]) .working-style p { color: #4f5a44; }
.contact-direct button { background: transparent; border: 0; }
.game-card .game-link { background: transparent; border: 0; min-height: 44px; text-align: left; cursor: pointer; }

.resume-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; margin-top: 10px; }

.nav-links > .mobile-contact { display: none; }
.nav-links > a, .text-button { min-height: 44px; display: inline-flex; align-items: center; }
.filter, [role=tab], .demo-filters button { min-height: 44px; }
.modal-close, #closeAssistant { min-width: 44px; min-height: 44px; }
@media (max-width:900px) { .nav-links > .mobile-contact { display: flex; } }
@media (max-width:640px) {
  .nav-contact { display: none; }
  .theme-toggle { width: 44px; height: 44px; flex-basis: 44px; }
  .motion-btn, .menu-btn { min-width: 44px; width: 44px; min-height: 44px; }
}


/* Keep full-screen filter layers off mobile compositors. */
@media (max-width:700px) {
  body::before { content: none; }
  .site-header { backdrop-filter: none; }
  .photo-card img { filter: none; }
  .assistant-launcher { backdrop-filter: none; }
}

@media (max-width:700px) {
  .home-overview { content-visibility: auto; contain-intrinsic-size: auto 280px; }
  .footer-information { content-visibility: auto; contain-intrinsic-size: auto 580px; }
}

@keyframes detail-enter {
  from { transform: translateY(3px); }
  to { transform: translateY(0); }
}
.result-row, .hat-panel { animation-name: detail-enter; }
html:not(.dark) .hat-panel { color: #534c46; }
.result-row small { color: #45503e; }
.result-row strong { color: #343b30; }
