/* 4499.io design preview — shared by dev-1/2/3.html */

@font-face {
    font-family: "Roboto Mono";
    src: url("roboto-mono.woff2") format("woff2");
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #151715;
    --fg: #ffffff;
    --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --gutter: max(14rem, 20vw);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    background: var(--bg);
}

body {
    overflow: hidden;
    color: var(--fg);
    font-family: var(--mono);
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* Graph layers cover the viewport; JS places lanes left of the menu. */
.graph,
.packets {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.graph {
    overflow: visible;
}

.packets {
    z-index: 1;
}

.graph .edge {
    fill: none;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 1;
    transition: opacity 400ms ease;
}

.graph .main {
    stroke: rgba(255, 255, 255, 0.45);
}

.graph .ghost {
    stroke: rgba(255, 255, 255, 0.22);
}

.graph .link {
    fill: none;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 1;
    stroke-dasharray: 2 4;
    transition: opacity 400ms ease, stroke 400ms ease;
}

.graph .commit {
    fill: var(--bg);
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 1;
}

.graph .tip {
    fill: var(--bg);
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 1;
    transition: fill 300ms ease, stroke 300ms ease, opacity 400ms ease;
}

.graph .hash {
    fill: rgba(255, 255, 255, 0.55);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.04em;
    transition: fill 300ms ease, opacity 400ms ease;
}

.graph .trail {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
}

.graph .halo {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1;
}

.graph .dot {
    fill: var(--accent);
}

.is-instant,
.is-instant * {
    transition: none !important;
}

.graph .branch.is-dim .edge,
.graph .branch.is-dim .link,
.graph .branch.is-dim .tip {
    opacity: 0.3;
}

.graph .branch.is-dim .hash {
    opacity: 0.6;
}

.graph .branch.is-active .tip {
    fill: var(--accent);
    stroke: var(--accent);
}

.graph .branch.is-active .hash {
    fill: var(--accent);
}

.graph .branch.is-active .link {
    stroke: rgba(var(--accent-rgb), 0.6);
}

/* Layout: template proportions — menu at 20vw / 20vh, panel bottom right. */
.shell {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    height: 100%;
    padding-left: var(--gutter);
}

.menu {
    flex-shrink: 0;
    width: 12rem;
    padding-top: 20vh;
}

.brand {
    display: block;
    margin-bottom: 2.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    opacity: 0.6;
    text-decoration: none;
}

.menu ul {
    list-style: none;
}

.menu button {
    width: auto;
    padding-block: 0.2rem;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 200ms ease;
}

.menu button:hover,
.menu button[aria-current="page"] {
    opacity: 1;
}

.panel {
    flex: 1;
    align-self: flex-end;
    display: grid;
    align-content: start;
    max-width: 42rem;
    min-height: 22rem;
    padding-right: 20vh;
    padding-bottom: 20vh;
    font-size: 0.85rem;
}

.row {
    display: grid;
    grid-template-columns: minmax(7rem, max-content) 1fr;
    column-gap: 0.75rem;
    padding-block: 0.2rem;
    line-height: 1.4;
}

.row .key {
    opacity: 0.6;
}

.row .key::after {
    content: " :";
}

.row .note {
    display: block;
    margin-top: 0.15rem;
    opacity: 0.6;
    font-size: 0.75rem;
}

.row a {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.row.rule {
    display: block;
    opacity: 0.6;
}

.noscript {
    position: fixed;
    inset: 0;
    z-index: 3;
    overflow: auto;
    background: var(--bg);
    padding: 20vh var(--gutter);
    line-height: 1.6;
}

/* Narrow: menu on top, panel below, graph is a thin strip at the left edge. */
/* Phone frame: only on pages whose content has screenshots (graph.js adds
   .has-phone to the shell). Images stack and cross-fade. */
.phone {
    --phone-h: min(70vh, 40rem);
    position: absolute;
    top: 50%;
    right: 6vw;
    height: var(--phone-h);
    aspect-ratio: 1320 / 2868;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    background: #0d0e0d;
    transform: translateY(-50%);
}

.phone {
    transition: opacity 300ms ease;
}

.phone.is-empty {
    opacity: 0;
}

.phone[hidden] {
    display: none;
}

.phone img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 300ms ease;
}

.phone img.is-active {
    opacity: 1;
}

.shell.has-phone .panel {
    padding-right: calc(min(70vh, 40rem) * 1320 / 2868 + 6vw + 3rem);
    max-width: none;
}

@media (max-width: 699px) {
    .phone {
        position: relative;
        top: auto;
        right: auto;
        width: min(14rem, 60vw);
        height: auto;
        margin: 0 auto 4rem;
        border-radius: 1.5rem;
        transform: none;
    }

    .shell.has-phone .panel {
        padding-right: 0;
        padding-bottom: 2.5rem;
    }
    :root {
        --gutter: 4rem;
    }

    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .shell {
        flex-direction: column;
        gap: 2.5rem;
        height: auto;
        min-height: 100%;
        padding-right: 1.25rem;
    }

    .graph {
        position: absolute;
        height: 100%;
    }

    .menu {
        width: 100%;
        padding-top: 12vh;
    }

    .menu button {
        padding-block: 0.625rem;
    }

    .panel {
        align-self: stretch;
        max-width: none;
        min-height: 0;
        padding: 0 0 4rem;
        font-size: 0.8rem;
    }

    .row {
        grid-template-columns: minmax(5.5rem, max-content) 1fr;
    }

    .row > span:last-child {
        overflow-wrap: anywhere;
    }

    .graph .hash {
        display: none;
    }
}

/* Tier 3 plays an intro that reveals the page. An inline script in <head>
   sets html.kit-intro before first paint; graph.js removes it when the intro
   reveals the page, or on any failure. Without JavaScript the class is never
   set, so nothing is hidden. */
@media (prefers-reduced-motion: no-preference) {
    html.kit-intro body[data-tier="3"] .shell,
    html.kit-intro body[data-tier="3"] .graph {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.noscript h1,
.noscript h2 {
    margin-block: 1.5rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.noscript p {
    max-width: 42rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.8;
}
