@font-face {
    font-family: 'Reckless';
    src: url('../../assets/fonts/reckless/Reckless-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Reckless';
    src: url('../../assets/fonts/reckless/Reckless-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* A pile of my things at the foot of About — photos, books, a CD, a note,
   the tools I use — that falls into place when it comes
   into view and can be pushed around.

   The pile is laid out on a fixed canvas (1040 × 600, or 600 × 1000 on a
   phone) and scaled to the width it is given, so the arrangement holds at
   every size. Positions live on each item as "x y rotation". */

.pile {
    /* Wider than the reading column, as a table is wider than a page. */
    width: min(1040px, calc(100vw - 2 * var(--gutter)));
    margin: 96px 0 0 50%;
    translate: -50% 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pile__stage { position: relative; width: 100%; height: calc(600px * var(--k, 1)); }
.pile__canvas {
    position: absolute;
    inset: 0 auto auto 0;
    width: 1040px;
    height: 600px;
    transform: scale(var(--k, 1));
    transform-origin: 0 0;
}

.pile__item {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    padding: 0;
    border: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    filter: drop-shadow(0 1px 1px #0000000f) drop-shadow(0 6px 14px #00000014);
    transition: filter 0.2s ease;
}
.pile__item:hover { filter: drop-shadow(0 2px 2px #00000014) drop-shadow(0 14px 28px #0000001f); }
.pile__item.is-dragging { cursor: grabbing; filter: drop-shadow(0 4px 4px #0000001a) drop-shadow(0 24px 40px #00000029); }
/* Before the pile has fallen, it waits out of sight. */
.pile.is-waiting .pile__item { visibility: hidden; }

.pile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 14px; pointer-events: none; }
.pile-photo--wide { width: 380px; height: 253px; }
.pile-photo--tall { width: 290px; height: 387px; }
.pile-photo--award { width: 230px; height: 266px; }
.pile-photo--round { width: 180px; height: 180px; }
.pile-photo--round img { border-radius: 50%; object-position: 50% 20%; }

.pile-book { width: 140px; height: 212px; border-radius: 3px 6px 6px 3px; overflow: hidden; background: var(--surface); }
.pile-book img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* A spine shadow on the left edge, so a cover reads as a book. */
.pile-book::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0000002e 0, #ffffff26 3%, #0000 7%, #0000 100%);
    pointer-events: none;
}

/* Black vinyl, pressed grooves, a paper centre label and a separate steel arm. */
.pile-vinyl { width: 248px; height: 212px; background: none; }
.vinyl__record { padding: 0; border: 0; cursor: pointer; touch-action: manipulation; position: absolute; left: 0; top: 6px; width: 190px; height: 190px; border-radius: 50%; background: #090a0b; box-shadow: 0 2px 3px #0008, 0 8px 16px #0003; }
.vinyl__disc { position: absolute; inset: 0; overflow: hidden; border-radius: 50%; background: repeating-radial-gradient(circle at center, #17181a 0 1px, #090a0b 1px 2px, #202124 2px 2.6px, #101113 2.6px 4px); border: 2px solid #252628; box-shadow: inset 0 0 0 3px #111214; will-change: transform; }
.vinyl__record::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 25deg, #fff0 0 12%, #fff2 16%, #fff0 23% 58%, #fff1 65%, #fff0 74%); pointer-events: none; }
.vinyl__disc img { position: absolute; inset: 33%; width: 34%; height: 34%; object-fit: cover; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2px #08090a, 0 0 0 4px #28292b; }
.vinyl__spindle { position: absolute; top: calc(50% - 3px); left: calc(50% - 3px); z-index: 1; width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(125deg, #fff, #6b6d71 65%, #d7d7d8); box-shadow: 0 1px 2px #0009; }
.vinyl__hardware { position: absolute; inset: 0; width: 248px; height: 196px; overflow: visible; pointer-events: none; }
[data-tonearm] { pointer-events: auto; cursor: grab; transform-origin: 215px 22px; transition: transform 600ms cubic-bezier(.22,.7,.25,1), filter 250ms ease; touch-action: none; }
[data-tonearm]:focus-visible { outline: none; filter: drop-shadow(0 0 3px var(--accent)); }
.pile-vinyl.is-lifting [data-tonearm] { filter: drop-shadow(3px 6px 3px #0005); }
.pile-vinyl.is-arm-dragging [data-tonearm] { transition: filter 150ms ease; cursor: grabbing; }
@media (prefers-reduced-motion: reduce) { [data-tonearm] { transition: none; } }

.pile-tools {
    width: 232px;
    padding: 18px 14px 14px;
    border-radius: 16px;
    background: var(--control);
    font-size: 15px;
    color: var(--text-secondary);
}
.pile-tools p { margin: 0 0 10px 6px; }
.pile-tools ul { display: flex; flex-direction: column; gap: 6px; }
.pile-tools li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--raised);
    color: var(--text-primary);
}
.pile-tools svg { width: 16px; height: 16px; flex-shrink: 0; }

.pile-note {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 212px;
    height: 212px;
    padding: 18px;
    border-radius: 0;
    background: var(--note-preview-paper, #f5d34e);
    color: #000;
    cursor: grab;
    text-align: left;
    font: 500 16px/1.4 var(--font-sans);
}
.pile-note__preview {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    max-height: 140px;
}
.pile-note__open {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #000;
    color: var(--note-preview-paper, #f5d34e);
}
.pile-note__open svg { width: 18px; height: 18px; }
.pile-note.is-editing { visibility: hidden; }
.pile-note:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }

.note-editor {
    --note-paper: #00e935;
    --note-avatar-color: #f5d34e;
    width: min(567px, calc(100vw - 32px));
    height: min(568px, calc(100dvh - 32px));
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 24px;
    border: 0;
    border-radius: 0;
    background: var(--note-paper);
    color: #000;
    box-shadow: -16px 16px 48px #0006;
    overflow: hidden;
}
.note-editor::backdrop { background: #16130f70; backdrop-filter: blur(6px); }
.note-editor__form { height: 100%; display: flex; flex-direction: column; gap: 0; margin: 0; }
.note-editor__form[hidden], .note-editor__receipt[hidden] { display: none; }
.note-editor__receipt { position: relative; height: 100%; outline: none; }
.note-editor__receipt > .note-editor__close { position: absolute; top: 0; right: 0; }
.note-editor__receipt-body { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.note-editor__receipt-mark { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: #fffdf380; }
.note-editor__receipt-mark svg { width: 48px; height: 48px; }
.note-editor__receipt h2 { color: #000; font: 500 30px/1.2 var(--font-sans); }
.note-editor__receipt p { margin: 0; color: #0009; font: 14px/1.4 var(--font-sans); }
.note-editor__flight { position: absolute; width: 64px; height: 48px; z-index: 2; color: #000; pointer-events: none; }
.note-editor__flight svg { width: 100%; height: 100%; }
.note-editor__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.note-editor__header h2 { color: #000; margin: 0; font: 500 16px/1.225 var(--font-sans); }
.note-editor__close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #100;
    color: var(--note-paper);
    cursor: pointer;
}
.note-editor__close-icon { width: 14.122px; height: 14.122px; background: currentColor; mask: url('/assets/note-ui/close.svg') center / contain no-repeat; }
.note-editor textarea {
    flex: 1;
    min-height: 0;
    width: 100%;
    margin: 64px 0 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    resize: none;
    background: transparent;
    color: inherit;
    font: 500 48px/1 'Reckless', Georgia, serif;
    box-shadow: none;
    outline: none;
}
.note-editor textarea::placeholder { color: #0006; opacity: 1; }
.note-editor__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-editor__identity { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.note-editor__name-field { position: relative; flex-shrink: 1; width: 139px; min-width: 0; max-width: 100%; border-radius: 999px; background: var(--note-avatar-color); }
.note-editor__name { display: block; min-width: 0; width: 100%; height: 48px; padding: 0 16px; border: 0; border-radius: inherit; background: transparent; color: #000; font: 500 14px/24px var(--font-sans); }
.note-editor__name::placeholder { color: #0004; opacity: 1; }
.note-editor__name:focus-visible { outline: 2px solid #000; outline-offset: -2px; }
.note-editor__name-field.has-name { box-shadow: inset 0 0 0 1.5px #000; }
.note-editor__name-field.has-name .note-editor__name { padding-right: 36px; }
.note-editor__clear-name { position: absolute; right: 8px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: #0003; color: var(--note-avatar-color); cursor: pointer; }
.note-editor__clear-name > span { width: 10px; height: 10px; background: currentColor; mask: url('/assets/note-ui/close.svg') center / contain no-repeat; }
.note-editor__clear-name[hidden] { display: none; }
.note-avatar { position: relative; flex-shrink: 0; }
.note-avatar__toggle { position: relative; display: block; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.note-avatar__art { position: absolute; left: -2px; top: -2px; max-width: none; }
.note-avatar__choices .note-avatar__art { left: -1px; top: -1px; transform: scale(.583333); transform-origin: 0 0; }
.note-avatar__choices { position: absolute; z-index: 1; left: -4px; bottom: 60px; display: grid; grid-template-columns: repeat(4, 28px); gap: 8px; width: max-content; height: auto; padding: 12px; border-radius: 12px; background: #000; box-shadow: 0 6px 24px #4a3f1a30; animation: note-avatar-in 240ms cubic-bezier(0.2, 0.8, 0.3, 1.2) both; transform-origin: 20px 100%; }
.note-avatar__choices[hidden] { display: none; }
.note-avatar__choices button { position: relative; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; opacity: .5; cursor: pointer; }
.note-avatar__choices button[aria-pressed='true'] { outline: 2px solid #f5d34e; outline-offset: 2px; opacity: 1; }
@keyframes note-avatar-in { from { opacity: 0; transform: scale(0.65) translateY(12px); } to { opacity: 1; transform: none; } }
.note-editor__status { margin: 0; color: #000; font: 13px/1.4 var(--font-sans); }
.note-editor__status[hidden] { display: none; }
.note-editor__honeypot { display: none; }
.note-editor__send svg { width: 16px; height: 16px; }
.note-editor.is-sent { background: var(--note-paper); }
.pile-note.is-sent { background: var(--note-preview-paper, #f5d34e); }
.note-editor__send:disabled { cursor: default; opacity: 0.8; }
@media (prefers-reduced-motion: reduce) { .note-avatar__choices { animation: none; } }
.note-editor__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: #000;
    color: var(--note-paper);
    font: 500 14px/1.4 var(--font-sans);
    cursor: pointer;
}
.note-editor button:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
@media (max-width: 639px) {
    .note-editor { padding: 20px; }
    .note-editor textarea { margin-top: 48px; font-size: clamp(32px, 8vw, 48px); }
    .note-editor__footer { gap: 10px; }
    .note-editor__send { padding-inline: 14px; }
    .note-editor__identity { gap: 8px; }
    .note-editor__name { font-size: 16px; }
}
@media print {
    .note-editor { display: none !important; }
}

/* On a touch screen the pile covers most of the view, so an upward swipe
   still scrolls the page; items move with a sideways push. */
@media (pointer: coarse) {
    .pile__item { touch-action: pan-y; }
}

/* The phone canvas: taller and narrower. */
@media (max-width: 719px) {
    .pile { margin-top: 72px; }
    .pile__stage { height: calc(1000px * var(--k, 1)); }
    .pile__canvas { width: 600px; height: 1000px; }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 359px) {
    .note-editor__name::placeholder { font-size: 12px; }
}

/* The clock shares the pile’s falling and elastic drag behavior. */
.pile-clock { width: 164px; height: 171px; }
.pile-clock svg { display: block; width: 100%; height: 100%; pointer-events: none; }

/* The palette fans out from its button; the writing stays in place. */
.note-editor__tools { display: flex; align-items: center; gap: 16px; }
.note-colors { position: relative; }
.note-colors__toggle { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.note-colors__choices { position: absolute; top: 4px; right: 40px; width: 64px; height: 64px; z-index: 2; }
.note-colors__choices[hidden] { display: none; }
.note-colors__choices button { position: absolute; width: 20px; height: 20px; border: 0; border-radius: 50%; padding: 0; background: var(--swatch); cursor: pointer; }
.note-colors__choices button:nth-child(1) { top: 0; left: 0; }
.note-colors__choices button:nth-child(2) { top: 30px; left: 8px; }
.note-colors__choices button:nth-child(3) { top: 45px; left: 38px; }
.note-colors__choices button:nth-child(4) { top: 35px; left: 68px; }
.note-colors__choices button[aria-pressed='true'] { box-shadow: inset 0 0 0 1.5px #000; }
.note-colors__toggle[aria-expanded='true'] { opacity: .4; }
.note-editor__send-icon { width: 18px; height: 18px; background: currentColor; mask: url('/assets/note-ui/send.svg') center / 14.7982px 14.3604px no-repeat; }
@media (max-width: 399px) {
    .note-editor { padding: 16px; }
    .note-editor__header { gap: 8px; }
    .note-editor__tools { gap: 12px; }
    .note-editor__header h2 { font-size: 14px; }
    .note-editor__name { padding-inline: 10px; font-size: 12px; }
    .note-editor__footer, .note-editor__identity { gap: 8px; }
    .note-editor__send { padding-inline: 12px; font-size: 13px; }
    .note-colors__choices { top: 40px; right: 0; width: 108px; }
}
