/* ==========================================================================
   THE UNDERWEB — "descent" stylesheet
   purple on black. every page is a deeper layer of dirt.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&family=VT323&family=IBM+Plex+Mono:ital,wght@0,400;0,600;1,400&family=Instrument+Serif:ital@0;1&display=swap');

:root {
    /* the palette is the same 9 colours the gifs were drawn with */
    --void:     #000000;
    --ink:      #0e001a;
    --bruise:   #22003a;
    --violet:   #3e066e;
    --amethyst: #6e1cbe;
    --lilac:    #a048ff;
    --lavender: #d6a0ff;
    --bone:     #f8ecff;
    --hot:      #ff5ae6;

    --display: 'VT323', monospace;
    --pixel:   'Silkscreen', monospace;
    --mono:    'IBM Plex Mono', ui-monospace, monospace;
    --serif:   'Instrument Serif', Georgia, serif;

    /* legacy vars the old js still reaches for */
    --primary-text: var(--lavender);
    --border-color: var(--amethyst);
    --accent-color: var(--lilac);
    --accent-glow: rgba(160, 72, 255, .5);
    --terminal-green: var(--lilac);
    --tertiary-bg: var(--violet);

    --shadow: 4px 4px 0 var(--void);
    --gutter: clamp(12px, 3vw, 28px);

    color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--void);
    /* 2px checker dither that fades in toward the bottom: the deeper you scroll the more the dirt shows */
    background-image:
        radial-gradient(ellipse 120% 60% at 50% 120%, rgba(110, 28, 190, .28), transparent 70%),
        conic-gradient(from 90deg at 1px 1px, transparent 25%, rgba(34, 0, 58, .55) 0 50%, transparent 0 75%, rgba(34, 0, 58, .55) 0);
    background-size: 100% 100%, 4px 4px;
    background-attachment: fixed;
    color: var(--lavender);
    font: 15px/1.65 var(--mono);
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='20' shape-rendering='crispEdges'><path d='M0 0h2v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v2H7v1h1v2h1v2H7v-1H6v-2H5v-1H4v1H3v1H2v1H0z' fill='%23000'/><path d='M1 2h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1H6v1h1v2h1v1H7v-1H6v-2H5v-1H4v1H3v1H2v1H1z' fill='%23d6a0ff'/></svg>") 1 1, auto;
    overflow-x: hidden;
}

/* crt scanlines over everything, very faint */
body::after {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.18) 2px 3px);
    z-index: 9000;
    mix-blend-mode: multiply;
}

a { color: var(--lilac); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--bone); background: var(--violet); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px dashed var(--hot); outline-offset: 2px;
}

img.px, .px img, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

::selection { background: var(--hot); color: var(--void); }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; color: var(--bone); letter-spacing: .02em; line-height: 1; }
h2 { font-size: 2.2rem; margin: 0 0 .6rem; }
h3 { font-size: 1.6rem; margin: 1.4rem 0 .5rem; }
h4 { font-size: 1.3rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 1em; }

