/* =====================================================================
   DOCUMENTS THEME  -  /documents/documents-theme.css (after documents.css)
   An archive desk: manila folder paper with a faint graph-paper grid,
   each subject a folder tab, papers dealt onto the desk as they come
   into view, a red rubber "NEW" stamp, and a paper clip on favourites.
   The title is typed out like on a typewriter. Calm; nothing moves
   with reduced motion.
   ===================================================================== */

body.dc-page {
    --dc-ink: #2b2318;
    --dc-muted: #6b5d45;
    --dc-faint: #9a8b6f;
    --dc-rule: rgba(110, 85, 40, 0.2);
    --dc-accent: #a3301e;            /* stamp-pad red */
    --mf-paper: #efe4c9;              /* manila */
    --mf-tab: #e5d5ae;
    --mf-grid: rgba(120, 92, 40, 0.07);
    background-color: var(--mf-paper);
    background-image:
        radial-gradient(1200px 700px at 50% -10%, rgba(255, 250, 235, 0.65), transparent 70%),
        linear-gradient(var(--mf-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--mf-grid) 1px, transparent 1px);
    background-size: auto, 24px 24px, 24px 24px;
    background-attachment: fixed;
    color: var(--dc-ink);
}

/* the site's own header and box on the folder */
body.dc-page:not(#_) .site-title:hover { color: var(--dc-accent); }
body.dc-page:not(#_) > header > h2 { border-bottom-color: rgba(110, 85, 40, 0.35); color: #5b4e38; }
body.dc-page:not(#_) .mywork { background: rgba(250, 245, 232, 0.8); border-color: rgba(110, 85, 40, 0.22); }
body.dc-page:not(#_) .mywork-kicker { color: var(--dc-accent); }
body.dc-page:not(#_) footer { border-top-color: rgba(110, 85, 40, 0.3); color: #7a6a4e; }

/* ---------------------------------------------------------------- the title, typed */
body.dc-page .dc-hero { border-bottom: 2px solid rgba(110, 85, 40, 0.28); }
body.dc-page main.dc-main .dc-kicker {
    font-family: ui-monospace, "SF Mono", "Courier New", Courier, monospace; letter-spacing: 0.22em; color: var(--dc-accent);
}
body.dc-page main.dc-main .dc-title {
    position: relative; display: inline-block; justify-self: start; width: fit-content;
    font-family: "American Typewriter", "Courier Prime", "Courier New", Courier, ui-monospace, monospace;
    font-style: normal; font-weight: 600; letter-spacing: -0.01em;
}
body.dc-page .dc-hero.is-in .dc-title { animation: mf-type 1.1s steps(9, end) 0.15s both; }
body.dc-page .dc-hero.is-in .dc-title::after {           /* the typewriter's caret, then gone */
    content: ""; position: absolute; right: -0.12em; top: 12%; bottom: 10%; width: 0.08em; background: var(--dc-accent);
    animation: mf-caret 0.5s steps(1) 0.15s 4 both;
}
@keyframes mf-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -0.3em 0 0); } }
@keyframes mf-caret { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- the toolbar */
body.dc-page .dc-toolbar { background: linear-gradient(var(--mf-paper) 80%, rgba(239, 228, 201, 0)); }
body.dc-page .dc-search input, body.dc-page .dc-sort select, body.dc-page .dc-chips button { background: #fbf7ec; border-color: rgba(110, 85, 40, 0.25); }
body.dc-page .dc-chips button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }

/* ---------------------------------------------------------------- each subject: a folder tab */
body.dc-page .dc-group { position: relative; margin-top: 30px; padding: 0 18px 16px; background: rgba(250, 244, 228, 0.55); border: 1px solid rgba(110, 85, 40, 0.16); border-radius: 0 10px 10px 10px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 14px 30px -26px rgba(60, 40, 10, 0.5); }
body.dc-page .dc-group-head {
    position: relative; top: -1px; margin: 0 -18px 4px; padding: 10px 18px 10px;
    border-bottom: 1px dashed rgba(110, 85, 40, 0.25);
}
body.dc-page .dc-group-head::after { display: none; }
body.dc-page .dc-group-head::before {                    /* the tab sticking up from the folder */
    content: ""; position: absolute; left: -1px; bottom: 100%; width: 190px; height: 16px;
    background: var(--mf-tab); border: 1px solid rgba(110, 85, 40, 0.18); border-bottom: 0;
    border-radius: 9px 12px 0 0; clip-path: polygon(0 0, 88% 0, 100% 100%, 0 100%);
    box-shadow: inset 0 3px 0 var(--c);
}
body.dc-page main.dc-main .dc-group-title { font-family: "American Typewriter", "Courier Prime", "Courier New", Courier, monospace; font-style: normal; font-weight: 600; font-size: 1.15rem; letter-spacing: 0.01em; }
body.dc-page .dc-grid { padding-top: 18px; }

/* ---------------------------------------------------------------- papers dealt onto the desk */
body.dc-page .dc-card { transform: translateY(-26px) rotate(var(--deal, -3deg)) scale(1.02); transition: opacity 0.55s ease, transform 0.8s cubic-bezier(.2, 1.25, .35, 1); }
body.dc-page .dc-card.is-in { transform: rotate(var(--rest, 0deg)); }
body.dc-page .dc-card:nth-child(4n+1) { --deal: -4deg; --rest: -0.6deg; }
body.dc-page .dc-card:nth-child(4n+2) { --deal: 3deg; --rest: 0.5deg; }
body.dc-page .dc-card:nth-child(4n+3) { --deal: -2deg; --rest: -0.3deg; }
body.dc-page .dc-card:nth-child(4n+4) { --deal: 4deg; --rest: 0.7deg; }
body.dc-page .dc-card:hover { transform: rotate(0deg); }
body.dc-page .dc-paper { box-shadow: 0 1px 1px rgba(60, 40, 10, 0.12), 0 12px 22px -12px rgba(60, 40, 10, 0.5); }
body.dc-page .has-stack .dc-link::before, body.dc-page .has-stack .dc-link::after { background: #fdfbf5; }

/* the "NEW" mark is a red rubber stamp, pressed on as the paper lands */
body.dc-page .dc-new {
    left: auto; right: 10px; top: 12px; padding: 3px 8px 2px; background: transparent; color: var(--dc-accent);
    border: 2px solid var(--dc-accent); border-radius: 4px; box-shadow: none; transform: rotate(-9deg);
    font: 700 0.72rem/1.2 ui-monospace, "Courier New", monospace; letter-spacing: 0.18em; opacity: 0.85; mix-blend-mode: multiply;
}
body.dc-page .dc-new::after { display: none; }
body.dc-page .dc-card.is-in .dc-new { animation: mf-stamp 0.45s cubic-bezier(.3, 1.6, .5, 1) 0.55s both; }
@keyframes mf-stamp { from { opacity: 0; transform: rotate(-9deg) scale(2.2); } to { opacity: 0.85; transform: rotate(-9deg) scale(1); } }
body.dc-page .dc-pin { right: auto; left: 10px; }

/* a paper clip on my favourites */
body.dc-page .dc-fav .dc-paper::before {
    content: ""; position: absolute; z-index: 3; top: -14px; left: 22px; width: 18px; height: 46px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 46'%3E%3Cpath d='M6 12V35a4 4 0 0 0 8 0V8a6 6 0 0 0-12 0v30a7 7 0 0 0 14 0V14' fill='none' stroke='%23878d96' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

/* the words under a card, on manila */
body.dc-page .dc-dl:hover { border-color: rgba(110, 85, 40, 0.3); }

@media (max-width: 720px) {
    body.dc-page .dc-group { padding: 0 12px 12px; }
    body.dc-page .dc-group-head { margin: 0 -12px 4px; padding: 10px 12px; }
    body.dc-page .dc-group-head::before { width: 130px; }
}
@media (prefers-reduced-motion: reduce) {
    body.dc-page .dc-card, body.dc-page .dc-card.is-in { transform: none; transition: none; }
    body.dc-page .dc-hero.is-in .dc-title, body.dc-page .dc-hero.is-in .dc-title::after, body.dc-page .dc-card.is-in .dc-new { animation: none; }
}
