/* Ransom Note - A Free Design by Bryant Smith (bryantsmith.com)
   The whole page is one note cut from scraps of paper and pinned to a desk.
   Every colour, font and tilt lives here. Change a value and the note
   rebuilds itself. Look for the section headings to find what you want. */


/* ---- RESET: start from a clean slate ---- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ---- DESK: the warm wooden surface behind the note ---- */

body {
    background-color: #2b221c;
    background-image:
        radial-gradient(circle at 50% 14%, rgba(255, 226, 170, 0.16), rgba(0, 0, 0, 0) 58%),
        repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.18) 0, rgba(0, 0, 0, 0.18) 2px, rgba(255, 255, 255, 0.02) 2px, rgba(255, 255, 255, 0.02) 9px),
        linear-gradient(180deg, #3b2d23, #221a15);
    color: #1d1a16;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 17px;
    line-height: 1.6;
    overflow-x: hidden;
    padding: 56px 20px 48px 20px;
}


/* ---- NOTE: the page wrapper, an off-centre collage ---- */

#note {
    margin: 0 auto;
    max-width: 900px;
    position: relative;
    text-align: left;
    z-index: 0;
}

/* A soft sheet sits behind the masthead so the title has a backdrop. */
#masthead {
    margin-bottom: 32px;
    position: relative;
}

#masthead::before {
    background: #efe9da;
    clip-path: polygon(0 5%, 15% 0, 33% 4%, 52% 1%, 71% 4%, 87% 0, 100% 6%, 99% 30%, 100% 55%, 98% 78%, 99% 97%, 84% 100%, 66% 96%, 48% 100%, 29% 96%, 11% 100%, 1% 96%, 0 72%, 2% 48%, 0 24%);
    content: "";
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.45));
    inset: -18px -20px -14px -16px;
    position: absolute;
    transform: rotate(-0.9deg);
    z-index: -1;
}


/* ---- CUT-OUT BLOCKS: the scraps of paper themselves ----
   .p is the base shape. Tints, fonts, sizes and tilts are added on top. */

.p {
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 2px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18), 0 3px 5px rgba(0, 0, 0, 0.30);
    color: #1d1a16;
    display: inline-block;
    line-height: 1.15;
    padding: 0.22em 0.5em;
    transform-origin: center center;
    white-space: normal;
}

/* Flex rows let the scraps wrap and line up without a table or float. */
.line {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 9px 11px;
}

p.line {
    margin-bottom: 14px;
}

.gap {
    display: inline-block;
    width: 16px;
}


/* ---- PAPER TINTS: a small, repeated palette ---- */