.serif { font-family: var(--serif); font-size: 1.35em; line-height: 1.35; color: var(--bone); }
.serif em, em.serif { font-style: italic; color: var(--lilac); }
.small { font-size: .9rem; }
.dim { color: var(--lavender); opacity: .86; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- star field (filled by ui.js) ---------- */
.stars { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.star {
    position: absolute; background: var(--lavender);
    animation: twinkle 3.2s steps(4) infinite;
}
.star.s2 { background: var(--lilac); }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

/* ---------- status strip ---------- */
.statusbar {
    display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap;
    padding: 8px var(--gutter);
    background: var(--ink);
    border-bottom: 1px solid var(--violet);
    font: 12px/1.6 var(--pixel); text-transform: uppercase; letter-spacing: .06em;
    color: var(--lavender);
}
.statusbar b { color: var(--lilac); font-weight: 400; }
.statusbar .push { margin-left: auto; }
.statusbar .led { display: inline-block; width: 6px; height: 6px; background: var(--hot); margin-right: 6px; animation: blink 1.1s steps(1) infinite; vertical-align: 1px; }

/* ---------- depth gauge (left rail) ---------- */
.depth-gauge {
    position: fixed; left: 10px; top: 50%; transform: translateY(-50%);
    width: 34px; z-index: 50;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    font: 12px/1 var(--pixel); color: var(--lavender);
    pointer-events: none;
}
.depth-gauge .rail {
    position: relative; width: 6px; height: 46vh;
    background: repeating-linear-gradient(to bottom, var(--violet) 0 1px, transparent 1px 8px);
    border-left: 1px solid var(--violet); border-right: 1px solid var(--violet);
}
.depth-gauge .bob {
    position: absolute; left: -5px; width: 14px; height: 6px;
    background: var(--lilac); box-shadow: 0 0 0 1px var(--void), 0 0 8px var(--lilac);
    top: 0; transition: top .12s steps(3);
}
.depth-gauge .reading { color: var(--bone); writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .1em; }
@media (max-width: 1100px) { .depth-gauge { display: none; } }

/* ---------- masthead ---------- */
.masthead {
    position: relative;
    max-width: 980px; margin: 22px auto 0; padding: 0 var(--gutter);
    text-align: center;
}
.masthead .banner {
    display: block; width: 100%; max-width: 936px; height: auto; margin: 0 auto;
    image-rendering: pixelated;
    box-shadow: 0 0 0 2px var(--void), 6px 6px 0 var(--bruise);
}
.masthead h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* hand-placed stickers that sit slightly crooked on things */
.sticker {
    position: absolute; z-index: 5;
    font: 11px/1 var(--pixel); text-transform: uppercase;
    background: var(--hot); color: var(--void);
    padding: 5px 7px 4px;
    transform: rotate(var(--r, -6deg));
    box-shadow: 2px 2px 0 var(--void);
}
.sticker.alt { background: var(--lavender); }
.sticker.ghost { background: var(--void); color: var(--lilac); border: 1px dashed var(--lilac); }
.masthead .sticker { right: calc(var(--gutter) - 8px); top: -12px; --r: 7deg; }
.masthead .sticker.left { left: calc(var(--gutter) - 10px); right: auto; top: auto; bottom: -14px; --r: -4deg; }

/* ---------- nav: numbered beveled tabs ---------- */
.tabs {
    max-width: 980px; margin: 26px auto 0; padding: 0 var(--gutter);
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.tabs a {
    display: inline-flex; align-items: baseline; gap: 8px;
    padding: 7px 14px 6px;
    font: 22px/1 var(--display); text-transform: lowercase; text-decoration: none;
    color: var(--lavender);
    background: var(--violet);
    border: 2px solid; border-color: var(--lilac) var(--bruise) var(--bruise) var(--lilac);
    box-shadow: 3px 3px 0 var(--void);
}
.tabs a small { font: 12px/1 var(--pixel); color: var(--bone); }
.tabs a:hover { background: var(--amethyst); color: var(--bone); }
.tabs a[aria-current="page"] {
    background: var(--void); color: var(--bone);
    border-color: var(--bruise) var(--lilac) var(--lilac) var(--bruise);
    box-shadow: none; transform: translate(2px, 2px);
}
.tabs a[aria-current="page"] small { color: var(--hot); }

/* ---------- ticker ---------- */
.ticker {
    margin: 22px 0 0; overflow: hidden; white-space: nowrap;
    padding: 4px 0;
    border-top: 1px solid var(--violet); border-bottom: 1px solid var(--violet);
    background: linear-gradient(90deg, var(--void), var(--ink) 15% 85%, var(--void));
    font: 12px/26px var(--pixel); color: var(--lilac); text-transform: uppercase;
}
.ticker-track { display: inline-flex; animation: tick 48s linear infinite; }
.ticker-track span { padding-right: 3rem; }
.ticker-track b { color: var(--bone); font-weight: 400; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- page grid ---------- */
main.page {
    max-width: 1180px; margin: 30px auto 0; padding: 0 var(--gutter) 40px;
    display: grid; gap: 26px;
}
.page--home {
    grid-template-columns: 270px minmax(0, 1fr) 140px;
    grid-template-areas:
        "hero hero sky"
        "side feed sky"
        "side link link";
    align-items: start;
}
.area-hero { grid-area: hero; padding: 6px; }
.area-sky  { grid-area: sky; position: sticky; top: 20px; }
.area-side { grid-area: side; }
.area-feed { grid-area: feed; }
.area-link { grid-area: link; }

@media (max-width: 1000px) {
    .page--home { grid-template-columns: 1fr; grid-template-areas: "hero" "feed" "side" "link"; }
    .area-sky { display: none; }
}

.page--single { max-width: 980px; }
.page--split { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .page--split { grid-template-columns: 1fr; } }

/* ==========================================================================
   window chrome — keeps the old .win98-box contract (script.js & chat.js
   build these, and the last <span> of every title bar is the close box)
   ========================================================================== */
.win98-box {
    position: relative;
    background: var(--ink);
    border: 2px solid; border-color: var(--lilac) var(--violet) var(--violet) var(--lilac);
    box-shadow: var(--shadow);
    min-width: 0;
}
.win98-box-title {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 4px 3px 8px;
    background: var(--violet);
    background-image: repeating-linear-gradient(90deg, rgba(160,72,255,.35) 0 1px, transparent 1px 3px);
    border-bottom: 2px solid var(--void);
    font: 11px/18px var(--pixel); text-transform: lowercase; color: var(--bone);
    user-select: none;
}
.win98-box-title span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win98-box-title span:first-child::before { content: '▚ '; color: var(--lilac); }
.win98-box-title span:last-child:not(:first-child) {
    flex: none; width: 18px; height: 16px;
    display: grid; place-items: center;
    font-size: 9px; line-height: 1; color: var(--void);
    background: var(--lavender);
    border: 1px solid; border-color: var(--bone) var(--void) var(--void) var(--bone);
    cursor: pointer;
}
.win98-box-title span:last-child:not(:first-child):hover { background: var(--hot); }
.win98-box-content { padding: 16px 18px; }
.win98-box-content > :last-child { margin-bottom: 0; }

/* organic offsets — nothing on this site sits perfectly square */
.tilt-l { transform: rotate(-.6deg); }
.tilt-r { transform: rotate(.5deg); }
.nudge  { margin-left: 14px; }
.win98-box.deep { background: var(--void); }
.win98-box.loud { border-color: var(--hot) var(--violet) var(--violet) var(--hot); }
.win98-box.loud .win98-box-title { background-color: #4a0560; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 0; }
.hero .featured-frame { padding: 10px; background: var(--void); border-right: 2px solid var(--violet); display: flex; flex-direction: column; justify-content: center;
    background-image: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(62,6,110,.35) 3px 4px); }
.hero .featured-frame img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.hero .featured-frame figcaption { font: 12px/1.4 var(--pixel); color: var(--lavender); text-transform: uppercase; padding-top: 8px; display: flex; justify-content: space-between; }
.hero .hero-copy { padding: 22px 22px 20px; display: flex; flex-direction: column; }
.hero .hero-copy h2 { font-size: 2.8rem; }
.hero .hero-copy h2 span { color: var(--lilac); }
.hero .hero-copy .serif { font-size: 1.28rem; }
.hero .hero-copy .actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 10px; }
@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; }
    .hero .featured-frame { border-right: 0; border-bottom: 2px solid var(--violet); }
}

/* ---------- buttons ---------- */
button, .link-button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 14px 6px;
    font: 12px/1.2 var(--pixel); text-transform: uppercase; text-decoration: none;
    color: var(--bone);
    background: var(--amethyst);
    border: 2px solid; border-color: var(--lavender) var(--bruise) var(--bruise) var(--lavender);
    box-shadow: 2px 2px 0 var(--void);
    cursor: pointer;
}
button:hover, .link-button:hover, .btn:hover { background: var(--lilac); color: var(--void); }
button:active, .link-button:active, .btn:active {
    border-color: var(--bruise) var(--lavender) var(--lavender) var(--bruise);
    box-shadow: none; transform: translate(2px, 2px);
}
.btn.ghost { background: transparent; color: var(--lilac); border: 1px dashed var(--lilac); box-shadow: none; }
.btn.ghost:hover { background: var(--violet); color: var(--bone); }
.btn.hot { background: var(--hot); color: var(--void); border-color: #ffc4f6 #6b0560 #6b0560 #ffc4f6; }

/* ---------- forms ---------- */
label { display: block; margin: 12px 0 4px; font: 12px/1.3 var(--pixel); text-transform: uppercase; color: var(--lilac); letter-spacing: .04em; }
input[type=text], input[type=url], input[type=email], input[type=search], select, textarea {
    width: 100%;
    padding: 7px 9px;
    font: 14px/1.4 var(--mono); color: var(--bone);
    background: var(--void);
    border: 2px solid; border-color: var(--bruise) var(--amethyst) var(--amethyst) var(--bruise);
    border-radius: 0;
}
input::placeholder, textarea::placeholder { color: var(--lavender); opacity: .82; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--lilac) 50%), linear-gradient(135deg, var(--lilac) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
input[type=file] { width: 100%; font: 12px var(--pixel); color: var(--lilac); }
input[type=file]::file-selector-button {
    font: 11px var(--pixel); text-transform: uppercase; color: var(--void); background: var(--lavender);
    border: 2px solid; border-color: var(--bone) var(--bruise) var(--bruise) var(--bone); padding: 5px 8px; margin-right: 8px; cursor: pointer;
}
form button[type=submit] { margin-top: 14px; width: 100%; }
.hint { font-size: .78rem; color: var(--amethyst); margin: 6px 0 0; }
#submission-message { display: none; margin-top: 12px; padding: 10px 12px; background: var(--void); border: 1px dashed var(--hot); color: var(--bone); }

/* ---------- visitor counter (odometer) ---------- */
.counter { display: flex; justify-content: center; gap: 2px; padding: 4px 0; }
.counter .d {
    width: 20px; height: 30px; display: grid; place-items: center;
    font: 26px/1 var(--display); color: var(--bone);
    background: linear-gradient(var(--bruise) 0 48%, var(--void) 48% 52%, var(--bruise) 52%);
    border: 1px solid var(--amethyst);
}
.counter .d.sep { width: 8px; background: none; border: 0; color: var(--amethyst); }
.visitor-counter { display: none; }

/* quick links list */
.drawer { list-style: none; margin: 0; padding: 0; }
.drawer li + li { border-top: 1px dotted var(--violet); }
.drawer a { display: flex; justify-content: space-between; padding: 6px 2px; text-decoration: none; color: var(--lavender); }
.drawer a::after { content: '→'; color: var(--amethyst); }
.drawer a:hover::after { color: var(--void); }

/* ---------- image feed (rendered by script.js as .image-item) ---------- */
#image-feed {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px;
}
#image-feed:empty::before {
    content: 'no transmissions yet. be the first to send one down.';
    grid-column: 1 / -1;
    display: block; padding: 28px 12px; text-align: center;
    font: 11px/1.6 var(--pixel); color: var(--amethyst); text-transform: uppercase;
    border: 1px dashed var(--violet);
}
.image-item {
    background: var(--void); padding: 6px 6px 4px;
    border: 1px solid var(--violet);
    box-shadow: 3px 3px 0 var(--bruise);
    transition: transform .15s steps(2);
}
.image-item:nth-child(3n+1) { transform: rotate(-1.2deg); }
.image-item:nth-child(3n+2) { transform: rotate(.8deg) translateY(4px); }
.image-item:hover { transform: rotate(0) scale(1.03); border-color: var(--lilac); z-index: 2; position: relative; }
.image-item a { display: block; background: none; }
.image-item img { display: block; width: 88px; height: auto; margin: 6px auto; background: var(--void); image-rendering: pixelated; }
.image-item .tags, .tags { font: 12px/1.5 var(--pixel); color: var(--lavender); text-transform: lowercase; padding-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- widget / embed ---------- */
.embed-code, textarea.code {
    width: 100%; min-height: 80px; resize: vertical;
    font: 12px/1.5 var(--mono); color: var(--lilac); background: var(--void);
}
.copy-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
#widget-strip { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; background: var(--void); border: 1px dashed var(--violet); min-height: 60px; }
.widget-image { width: 88px; height: auto; image-rendering: pixelated; cursor: pointer; border: 1px solid var(--violet); }
.widget-image:hover { border-color: var(--hot); }

/* ---------- link-to-us shelf ---------- */
.shelf { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 22px; align-items: center; }
.shelf img { image-rendering: pixelated; display: block; }
.shelf .shelf-banner { max-width: 468px; width: 100%; height: auto; }
.shelf textarea { min-height: 54px; }
@media (max-width: 640px) { .shelf { grid-template-columns: 1fr; } }

/* ==========================================================================
   links directory + index
   ========================================================================== */
.toolbar {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end;
    padding-bottom: 18px; margin-bottom: 8px; border-bottom: 1px dashed var(--violet);
}
.toolbar label { margin-top: 0; }
@media (max-width: 700px) { .toolbar { grid-template-columns: 1fr 1fr; } .toolbar .grow { grid-column: 1 / -1; } }

.category-section { margin-top: 26px; }
.category-title {
    display: flex; align-items: baseline; gap: 12px;
    font: 2rem/1 var(--display); color: var(--bone); margin: 0 0 14px;
}
.category-title::before { content: attr(data-depth); font: 10px/1 var(--pixel); color: var(--hot); }
.category-title::after { content: ''; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--amethyst) 0 4px, transparent 4px 8px); align-self: center; }
.links-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }

