/*
 * Adventures for TFT Helper — brown ink on parchment, after Leonardo's notebooks.
 * Palette and fonts shared with Arrows & Ceilings.
 */

:root {
    --parchment: #DEB887;            /* burlywood */
    --ink: #4A2C14;                  /* dark brown ink */
    --ink-deep: #3A2A1A;
    --ink-title: #5C3317;            /* warm brown for headings */
    --ink-faint: rgba(74, 44, 20, 0.55);
    --panel: rgba(255, 250, 205, 0.22);  /* faint LemonChiffon behind each entry */
    --hand: 'Almendra', 'Palatino', Georgia, serif;
    --book: 'IM Fell English', 'Palatino', Georgia, serif;
    --list-width: 40rem;
    --note-size: clamp(1rem, 2.6vw, 1.25rem);   /* the email line and the instructions */
    color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* The page itself doesn't scroll: the header and the instructions stay put and only the list
   of adventures scrolls between them. */
body {
    margin: 0;
    height: 100vh;
    height: 100dvh;                  /* phones: the visible height, toolbars excluded */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--parchment);    /* until the parchment texture is drawn */
    color: var(--ink);
    font-family: var(--book);
    font-size: 1.125rem;
    line-height: 1.5;
}

#parchment {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-color: var(--parchment);
}

a { color: var(--ink-title); }

/* ------------------------------------------------------------ header */

header.page {
    flex: none;
    text-align: center;
    padding: 1.5rem 16px 0.4rem;
}

h1 {
    font-family: var(--hand);
    font-weight: 700;
    font-size: clamp(2.1rem, 7vw, 3.6rem);
    line-height: 1.05;
    margin: 0;
    color: var(--ink-title);
    letter-spacing: 0.01em;
}

.subtitle {
    font-style: italic;
    margin: 0.5rem auto 0;
    font-size: var(--note-size);
    overflow-wrap: anywhere;
}

.mirror {
    display: inline-block;
    margin: 0.3rem 0 0;
    font-family: var(--hand);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--ink-faint);
    transform: scaleX(-1);
}

/* ------------------------------------------------------------ the list */

/* the scrolling part; full width so the scroll bar sits at the window's edge */
main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem 16px 1.5rem;
    /* entries fade out as they scroll under the header and the instructions */
    mask-image: linear-gradient(to bottom, transparent, #000 1rem, #000 calc(100% - 1rem), transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 1rem, #000 calc(100% - 1rem), transparent);
}

.status,
.adventures {
    width: min(var(--list-width), 100%);
    margin-inline: auto;
}

/* on wide screens, leave the margins for the sketches */
body.wide .status,
body.wide .adventures { width: min(var(--list-width), 62vw); }

.status {
    text-align: center;
    font-style: italic;
    color: var(--ink-faint);
}

.status:empty { display: none; }

.adventures {
    list-style: none;
    margin-block: 0;
    padding: 0;
    display: grid;
    gap: 1.6rem;
}

.adventure {
    position: relative;              /* the pen frame (an SVG) sits over the entry */
    padding: 1.1rem 1.3rem 1.2rem;
    background: var(--panel);
}

.adventure .frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.adventure h2 {
    font-family: var(--hand);
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1.15;
    margin: 0;
    color: var(--ink-title);
}

.adventure .byline {
    margin: 0.1rem 0 0;
    font-style: italic;
    color: var(--ink-faint);
}

.adventure .level {
    margin: 0.5rem 0 0;
    font-family: var(--hand);
    font-size: 1.02rem;
}

.adventure .description {
    margin: 0.35rem 0 0;
}

.adventure .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.9rem;
}

/* wood-buttons.css styles <button>; the Download link wears the same coat */
.adventure .wood-btn {
    display: inline-block;
    min-width: 6.5em;
    text-align: center;
    text-decoration: none;
    font-family: var(--hand);
    font-size: 1.05rem;
    padding: 0.3em 0.8em;
}

/* ------------------------------------------------------------ instructions */

footer.page {
    flex: none;
    padding: 0.4rem 16px 0.9rem;
    text-align: center;
}

.instructions {
    max-width: 44rem;
    margin: 0 auto;
    font-style: italic;
    font-size: var(--note-size);
    line-height: 1.35;
}

.instructions strong {
    font-family: var(--hand);
    font-style: normal;
    font-weight: 700;
}

/* ------------------------------------------------------------ margin sketches */

#art {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    display: none;
}

body.wide #art { display: block; }

#art img {
    position: absolute;
    height: auto;
    mix-blend-mode: multiply;        /* white paper in the sketch drops away into the parchment */
    opacity: 0.85;
}
