/* =========================================================
   IO|HAZE — terminal / CLI design
   Concept: the wordmark IO|HAZE reads as a Unix pipe
   (IO = input/output, | = pipe). The whole site is framed
   as a terminal session.
   ========================================================= */

:root {
    --bg:        #0b0d0c;
    --bg-2:      #111413;
    --bg-3:      #161a18;
    --line:      #25302c;
    --line-hot:  #2f3d39;
    --fg:        #d6e2dc;
    --fg-dim:    #7d8c87;
    --fg-mute:   #4a5550;

    --red:       #ff3030;
    --red-soft:  #ff6464;
    --green:     #38d97a;
    --amber:     #ffb02e;
    --cyan:      #6ad7ff;
    --violet:    #c08cff;

    --mono:      'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --display:   'Orbitron', sans-serif;

    --max:       1100px;
    --pad:       28px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #050706;
    color: var(--fg);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

body {
    background:
        radial-gradient(ellipse at 50% 0%, #0e1311 0%, #050706 60%);
}

a { color: var(--red-soft); text-decoration: none; }
a:hover { color: var(--red); }
em { font-style: normal; color: var(--amber); }
address { font-style: normal; }

/* ---------- CRT effects --------------------------------- */

.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.025) 0px,
        rgba(255, 255, 255, 0.025) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: overlay;
    opacity: 0.6;
}

.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 100%);
}

/* ---------- Terminal frame ------------------------------ */

.terminal {
    position: fixed;
    top: 28px;
    bottom: 28px;
    left: 20px;
    right: 20px;
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow:
        0 0 0 1px rgba(255, 48, 48, 0.05),
        0 30px 80px -20px rgba(0, 0, 0, 0.7),
        0 0 120px -30px rgba(255, 48, 48, 0.15);
    overflow: hidden;
}

.terminal-bar, .statusbar { flex-shrink: 0; }

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #1a1f1d 0%, #131816 100%);
    border-bottom: 1px solid var(--line);
}
.dots { display: flex; gap: 8px; }
.dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    box-shadow: inset 0 -1px 1px rgba(0,0,0,0.3);
}
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.terminal-bar .title {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--fg-dim);
    letter-spacing: 0.04em;
}
.terminal-bar .meta {
    font-size: 11px;
    color: var(--fg-mute);
    letter-spacing: 0.06em;
}

.terminal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 36px var(--pad) 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}
.terminal-body::-webkit-scrollbar { width: 10px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb {
    background: var(--line);
    border: 2px solid var(--bg);
    border-radius: 6px;
}
.terminal-body::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ---------- Boot / masthead ----------------------------- */

.boot {
    margin-bottom: 56px;
}

.boot-log {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--fg-dim);
    background: transparent;
    margin: 0 0 28px;
    line-height: 1.7;
    white-space: pre-wrap;
}
.boot-log .ok   { color: var(--green); }
.boot-log .warn { color: var(--amber); }