.link-card { display: flex; flex-direction: column; }
.link-card:nth-child(odd)  { transform: rotate(-.4deg); }
.link-card:nth-child(even) { transform: rotate(.35deg); }
.link-card:hover { transform: none; border-color: var(--hot) var(--violet) var(--violet) var(--hot); }
.link-card-header {
    padding: 4px 8px; background: var(--violet); border-bottom: 2px solid var(--void);
    font: 20px/1.1 var(--display); color: var(--bone);
    display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.link-card-header small { font: 11px/1 var(--pixel); color: var(--lavender); text-transform: uppercase; }
.link-card-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.link-card-image { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; background: var(--void); border: 1px solid var(--bruise); }
.link-card-description { font-size: .86rem; line-height: 1.5; flex: 1; }
.link-card-tags { font: 11px/1.5 var(--pixel); color: var(--lavender); text-transform: lowercase; word-spacing: 4px; }
.link-card .link-button { align-self: flex-start; }
.link-card .link-button[href="#"] { opacity: .55; }
.empty-state { display: none; padding: 30px; text-align: center; font: 11px var(--pixel); color: var(--lavender); text-transform: uppercase; }
.empty-state.show { display: block; }

/* a–z index */
.alphabet-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0; }
.alphabet-nav a {
    min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 4px;
    font: 20px/1 var(--display); text-decoration: none; color: var(--lilac);
    background: var(--void); border: 1px solid var(--violet);
}
.alphabet-nav a.has { color: var(--bone); background: var(--bruise); border-color: var(--amethyst); }
.alphabet-nav a:not(.has) { opacity: .35; pointer-events: none; cursor: default; }
.alphabet-nav a.active { background: var(--hot); color: var(--void); border-color: var(--hot); }
.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; }
form.search-form button[type=submit] { margin: 0; width: auto; flex: none; }
.search-form input { min-width: 0; }
.index-letter { margin-top: 22px; scroll-margin-top: 20px; }
.index-letter h3 { font-size: 2.8rem; margin: 0 0 4px; color: var(--hot); display: flex; gap: 12px; align-items: baseline; }
.index-letter h3 small { font: 11px var(--pixel); color: var(--lavender); text-transform: uppercase; }
.index-list { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 28px; }
.index-list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px dotted var(--violet); }
.index-list a { font: 20px/1.2 var(--display); text-decoration: none; color: var(--bone); }
.index-list a:hover { color: var(--void); }
.index-list .meta { display: block; font-size: .78rem; color: var(--amethyst); }
.stats-section, .stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-item, .stat-box { padding: 12px; background: var(--void); border: 1px solid var(--violet); text-align: center; }
.stat-number { font: 2.6rem/1 var(--display); color: var(--bone); }
.stat-label { font: 11px/1.4 var(--pixel); color: var(--lavender); text-transform: uppercase; margin-top: 4px; }

