/* The desk (homepage), the 3D overlay built by js/desk.js. Tokens, fonts and buttons come from notebook.css. */
html.desk-on,
html.desk-on body { overflow: hidden; }

.desk { position: fixed; inset: 0; z-index: 300; background: #dfe2e8; color: var(--ink); font-family: var(--sans); opacity: 1; transition: opacity 0.6s ease; }
.desk.is-gone { display: none; }
.desk.is-fading { opacity: 0; }
.desk-stage { position: absolute; inset: 0; }
.desk-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
/* until the desk's script arrives, the page waits behind the desk's colour (set by a tiny script in the page head) */
html.desk-pending body { visibility: hidden; background: #e6e1d7; }
html.desk-pending { background: #e6e1d7; }

/* while it loads: the notebook sketched in pencil on the desk, and a line you can read */
.desk { background: #e6e1d7; }
.desk-wait { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 0.4rem; margin: 0; background: #e6e1d7; color: #3a2a18; transition: opacity 0.6s ease; }
.desk-wait.is-done { opacity: 0; pointer-events: none; }
.desk-wait[hidden] { display: none; }
.desk .desk-wait p.hand { margin: 0; color: #3a2a18; font-size: clamp(1.9rem, 3.4vw, 2.5rem); font-weight: 600; line-height: 1.1; opacity: 0; animation: desk-wait-in 0.5s 0.25s ease forwards; }
.desk-sketch { width: min(18rem, 60vw); height: auto; overflow: visible; fill: none; stroke: #3a2a18; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.desk-sketch path { stroke-dasharray: 520; stroke-dashoffset: 520; animation: desk-draw 2.6s ease-in-out infinite; }
.desk-sketch .s2 { animation-delay: 0.25s; } .desk-sketch .s3 { animation-delay: 0.4s; }
.desk-sketch .s4 { animation-delay: 0.55s; stroke: #8a4a24; } .desk-sketch .s5 { animation-delay: 0.75s; stroke: #b8693c; stroke-width: 3.4; }
.desk-sketch .s6 { animation-delay: 0.9s; stroke-width: 1.6; opacity: 0.5; }
@keyframes desk-draw { 0% { stroke-dashoffset: 520; } 45%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -520; } }
@keyframes desk-wait-in { to { opacity: 1; } }

/* name and sound, top; the line and the way in, bottom. They step aside while the notebook opens or closes. */
.desk-head, .desk-bar { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1rem, 3vw, 2rem); pointer-events: none; transition: opacity 0.4s ease; }
.desk-head > *, .desk-bar > * { pointer-events: auto; }
.desk-head { top: 0; align-items: flex-start; justify-content: flex-end; }
.desk-bar { bottom: 0; flex-wrap: wrap; }
.desk.is-opening .desk-head, .desk.is-opening .desk-bar, .desk.is-opening .desk-tag { opacity: 0; pointer-events: none; }
.desk-head-tools { display: flex; gap: 0.5rem; }
/* the keyboard list of things on the desk: out of sight until you tab into it */
.desk-objects { position: absolute; top: 1.1rem; left: clamp(1rem, 3vw, 2rem); display: flex; flex-wrap: wrap; gap: 0.4rem; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.desk-objects:focus-within { width: auto; height: auto; max-width: min(40rem, calc(100% - 2rem)); overflow: visible; clip-path: none; z-index: 3; }
.desk-objects[hidden] { display: none; }
.desk-chip { white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 999px; padding: 0.4rem 0.9rem; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(6px); color: var(--ink-2); font: 500 0.8rem var(--sans); cursor: pointer; }
.desk-chip:hover { color: var(--pen); }
.desk-chip[hidden] { display: none; }
.desk-sound::before { content: "♪ "; color: var(--ink-3); }
.desk-sound[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.desk-sound[aria-pressed="true"]::before { color: #fff; }
.desk-intro { margin: 0; max-width: 34rem; padding: 0.55rem 0.9rem; border-radius: 10px; background: rgba(247, 248, 250, 0.86); backdrop-filter: blur(6px); font-family: var(--hand); font-size: 1.35rem; line-height: 1.25; color: var(--ink); }
.desk-intro span { color: var(--ink-2); }
.desk-intro[hidden], .desk-actions[hidden], .desk-held[hidden], .desk-actions [hidden], .desk-held [hidden] { display: none; }
.desk-actions, .desk-held { display: flex; align-items: center; gap: 0.8rem; margin-left: auto; }
.desk-skip { padding: 0.45rem 0.8rem; border-radius: 999px; background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(6px); color: var(--ink-2); font-size: 0.92rem; text-decoration: underline; text-underline-offset: 3px; }
.desk-skip:hover { color: var(--pen); }

/* the story tag beside whatever you pick up */
.desk-tag { position: absolute; top: 50%; right: clamp(1rem, 6vw, 5rem); width: min(19rem, 34vw); padding: 1.3rem 1.3rem 1.1rem 1.6rem; background: #fbf8f0; transform: translateY(-55%) rotate(1.5deg); box-shadow: 0 18px 40px -18px rgba(12, 18, 34, 0.55); clip-path: polygon(0.9rem 0, 100% 0, 100% 100%, 0.9rem 100%, 0 calc(100% - 0.9rem), 0 0.9rem); transition: opacity 0.4s ease; }
.desk-tag[hidden] { display: none; }
.desk-tag-hole { position: absolute; left: 0.55rem; top: 50%; width: 0.55rem; height: 0.55rem; margin-top: -0.28rem; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(12, 18, 34, 0.2); }
.desk-tag .mono { margin: 0; color: var(--pen); font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; }
.desk-tag h2 { margin: 0.45rem 0; font-family: var(--serif); font-weight: 400; font-size: 1.55rem; line-height: 1.05; letter-spacing: -0.02em; }
.desk-tag p:not(.mono) { margin: 0; color: var(--ink-2); font-size: 0.95rem; line-height: 1.45; }
.desk-link { display: inline-block; margin-top: 0.7rem; color: var(--accent-text); font-size: 0.9rem; }

.desk.is-opening 
/* the ways out of the page and back to the desk: a tab on the spine, and a line at the end */
.spine-close { position: absolute; z-index: 8; top: 1.6rem; left: 0; width: var(--bind, 34px); padding: 0.7rem 0; border: 0; border-radius: 0 6px 6px 0; background: #1e3b2f; color: #e9ece4; font: 500 0.62rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; box-shadow: 2px 2px 6px rgba(12, 18, 34, 0.25); }
.spine-close span:first-child { display: block; writing-mode: vertical-rl; transform: rotate(180deg); margin: 0 auto; }
.spine-close:hover, .spine-close:focus-visible { background: var(--pen); }
.close-end { margin: 2.2rem 0 0; text-align: center; }
.close-end button { border: 0; background: none; padding: 0.4rem 0.6rem; color: var(--ink-2); font-family: var(--hand); font-size: 1.5rem; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(216, 67, 47, 0.5); text-underline-offset: 5px; }
.close-end button:hover { color: var(--pen); }

@media (max-width: 760px) {
	.desk-chip { padding: 0.35rem 0.7rem; font-size: 0.74rem; }
	.desk-head { gap: 0.5rem; }
	.spine-close { width: 18px; top: 1rem; font-size: 0.55rem; }
		.desk-intro { font-size: 1.15rem; }
	.desk-actions { width: 100%; justify-content: space-between; }
	.desk-tag { top: auto; bottom: 5.5rem; left: 1rem; right: 1rem; width: auto; padding: 0.9rem 1rem 0.85rem 1.4rem; transform: rotate(0.6deg); }
	.desk-tag h2 { font-size: 1.3rem; margin: 0.3rem 0; }
	.desk-tag p:not(.mono) { font-size: 0.86rem; }
}
@media (prefers-reduced-motion: reduce) {
	.desk, .desk-head, .desk-bar, .desk-tag, .desk-wait { transition: none; }
	.desk-sketch path { animation: none; stroke-dashoffset: 0; }
	.desk .desk-wait p.hand { animation: none; opacity: 1; }
}

/* what you're holding: a note in hand, a row of links, its own buttons, and the GoPro's flash */
.desk-note { margin: 0.6rem 0 0 !important; color: var(--pen) !important; font-family: var(--hand); font-size: 1.15rem !important; line-height: 1.25 !important; }
.desk-note[hidden], .desk-links[hidden] { display: none; }
.desk-links { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 0.7rem 0 0 !important; }
.desk-links .desk-link { margin: 0; }
.desk-controls { display: contents; }
.desk-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.desk-flash.is-on { animation: desk-flash 0.7s ease-out; }
@keyframes desk-flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
@media (max-width: 760px) { .desk-held { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .desk-flash.is-on { animation: none; } }
