.transition (@property, @duration, @function: ease, @delay: 0s) {
    -webkit-transition: @arguments;
    -moz-transition: @arguments;
    -o-transition: @arguments;
    -ms-transition: @arguments;
    transition: @arguments;
}

.transform(...) {
    -webkit-transform: @arguments;
    -moz-transform: @arguments;
    -o-transform: @arguments;
    -ms-transform: @arguments;
    transform: @arguments;
}

.inset-white-with-shadow {
    @border-radius: 6px;
    background: white;
    border-radius: @border-radius;
    position: relative;

    &:after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        border-radius: @border-radius;
        box-shadow: 0 1px 5px #735121 inset;
    }
}

section#gold-letter, section#about-gold, section#about-gold-partners, section#postcard, .or-box {
    font-family: "Bitstream Charter", "Hoefler Text", "Palatino Linotype",
                 "Book Antiqua", Palatino, georgia, garamond, FreeSerif, serif;
}

section#gold-letter {
    @width: 944px;
    @padding: 13px;
    position: relative;
    width: @width - 2 * @padding;
    margin: 30px auto;
    padding: (@padding + 2) @padding;

    &:before, &:after {
        content: '';
        position: absolute;
        display: block;
        height: 30px;
        left: 0;
        right: 0;
        z-index: 1;
    }

    &, &:before, &:after {
        background: url(../gold/letter-bg.png) repeat-y;
    }

    &:before {
        top: 0;
    }

    & {
        background-position: -@width 0;
    }

    &:after {
        bottom: 0;
        background-position: -(@width * 2) 0;
    }

    .letter-body {
        position: relative;
        z-index: 2;
        border: 1px solid #ece9e3;
        padding: 20px 40px;
        background: url(../gold/letter-watermark.png) 360px -45px no-repeat;
        font-size: 17px;

        .logo {
            margin-bottom: .5em;
        }

        p {
            margin-bottom: 1em;
            margin-right: 3em;
        }

        .signature {
            text-align: right;
            line-height: .9em;
            margin-top: -1em;
            margin-bottom: 0;
            margin-right: 0;

            a {
                position: relative;
                margin-left: -47px;
                top: -10px;
                font-family: sans-serif;
                font-size: .75em;
            }

            &:after {
                content: '';
                display: block;
                position: absolute;
                top: 85px;
                left: 270px;
                width: 200px;
                height: 276px;
                background: url(../gold/sparklepants.png);
                z-index: 100;
                opacity: 0;
            }

            &:hover:after {
                opacity: 1;
                left: 85px;
                .transition(all, 0.70s, ease, 7s);
            }
        }
    }
}