.sidebar .stats-section { grid-template-columns: 1fr 1fr; }
#image-feed .loading-spinner { grid-column: 1 / -1; justify-self: center; border-color: var(--lilac) var(--bruise) var(--bruise) !important; border-radius: 0 !important; }

/* ---------- dialogs (common.js win98Alert / win98Confirm) ---------- */
.uw-dialog-overlay {
    position: fixed; inset: 0; z-index: 9500;
    display: grid; place-items: center; padding: 16px;
    background: rgba(0, 0, 0, .72);
    background-image: repeating-linear-gradient(0deg, rgba(34,0,58,.5) 0 1px, transparent 1px 3px);
}
.uw-dialog { width: min(380px, 100%); background: var(--ink); box-shadow: 6px 6px 0 var(--void), 0 0 0 1px var(--void), 0 0 40px rgba(160,72,255,.25); }
.uw-dialog-body { text-align: center; padding: 20px 20px 18px; }
.uw-dialog-text { margin: 0 0 18px; color: var(--bone); font: 15px/1.55 var(--mono); }
.uw-dialog-actions { display: flex; gap: 10px; justify-content: center; }
.uw-dialog-actions button { min-width: 84px; margin: 0; }
.feed-offline {
    margin: 0 0 14px; padding: 8px 10px;
    font: 10px/1.6 var(--pixel); text-transform: uppercase; color: var(--lavender);
    border: 1px dashed var(--amethyst); background: var(--void);
}
.feed-offline::before { content: '▲ '; color: var(--hot); }

