/* Maze - A Free Design by Bryant Smith (bryantsmith.com)
   This page is a hand-drawn maze built from a CSS grid.
   Every wall is just a border; every room is a bordered box.
   Look for the section headings below to find what you want to change. */


/* ---- COLOURS (change these hex values to repaint the maze) ----
   paper : #fbf7ec   the rooms
   desk  : #e6ddc9   the table the page rests on
   ink   : #2f2a24   walls, text and outlines
   rust  : #9c3f18   links, markers and the treasure
   gold  : #b8860b   the small treasure coin
   faint : #8a8070   small grey-brown text
*/


/* ---- BODY: the desk the paper maze sits on ---- */

body {
    background: #e6ddc9;
    color: #2f2a24;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 16px;
    line-height: 1.7;
    padding: 40px 16px 48px;
    text-align: center;
}

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


/* ---- PAGE: the sheet that holds the whole maze ---- */

#page {
    margin: 0 auto;
    max-width: 900px;
    text-align: left;
}


/* ---- MASTHEAD: the sign nailed above the entrance ---- */

#masthead {
    background: #fbf7ec;
    border: 3px solid #2f2a24;
    border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
    box-shadow: 3px 4px 0 rgba(47, 42, 36, 0.16);
    margin: 0 4px 28px;
    padding: 36px 34px 30px;
    text-align: center;
    transform: rotate(-0.35deg);
}

.kicker {
    color: #9c3f18;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

#masthead h1 {
    font-size: 54px;
    font-weight: normal;
    letter-spacing: -1px;
    line-height: 1.05;
    margin-top: 8px;
}

.tagline {
    color: #6f6657;
    margin: 10px auto 0;
    max-width: 30em;
}


/* ---- MENU: the row of links under the title ---- */

#menu {
    border-top: 1px dashed #c9bda3;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    letter-spacing: 1.5px;
    margin-top: 24px;
    padding-top: 18px;
    text-transform: uppercase;
}

#menu a,
#menu a:visited {
    border-bottom: 2px solid transparent;
    color: #4a4338;
    margin: 0 12px;
    padding-bottom: 3px;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}

#menu a:hover,
#menu a:focus {
    border-bottom-color: #9c3f18;
    color: #9c3f18;
}


/* ---- MAZE: a grid of rooms, corridors and walls ----
   Eight columns wide and eleven rows tall. Each child is pinned into place
   with "grid-column" and "grid-row", and that is what draws the map. The
   uneven border-radius below is the trick that makes a straight border
   wobble like a pencil line. */

.maze {
    background: #fbf7ec;
    border: 3px solid #2f2a24;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    display: grid;
    grid-auto-rows: minmax(78px, auto);
    grid-template-columns: repeat(8, 1fr);
    margin: 4px;
    overflow: hidden;
    position: relative;
}


/* ---- ROOMS: each room is a bordered box holding some text ----
   The border is the wall and the background is the floor. A tiny rotation
   on each room keeps the hand-drawn feel. */

.room {
    background: #fdfaf2;
    border: 3px solid #2f2a24;
    border-radius: 255px 16px 225px 16px / 16px 225px 16px 255px;
    padding: 26px 28px;
    position: relative;   /* so the doorways inside it can be positioned */
}

.room--entrance { transform: rotate(-0.25deg); }
.room--about    { transform: rotate(0.3deg); }
.room--work     { transform: rotate(0.2deg); }
.room--notes    { transform: rotate(-0.3deg); }
.room--contact  { transform: rotate(0.15deg); }


/* ---- WHERE EACH PIECE SITS IN THE GRID ----
   Line numbers, not cell numbers: line 1 is the far edge of the grid. */

.room--entrance { grid-column: 1 / 5; grid-row: 1 / 4; }
.room--about    { grid-column: 6 / 9; grid-row: 2 / 5; }
.room--work     { grid-column: 2 / 6; grid-row: 5 / 8; }
.room--notes    { grid-column: 6 / 9; grid-row: 7 / 10; }
.room--contact  { grid-column: 2 / 6; grid-row: 9 / 12; }

.corridor--ab    { grid-column: 5 / 6; grid-row: 2 / 5; }
.corridor--shaft { grid-column: 2 / 6; grid-row: 8 / 9; }

.wall--a { grid-column: 5 / 6; grid-row: 1 / 2; }
.wall--b { grid-column: 1 / 5; grid-row: 4 / 5; }
.wall--c { grid-column: 6 / 9; grid-row: 1 / 2; }
.wall--d { grid-column: 6 / 9; grid-row: 5 / 7; }
.wall--e { grid-column: 1 / 2; grid-row: 5 / 8; }
.wall--f { grid-column: 6 / 9; grid-row: 10 / 12; }
.wall--g { grid-column: 1 / 2; grid-row: 9 / 12; }
.wall--h { grid-column: 1 / 2; grid-row: 8 / 9; }


/* ---- WALLS: solid blocks of pencil hatching ----
   These fill the dead ends. They are decoration only, so the HTML hides
   them from screen readers with aria-hidden. */

.wall {
    background-color: #d9cdb3;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(47, 42, 36, 0.5) 0,
        rgba(47, 42, 36, 0.5) 1.5px,
        transparent 1.5px,
        transparent 7px
    );
    border: 2px solid #2f2a24;
    border-radius: 225px 12px 255px 12px / 12px 255px 12px 225px;
}


/* ---- CORRIDORS: the empty floor between rooms ----
   A dashed line is drawn down the middle with a pseudo-element, so the
   eye can follow the one path that leads out. */

.corridor {
    background: #f5eeda;
    position: relative;
}

