* {
    box-sizing: border-box;
}

:root {
    --image-size: 20rem;
    --shadow-size: 0.5rem;
    --body-bg: hsl(60, 100%, 93.9%);
    --header-bg: hsl(204.4, 90%, 88.2%);
    --text-color: black;
    --bg1: hsl(204.4, 90%, 88.2%);
    --shadow-color: hsl(204.4, 90%, 28.2%);
    --link-color: hsl(0, 64.9%, 43.1%);
    --header-font: 'goudy_bookletter_1911regular';
    --max-width: 60rem;
    --border-radius: 1rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --body-bg: hsl(60, 100%, 5.9%);
        --header-bg: hsl(204.4, 90%, 18.2%);
        --text-color: white;
        --bg1: hsl(204.4, 90%, 18.2%);
        --shadow-color: hsl(204.4, 90%, 28.2%);
        --link-color: hsl(0, 64.9%, 88.1%);
    }
}

html {
    font-size: 18px;
}
body {
    color: var(--text-color);
    font-family: sans-serif;
    background: var(--body-bg);
    padding-bottom: 5rem;
    margin: 0;
}
p {
    line-height: 1.3em;
}
body > main {
    padding: 0 1rem;
}
body > main > p, body > main > figure { 
    max-width: var(--max-width);
    margin: 1em auto;
    font-size: 1.2rem;
}
figure > svg, figure > img {
    width: 100%;
    height: auto;
}
figure > figcaption {
    text-align: center;
}
a {
    color: var(--link-color);
}
a > p:only-child {
    display: inline;
    margin: 0;
}
h2,h3,h4,h5,h6 {
    font-family: var(--header-font);
    word-break: break-word;
}
h2 a, h3 a, h4 a, h5 a, h6 a {
    text-decoration: none;
}

body > header {
    text-align: center;
    margin-bottom: 0;
    padding: 1rem;
    background: var(--header-bg);
}
body > header h1 {
    margin: 0;
    font-family: var(--header-font);
    font-size: 4.5rem;
    font-weight: normal;
    line-height: 1em;
}
body > header a {
    text-decoration: none;
    color: inherit;
}
body > header p {
    font-family: var(--header-font);
    font-size: 1.25rem;
    margin: 1rem 0 0 0;
}
.row {
    max-width: var(--max-width);
    display: grid;
    grid-auto-flow: dense;
    grid-gap: 0rem;
    margin: 0 auto;
    align-items: center;
    justify-items: center;
    grid-gap: 1em;
}
.row:nth-child(odd) {
    grid-template-columns: var(--image-size) 1fr;
    grid-template-areas: "logo text";
}
.row:nth-child(even) {
    grid-template-columns: 1fr var(--image-size);
    grid-template-areas: "text logo";
}
.row.full {
    grid-template-columns: 1fr;
}
.row:not(:last-child) {
    margin-bottom: 2rem;
}
.text {
    background: var(--bg1);
    padding: 2em;
    grid-area: text;
    width: 100%;
    border-radius: var(--border-radius);
}
.text p:first-child {
    margin-top: 1rem;
}
.logo {
    grid-area: logo;
    align-self: center;
    justify-self: center;
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--border-radius);
    border: 0.3rem solid var(--bg1);
}
.logo, .text {
    box-shadow: calc(-1*var(--shadow-size)) var(--shadow-size) var(--shadow-color);
}
.row:nth-child(odd) .logo,
.row:nth-child(odd) .text {
    box-shadow: var(--shadow-size) var(--shadow-size) var(--shadow-color);
}
h3 a {
    color: var(--text-color);
}

#intro.with-image {
    display: grid;
    grid-template-columns: 10em 1fr;
    grid-gap: 1em;
}

#intro.with-image img {
    width: 100%;
    border-radius: var(--border-radius);
}


#intro {
    max-width: var(--max-width);
    background: var(--bg1);
    padding: 1em;
    font-size: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-size) var(--shadow-size) var(--shadow-color);
    margin: 2rem auto 5rem auto;
}
#intro p:first-child {
    margin-top: 0;
}
#intro p:last-child {
    margin-bottom: 0;
}

#accounts ul {
    padding: 0;
}

