/* global.css */

@import url('./colors.css');

@font-face {
    font-family: 'Hack';
    src: url('/fonts/Hack-Bold.ttf') format('truetype');
}

html * {
    box-sizing: border-box;
}

html, body {
    background-color: var(--terminal-background);
    color: var(--font-color);
    height: 100%;
    width: 100%;
    margin: 0;
    font-family: var(--font-family-mono);
}

body {
    padding: calc(var(--baseline)*2) calc(var(--baseline)*2) calc(var(--baseline)*4) calc(var(--baseline)*2)
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

p {
    text-align: justify;
    margin: calc(var(--baseline)/2) 0;
    font-size: var(--font-size-md);
    line-height: 1.5;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: var(--baseline);
}
.navigation > * {
    padding-right: var(--baseline);
}

.directory {
    cursor: pointer;
    color: var(--directory-color);
}

.directory:hover {
    text-decoration: underline;
}

.soundLink {
    color: var(--wav-color);
    cursor: pointer;
}

.subdirectory { display: none; flex-wrap: wrap; }
.subdirectory > * { padding-right: calc(var(--baseline)*2) }

/* the terminal "session" fiction — a prompt line and a blinking cursor; shared
   by / and /portfolio (was pages/home.css) */
.prompt { color: var(--wav-color); text-align: left; }   /* wraps on narrow paths — never justify */
.prompt .path { color: var(--directory-color); }
.prompt .dollar { color: var(--font-bright); }
.prompt .cmd { color: var(--font-bright); }
.prompt--top { margin-bottom: var(--baseline); }
.prompt--idle { margin-top: var(--baseline); }

.cursor {
    display: inline-block;
    width: 0.65em;
    height: 1.1em;
    background: var(--font-color);
    vertical-align: text-bottom;
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* layout & spacing utilities — replacements for the old inline styles */
.page { display: flex; flex-direction: column; }
.row { display: flex; }
.pb-1 { padding-bottom: var(--baseline); }
.pb-2 { padding-bottom: calc(var(--baseline)*2); }
.pb-4 { padding-bottom: calc(var(--baseline)*4); }
.mb-1 { margin-bottom: var(--baseline); }
.important { color: var(--important-color); }

/* scrollbars — squared-off, token-colored, matching the terminal chrome.
   scrollbar-color is inherited, so it crosses shadow boundaries (modal body,
   code blocks) on its own; where it's supported it also disables the
   ::-webkit-scrollbar rules below, which exist only for Safari */
html {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
::-webkit-scrollbar { width: 12px; height: 12px; background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
::-webkit-scrollbar-corner { background: var(--scrollbar-track); }

/* until siteModal.js upgrades the element, <site-modal> is unknown markup and
   its slotted children (img, cv iframe, …) would render in the page flow,
   then jump away when the dialog takes them — a layout shift on hard reload */
site-modal:not(:defined) { display: none; }
/* same guard for <blog-post>: its host page shows nothing until the module
   upgrades it, instead of an empty box that grows on hydration */
blog-post:not(:defined) { display: none; }

@media screen and (max-width: 420px) {
    body {
        padding: calc(var(--baseline)*2) var(--baseline)  calc(var(--baseline)*3) var(--baseline) ;
    }
}

