﻿:root {
    --background: #16161d;
    --greet: #ff6319; /* red/orange */
    --name: #fdbb12; /* yellow */
    --past: #01b2db; /* blue */
    --present: #6cbe45; /* green */
    --contact: #db5aa2; /* pink */
}

@media (prefers-color-scheme: light) {
    :root {
        --background: #faf9f4;
        --greet: #ff1300;
        --name: #fd8012;
        --past: #018af4;
        --present: #4ebe45;
        --contact: #d230b3;
    }
}

@font-face {
    font-family: "Peachi";
    src: url("fonts/peachi.woff2") format("woff2");
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

body {
    background: var(--background);
    font-family: "Peachi", sans-serif;
    font-size: 2.2em;
    padding: 1.25em;
    margin: 0;
}

.wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25em;
}

.line {
    white-space: nowrap;
    margin: 0;
    line-height: 1.25em;
    opacity: 0;
    animation: lineFade 0.75s ease forwards;
}

.greet {
    color: var(--greet);
}

.name {
    color: var(--name);
}

.jobinfo {
    color: var(--present);
}

.contact {
    color: var(--contact);
}

.history {
    white-space: normal;
}

.history-summary {
    cursor: pointer;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    color: var(--past);
    border-bottom: 0.05em dotted currentColor;
    padding-bottom: 0.05em;
    user-select: text;
}

.history-summary::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 0.3em solid transparent;
    border-right: 0.3em solid transparent;
    border-top: 0.35em solid currentColor;
    transform-origin: 50% 40%;
    transition: transform 0.25s ease;
}

.history.open .history-summary::after {
    transform: rotate(180deg);
}

.history.closing .history-summary::after {
    transform: rotate(0deg);
}

.history-summary:focus-visible {
    outline: 2px dotted currentColor;
    outline-offset: 0.1em;
}

.history-content {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.3em;
    opacity: 0;
    transform: translateY(0.2em);
    color: var(--past);
    overflow: hidden;
    max-height: var(--history-content-height, 0);
    transition: max-height 0.75s ease, margin-top 0.75s ease;
    will-change: opacity, transform, max-height, margin-top;
}

.history.open .history-content {
    opacity: 1;
    transform: translateY(0);
}

.history.opening .history-content {
    animation: lineFade 0.75s ease forwards;
}

.history.closing .history-content {
    animation: lineFade 0.75s ease reverse forwards;
    margin-top: 0;
}

a {
    color: inherit;
}

::selection,
::-moz-selection {
    background-color: rgba(255, 255, 255, 0.1);
}

.greet::selection,
.greet *::selection,
.greet::-moz-selection,
.greet *::-moz-selection {
    background-color: var(--greet);
    color: #fff;
}

.name::selection,
.name *::selection,
.name::-moz-selection,
.name *::-moz-selection {
    background-color: var(--name);
    color: #fff;
}

.history-summary::selection,
.history-summary *::selection,
.history .history-content::selection,
.history .history-content *::selection,
.history-summary::-moz-selection,
.history-summary *::-moz-selection,
.history .history-content::-moz-selection,
.history .history-content *::-moz-selection {
    background-color: var(--past);
    color: #000;
}

.jobinfo::selection,
.jobinfo *::selection,
.jobinfo::-moz-selection,
.jobinfo *::-moz-selection {
    background-color: var(--present);
    color: #000;
}

.contact::selection,
.contact *::selection,
.contact::-moz-selection,
.contact *::-moz-selection {
    background-color: var(--contact);
    color: #fff;
}

@keyframes lineFade {
    from {
        opacity: 0;
        transform: translateY(0.2em);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.line:nth-child(1) {
    animation-delay: 0.05s;
}

.line:nth-child(2) {
    animation-delay: 0.25s;
}

.line:nth-child(3) {
    animation-delay: 0.45s;
}

.line:nth-child(4) {
    animation-delay: 0.65s;
}

.line:nth-child(5) {
    animation-delay: 0.85s;
}

@media (max-width: 600px) {
    body {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        padding: clamp(0.75rem, 5vw, 1.25rem);
    }

    .line {
        white-space: normal;
    }

    .history-summary {
        flex-wrap: wrap;
    }
}
