*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg-surface);color:var(--text-primary)}
body{min-height:100svh;display:flex;flex-direction:column;font-family:var(--sans);-webkit-font-smoothing:antialiased}
[hidden]{display:none!important}
button,input{touch-action:manipulation}
button:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid var(--text-primary);outline-offset:4px}

/* Site header: the same logo, badge and shared Search/Menu components as Lab. */
.topbar{position:relative;z-index:100001;display:flex;align-items:flex-start;justify-content:space-between;width:100%;padding:20px 20px 0;flex:none}
.logo-wrap{display:flex;flex-direction:column;align-items:flex-start}
.logo{width:140px;height:32px;padding-left:8px;display:flex;align-items:center;background:var(--button-bg);text-decoration:none;transition:opacity var(--sketch-motion) ease}
.logo:hover{opacity:.9}
.logo img{width:68px;height:24px;object-fit:contain;display:block}
.beta-badge{display:inline-flex;align-items:center;padding:1px 4px;background:var(--style-yellow1);color:var(--text-primary);font:400 8px/1.4 var(--mono)}
.tools{position:relative;display:flex;gap:4px;z-index:100002}
.tools>button{height:32px;padding:0 12px;border:0;background:var(--button-bg);color:var(--button-text);font:400 12px/1 var(--mono);text-transform:uppercase;cursor:pointer;transition:background var(--sketch-motion) ease}
.tools>button:hover{background:var(--text-secondary)}
.tools>button.is-open,.tools>button.is-menu-active,.tools>button.is-search-active{background:var(--accent)!important;color:var(--text-primary)!important}
.menu-dropdown{position:absolute;top:calc(100% + 4px);right:0;min-width:248px;display:none;flex-direction:column;gap:4px;z-index:100003}
.menu-dropdown.is-open{display:flex}
.menu-dropdown-item{display:flex;align-items:center;min-height:29px;padding:7px 26px 7px 8px;background:var(--button-bg);color:var(--button-text);font:400 10px/1.5 var(--mono);text-transform:uppercase;text-decoration:none;white-space:nowrap}
.menu-dropdown-item:hover,.menu-dropdown-item:focus-visible{background:var(--text-secondary);color:var(--button-text)}

.sketchbook-main{position:relative;display:flex;flex:1;min-height:0;width:100%;align-items:stretch;justify-content:center}
.book-landing{display:grid;place-items:center;width:100%;min-height:calc(100svh - 65px);padding:24px}
.book-landing.is-overlay{position:absolute;inset:0;z-index:2;min-height:0}
.book-launch{display:block;width:min(var(--sketch-scene-width),calc(100vw - 48px));height:min(var(--sketch-scene-height),calc(100svh - 120px),calc((100vw - 48px) / .72));border:0;padding:0;background:transparent;color:var(--text-primary);cursor:grab;touch-action:none}
.book-launch.is-dragging{cursor:grabbing}
.book-launch.is-opening,.book-launch.is-handoff{cursor:default}
.book-launch.is-handoff{pointer-events:none}
.book-scene{position:relative;display:block;width:100%;height:100%}
.book-floor-shadow{position:absolute;left:50%;top:82%;width:180px;height:28px;border-radius:50%;background:var(--sketch-book-shadow);filter:blur(var(--sketch-shadow-blur));transform:translate(-50%,0);pointer-events:none}
.book-canvas{position:relative;display:block;width:100%;height:100%;background:transparent}
.book-file-cover{display:none}
.sketchbook-static-cover .book-canvas{display:none}
.sketchbook-static-cover .book-file-cover{position:absolute;left:50%;top:50%;width:min(70%,310px);aspect-ratio:1/1.43738;display:block;overflow:hidden;border-radius:3px;box-shadow:12px 18px 28px var(--sketch-book-shadow);transform:translate(-50%,-50%) perspective(900px) rotateY(-20deg) rotateZ(-2deg)}
.book-file-cover img{display:block;width:100%;height:100%;object-fit:cover}
.book-file-cover span{position:absolute;right:7.5%;bottom:5%;color:var(--sketch-foil-light);font:600 24px/1 var(--serif)}
.book-landing.is-overlay .book-launch.is-stage{position:absolute;inset:0;width:100%;height:100%}
.book-launch.is-handoff .book-canvas,
.book-launch.is-handoff .book-floor-shadow{opacity:0}
.gallery.is-arriving .spread-frame{background:transparent;box-shadow:0 10px 30px var(--sketch-panel-shadow),0 2px 8px color-mix(in srgb,var(--text-primary) 4%,transparent);opacity:var(--sketch-shadow, 0)}
.gallery.is-arriving .spread-frame img{opacity:var(--sketch-reveal, 0)}
.book-landing.is-overlay .book-canvas{opacity:calc(1 - var(--sketch-reveal, 0))}
.gallery.is-arriving .turn-control,.gallery.is-arriving .progress-control{pointer-events:none}
.gallery.is-arriving .close-book,
.gallery.is-arriving .turn-control,
.gallery.is-arriving .gallery-caption{opacity:var(--sketch-open, 0)}