.brand {
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(54px, 11vw, 132px);
    line-height: 0.95;
    letter-spacing: 0.02em;
    margin: 0 0 18px;
    user-select: none;
    display: inline-flex;
    align-items: baseline;
    gap: 0;
}
.brand-io   { color: var(--red); text-shadow: 0 0 24px rgba(255, 48, 48, 0.45); }
.brand-pipe { color: var(--fg); margin: 0 4px; }
.brand-haze {
    color: var(--fg-dim);
    background: linear-gradient(180deg, var(--fg-dim) 0%, var(--fg-mute) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@keyframes blink {
    to { visibility: hidden; }
}

.tagline {
    margin: 0 0 8px;
    font-size: 14px;
}
.prompt {
    color: var(--green);
    font-weight: 500;
    margin-right: 10px;
}
.typed { color: var(--fg); }
.cursor {
    display: inline-block;
    animation: blink 1s steps(2, start) infinite;
}

.whoami {
    margin: 0 0 28px;
    color: var(--fg-dim);
    max-width: 620px;
    font-size: 14.5px;
    padding-left: 14px;
    border-left: 2px solid var(--line-hot);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}
.nav a {
    color: var(--fg-dim);
    font-size: 13px;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
}
.nav a:hover { color: var(--red); }

/* ---------- Block (section) ----------------------------- */

.block { margin: 56px 0; }

.cmd {
    font-size: 13.5px;
    margin-bottom: 22px;
}

/* ---------- ls listing ---------------------------------- */

.ls-head, .row {
    display: grid;
    grid-template-columns: 110px 50px 70px 200px 1fr 30px;
    gap: 16px;
    padding: 10px 14px;
    align-items: center;
    font-size: 13px;
}
.ls-head {
    color: var(--fg-mute);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.row {
    color: var(--fg);
    border-bottom: 1px dashed var(--line);
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}
.row:hover {
    background: rgba(255, 48, 48, 0.06);
    color: var(--fg);
}
.row:hover .name { color: var(--red); }
.row:hover .go { color: var(--red); transform: translateX(3px); }

.row .perm { color: var(--cyan); }
.row .size { color: var(--violet); text-align: right; }
.row .date { color: var(--green); }
.row .name {
    color: var(--fg);
    font-weight: 500;
}
.row .name .folder { color: var(--red); margin-right: 4px; }
.row .desc {
    color: var(--fg-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row .go {
    color: var(--fg-mute);
    font-size: 16px;
    text-align: right;
    transition: transform 0.15s ease, color 0.15s ease;
}

.row-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.row-disabled:hover { background: transparent; }
.row-disabled .perm { color: var(--fg-mute); }
.row-disabled .name { color: var(--fg-mute); }

.ls-foot {
    margin-top: 12px;
    padding: 10px 14px;
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--fg-mute);
}
.ok-tag {
    color: var(--green);
    background: rgba(56, 217, 122, 0.08);
    border: 1px solid rgba(56, 217, 122, 0.25);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    letter-spacing: 0.04em;
}
.dim { color: var(--fg-mute); }

/* ---------- Download / app block ------------------------ */

.cmd .flag { color: var(--amber); }

.install-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 14px;
    background: rgba(255, 48, 48, 0.06);
    border: 1px solid rgba(255, 48, 48, 0.25);
    border-left: 3px solid var(--red);
    border-radius: 4px;
}
.install-msg { color: var(--fg); font-size: 13.5px; }

.badge-new {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    padding: 3px 8px;
    border-radius: 3px;
    box-shadow: 0 0 16px rgba(255, 48, 48, 0.4);
    animation: pulse 2.4s ease-in-out infinite;
}
.badge-new.inline {
    margin-left: 8px;
    font-size: 9px;
    padding: 2px 6px;
    letter-spacing: 0.16em;
    vertical-align: middle;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 48, 48, 0.35); }
    50%      { box-shadow: 0 0 22px rgba(255, 48, 48, 0.65); }
}

.apps {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--bg-2);
    overflow: hidden;
}

.app-row {
    display: grid;
    grid-template-columns: 110px 1fr 160px 30px;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px dashed var(--line);
    color: var(--fg);
    font-size: 13px;
    transition: background 0.15s ease;
}
.app-row:last-child { border-bottom: 0; }
.app-row:hover { background: rgba(255, 48, 48, 0.06); }
.app-row:hover .go { color: var(--red); transform: translateX(3px); }

.app-tag {
    font-weight: 500;
    letter-spacing: 0.02em;
}
.app-tag[data-p="android"] { color: var(--green); }
.app-tag[data-p="ios"]     { color: var(--cyan); }
.app-tag[data-p="macos"]   { color: var(--violet); }
.app-tag[data-p="windows"] { color: var(--amber); }
.app-tag[data-p="web"]     { color: var(--red-soft); }

.app-bin {
    color: var(--fg-dim);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-store {
    color: var(--fg);
    font-size: 12.5px;
    text-align: right;
    letter-spacing: 0.02em;
}
.app-row .go {
    color: var(--fg-mute);
    font-size: 16px;
    text-align: right;
    transition: transform 0.15s ease, color 0.15s ease;
}

/* ---------- Markdown-ish about block -------------------- */

.md {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--red);
    border-radius: 4px;
    padding: 24px 28px;
    max-width: 760px;
}
.md p {
    color: var(--fg);
    margin: 0 0 14px;
    font-size: 14.5px;
}
.md p:last-of-type { margin-bottom: 0; }
.md-h {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--amber);
    margin: 24px 0 12px;
    text-transform: none;
}
.md-h:first-child { margin-top: 0; }

.kv {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13.5px;
}
.kv li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
}
.kv li:last-child { border-bottom: 0; }
.k   { color: var(--cyan); min-width: 200px; }
.eq  { color: var(--fg-mute); }
.v   { color: var(--fg); }
.v.num { color: var(--violet); font-weight: 500; }
.v.str { color: var(--green); }