section#about-gold, section#about-gold-partners {
    @section-width: 960px;
    width: @section-width;
    margin: 30px auto 40px;
    background: url(../gold/inner-bg.jpg) 11px repeat-y;

    h1 {
        font-weight: bold;
    }

    p {
        font-size: 18px;
    }

    .buy-gold-button, .postcard-button {
        position: relative;
        border-radius: 5px;
        box-shadow: 0 3px 0 #bca88b;

        &:active {
            top: 2px;
            box-shadow: none;
            outline: none;
        }
    }

    .buy-gold-button {
        display: inline-block;
        padding: 4px 14px;
        color: #e3d2a2;
        font-size: 22px;
        font-weight: bold;
        line-height: 26px;
        background: url(../gold/gold-button-bg.png) left top repeat-x;
        border: 3px solid #5a3f1a;
        text-shadow: 0 1px 1px #2c2c2c;

        &:after {
            content: '';
            position: absolute;
            right: -3px;
            top: -4px;
            display: block;
            width: 18px;
            height: 18px;
            background: url(../gold/shiny.png) no-repeat;
            opacity: .6;
        }

        &:hover {
            background-position: left bottom;
            color: #f2ead4;
            &:after {
                opacity: 1;
            }
        }
    }

    .postcard-button {
        padding: 4px 10px 4px 5px;
        color: #424242;
        font-size: 18px;
        background: #f5f0e6;
        border: 3px solid #656158;
        text-shadow: 0 1px 1px #bbb;

        img {
            margin-right: 9px;
            width: 48px;
            height: 58px;
            vertical-align: middle;
        }

        &:hover {
            border-color: #8d6411;
            text-shadow: 0 1px #ecbe61;
            img {
                .transform(rotate(-8deg));
            }
        }
    }

    .claim-code-button {
        .buy-gold-button;

        cursor: pointer;
        border-width: 1px;
        padding: 3px 5px;
        font-size: 16px;
        line-height: 20px;
        float: right;
        margin-top: 5px;
    }

    header {
        @width: 960px;
        @padding-right: 50px;
        @padding-top: 23px;
        position: relative;
        z-index: 5;

        &.large {
            // could use box-sizing here, but want to look semi-decent in IE7
            @height: 161px;
            @padding-left: 242px;
            width: @width - @padding-left - @padding-right;
            height: @height - @padding-top;
            padding-top: @padding-top;
            padding-left: @padding-left;
            padding-right: @padding-right;
            background: url(../gold/header-bg.jpg) no-repeat center top;

            .actions {
                margin-top: 10px;
            }
        }

        &.short {
            @height: 101px;
            @padding-left: 42px;
            width: @width - @padding-left - @padding-right;
            height: @height - @padding-top;
            padding-top: @padding-top;
            padding-left: @padding-left;
            padding-right: @padding-right;
            background: url(../gold/header-bg-short.jpg) no-repeat center top;

            .insignia {
                display: none;
            }

            h1 {
                float: left;
                line-height: 52px;
                margin: 0;
            }

            .actions {
                float: right;
            }
        }

        &:before {
            // shadow after the header
            @size: 40px;
            content: '';
            position: absolute;
            display: block;
            bottom: -@size + 2;
            left: 11px;
            right: 11px;
            height: @size;
            box-shadow: 0 @size @size -@size rgba(0, 0, 0, .35) inset;
            z-index: 1;
        }

        .insignia {
            position: absolute;
            left: 38px;
            top: 6px;
        }

        h1, p {
            display: inline;
        }

        h1 {
            font-size: 24px;
            margin-right: .5em;
        }

        .or {
            font-size: 18px;
            margin: 0 16px 0 10px;
        }
    }

    section {
        @section-height: 135px;
        height: @section-height;
        line-height: @section-height;
        margin: 0 45px;
        padding: 30px 25px;
        border-bottom: 1px solid rgba(255,255,255,.65);
        &.last {
            border-bottom: none;
        }

        h1 {
            font-size: 24px;
            font-weight: normal;
            margin: 0;
            margin-bottom: .25em;
        }

        p, ul {
            color: #555;
            font-size: 16px;
        }

        .description, .sample {
            display: inline-block;
            vertical-align: middle;
        }

        .description {
            position: relative;
            width: 460px;
            line-height: normal;

            .new-mark {
                position: absolute;
                top: -24px;
                color: #9a7d2e;
                font-size: 17px;
                font-weight: bold;
                font-style: italic;
            }
        }

        .sample {
            .inset-white-with-shadow;
            float: right;
            width: 315px;
            height: @section-height;
            margin: 0;
            text-align: center;

            & img {
                vertical-align: middle;
            }
        }

        &#partner-benefits {
            height: auto;
            line-height: inherit;
            text-align: center;

            h1 {
                text-align: center;
            }

            li {
                display: inline-block;
                padding: 10px;
                margin: 10px 12px;
                text-align: center;
                width: 210px;
                height: 110px;
                font-size: 18px;

                .label-container {
                    line-height: 2em;
                    height: 2em;
                    margin-bottom: 8px;
                }

                .partner-label {
                    display: inline-block;
                    line-height: 1em;
                    vertical-align: middle;
                }

                .logo {
                    .inset-white-with-shadow;

                    img {
                        width: 200px;
                        padding-top: 5px;
                    }
                }
            }
        }
    }

    section.etc {
        height: auto;
        line-height: normal;
        strong {
            color: black;
            font-size: 18px;
            margin-right: .5em;
        }
    }

    section#terms {
        text-align: center;
        
        #giveaway-rules {
            display: none;
            text-align: left;

            h2 {
                text-align: center;
                font-size: 2em;
                color: #000;
            }

            h3 {
                margin-top: 1em;
                font-size: small;
            }

            p {
                font-size: x-small;
            }
        }

        #prize-details {
            display: none;

            ul {
                margin-left: 20px;
                list-style-type: disc;
            }

            ul li {
                font-size: x-small;
            }
        }
    }

    footer {
        @height: 159px;
        @padding-top: 6px;
        position: relative;
        top: 10px;
        width: 960px;
        height: @height - @padding-top;
        padding-top: @padding-top;
        background: url(../gold/footer-bg.jpg) no-repeat;
        text-align: center;

        h1 {
            font-size: 26px;
        }

        p {
            margin-bottom: 18px;
        }

        &:after {
            // shadow above the footer
            @size: 10px;
            content: '';
            position: absolute;
            display: block;
            top: -@size;
            left: 11px;
            right: 11px;
            height: @size;
            box-shadow: 0 -@size @size -@size rgba(0, 0, 0, .25) inset;
            z-index: 1;
        }
    }

    header, footer {
        text-shadow: 0 2px 1px rgba(255,255,255,.5);
    }
}

section#about-gold-partners {
    input.code {
        font-weight: bold;
        font-size: 16px;
        float: right;
        max-width: 200px;
        line-height: 20px;
        text-align: center;
    }

    span.error {
        font-size: 16px;
        float: right;
    }

    section {
        .how-to-use p {
            font-size: 13px;
            font-style: italic;
            margin-top: 10px;
        }
    }
}


.or-box {
    background: #817461;
    margin: 0 auto;
    padding: 3px 0;
    width: 48px;
    border-radius: 4px;
    color: white;
    font-size: 16px;
    text-align: center;
}

a.postcard {
    display: block;
    width: 765px;
    height: 502px;
    margin: 20px auto;
}

section#postcard {
    @height: 502px;
    @padding-top: 78px;
    position: relative;
    height: @height - @padding-top;
    padding-left: 34px;
    padding-right: 390px;
    padding-top: @padding-top;
    margin-left: 32px;
    background: url(../gold/postcard.jpg);
    color: #444;
    text-align: center;

    h1 {
        span, strong {
            display: block;
            font-size: 22px;
        }

        strong {
            font-size: 32px;
        }

        .for {
            margin-top: 8px;
            margin-bottom: 0px;
        }

        .of {
            font-size: 17px;
            margin: 20px 0;
        }

        .gold-typo {
            display: inline-block;
            width: 170px;
            height: 40px;
            background: url(../gold/reddit-gold.png) no-repeat;
            text-indent: -9999px;
        }
    }

    .sticker {
        position: absolute;
        top: 174px;
        left: 306px;
        width: 85px;
        height: 86px;
        background: url(../gold/sticker.png) no-repeat;

        div {
            color: white;
            padding: 20px 0;
            font: bold 13px sans-serif;
            .transform(rotate(-15deg));
        }
    }

    &:hover .sticker {
        background-position: 0 bottom;
    }
}