.p-light { background: #f3eee2; }
.p-news  { background: #dad9d1; }
.p-cream { background: #ece0c6; }
.p-kraft { background: #cdb488; }
.p-ink   { background: #211f1b; color: #f2ecdc; }
.p-red   { background: #a83227; color: #f7efdf; }

/* A single coloured underline, for a little emphasis. */
.edge {
    border-bottom: 3px solid #a83227;
}


/* ---- TORN EDGES: a jagged clip-path instead of a straight cut ----
   The drop-shadow follows the torn outline, so it still reads as paper. */

.torn {
    border: none;
    box-shadow: none;
    clip-path: polygon(0 7%, 8% 0, 20% 6%, 34% 1%, 48% 6%, 62% 1%, 77% 5%, 90% 0, 100% 8%, 98% 28%, 100% 52%, 97% 74%, 100% 92%, 94% 100%, 80% 95%, 64% 100%, 47% 95%, 31% 100%, 15% 96%, 4% 100%, 2% 80%, 0 58%, 3% 34%);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.42));
    padding: 0.4em 0.7em;
}


/* ---- MIXED TYPE: a different system font for every scrap ---- */

.f-serif    { font-family: Georgia, "Times New Roman", Times, serif; }
.f-cambria  { font-family: Cambria, Georgia, serif; }
.f-mono     { font-family: "Courier New", Courier, monospace; font-weight: bold; }
.f-sans     { font-family: Verdana, Arial, Helvetica, sans-serif; }
.f-trebuchet{ font-family: "Trebuchet MS", Tahoma, Geneva, sans-serif; }
.f-display  { font-family: Impact, "Arial Black", "Franklin Gothic Bold", sans-serif; font-weight: normal; letter-spacing: 0.02em; }


/* ---- SIZE AND TILT: the offset engine of the collage ---- */

.big  { font-size: 46px; padding: 0.06em 0.24em; }
.sm   { font-size: 13px; letter-spacing: 0.06em; padding: 0.24em 0.6em; }
.caps { text-transform: uppercase; }

.r1 { transform: rotate(-2.4deg); }
.r2 { transform: rotate(1.8deg); }
.r3 { transform: rotate(-1.2deg); }
.r4 { transform: rotate(3deg); }
.r5 { transform: rotate(-3.2deg); }
.r6 { transform: rotate(2.4deg); }
.r7 { transform: rotate(-0.8deg); }
.r8 { transform: rotate(1.2deg); }


/* ---- PINS: a small brass-headed pin holding a scrap down ---- */

.pinned {
    position: relative;
}

.pinned::before {
    background: radial-gradient(circle at 35% 30%, #ffd98a, #b8862b 55%, #6d4a12);
    border-radius: 50%;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
    content: "";
    height: 13px;
    left: 50%;
    margin-left: -7px;
    position: absolute;
    top: -8px;
    width: 14px;
    z-index: 3;
}


/* ---- MASTHEAD: kicker, title and tagline ---- */

.kicker {
    margin-bottom: 18px;
}

#title {
    margin-bottom: 18px;
}

.tagline {
    margin-bottom: 0;
}


/* ---- MENU: five paper strips that lift on hover ---- */

#menu {
    margin: 4px 0 44px 0;
}

#menu a {
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

#menu a:hover,
#menu a:focus {
    background: #fbf7ec;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 9px 14px rgba(0, 0, 0, 0.42);
    color: #7a1d16;
    outline: none;
    transform: rotate(0deg) translateY(-3px);
}


/* ---- LABELS: "SUBJECT", "VITALS" and friends, letter by letter ---- */

.label {
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 14px;
}

.label .p {
    font-size: 15px;
    padding: 0.16em 0.42em;
}


/* ---- OFFSET GRID: each section sits at a different margin ----
   These four classes are what keep the page from being one centred column. */

.scrap {
    margin-bottom: 32px;
}

.offset-a { margin-left: 0;    max-width: 88%; }
.offset-b { margin-left: auto; margin-right: 3%; max-width: 80%; }
.offset-c { margin-left: 6%;   max-width: 84%; }
.offset-d { margin-left: 2%;   max-width: 74%; }


/* ---- FACTS: a labelled list, each row its own little line ---- */

.facts {
    list-style: none;
}

.facts li {
    margin-bottom: 12px;
}


/* ---- QUOTE: one large pinned scrap ---- */

#quote {
    margin: 0 0 40px 16%;
    max-width: 70%;
}

.quote-scrap {
    display: block;
    font-size: 22px;
    line-height: 1.4;
    padding: 26px 30px;
    text-align: center;
    white-space: normal;
}

.quote-scrap .who {
    color: #6a6152;
    display: block;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    letter-spacing: 0.1em;
    margin-top: 14px;
    text-transform: uppercase;
}


/* ---- INLINE EMPHASIS: bold words inside a scrap ---- */

.p strong {
    font-weight: bold;
}


/* ---- ACCESSIBILITY: a clear keyboard focus ring everywhere ---- */

a:focus-visible {
    outline: 3px solid #ffd98a;
    outline-offset: 3px;
}


/* ---- FOOTER: the required credit, trimmed like a paper strip ---- */

#footer {
    background: #efe9da;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    color: #6a6152;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    margin-top: 56px;
    padding: 14px 16px;
    text-align: center;
    transform: rotate(-0.6deg);
}

#footer a {
    border-bottom: 1px dotted #9a8c72;
    color: #7a1d16;
    text-decoration: none;
}

#footer a:hover {
    border-bottom-color: #7a1d16;
    color: #a83227;
}


/* ---- SMALL SCREENS: straighten the scraps and stack them ---- */

@media (max-width: 640px) {
    body {
        font-size: 16px;
        padding: 32px 12px 28px 12px;
    }

    .offset-a,
    .offset-b,
    .offset-c,
    .offset-d {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }

    #masthead::before {
        inset: -12px -10px -10px -10px;
    }

    .big {
        font-size: 30px;
    }

    .p {
        max-width: 100%;
        white-space: normal;
    }

    #quote {
        margin-left: 0;
        max-width: 100%;
    }

    .quote-scrap {
        font-size: 18px;
        padding: 20px;
    }

    /* Straighten everything on a narrow screen so it stays easy to read. */
    .r1, .r2, .r3, .r4, .r5, .r6, .r7, .r8 {
        transform: rotate(0deg);
    }

    #footer {
        transform: none;
    }
}


/* ---- PRINT: drop the desk and the tilts for a clean sheet ---- */

@media print {
    body {
        background: #ffffff;
        color: #000000;
        padding: 0;
    }

    #masthead::before {
        display: none;
    }

    .p,
    .quote-scrap {
        background: #ffffff !important;
        border: 1px solid #999999;
        box-shadow: none;
        clip-path: none;
        color: #000000 !important;
        filter: none;
    }

    .pinned::before {
        display: none;
    }

    .r1, .r2, .r3, .r4, .r5, .r6, .r7, .r8,
    #footer {
        transform: none;
    }

    #menu {
        display: none;
    }
}