/* ---------- Contact panels ------------------------------ */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.panel {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-3);
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    letter-spacing: 0.16em;
}
.panel-tag { color: var(--red); font-weight: 700; }
.panel-id  { color: var(--fg-mute); }
.panel p, .panel address {
    margin: 0;
    padding: 18px 20px;
    color: var(--fg);
    font-size: 14px;
    line-height: 1.7;
}
.panel .links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 20px 18px;
}
.panel .links a {
    color: var(--red-soft);
    font-size: 13.5px;
    transition: color 0.15s ease, transform 0.15s ease;
}
.panel .links a:hover { color: var(--red); transform: translateX(3px); display: inline-block; }

/* ---------- REPL / interactive shell -------------------- */

.repl { margin-top: 64px; margin-bottom: 16px; }
.repl .cmd { margin-bottom: 0; }
.repl .cursor {
    color: var(--red);
    text-shadow: 0 0 12px var(--red);
}

.repl-input {
    outline: none;
    color: var(--fg);
    caret-color: transparent;
    min-width: 1px;
    white-space: pre;
    word-break: break-all;
}

.repl-history {
    margin-bottom: 0;
}
.h-block { margin-bottom: 14px; }
.h-block:last-child { margin-bottom: 0; }
.h-line { font-size: 13.5px; color: var(--fg); }
.h-line .h-prompt {
    color: var(--green);
    font-weight: 500;
    margin-right: 10px;
}
.h-line .h-cmd { color: var(--fg); }

.h-out {
    margin-top: 4px;
    color: var(--fg-dim);
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 13px;
}
.h-out a { color: var(--red-soft); }
.h-out a:hover { color: var(--red); }
.h-out .perm { color: var(--cyan); }
.h-out .panel-tag {
    color: var(--red);
    font-weight: 700;
    background: rgba(255, 48, 48, 0.08);
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 11px;
    letter-spacing: 0.16em;
}
.h-out .t-android { color: var(--green); }
.h-out .t-ios     { color: var(--cyan); }
.h-out .t-macos   { color: var(--violet); }
.h-out .t-windows { color: var(--amber); }
.h-out .t-web     { color: var(--red-soft); }

/* ---------- Status bar ---------------------------------- */

.statusbar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    overflow: hidden;
}
.statusbar .seg {
    padding: 6px 14px;
    border-right: 1px solid rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1;
}
.statusbar .seg:last-child { border-right: none; }
.statusbar .seg.dim { background: rgba(0, 0, 0, 0.18); color: rgba(255, 255, 255, 0.85); }
.statusbar .seg.push { margin-left: auto; }
.statusbar .seg-ok { background: rgba(0, 0, 0, 0.22); }

/* ---------- Responsive ---------------------------------- */

@media (max-width: 820px) {
    .terminal { top: 16px; bottom: 16px; left: 16px; right: 16px; }
    .terminal-body { padding: 28px 20px 18px; }
    .boot-log { font-size: 11.5px; }

    .ls-head { display: none; }
    .row {
        grid-template-columns: 1fr 30px;
        grid-template-areas:
            "name go"
            "desc desc"
            "meta meta";
        gap: 6px;
        padding: 14px;
    }
    .row .name { grid-area: name; }
    .row .go   { grid-area: go; }
    .row .desc { grid-area: desc; white-space: normal; }
    .row .perm, .row .size, .row .date {
        grid-area: meta;
        display: inline;
        font-size: 11px;
        margin-right: 12px;
    }
    .row .perm::after, .row .size::after { content: ' ·'; color: var(--fg-mute); }

    .contact-grid { grid-template-columns: 1fr; }

    .app-row {
        grid-template-columns: 1fr 30px;
        grid-template-areas:
            "tag go"
            "store store"
            "bin bin";
        gap: 4px;
        padding: 14px 16px;
    }
    .app-row .app-tag   { grid-area: tag; }
    .app-row .go        { grid-area: go; }
    .app-row .app-store { grid-area: store; text-align: left; color: var(--fg-dim); font-size: 12px; }
    .app-row .app-bin   { grid-area: bin; font-size: 11.5px; }

    .statusbar .seg { padding: 6px 10px; }
    .statusbar .seg.push { display: none; }
}

@media (max-width: 520px) {
    .terminal {
        top: 8px; bottom: 8px; left: 8px; right: 8px;
        border-radius: 8px;
    }
    .terminal-body { padding: 22px 16px 14px; }
    .brand { gap: 0; }
    .terminal-bar .meta { display: none; }
    .nav { gap: 14px; }
    .md { padding: 18px 20px; }
    .k { min-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
    .cursor { animation: none; }
    .row, .panel .links a, .row .go { transition: none; }
}
