:root {
    --monospace-font: 'Victor Mono', monospace;
    --retro-font: 'IBM EGA', monospace;

    --font-size: 13px;

    --background-color: #111;
    --text-color: lightgreen;

    --color-cyan: #55ffff;
    --color-yellow: #ffff55;
    --color-magenta: #ff55ff;
    --color-blue: #5555ff;
    --color-gray: lightgray;

    --icon-base-size: 100px;

    --thumbnail-base-width: calc(512px / 2);
    --thumbnail-base-height: calc(342px / 2);

    --image-resize-factor: 0.5;

    --moon-font-size: 2px;
    --title-font-size: min(1.6vw, 1rem);
    --subtitle-font-size: 1.5rem;

    --icon-size: calc(var(--image-resize-factor) * var(--icon-base-size));
    --thumbnail-width: calc(var(--image-resize-factor) * var(--thumbnail-base-width));
    --thumbnail-height: calc(var(--image-resize-factor) * var(--thumbnail-base-height));
}

@media (min-width: 600px) {
    :root {
        --font-size: 14px;
        --image-resize-factor: 0.75;
        --subtitle-font-size: 2.5rem;
    }
}

@media (min-width: 800px) {
    :root {
        --font-size: 16px;
        --image-resize-factor: 1;
        --moon-font-size: 3px;
        --subtitle-font-size: 3rem;
    }
}

.visually-hidden {
    clip-path: inset(50%);
    clip: rect(0 0 0 0);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

html, body {
    font-size: var(--font-size);
    height: 100%;
}

body {
    background: var(--background-color);
    color: var(--text-color);
}

a {
    border-bottom: 2px dotted var(--text-color);
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
}

a:hover, a:focus {
    border-style: solid;
}

a:active {
    border-bottom-width: 3px;
    border-style: solid;
}

h2 {
    font-size: 1.75rem;
    font-style: italic;
}

h2::before {
    font-family: var(--retro-font);
    font-size: 1.25em;
    font-style: normal;
    margin-inline-end: 0.75rem;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

p {
    line-height: 1.5;
}

main {
    margin: 0 auto;
    max-width: 900px;
    padding: 1rem 2rem;
}

header {
    align-items: center;
    display: flex;
    flex-direction: column;
    grid-area: heading;
}

article {
    display: flex;
    flex-flow: column;
    font-family: var(--monospace-font);
    gap: 3rem;
    padding: 1rem;
}

@media (min-width: 800px) {
    article {
        display: grid;
        grid-template-areas:
            "heading heading"
            "intro intro"
            "moon moon"
            "hits hits"
            "apps skills"
            "faq contact";
        grid-template-columns: 60% 40%;
    }
 }


section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

section > section {
    padding: 1.5rem 0;
}

.title {
    font-size: var(--title-font-size);
    text-align: center;
    white-space: pre;
}

.subtitle {
    font-size: var(--subtitle-font-size);
}

.subtitle .decoration {
    font-size: 0.5em;
}

.subtitle .text {
    color: var(--color-gray);
    font-family: var(--retro-font);
}

.highlight {
    animation: hilite 1s ease-in-out 0s forwards;
    background-position: 100%;
    background-size: 200% 200%;
    background-image: linear-gradient(90deg, var(--text-color) 49.99%, var(--background-color) 50%);
    font-weight: 600;
    padding: 0 0.5rem;
}

/* Sections */

.intro {
    grid-area: intro;
    font-size: 1.3rem;
}

.moon-container {
    grid-area: moon;
    display: flex;
    justify-content: center;
}

.greatest-hits {
    grid-area: hits;
    font-size: 1.25rem;
}

.apps {
    grid-area: apps;
}

.apps > h2::before {
    content: '♠';
    color: var(--color-cyan);
}

.skills {
    grid-area: skills;
}

.skills > h2::before {
    content: '♣';
    color: var(--color-yellow);
}

.contact {
    grid-area: contact;
}

.contact > h2::before {
    content: '♥';
    color: var(--color-magenta);
}

.colophon {
    grid-area: faq;
}

.colophon > h2::before {
    content: '♦';
    color: var(--color-blue);
}

/* Lists */

.thumbnail-list {
    display: flex;
    flex-flow: column;
    gap: 2.5rem;
}

.thumbnail-list li {
    display: flex;
    flex-flow: column;
    font-size: 1.2rem;
    gap: 2rem;
    line-height: 1.5;
}

@media (min-width: 600px) {
    .thumbnail-list li {
        flex-flow: row;
    }
}


.text-list {
    display: flex;
    flex-flow: column;
    gap: 1.5rem;
    padding: 0 1rem;
}

.text-list li {
    line-height: 1.5;
}

.icon-list {
    display: flex;
    flex-flow: column;
    gap: 1.5rem;
}

.icon-list li {
    display: flex;
    gap: 1.5rem;
    line-height: 1.5;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.word-list li {
    display: inline-block;
    line-height: 1.5;
    margin: 0.5rem;
}

/* Graphics */

.moon {
    color: var(--color-gray);
    font-size: var(--moon-font-size);
    line-height: 1;
    white-space: pre;
}

.thumbnail, .icon {
    background-color: var(--color-gray);
    mask-size: cover;
}

.thumbnail {
    border-radius: 1rem;
    flex: 0 0 var(--thumbnail-width);
    height: var(--thumbnail-width);
    width: 100%;
}

@media (min-width: 600px) {
    .thumbnail {
        height: var(--thumbnail-height);
        width: var(--thumbnail-width);
    }
}

.icon {
    border-radius: 0.5rem;
    flex: 0 0 var(--icon-size);
    height: var(--icon-size);
    width: var(--icon-size);
}

.thumbnail-covid {
    mask-image: url('../images/hits-covid-tracker-mask.png');
}

.thumbnail-elections {
    mask-image: url('../images/hits-election-map-mask.png');
}

.thumbnail-pandora {
    mask-image: url('../images/hits-pandora-papers-mask.png');
}

.thumbnail-migrants {
    mask-image: url('../images/hits-channel-migrants-mask.png');
}

.icon-disc {
    mask-image: url('../images/app-disc-mask.png');
}

.icon-babybaby {
    mask-image: url('../images/app-babybaby-mask.png');
}

.icon-bulas {
    mask-image: url('../images/app-bulas-mask.png');
}

.icon-genericos {
    mask-image: url('../images/app-genericos-br-mask.png');
}

/* Animations */

.reveal {
    animation: reveal 2s linear 1 forwards;
    clip-path: inset(0 0 100% 0);
}

@keyframes reveal {
    0% {
        clip-path: inset(0 0 100% 0);
    }

    100% {
        clip-path: inset(0 0 0 0);
    }

}

.highlight--1 {
  animation-delay: 0.5s;
  animation-duration: 0.5s;
}

.highlight--2 {
  animation-delay: 0.75s;
  animation-duration: 1s;
}

.highlight--3 {
  animation-delay: 1.25s;
  animation-duration: 0.5s;
}

.highlight--4 {
  animation-delay: 1.5s;
  animation-duration: 0.5s;
}

.highlight--5 {
  animation-delay: 1.75s;
  animation-duration: 0.5s;
}

.highlight--6 {
  animation-delay: 2s;
  animation-duration: 0.5s;
}

@keyframes hilite {
  0% {
    background-position: 100%;
    color: var(--text-color);
  }

  100% {
    background-position: 0%;
    color: var(--background-color);
  }
}