/*
 * prosolve_ — tiling-desktop / terminal theme.
 */

:root {
    --primary: #ff3e3e;
    --primaryDeep: #d90429;
    --primaryGlow: rgba(255, 62, 62, 0.35);
    --bg: #0b0b0c;
    --surface: #111113;
    --surfaceRaised: #17171a;
    --border: #2a2a2f;
    --text: #e8e8ea;
    --textDim: #7d7d86;
    --textFaint: #4a4a52;
    --white: #fafbfc;
    --gap: clamp(0.5rem, 1vw, 0.875rem);
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --pixel: "Jersey 10", var(--mono);
    font-family: var(--mono);
    font-size: 15px;
    color: var(--text);
}

*, *:before, *:after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 62, 62, 0.12), transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(217, 4, 41, 0.10), transparent 45%),
        var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* faint dot grid "wallpaper" */
body:before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
    z-index: 0;
}

::selection {
    background: var(--primary);
    color: var(--bg);
}

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

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.red { color: var(--primary); }
.dim { color: var(--textDim); }

/*-- -------------------------- -->
<---          Desktop           -->
<--- -------------------------- -*/

.desktop {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    padding: var(--gap);
}

/*-- -------------------------- -->
<---          Top bar           -->
<--- -------------------------- -*/

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    background: rgba(17, 17, 19, 0.85);
    border: 1px solid var(--border);
}

.bar-workspaces {
    display: flex;
    gap: 0.25rem;
}

.ws {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.4rem;
    color: var(--textDim);
}

.ws-active {
    background: var(--primary);
    color: var(--bg);
    font-weight: 800;
}

.bar-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bar-clock {
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

/*-- -------------------------- -->
<---       Tiled windows        -->
<--- -------------------------- -*/

.tiles {
    flex: 1;
    display: grid;
    gap: var(--gap);
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
}

.win {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(17, 17, 19, 0.92);
    border: 2px solid var(--border);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.win.is-focused {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primaryDeep), 0 0 40px -10px var(--primaryGlow);
}

.win-head {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    font-size: 0.72rem;
    color: var(--textDim);
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.04em;
}

.win.is-focused .win-head {
    color: var(--text);
}

.win-dims {
    color: var(--textFaint);
}

.win.is-focused .win-dims {
    color: var(--primary);
}

.win-body {
    flex: 1;
    padding: clamp(1rem, 2.5vw, 1.75rem);
}

/*-- -------------------------- -->
<---        Hero terminal       -->
<--- -------------------------- -*/

.line {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.prompt { color: var(--primary); font-weight: 700; }
.path { color: var(--white); }
.caret { color: var(--textDim); }

.typed {
    display: inline-block;
    vertical-align: bottom;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: type calc(var(--n) * 0.06s) steps(var(--n)) var(--d) forwards;
}

@keyframes type {
    to { width: calc(var(--n) * 1ch); }
}

.reveal {
    opacity: 0;
    animation: reveal 0.35s ease-out var(--d) forwards;
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.topper {
    margin: 1.5rem 0 0;
    color: var(--textDim);
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    letter-spacing: 0.1em;
}

.wordmark {
    position: relative;
    margin: 0 0 1.5rem;
    font-family: var(--pixel);
    font-weight: 400;
    font-size: clamp(5rem, 17vw, 13.5rem);
    line-height: 0.9;
    letter-spacing: -0.01em;
    color: var(--white);
    text-shadow: 0.04em 0.04em 0 var(--primaryDeep);
}

/* glitch slice, fires occasionally */
.wordmark:after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary);
    text-shadow: none;
    clip-path: inset(0 0 100% 0);
    animation: glitch 6s steps(1) 3.5s infinite;
    pointer-events: none;
}

@keyframes glitch {
    0%, 92%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
    93% { clip-path: inset(20% 0 55% 0); transform: translateX(-0.03em); }
    95% { clip-path: inset(60% 0 15% 0); transform: translateX(0.04em); }
    97% { clip-path: inset(40% 0 40% 0); transform: translateX(-0.02em); }
}

.cursor {
    color: var(--primary);
    animation: blink 1.1s steps(1) infinite;
}

.cursor.block {
    display: inline-block;
    width: 0.6em;
    background: var(--primary);
}

@keyframes blink {
    50% { opacity: 0; }
}

.manifesto {
    margin: 0 0 1.75rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary);
    max-width: 52ch;
}

.manifesto p {
    margin: 0;
    font-size: clamp(1rem, 1.7vw, 1.3rem);
    line-height: 1.55;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--white);
}