/* The fixed-height stage keeps the caption still as spread ratios change. */
.gallery{position:relative;display:flex;flex:1;min-height:calc(100svh - 65px);flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:48px 24px 30px}
.close-book{position:absolute;right:24px;top:22px;padding:7px 0;border:0;border-bottom:1px solid var(--border-strong);background:transparent;color:var(--text-primary);font:400 11px/1.4 var(--mono);text-transform:uppercase;cursor:pointer}
.close-book:hover{border-color:var(--border-default)}
.carousel{width:min(100%,1440px);height:var(--sketch-reader-stage-height);flex:none;display:grid;grid-template-columns:72px minmax(0,1fr) 72px;align-items:center;justify-items:center;gap:24px}
.spread-frame{width:auto;height:auto;max-width:min(67vw,964px);max-height:100%;margin:0;padding:0;display:grid;place-items:center;overflow:hidden;border-radius:var(--sketch-page-radius);background:var(--bg-surface);box-shadow:0 10px 30px var(--sketch-panel-shadow),0 2px 8px color-mix(in srgb,var(--text-primary) 4%,transparent)}
.spread-frame img{display:block;width:auto;height:auto;max-width:100%;max-height:var(--sketch-reader-stage-height);object-fit:contain}
.spread-frame.is-turning img{animation:scan-enter var(--sketch-motion) cubic-bezier(.2,.8,.2,1) both}
@keyframes scan-enter{from{opacity:.72;transform:translateX(8px)}to{opacity:1;transform:translateX(0)}}
.turn-control{width:72px;height:72px;padding:20px;display:grid;place-items:center;border:1px solid var(--border-strong);border-radius:50%;background:var(--bg-surface);color:var(--text-primary);cursor:pointer;transition:background var(--sketch-motion) ease,border-color var(--sketch-motion) ease}
.turn-control svg{display:block;width:32px;height:32px;fill:none;stroke:currentColor;stroke-width:1.1;stroke-linecap:round;stroke-linejoin:round}
.turn-control:hover:not(:disabled){background:var(--bg-panel);border-color:var(--text-primary)}
.turn-control:disabled{opacity:.4;cursor:default}
.gallery-caption{display:flex;flex:none;flex-direction:column;align-items:center;gap:16px;width:240px;max-width:100%;transform:translateY(clamp(0px,calc(100svh - var(--sketch-caption-clearance)),var(--sketch-caption-offset)))}
.gallery-caption p{margin:0;font-size:16px;line-height:1.4;font-weight:400;white-space:nowrap}
.progress-control{position:relative;width:100%;height:8px;display:grid;align-items:center}
.progress-track{width:100%;height:4px;background:var(--border-light);pointer-events:none}
.progress-fill{display:block;width:1.54%;min-width:8px;height:100%;background:var(--text-primary)}
.progress-control input{position:absolute;inset:0;width:100%;height:8px;margin:0;opacity:0;cursor:pointer}
.progress-control:focus-within{outline:2px solid var(--text-primary);outline-offset:5px}
.no-script{font-size:16px;text-align:center}
@media(max-width:800px){.gallery{gap:18px;padding:58px 14px 30px}.carousel{position:relative;display:flex;justify-content:center;width:100%;height:var(--sketch-reader-stage-height-mobile)}.spread-frame{max-width:82vw;border-radius:var(--sketch-page-radius)}.spread-frame img{max-height:var(--sketch-reader-stage-height-mobile)}.turn-control{position:absolute;z-index:2;top:50%;width:48px;height:48px;padding:12px;transform:translateY(-50%);box-shadow:0 2px 8px var(--sketch-panel-shadow)}.turn-control:first-child{left:0}.turn-control:last-child{right:0}.turn-control svg{width:24px;height:24px}}
@media(max-width:520px){.topbar{padding:16px 14px 0}.book-launch{width:min(var(--sketch-scene-width),calc(100vw - 16px));height:min(var(--sketch-scene-height),calc(100svh - 96px),calc((100vw - 16px) / .72))}.gallery{padding:52px 10px 24px}.close-book{top:16px;right:14px}.spread-frame{max-width:94vw;border-radius:var(--sketch-page-radius)}.turn-control{width:42px;height:42px;padding:10px}.turn-control:first-child{left:2px}.turn-control:last-child{right:2px}.gallery-caption{gap:13px}.gallery-caption p{font-size:15px}.menu-dropdown{min-width:min(248px,calc(100vw - 28px))}}
@media(prefers-reduced-motion:reduce){.turn-control,.logo,.tools>button{transition:none}.spread-frame.is-turning img{animation:none}}