/* ==========================================================================
   about
   ========================================================================== */
.about-section { padding: 18px 0 22px; border-bottom: 1px dashed var(--violet); }
.about-section:last-child { border-bottom: 0; }
.about-title { font-size: 2.4rem; display: flex; gap: 12px; align-items: baseline; }
.about-title::before { content: attr(data-n); font: 10px var(--pixel); color: var(--hot); }
.about-text { max-width: 68ch; }
.typewriter { font: 1.6rem/1.3 var(--serif); font-style: italic; color: var(--lilac); min-height: 2.2rem; margin-bottom: 14px; }
.terminal-section { margin: 16px 0; background: var(--void); border: 1px solid var(--violet); border-left: 4px solid var(--amethyst); padding: 12px 14px; }
.terminal-output { font: 18px/1.35 var(--display); color: var(--lilac); white-space: pre-wrap; overflow-wrap: anywhere; }
.cursor { animation: blink 1s steps(1) infinite; color: var(--lilac); margin-left: 2px; }

.timeline { position: relative; margin: 14px 0 0; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: repeating-linear-gradient(to bottom, var(--amethyst) 0 6px, transparent 6px 10px); }
.timeline-item { position: relative; padding: 0 0 18px; }
.js .timeline-item { opacity: 0; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; background: var(--lilac); box-shadow: 0 0 0 2px var(--void), 0 0 0 3px var(--amethyst); }
.timeline-date { font: 28px/1 var(--display); color: var(--hot); }
.timeline-content p { margin: 4px 0 0; max-width: 62ch; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 14px; }
.team-member { background: var(--void); border: 1px solid var(--violet); padding: 14px; text-align: center; cursor: pointer; }
.team-member:nth-child(even) { transform: translateY(10px) rotate(.6deg); }
.team-member canvas { width: 72px; height: 72px; display: block; margin: 0 auto 10px; border: 2px solid var(--amethyst); }
.team-name { font: 22px/1 var(--display); color: var(--bone); }
.team-role { font: 9px/1.6 var(--pixel); color: var(--hot); text-transform: uppercase; margin: 4px 0 8px; }
.team-member p { font-size: .82rem; margin: 0; }