.info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}
nav {
    margin: 1rem 0 3rem 0;
}
nav ul {
    padding: 0;
    display: grid;
    grid-gap: 1em;
    justify-content: center;
    font-family: var(--header-font);
    list-style: none;
    grid-template-columns: repeat( auto-fit, 6em );
    max-width: 60vw;
    margin: 0 auto;
}
nav a {
    text-decoration: none;
}
nav .current a {
    font-weight: bold;
    text-transform: capitalize;
    text-decoration: underline;
}

body > nav  .contact {
    grid-column: -1;
}

body.item main {
    max-width: 40rem;
    margin: 0 auto;
}
main h2 {
    text-align: center;
    font-size: 3rem;
    border-bottom: 0.1em solid var(--text-color);
}
body.item .main-image {
    width: 100%;
    border-radius: var(--border-radius);
}

.item .info .links {
    margin: 0;
    list-style: none;
}

.item .info .links li ~ li {
    margin-top: 1em;
}

.item .info .homepage {
    font-weight: bold;
    font-size: 1.1em;
}

.item .broken {
    font-weight: bold;
    font-style: italic;
}


.items .info {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    grid-template-areas: 
    "time name section" ". links links";
    grid-gap: 0.5em 1em;
    margin-bottom: 2em;
}
.items .info h3 { 
    font-size: 2rem;
    margin: 0;
    grid-area: name;
}
.items .info time { 
    grid-area: time;
}
.items .info .section {
    grid-area: section;
    font-style: italic;
}
.items .info .links {
    grid-area: links;
    justify-self: start;
    padding: 0;
    text-align: start;
    font-size: 1em;
    word-break: break-all;
}

.item .more-info {
    font-style: italic;
}
.items .item footer {
    display: grid;
    justify-content: center;
}

.item section.links {
    margin-top: 5rem;
}

.item section.links > h3 {
    border-bottom: 1px solid var(--text-color);
}

body.contact dl {
    font-size: 2rem;
    display: grid;
    grid-template-columns: auto auto;
    grid-gap: 2em 0.5em;
    justify-content: center;
}
body.contact dt {
    grid-column: 1;
    justify-self: end;
    font-weight: bold;
}
body.contact dt::after {
    content: ':'
}
body.contact dd {
    grid-column: 2;
    margin: 0;
}
body.contact dd a {
    text-decoration: none;
}
body.contact dd a.deprecated {
    text-decoration: line-through;
}

@media only screen and (max-width: 60rem) {
    html {
        font-size: 16px;
    }
    body > header h1 {
        font-size: 2rem;
        word-break: break-word;
    }
    .row:nth-child(n) {
        grid-template-columns: 1fr;
        grid-template-areas: "logo" "text";
        grid-gap: 0.5rem;
    }
    .row:not(:last-child) {
        margin-bottom: 3rem;
    }
    .row:nth-child(n) .logo {
        box-shadow: var(--shadow-size) var(--shadow-size) var(--shadow-color);
    }
    .logo {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        max-height: 50vh;
    }
    .item .info .links a {
        max-width: 100%;
        overflow-x: hidden;
        word-break: break-all;
    }

    #intro.with-image {
        grid-template-columns: 1fr;
        grid-gap: 1em;
    }

    #intro.with-image img {
        max-height: 30vh;
        max-width: 90vw;
        width: auto;
        justify-self: center;
    }

    body > header h1 {
        font-size: 2rem;
        word-break: break-word;
    }

    body.contact dl {
        padding: 0 1em;
        font-size: 1rem;
        display: block;
    }
    body.contact dd {
        grid-column: 1;
    }
    body.contact dd ~ dt {
        margin-top: 1em;
    }

    #intro {
        font-size: 1.2rem;
    }
}

@media only screen and (max-width: 300px) {
    :root {
        --border-radius: 0;
    }
    html {
        font-size: 16px;
    }
    body > nav ul {
        display: flex;
        flex-wrap: wrap;
    }
    body > main {
        padding: 0;
    }
    body > main > p {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    main p {
        word-break: break-all;
    }
    #intro {
        font-size: 1rem;
    }
    .items .info {
        grid-template-columns: 1fr;
        grid-template-areas:
            "time"
            "name"
            "links"
        ;
    }
    .items .info h3 {
        font-size: 1.5rem;
    }
}
