/* Colors. Light by default, dark when the OS asks for it, unless the header
   toggle stored an explicit choice (data-theme on <html>, see src/theme.ts). */
:root {
    color-scheme: light dark;
    --bg: light-dark(#ffffff, #121417);
    --text: light-dark(#000000, #e4e6e8);
    --muted: light-dark(#6c757d, #9aa1a8);
    --gray: light-dark(gray, #9a9a9a);
    --accent: light-dark(#007bff, #4da3ff);
    --link: light-dark(#3a6ea5, #82b1e0);
    --terminal-header: light-dark(rgb(228, 228, 228), #3a3d42);
    --terminal-bg: light-dark(#555, #2a2d31);
    --terminal-shadow: light-dark(rgb(50 50 93 / 15%), rgb(0 0 0 / 40%));
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: Droid Sans Mono, Consolas, Lucida Console, monospace;
}

a,
a:visited {
    color: var(--text);
    text-decoration: none;
    display: inline-block;
}

a:hover {
    color: var(--text);
}

a:active {
    color: var(--accent);
}

a::after {
    width: 0;
    transition: width .35s;
    content: '';
    display: block;
    height: 0.15em;
    background: var(--accent);
    margin-top: 0.25em;
}

a:hover::after {
    width: 100%;
}

header {
    max-width: 800px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 1em;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5em 0;
}

header .title {
    font-weight: bold;
    white-space: nowrap;
}

.menu>ul {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.menu .menu-item {
    display: block;
}

/* Padding on the link itself gives a comfortable tap target */
.menu-item a {
    color: var(--muted);
    padding: 10px;
}

.menu .menu-item:last-child a {
    padding-right: 0;
}

/* Narrow screens: tighter link spacing; if the title and menu still
   don't fit side by side, the menu wraps below the title. */
@media (max-width: 480px) {
    .menu-item a {
        padding: 10px 8px;
    }

    .menu .menu-item:first-child a {
        padding-left: 0;
    }
}

.container {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

footer {
    text-align: center;
    font-size: 0.8em;
    margin: 3em 10px 20px;
}

.terminal {
    width: 100%;
    font-family: Droid Sans Mono, Consolas, Lucida Console, monospace;
    color: whitesmoke;
    margin-top: 2em;
    margin-bottom: 2em;
}

.terminal-header {
    height: 28px;
    background-color: var(--terminal-header);
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.terminal .caret {
    background: hsla(0, 0%, 97%, .65);
    animation: blink-caret 1.2s step-end infinite;
}

.terminal .caret.typing {
    animation: none;
    background: whitesmoke;
}

@keyframes blink-caret {

    from,
    to {
        background: transparent
    }

    50% {
        background: whitesmoke;
    }
}

.header-dot {
    width: 12px;
    height: 12px;
    border-radius: 50px;
    margin-left: 8px;
}

.header-dot.red {
    background-color: rgb(253, 65, 65);
    border: 1px solid #f65549;
}

.header-dot.orange {
    background-color: rgb(252, 176, 34);
    border: 1px solid #ecb338;
}

.header-dot.green {
    background-color: rgb(70, 230, 65);
    border: 1px solid rgb(69, 223, 64);
}

.terminal-content {
    background-color: var(--terminal-bg);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 50px 100px var(--terminal-shadow), 0 15px 35px rgb(50 50 93 / 20%), 0 5px 15px rgb(0 0 0 / 12%);
    padding: 20px;
}

.terminal .command::before {
    content: "\003E\A0";
}

.terminal div.command {
    margin-top: 10px;
}

.terminal .output {
    color: lightblue;
}

.terminal ul {
    list-style-type: none;
    margin-top: 0;
    padding-inline-start: 0;
}

.terminal ul > li {
    line-height: 1.5em;
}

.terminal a,
.terminal a:visited {
    color: lightblue;
    text-decoration: none;
    display: inline-block;
}

.terminal a:hover {
    color: white;
}

.terminal a:active {
    color: lightblue;
}

.job-name, .education-name {
    font-weight: bold;
    margin-top: 10px;
}

.job-time, .education-time {
    color: var(--gray);
    font-size: 0.8em;
    margin: 5px 0;
}

.job-description, .education-description {
    color: var(--gray);
}

.stack .technology {
    display: inline-block;
    font-size: 0.8em;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 10rem;
    padding: 0.25em 0.75em;
    margin-top: 10px;
    margin-right: 5px;
    cursor: default;
}

blockquote {
    border-left: 0.25em solid var(--accent);
    color: var(--muted);
    padding: 0 1em;
    margin-left: 0;
}
article img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Image captions: the italic line directly after an image */
article p:has(> img) + p:has(> em:only-child) {
    text-align: center;
    color: var(--gray);
    font-size: 0.8em;
}

/* `ls`-style listing in the terminal */
.terminal .listing {
    display: flex;
    flex-wrap: wrap;
    column-gap: 2ch;
    line-height: 1.5em;
}

.terminal .listing-name {
    color: whitesmoke;
}

.terminal .listing-name.dir {
    color: lightblue;
    /* font-weight: bold; */
}

/* Footer social icons, grey until hovered (like kuehnel.co.at) */
footer .socials {
    font-size: 1.25rem;
    margin-bottom: 0.5em;
}

footer a.social,
footer a.social:visited {
    color: var(--muted);
    margin: 0 0.3em;
    transition: color .2s;
}

footer a.social:hover,
footer a.social:focus-visible {
    color: var(--hover-color);
}

footer a.social::after {
    display: none;
}

footer .copyright {
    color: var(--muted);
}

/* Links in body text: subtle blue (header, footer and terminal keep their own colors) */
.container a:not(.terminal a),
.container a:not(.terminal a):visited {
    color: var(--link);
}

/* Hover: brighten to the accent blue */
.container a:not(.terminal a):hover {
    color: var(--accent);
}

/* Content links: plain inline links with a faint underline that turns solid on hover.
   The animated underline (global a::after) is only for the menu. */
.container a,
.container .terminal a,
.container .terminal a:visited {
    display: inline;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 0.15em;
    transition: color .2s, text-decoration-color .2s;
}

.container a:hover,
.container .terminal a:hover {
    text-decoration-color: currentColor;
}

.container a::after {
    display: none;
}

/* Dark mode toggle in the header (hidden without JS, since it can't work) */
.theme-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 10px 0 10px 10px;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s;
}

:root[data-js] .theme-toggle {
    display: block;
}

/* Sit the icon on the text baseline like a glyph, so it lines up with the
   menu links (same padding and line height as `.menu-item a`) */
.theme-toggle svg {
    vertical-align: -0.125em;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--text);
}

/* Show the moon in light mode, the sun in dark mode */
.theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
    display: inline;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-moon {
        display: none;
    }

    :root:not([data-theme="light"]) .theme-toggle .icon-sun {
        display: inline;
    }
}