/* ==========================================================================
   chat
   ========================================================================== */
.sidebar { display: grid; gap: 22px; }
.channels-list, .users-list { list-style: none; margin: 0; padding: 0; }
.channel-item { padding: 5px 8px; cursor: pointer; font: 20px/1.1 var(--display); color: var(--lavender); }
.channel-item:hover { background: var(--bruise); }
.channel-item.active { background: var(--amethyst); color: var(--bone); }
.channel-icon { color: var(--hot); margin-right: 4px; }
.user-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; font: 11px var(--pixel); text-transform: uppercase; }
.user-status { width: 8px; height: 8px; flex: none; border: 1px solid var(--void); }
.status-online { background: var(--lilac); box-shadow: 0 0 6px var(--lilac); }
.status-idle { background: var(--violet); }
.status-offline { background: transparent; border-color: var(--violet); }
.help-title { font: 10px var(--pixel); text-transform: uppercase; color: var(--hot); margin-bottom: 6px; }
.help-item { font-size: .8rem; padding: 3px 0; }
.command { font-family: var(--mono); color: var(--bone); background: var(--bruise); padding: 0 4px; }

.chat-container { display: flex; flex-direction: column; min-height: 640px; }
.chat-messages { flex: 1; overflow-y: auto; max-height: 62vh; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--void);
    scrollbar-color: var(--amethyst) var(--void); }
