:root {
    --solid-width: 1.0rem;
    --thin-width: 0.2rem;
    --spacing: 0.1rem;
    --offset: calc(var(--solid-width) + var(--spacing));
    --bars-width: calc(var(--offset) * var(--bars-max) + 0.5rem);
}

h3 {
    margin: 0.5rem 0 0.5rem;
}

h3 > .year {
    vertical-align: text-top;
    font-size: 0.7em;
    color: #999;
}

h4 {
    margin: 0.25rem 0 0.75rem;
    font-size: 1.1rem;
}

.wrapper {
    position: relative;
}

.wrapper.project:not(:nth-child(3)) {
    padding-top: 1.5rem;
}

.year-title {
    padding: 2.5rem 0 1.7rem;
}

.wrapper:first-of-type > .year-title {
    padding-top: 0;
}

.year-title > h2 {
    text-align: center;
    margin: 0;
}

.year-title > h2::before,
.year-title > h2::after {
    content: '';
    display: inline-block;
    margin: 0 0.5em;
    height: 0.15rem;
    width: 1.25rem;
    background-color: #555;
    vertical-align: middle;
}

.project-inner {
    padding: 1.2rem 2.5rem 2rem;
    background-color: #EEE;
    margin-left: var(--bars-width);
    filter: drop-shadow(.2rem .2rem .1rem #AAA);
    z-index: 9;
    position: relative;
}

.project-inner > h4 {
    font-size: 0;
}

.project-inner > h4 > a {
    font-size: 1.1rem;
    padding: 0 1rem;
}

.project-inner > h4 > a:first-child {
    padding-left: 0;
}

.project-inner > h4 > a ~ a {
    border-left: 0.1rem solid #1C7C7C;
}

.project-inner > h4 > a:last-child {
    padding-right: 0;
}

.project-inner p {
    margin-bottom: 0;
}

.project-content {
    margin-top: 1.5rem;
    display: flex;
}

.bar {
    --pos: calc(var(--left, 0) * var(--offset));
    position: absolute;
    left: var(--pos);
    top: -0.1px;
    bottom: 0;
    border-color: var(--color);
    border-left-width: var(--thin-width);
    border-left-style: double;
    filter: drop-shadow(.2rem .2rem 0.1rem #AAA);
    z-index: calc(var(--left, 0) + 1);  /* Ensures that bar receives mouse events. */
}

.bar.end {
    top: 0.5rem;
}

.solid {
    border-left-style: solid;
    border-left-width: var(--solid-width);
}

.bar:not(.solid) {
    left: calc(var(--pos) + var(--solid-width)/2 - var(--thin-width)/2);
    filter: drop-shadow(.2rem .2rem 0.1rem #AAA);
}

.bar-horizontal {
    --pos: calc(var(--left, 0) * var(--offset) + var(--solid-width) - 0.1px);
    position: absolute;
    bottom: 0px;
    left: var(--pos);
    width: calc(var(--bars-width) - var(--pos) + 0.2px);
    border-color: var(--color);
    border-bottom-width: var(--thin-width);
    border-bottom-style: solid;
    filter: drop-shadow(.2rem .2rem 0.1rem #AAA);
    z-index: calc(var(--left, 0) + 1);
}

.popup {
    --connector-size: 1rem;
    left: calc(var(--left, 0) * var(--offset) +
               var(--solid-width) + var(--connector-size));
    display: none;
    padding: 1rem;
    position: absolute;
    background-color: var(--color, #555);
    filter: drop-shadow(.2rem .1rem .2rem #666);
    z-index: 10;
}

.popup a {
    color: var(--popup-text-color, white);
}

.popup-connector {
    position: absolute;
    top: calc(50% - var(--connector-size));
    left: calc(-1 * var(--connector-size) + 0.1px);
    border-top: var(--connector-size) solid transparent;
    border-bottom: var(--connector-size) solid transparent;
    border-right: var(--connector-size) solid var(--color, #555);
}

.popup-title {
    font-size: 1.3rem;
    font-weight: normal;
}

.popup-title > span {
    vertical-align: text-top;
    font-size: 0.7em;
    filter: brightness(75%);
}

@media screen and (min-width: 50em) {
    .project-content img {
        margin-right: 1.5rem;
        float: left;
        max-width: 27rem;
    }
    .project-content img.portrait {
        max-height: 25rem;
        width: auto;
    }
}

@media screen and (max-width: 49.999em) {
    :root:not(.expanded) {
        --solid-width: 0.2rem;
        --thin-width: 0.1rem;
        --spacing: 0.1rem;
    }

    .project-content img {
        display: block;
        width: 100%;
    }
    .project-content img.portrait {
        max-height: 25rem;
        width: auto;
    }
}
