/* Additions to the original A Boy In Words site. Original styling stays in index.html. */
[hidden]{display:none!important}
.extra-looks-grid .look-card{background:#dedbd1}
.extra-looks-grid .look-card img{object-fit:contain;object-position:center;transform:none;filter:none;padding:0}
.extra-looks-grid .look-card:hover img{transform:none;filter:none}
.chapter-controls{position:fixed;z-index:32;left:clamp(15px,3vw,40px);bottom:42px;display:flex;align-items:stretch;max-width:calc(100vw - 100px);height:39px;border:1px solid rgba(255,255,255,.43);background:rgba(10,21,15,.92);color:var(--white);box-shadow:0 4px 20px #0002;backdrop-filter:blur(12px)}
.chapter-controls button{border:0;background:none;color:inherit;cursor:pointer;font:700 11px var(--sans);transition:background .2s,color .2s}
.chapter-controls button:hover{background:var(--acid);color:var(--ink)}
.chapter-controls button:disabled{opacity:.3;cursor:default;background:none;color:inherit}
.chapter-controls>button:first-child,.chapter-controls>button:last-child{width:34px;flex:none;font-size:18px}
#chapter-map-toggle{display:flex;align-items:center;gap:12px;border-inline:1px solid #ffffff30;padding:0 13px;min-width:175px;text-align:left}
.chapter-dots{font-size:18px;color:var(--acid)}
#chapter-map-toggle:hover .chapter-dots{color:var(--ink)}
#chapter-current{max-width:125px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#chapter-count{margin-left:auto;color:var(--acid);font-size:9px;font-variant-numeric:tabular-nums;white-space:nowrap}
#chapter-map-toggle:hover #chapter-count{color:var(--ink)}
.enhanced-dialog{position:fixed;inset:0;margin:auto;padding:0;border:1px solid rgba(255,255,255,.6);border-radius:18px;background:var(--paper);color:var(--ink);box-shadow:0 30px 100px #0009;max-width:calc(100vw - 30px);max-height:calc(100dvh - 30px);overflow:hidden;animation:popup-in .28s ease both}
.enhanced-dialog::backdrop{background:rgba(4,9,6,.86);backdrop-filter:blur(8px);animation:backdrop-in .2s both}
.enhanced-close{position:absolute;top:12px;right:12px;z-index:5;width:42px;height:42px;display:grid;place-items:center;border:1px solid #fff;border-radius:50%;background:var(--forest);color:#fff;cursor:pointer;font-size:26px;line-height:1;transition:transform .2s,background .2s,color .2s;box-shadow:0 3px 15px #0003}
.enhanced-close:hover{background:var(--acid);color:var(--ink)}
.chapter-map{width:1000px;height:min(88dvh,850px);overflow-y:auto;scrollbar-color:#60756a #e5e0d5;overscroll-behavior:contain}
.chapter-map-header{padding:35px 36px 22px;border-bottom:1px solid #d5d0c4}
.enhanced-eyebrow{margin:0 50px 13px 0;color:#1c6049;font-size:10px;letter-spacing:.13em;font-weight:850}
.chapter-map h2{font-size:clamp(28px,4.5vw,47px);color:var(--ink);margin:0 40px 12px 0}
.chapter-map-header>p:not(.enhanced-eyebrow){color:#40584d;font-size:13px;margin-bottom:18px}
#chapter-map-search{width:100%;background:#fffdf7;border:1px solid #8b998f;padding:12px 14px;color:var(--ink);font:14px var(--sans);border-radius:4px}
#chapter-map-search:focus-visible{outline:3px solid var(--forest);outline-offset:2px}
#chapter-map-status{display:block;margin-top:9px;color:#53675d;font-size:10px;min-height:15px}
.chapter-map-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:24px 36px 36px}
.chapter-map-item{position:relative;display:flex;flex-direction:column;min-width:0;padding:0;background:#fffdf7;border:1px solid #d2cbbb;text-align:left;color:var(--ink);cursor:pointer;transition:transform .22s,box-shadow .22s}
.chapter-map-item:hover{transform:translateY(-4px);box-shadow:4px 4px 0 var(--coral)}
.chapter-map-item[aria-current="location"]{border:2px solid var(--forest)}
.chapter-map-item img{display:block;width:100%;height:125px;object-fit:cover;object-position:50% 24%}
.chapter-map-number{position:absolute;top:8px;left:8px;min-width:25px;padding:3px 5px;text-align:center;background:var(--forest);color:var(--acid);font-size:9px;font-weight:800}
.chapter-map-copy{display:block;width:100%;padding:12px}
.chapter-map-copy>strong{display:block;color:#1c6049;font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.06em}
.chapter-map-copy>span{display:block;padding-top:5px;font-size:13px;line-height:1.35;font-weight:650;letter-spacing:-.025em}
/* Active chapters replay their entrance. Authored content is always visible without JavaScript. */
.chapter-doodles{position:absolute;z-index:1;inset:0;overflow:hidden;pointer-events:none;opacity:0;transition:opacity .8s ease}
.chapter-doodle{position:absolute;display:block;width:clamp(34px,5vw,72px);color:var(--acid);opacity:.58}
.chapter-doodle svg{display:block;width:100%;height:auto;overflow:visible;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.doodle-1{top:19%;right:3%;rotate:12deg}
.doodle-2{top:54%;right:1.5%;width:clamp(27px,4vw,53px);color:var(--coral);rotate:-9deg}
.doodle-3{right:6%;bottom:11%;width:clamp(32px,4.5vw,61px);rotate:14deg}
@media(prefers-reduced-motion:no-preference){
 body.enhancements-ready:not(.quiet-mode) .chapter-active .panel{animation:chapter-panel-arrive .85s cubic-bezier(.16,.75,.22,1) both}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .panel>*{animation:chapter-text-arrive .75s cubic-bezier(.16,.75,.22,1) backwards;animation-delay:var(--entrance-delay,80ms)}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .eyebrow::before{animation:chapter-line-sweep 1.05s cubic-bezier(.2,.7,.2,1) both;transform-origin:left}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .section-mark{animation:chapter-number-arrive .75s cubic-bezier(.2,.7,.2,1) both}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .section-mark::after{animation:chapter-line-sweep .9s .2s cubic-bezier(.2,.7,.2,1) both}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .panel::before{animation:chapter-corner-trace 1.2s cubic-bezier(.2,.7,.2,1) both}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .slide-photo img{animation:chapter-photo-drift 20s ease-in-out infinite alternate;will-change:transform}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .chapter-doodles{opacity:1}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .chapter-doodle{animation:chapter-doodle-float 8s ease-in-out infinite alternate}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .doodle-2{animation-delay:-3s;animation-duration:10s}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .doodle-3{animation-delay:-5s;animation-duration:9s}
 body.enhancements-ready:not(.quiet-mode) .chapter-active .chapter-doodle svg{animation:chapter-line-draw 1.8s .1s ease both;stroke-dasharray:310;stroke-dashoffset:0}
 body:not(.quiet-mode) .magnetic-control{translate:var(--magnet-x,0px) var(--magnet-y,0px);transition:translate .18s ease,transform .22s ease,background .22s ease,color .22s ease,box-shadow .22s ease}
 body:not(.quiet-mode) .chapter-controls button:not(:disabled):hover{box-shadow:inset 0 -3px 0 var(--coral)}
 body:not(.quiet-mode) .quiet-toggle:hover{transform:translateY(-2px);box-shadow:3px 3px 0 var(--coral)}
 body:not(.quiet-mode) .enhanced-close:hover{transform:translateY(-2px)}
 body:not(.quiet-mode) #paw-trail.is-on svg{animation:chapter-paw-step .8s ease both}
 body:not(.quiet-mode) #paw-trail.is-on svg:nth-child(2){animation-delay:.1s}
 body:not(.quiet-mode) #paw-trail.is-on svg:nth-child(3){animation-delay:.2s}
}
@keyframes chapter-panel-arrive{from{opacity:.72;translate:0 26px}to{opacity:1;translate:0 0}}
@keyframes chapter-text-arrive{from{opacity:.42;translate:0 17px}to{opacity:1;translate:0 0}}
@keyframes chapter-line-sweep{0%{transform:scaleX(.08);opacity:.25}100%{transform:scaleX(1);opacity:1}}
@keyframes chapter-number-arrive{from{opacity:.25;translate:12px 0}to{opacity:1;translate:0 0}}
@keyframes chapter-corner-trace{from{opacity:.2;scale:.65;transform-origin:top right}to{opacity:1;scale:1;transform-origin:top right}}
@keyframes chapter-photo-drift{from{transform:scale(1.025) translateX(-.35%)}to{transform:scale(1.035) translateX(.35%)}}
@keyframes chapter-doodle-float{from{translate:0 -5px;rotate:-5deg}to{translate:0 10px;rotate:5deg}}
@keyframes chapter-line-draw{from{stroke-dashoffset:310;opacity:.25}to{stroke-dashoffset:0;opacity:1}}
@keyframes chapter-paw-step{0%{opacity:0;translate:0 8px;rotate:-6deg}65%,100%{opacity:1;translate:0 0;rotate:0deg}}
body.quiet-mode .chapter-doodles{display:none}
body.quiet-mode .magnetic-control{translate:none!important}
@media(prefers-reduced-motion:reduce){.chapter-doodles{display:none}.magnetic-control{translate:none!important}}
body.quiet-mode .enhanced-dialog,body.quiet-mode .chapter-controls{backdrop-filter:none}
@media(max-width:820px){.chapter-map-list{grid-template-columns:repeat(2,minmax(0,1fr))}.chapter-controls{bottom:39px}}
@media(max-width:620px){
 .chapter-controls{position:static;flex:none;height:34px;max-width:none;width:30px;border:0;box-shadow:none;backdrop-filter:none;background:transparent}
 #chapter-map-toggle{min-width:30px;width:30px;justify-content:center;gap:0;padding:0;border:1px solid #ffffff70}
 #chapter-current,#chapter-count,.chapter-controls>button:first-child,.chapter-controls>button:last-child{display:none}
 .chapter-dots{font-size:20px}
 .chapter-map{max-width:calc(100vw - 14px);height:calc(100dvh - 14px);max-height:calc(100dvh - 14px);border-radius:14px}
 .chapter-map-header{padding:25px 18px 18px}
 .chapter-map h2{margin-right:35px;font-size:32px}
 .chapter-map-header>p:not(.enhanced-eyebrow){font-size:12px}
 .chapter-map-list{padding:18px;gap:12px}
 .chapter-map-item img{height:110px}
 .chapter-map-copy{padding:10px}
 .chapter-map-copy>span{font-size:11px}
 .chapter-map-copy>strong{font-size:9px}
 .enhanced-close{top:8px;right:8px;width:35px;height:35px;font-size:23px}
 .chapter-doodle{opacity:.4}
 .doodle-1{right:8px;top:17%}
 .doodle-2{right:5px;top:52%}
 .doodle-3{right:11px;bottom:8%}
}
@media(max-width:380px){.quiet-toggle span[aria-hidden="true"]{display:inline}.quiet-toggle{min-width:30px;justify-content:center}.chapter-map-item img{height:90px}.chapter-map-copy>strong{font-size:8px}}