.corridor::before {
    border-left: 2px dashed rgba(47, 42, 36, 0.35);
    bottom: 14px;
    content: "";
    left: 50%;
    position: absolute;
    top: 14px;
}


/* ---- DOORS: a gap punched in a room wall ----
   A doorway is a small paper-coloured tab placed over the border. Its two
   little borders are the jambs on either side of the opening. */

.door {
    background: #fdfaf2;
    position: absolute;
}

.door--right {
    border-bottom: 3px solid #2f2a24;
    border-top: 3px solid #2f2a24;
    bottom: 34%;
    right: -3px;
    top: 34%;
    width: 8px;
}

.door--left {
    border-bottom: 3px solid #2f2a24;
    border-top: 3px solid #2f2a24;
    bottom: 34%;
    left: -3px;
    top: 34%;
    width: 8px;
}

.door--top {
    border-left: 3px solid #2f2a24;
    border-right: 3px solid #2f2a24;
    height: 8px;
    left: 34%;
    right: 34%;
    top: -3px;
}

.door--bottom {
    border-left: 3px solid #2f2a24;
    border-right: 3px solid #2f2a24;
    bottom: -3px;
    height: 8px;
    left: 34%;
    right: 34%;
}

/* this door sits at the right-hand end of a wall instead of the middle */
.door--end {
    left: 62%;
    right: 6%;
}


/* ---- SMALL LABELS: the pencil marker in a room ---- */

.marker {
    color: #9c3f18;
    display: inline-block;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2.5px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.marker--start::before {
    content: "\2192";
    margin-right: 6px;
}


/* ---- TEXT: headings, paragraphs and links inside a room ---- */

.room h2 {
    font-size: 26px;
    font-weight: normal;
    line-height: 1.2;
    margin-bottom: 12px;
}

.room h2::after {
    background: #9c3f18;
    content: "";
    display: block;
    height: 3px;
    margin-top: 10px;
    width: 40px;
}

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

.room p:last-child {
    margin-bottom: 0;
}

.room a,
.room a:visited {
    border-bottom: 1px solid #d9b49c;
    color: #9c3f18;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.room a:hover,
.room a:focus {
    border-bottom-color: #5f2410;
    color: #5f2410;
}

.lead {
    color: #443d31;
    font-size: 18px;
}

.note {
    background: #f1e8d4;
    border-left: 3px solid #9c3f18;
    font-size: 14.5px;
    margin-top: 18px;
    padding: 12px 14px;
}


/* ---- QUOTE: the indented passage with a coloured bar ---- */

blockquote {
    border-left: 3px solid #9c3f18;
    color: #5c5346;
    font-size: 18px;
    font-style: italic;
    margin: 20px 0;
    padding: 2px 0 2px 18px;
}


/* ---- CHAMBERS: the list of links in room three ---- */

.chambers {
    list-style: none;
}

.chambers li {
    border-bottom: 1px dashed #d8ccb2;
    padding: 10px 0;
}

.chambers li:last-child {
    border-bottom: none;
}

.chambers a {
    font-size: 18px;
}

.chambers span {
    color: #8a8070;
    display: block;
    font-size: 13.5px;
}


/* ---- ENTRIES: the dated list in room four ---- */

.entries {
    list-style: none;
}

.entries li {
    border-bottom: 1px dashed #d8ccb2;
    padding: 10px 0;
}

.entries li:last-child {
    border-bottom: none;
}

.entries .date {
    color: #8a8070;
    display: inline-block;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 96px;
}


/* ---- TREASURE ROOM: a little warmer, with a big contact link ---- */

.room--contact {
    background: #fbf3df;
}

/* a small gold coin marks the treasure, drawn with CSS only */
.room--contact::after {
    background: radial-gradient(circle at 35% 35%, #e8c25a, #b8860b);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.22);
    content: "";
    height: 18px;
    position: absolute;
    right: 22px;
    top: 22px;
    width: 18px;
}

.room--contact h2 {
    font-size: 30px;
}

.contact-line {
    margin: 18px 0 10px;
}

.big-link {
    border-bottom: none;
    font-size: 24px;
}

.small {
    color: #8a8070;
    font-size: 13.5px;
}


/* ---- FOOTER: the required credit link ---- */

#footer {
    border-top: 3px double #c4b79a;
    color: #8a8070;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    margin: 34px 4px 0;
    padding-top: 18px;
    text-align: center;
    text-transform: uppercase;
}

#footer a,
#footer a:visited {
    color: #6f6657;
    text-decoration: none;
}

#footer a:hover {
    color: #9c3f18;
}


/* ---- NARROW SCREENS: the maze becomes a single stack of rooms ----
   The hatched walls would just be noise on a narrow screen, so they are
   hidden and the rooms line up one under the other down a dashed path. */

@media (max-width: 760px) {
    .maze {
        grid-template-columns: 1fr;
    }

    .maze .wall,
    .door {
        display: none;
    }

    .maze > * {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .corridor {
        min-height: 46px;
    }
}


/* ---- SMALL SCREENS: tighten the padding and type on phones ---- */

@media (max-width: 640px) {
    body {
        padding: 22px 10px 32px;
    }

    #masthead {
        padding: 26px 20px 22px;
    }

    #masthead h1 {
        font-size: 40px;
    }

    #menu a {
        display: inline-block;
        margin: 4px 8px;
    }

    .room {
        padding: 22px 20px;
    }

    .room--contact h2 {
        font-size: 26px;
    }

    .entries .date {
        display: block;
        margin-bottom: 4px;
        width: auto;
    }
}


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

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

    #masthead,
    .room {
        transform: none;
    }

    .wall,
    .door,
    .corridor::before {
        display: none;
    }

    .maze {
        border: none;
    }

    #menu {
        display: none;
    }
}
