/* First-visit "sketch build" intro for the home page.
   Only active while <html data-sketch> is set; removed completely when done. */


/* The tour moves the page itself, so it holds still for the visitor. */
html[data-sketch] {
    overflow: hidden !important;
    scroll-behavior: auto !important;
}

/* Before the script takes over: keep the page blank so nothing flashes.
   (opacity on body, not visibility: visibility is inherited and transitions
   with `transition: all`, which would make parts read as hidden when measured) */
html[data-sketch="pending"] body {
    opacity: 0 !important;
}

/* The pencil layer, in page coordinates, moving with the page. */
.sk-layer {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 9990;
}

.sk-layer svg {
    position: absolute;
    left: 0;
    top: 0;
    overflow: visible;
}

.sk-pencil {
    fill: none;
    stroke: var(--sk-ink);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sk-note {
    font-family: var(--sk-hand-font, cursive);
    fill: var(--sk-ink);
    letter-spacing: -0.04em;
}

/* Every line of the page's text, first written in pencil. */
.sk-hand {
    font-family: var(--sk-hand-font, cursive);
    letter-spacing: -0.04em;
    fill: var(--sk-ink);
    stroke: var(--sk-ink);
    stroke-width: 0.45px;
    paint-order: stroke;
}

/* Measuring is done in blue pencil. */
.sk-pencil.sk-blue {
    stroke: var(--sk-blue);
}

.sk-note.sk-blue-text {
    fill: var(--sk-blue);
}

/* Rulers along the top and left of the screen. */
.sk-rulers {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9992;
    pointer-events: none;
    overflow: visible;
}

.sk-ruler-bg {
    fill: var(--sk-paper);
    opacity: 0.92;
}

/* The crew of hand-drawn cursors, each filled with its own colour. */
.sk-cursor-line {
    fill: none;
    stroke: #161616;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* After the build: the crew following the visitor's cursor. */
.sk-crew {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9993;
    pointer-events: none;
    overflow: visible;
}

/* The finishing ripple. */
.sk-ring {
    position: fixed;
    z-index: 9994;
    border-radius: 50%;
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 40px 6px rgba(140, 180, 255, 0.35), inset 0 0 60px 10px rgba(140, 180, 255, 0.18);
}

/* A picture being carried into place. */
.sk-carry {
    position: absolute;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    will-change: transform;
}

.sk-skip {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9995;
    font: 16px/1 'Gloria Hallelujah', 'Bradley Hand', cursive;
    color: var(--sk-ink, #9a9a9a);
    background: var(--sk-paper, rgba(20, 20, 20, 0.85));
    border: 2px solid var(--sk-ink, #9a9a9a);
    border-radius: 999px;
    padding: 6px 14px 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sk-skip:hover {
    opacity: 1;
}

.sk-sound {
    position: fixed;
    left: 36px;
    bottom: 22px;
    z-index: 9995;
    font: 15px/1 'Gloria Hallelujah', 'Bradley Hand', cursive;
    color: var(--sk-ink);
    opacity: 0.55;
    pointer-events: none;
}

/* Design-tool overlays: selection, padding, margin, the CSS tag. */
.sk-sel {
    fill: none;
    stroke-width: 1.5;
}

.sk-handle {
    fill: #ffffff;
    stroke-width: 1.5;
}

.sk-pad {
    fill: rgba(110, 200, 130, 0.28);
}

.sk-mar {
    fill: rgba(255, 170, 70, 0.22);
}

.sk-css-tag {
    opacity: 0.95;
}

.sk-css-text {
    font: 600 10.5px/1 ui-monospace, 'SF Mono', Menlo, monospace;
    fill: #111111;
}

/* I-beam (writers) and crosshair (measurers): a dark edge under a coloured stroke. */
.sk-cursor-under {
    fill: none;
    stroke: #111111;
    stroke-width: 4.2;
    stroke-linecap: round;
}

.sk-cursor-mark {
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* The hand-drawn note at the bottom: crew, progress, skip. */
.sk-hud {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) rotate(-0.6deg);
    z-index: 9995;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px 13px 18px;
    color: var(--hud-ink);
    font: 15px/1.1 'Gloria Hallelujah', 'Bradley Hand', cursive;
    white-space: nowrap;
}

/* the wobbly pencil frame, on a slip of paper */
.sk-hud-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    z-index: -1;
}

.sk-hud-frame path {
    fill: var(--hud-paper);
    stroke: var(--hud-ink);
    stroke-width: 2.2px;
    vector-effect: non-scaling-stroke;
    stroke-linejoin: round;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.sk-hud b {
    font-weight: 400;
    font-size: 18px;
}

.sk-hud-crew {
    display: flex;
    align-items: flex-start;
    height: 24px;
}

.sk-hud-cur {
    width: 15px;
    height: 23px;
    margin-left: -4px;
    overflow: visible;
    position: relative;
}

.sk-hud-cur:first-child {
    margin-left: 0;
}

.sk-hud-msg {
    opacity: 0.85;
}

.sk-hud-line {
    width: 92px;
    height: 14px;
    overflow: visible;
}

.sk-hud-line path {
    fill: none;
    stroke-linecap: round;
}

.sk-hud-track {
    stroke: var(--hud-ink);
    stroke-width: 1.4;
    stroke-dasharray: 2 5;
    opacity: 0.45;
}

.sk-hud-fill {
    stroke: #4d96ff;
    stroke-width: 3.2;
    transition: stroke-dashoffset 0.35s ease;
}

.sk-hud-skip {
    border: 0;
    background: none;
    color: var(--hud-ink);
    font: inherit;
    font-size: 16px;
    padding: 2px 2px 4px;
    cursor: pointer;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 100% 1.5px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    opacity: 0.85;
}

.sk-hud-skip:hover {
    opacity: 1;
}

/* "tap for sound": only while the browser is holding sound back */
.sk-hud-sound {
    border: 0;
    background: none;
    color: var(--hud-ink);
    font: inherit;
    font-size: 15px;
    padding: 2px 2px 4px;
    cursor: pointer;
    opacity: 0.85;
    animation: sk-sound-nudge 1.6s ease-in-out infinite;
}

.sk-hud-sound:hover { opacity: 1; }

@keyframes sk-sound-nudge {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-3deg) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
    .sk-hud-sound { animation: none; }
}

@media (max-width: 560px) {
    .sk-hud {
        gap: 10px;
        font-size: 13px;
        padding: 10px 14px 11px 12px;
    }

    .sk-hud-crew,
    .sk-hud-line {
        display: none;
    }
}