.message { max-width: 78%; }
.message.received { align-self: flex-start; }
.message.sent { align-self: flex-end; }
.message.system { align-self: center; max-width: 92%; text-align: center; font: 11px/1.6 var(--pixel); text-transform: uppercase; color: var(--lavender); }
.message.system .message-content { background: none; border: 0; padding: 0; }
.message-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.avatar { width: 22px; height: 22px; display: grid; place-items: center; font: 18px/1 var(--display); color: var(--void); }
.avatar-blue { background: var(--lilac); }
.avatar-pink { background: var(--hot); }
.avatar-green { background: var(--lavender); }
.username { font: 11px var(--pixel); color: var(--bone); text-transform: uppercase; }
.message-content { padding: 8px 11px; background: var(--ink); border: 1px solid var(--violet); font-size: .9rem; }
.message.received .message-content { border-left: 3px solid var(--amethyst); }
.message.sent .message-content { background: var(--violet); border-color: var(--lilac); color: var(--bone); border-right: 3px solid var(--hot); }
.message-meta { display: flex; gap: 8px; font: 11px var(--pixel); color: var(--lavender); margin-top: 3px; }
.message.sent .message-meta { justify-content: flex-end; }
.chat-input-container { border-top: 2px solid var(--violet); padding: 10px; background: var(--ink); }
.chat-input-form { display: flex; gap: 6px; }
.chat-input-form .chat-input { flex: 1; }
.chat-input-form .chat-input { min-width: 0; }
form.chat-input-form button { margin: 0; width: auto; flex: none; }
.toggle-emotes { padding: 7px 10px 6px; background: var(--bruise); }
.emotes-panel { display: none; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; margin-top: 8px; }
.emote { padding: 6px 0; text-align: center; font-family: var(--mono); background: var(--void); border: 1px solid var(--violet); cursor: pointer; }
.emote:hover { background: var(--hot); color: var(--void); }