.hl-dim {
    color: var(--textDim);
}

mark {
    background: var(--primary);
    color: var(--bg);
    padding: 0 0.2em;
    font-weight: 800;
}

/*-- -------------------------- -->
<---           Fetch            -->
<--- -------------------------- -*/

.fetch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

/* profile.png is a round photo inside transparent padding; crop to the circle */
.avatar {
    --w: 8.5rem;
    --s: calc(var(--w) / 236);
    position: relative;
    flex: none;
    width: var(--w);
    height: var(--w);
    overflow: hidden;
    background: var(--primary);
    border: 2px solid var(--primary);
}

.avatar img {
    display: block;
    width: calc(427 * var(--s));
    height: auto;
    margin-left: calc(-95 * var(--s));
    margin-top: calc(-190 * var(--s));
    /* filter: grayscale(1); */
    mix-blend-mode: normal;
}

.fetch-info {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.7;
    min-width: 0;
}

.fetch-info div {
    display: flex;
    gap: 0.5rem;
}

.fetch-info dt {
    min-width: 5.5rem;
    color: var(--primary);
    font-weight: 700;
}

.fetch-info dt:after {
    content: ":";
}

.fetch-info dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.fetch-user {
    font-weight: 800;
}

.fetch-rule {
    color: var(--textFaint);
    overflow: hidden;
}

.swatches {
    margin-top: 0.75rem;
    gap: 0 !important;
}

.swatches i {
    display: block;
    width: 1.5rem;
    height: 1rem;
    background: var(--c);
}

/*-- -------------------------- -->
<---          Contact           -->
<--- -------------------------- -*/

.code pre {
    margin: 0 0 1.5rem;
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
}

.kw { color: var(--primary); }
.const { color: var(--white); font-weight: 700; }
.fn { color: #ff9a9a; }
.str { color: var(--textDim); }

.run {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    background: var(--primary);
    color: var(--bg);
    font-weight: 800;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.run .red { color: inherit; }

.run:before {
    content: "";
    position: absolute;
    inset: 0;
    width: 0;
    background: var(--white);
    z-index: -1;
    transition: width 0.3s;
}

.run:hover {
    text-decoration: none;
}

.run:hover:before {
    width: 100%;
}

.run-key {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border: 2px solid currentColor;
}

.run-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.run:hover .run-arrow {
    transform: translateX(4px);
}

.hint {
    margin: 1rem 0 0;
    font-size: 0.72rem;
    color: var(--textDim);
}

kbd {
    font-family: inherit;
    padding: 0 0.35em;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    color: var(--text);
}

/*-- -------------------------- -->
<---        Status line         -->
<--- -------------------------- -*/

.statusline {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    font-size: 0.72rem;
    background: var(--surfaceRaised);
    border: 1px solid var(--border);
}

.statusline .mode {
    padding: 0.35rem 0.75rem;
    background: var(--primary);
    color: var(--bg);
    font-weight: 800;
}

.statusline .seg {
    padding: 0.35rem 0.75rem;
    border-right: 1px solid var(--border);
    color: var(--textDim);
    white-space: nowrap;
}

.statusline .seg-right {
    margin-left: auto;
    border-right: 0;
    border-left: 1px solid var(--border);
}

/*-- -------------------------- -->
<---         Breakpoints        -->
<--- -------------------------- -*/

@media (max-width: 47.99rem) {
    .bar-title .dim,
    .statusline .seg-right,
    .hint {
        display: none;
    }
    .statusline .seg {
        flex: 1 1 100%;
        border-right: 0;
        border-top: 1px solid var(--border);
    }
    .statusline .mode {
        flex: 1 1 100%;
    }
}

/* Tablet - 768px */
@media (min-width: 48rem) {
    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .win-hero {
        grid-column: 1 / -1;
    }
}

/* Desktop - 1100px: hyprland-style master + stack */
@media (min-width: 68.75rem) {
    .desktop {
        height: 100vh;
        min-height: 40rem;
    }
    .tiles {
        grid-template-columns: minmax(0, 1.65fr) minmax(22rem, 1fr);
        grid-template-rows: 1fr 1fr;
        align-content: stretch;
        min-height: 0;
    }
    .win-hero {
        grid-column: 1;
        grid-row: 1 / span 2;
    }
    .win-hero .win-body {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .win-body {
        overflow: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after {
        animation: none !important;
        transition: none !important;
    }
    .typed { width: auto; }
    .reveal { opacity: 1; }
}
