/* Gondan Media T1: the sketchbook, a full-width interlude on the homepage (sketch.js).
   A pencil rests on the midnight page for visitors to pick up and draw with; nothing draws itself. */
.sketch { position: relative; height: clamp(440px, 68vh, 760px); overflow: hidden; background-color: var(--navy);
  background-image: radial-gradient(rgba(234, 242, 248, .08) 1px, transparent 1.2px), linear-gradient(180deg, var(--navy-2), var(--navy));
  background-size: 26px 26px, 100% 100%; background-position: 13px 13px, 0 0; }
/* the dot grid melts into the sections around it */
.sketch::before, .sketch::after { content: ""; position: absolute; left: 0; right: 0; height: 22%; z-index: 2; pointer-events: none; }
.sketch::before { top: 0; height: 12%; background: linear-gradient(180deg, var(--navy-2), rgba(19, 41, 79, 0)); }
.sketch::after { bottom: 0; height: 12%; background: linear-gradient(0deg, var(--navy), rgba(11, 26, 51, 0)); }
.sketch__paper { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sketch__pencil { position: absolute; left: 0; top: 0; z-index: 3; width: clamp(130px, 12vw, 200px); pointer-events: none; transform-origin: 0 50%; will-change: transform;
  filter: drop-shadow(var(--lift, 3px) calc(var(--lift, 3px) * 1.6) calc(var(--lift, 3px) * 2) rgba(0, 0, 0, .45)); transition: filter .35s var(--ease), opacity .6s var(--ease); opacity: 0; }
.sketch.is-live .sketch__pencil { opacity: 1; }
.sketch__pencil svg { display: block; width: 100%; height: auto; }
.sketch__lead { fill: var(--lead, #2B3240); transition: fill .3s; }   /* the lead shows the chosen ink */

/* drawing by hand: the pencil is picked up (sketch.js) */
.sketch__pencil { pointer-events: auto; cursor: grab; touch-action: none; }
.sketch__pencil::before { content: ""; position: absolute; inset: -30px -16px; }   /* a generous area for a finger to take it by */
/* a soft ring breathes round the resting pencil: it can be taken */
.sketch__pencil::after { content: ""; position: absolute; left: 34%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(157, 189, 224, .55), 0 0 18px rgba(157, 189, 224, .25); animation: sk-breathe 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes sk-breathe { 0%, 100% { transform: scale(.75); opacity: 0; } 45% { opacity: .9; } 100% { transform: scale(1.35); } }
.sketch.is-hand { touch-action: none; cursor: crosshair; }
.sketch.is-hand .sketch__pencil::after { display: none; }
@media (hover: hover) and (pointer: fine) { .sketch.is-hand { cursor: none; } }

.sketch__tools { position: absolute; left: 50%; bottom: clamp(18px, 4vh, 34px); z-index: 4; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; border-radius: 99px; color: var(--ice);
  background: rgba(19, 41, 79, .62); box-shadow: inset 0 0 0 1px rgba(234, 242, 248, .16), 0 18px 40px -18px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sketch__tools[hidden] { display: none; }
/* the invitation: one quiet line on the blank page, where the toolbar appears once drawing starts */
.sketch__say { position: absolute; left: 50%; bottom: clamp(26px, 5vh, 44px); z-index: 4; transform: translateX(-50%); margin: 0; width: max-content; max-width: calc(100% - 32px);
  font-size: clamp(.86rem, .8rem + .2vw, .98rem); letter-spacing: .02em; text-align: center; color: rgba(234, 242, 248, .62); pointer-events: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.sketch__say.is-off { opacity: 0; transform: translate(-50%, 6px); }
/* the hint's fingertip: it presses on the pencil, lifts it and sketches a little (sketch.js moves it) */
.sketch__ghost { position: absolute; left: 0; top: 0; z-index: 4; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; opacity: 0; will-change: transform, opacity; }
.sketch__ghost i { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.95), rgba(234,242,248,.75));
  box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 0 0 8px rgba(157,189,224,.16), 0 12px 26px -8px rgba(0,0,0,.6); }
.sketch__tools { padding: 6px; gap: 4px; animation: sk-in .45s var(--ease); }
@keyframes sk-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.sketch__ink, .sketch__tool { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: background .25s; }
.sketch__ink::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform .25s var(--ease), box-shadow .25s; }
.sketch__ink[aria-pressed="true"]::before { transform: scale(1.15); box-shadow: 0 0 0 3px rgba(19, 41, 79, 1), 0 0 0 4.5px var(--ink); }
.sketch__ink:hover, .sketch__tool:hover { background: rgba(234, 242, 248, .1); }
.sketch__tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sketch__sep { width: 1px; height: 22px; margin: 0 4px; background: rgba(234, 242, 248, .18); }
.sketch__done { display: grid; place-items: center; width: 40px; height: 40px; margin-left: 4px; border-radius: 50%; background: var(--ice); color: var(--navy); cursor: pointer; transition: background .25s; }
.sketch__done svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sketch__done:hover { background: #fff; }
.sketch button:focus-visible { outline: 2px solid #9DBDE0; outline-offset: 2px; }
/* resting, the pencil breathes very slightly, as if it has just been set down */
.sketch.is-rest .sketch__pencil svg { animation: sk-rest 3.6s ease-in-out infinite; }
@keyframes sk-rest { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@media (hover: hover) and (pointer: fine) { .sketch.is-rest { cursor: crosshair; } .sketch.is-rest .sketch__pencil { cursor: grab; } }
@media (prefers-reduced-motion: reduce) { .sketch__tools, .sketch__pencil::after, .sketch.is-rest .sketch__pencil svg { animation: none; } .sketch__ghost { display: none; } }