/* ==========================================================================
   footer
   ========================================================================== */
.footer {
    margin-top: 30px; padding: 30px var(--gutter) 40px;
    border-top: 2px solid var(--violet);
    background: linear-gradient(var(--void), var(--ink));
    text-align: center;
}
.button-wall { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 760px; margin: 0 auto 22px; }
.button-wall > * { width: 88px; height: 31px; }
.button-wall img { image-rendering: pixelated; display: block; }
/* css-only 88x31s, drawn to match */
.b88 {
    display: grid; place-items: center; overflow: hidden;
    font: 10px/1.1 var(--pixel); text-transform: uppercase; text-align: center; text-decoration: none;
    padding: 4px 6px;
    border: 1px solid; border-color: var(--lilac) var(--bruise) var(--bruise) var(--lilac);
    color: var(--bone); background: var(--violet);
}
.b88:nth-child(3n) { background: var(--void); color: var(--lilac); border-style: dashed; border-color: var(--lilac); }
.b88:nth-child(4n) { background: repeating-linear-gradient(135deg, var(--bruise) 0 4px, var(--violet) 4px 8px); }
.b88:nth-child(5n) { background: var(--lavender); color: var(--void); }
.b88 b { color: var(--hot); font-weight: 400; }
.b88:nth-child(5n) b { color: var(--violet); }
.webring { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 16px; font: 11px var(--pixel); text-transform: uppercase; color: var(--lavender); }
.webring a { text-decoration: none; }
.footer p { font-size: .8rem; color: var(--lavender); margin: 0; }
.footer .footer-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font: 11px var(--pixel); text-transform: uppercase; }

/* ---------- misc animation ---------- */
@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes glitch {
    0% { transform: translate(0); filter: none; }
    25% { transform: translate(-3px, 1px); filter: drop-shadow(2px 0 0 var(--hot)); }
    50% { transform: translate(2px, -1px); filter: drop-shadow(-2px 0 0 var(--lilac)); }
    100% { transform: translate(0); filter: none; }
}
@keyframes fadeInOut { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
    .ticker-track { animation: none; }
}

/* ==========================================================================
   submit page
   ========================================================================== */
.page--submit { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; max-width: 1100px; }
.page--submit .submit-intro { grid-column: 1 / -1; }
@media (max-width: 860px) { .page--submit { grid-template-columns: 1fr; } }
.steps { margin: 10px 0 12px; padding-left: 1.4em; display: grid; gap: 6px; }
.steps b { color: var(--bone); }
.button-preview { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: .85rem; color: var(--lilac); }
.button-preview[hidden] { display: none; }
.button-preview img { width: 88px; height: auto; image-rendering: pixelated; border: 1px solid var(--violet); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: 12px 0 0; padding: 8px 10px; border: 1px solid var(--hot); color: var(--bone); background: var(--void); font-size: .85rem; }
.submit-done { padding: 12px; background: var(--void); border: 1px dashed var(--hot); color: var(--bone); }
.submit-done p { margin: 0 0 10px; }
.submit-done .btn { margin: 4px 6px 0 0; }
[hidden] { display: none !important; }
.feed-empty { margin: 0; padding: 18px; text-align: center; border: 1px dashed var(--violet); color: var(--lavender); }
.feed-empty a { margin-left: 4px; }
.home-pulse { display: grid; gap: 12px; }
.pulse-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pulse-grid > div { padding: 8px 5px; text-align: center; border: 1px dashed var(--violet); background: var(--void); }
.pulse-grid b, .pulse-grid span { display: block; }
.pulse-grid b { color: var(--hot); font: 18px/1 var(--pixel); }
.pulse-grid span { margin-top: 5px; color: var(--lavender); font: 11px/1.2 var(--pixel); text-transform: uppercase; }
.home-pulse .btn { justify-self: start; }

.index-list a.visit { margin-left: 4px; text-decoration: none; }
