/* ===========================================
   COMPONENTS.CSS - UI Components
   =========================================== */

/* --- OVERLAYS --- */
#noise {
    opacity: 0.05;
}

#vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 800;
    background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.8) 120%),
        url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.1"/%3E%3C/svg%3E');
    mix-blend-mode: multiply;
    opacity: 0.8;
}

#ascii-starfield {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    color: var(--border-subtle);
    font-family: monospace;
    pointer-events: none;
}

.star {
    position: absolute;
    color: var(--wired-cyan);
    will-change: opacity;
    animation: twinkle var(--duration, 3s) infinite ease-in-out;
}

/* --- WIRED BOXES --- */
.wired-box {
    background: rgba(10, 10, 16, 0.7);
    border: 1px solid var(--wired-cyan);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.1);
    margin-bottom: 24px;
    position: relative;
    backdrop-filter: blur(4px);
}

.box-header {
    background: rgba(0, 255, 255, 0.15);
    color: var(--wired-cyan);
    padding: 6px 10px;
    font-family: var(--f-pixel);
    font-size: 0.75rem;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--wired-cyan);
}

.box-header .icon {
    display: none;
}

.box-body {
    padding: 20px;
}

/* Window controls (colored dots) */
.controls {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.controls span {
    width: 6px;
    height: 6px;
    background: var(--border-muted);
    display: block;
}

.controls span:nth-child(1) {
    background: var(--wired-pink);
}

.controls span:nth-child(2) {
    background: var(--wired-cyan);
}

.controls span:nth-child(3) {
    background: var(--wired-green);
}

/* --- BRAND BOX --- */
.brand-box {
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border: 1px solid var(--wired-pink);
}

.brand-box .glitch-text {
    font-family: var(--f-pixel);
    color: var(--wired-pink);
    font-size: 0.9rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.brand-box .subtitle {
    font-family: var(--f-display);
    font-size: 1.1rem;
    color: var(--fg);
}

/* --- NAVIGATION --- */
.nav-links {
    display: flex;
    flex-direction: column;
}

.nav-links a {
    padding: 10px 12px;
    text-decoration: none;
    color: var(--fg);
    border-bottom: 1px solid var(--border-dim);
    transition: all 0.1s;
    font-family: var(--f-pixel);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover {
    background: var(--wired-cyan);
    color: #000;
}

/* --- BADGES --- */
.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 10px;
}

.badge {
    font-family: var(--f-pixel);
    font-size: 0.6rem;
    padding: 4px 6px;
    border: 1px solid var(--border-muted);
    background: var(--bg-subtle);
    color: var(--fg-dim);
    cursor: default;
    transition: 0.2s;
}

.badge:hover {
    border-color: var(--wired-cyan);
    color: var(--wired-cyan);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

/* --- TAGS --- */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: var(--bg);
    color: var(--wired-green);
    font-family: var(--f-pixel);
    font-size: 0.55rem;
    padding: 4px 6px;
    border: 1px solid var(--wired-green);
    text-transform: uppercase;
}

/* --- CLOCK --- */
.clock {
    text-align: center;
}

.clock-time {
    font-family: var(--f-display);
    font-size: 4rem;
    color: var(--wired-pink);
    text-shadow: 2px 2px 0px rgba(255, 0, 255, 0.3);
    line-height: 1;
}

.clock-date {
    color: var(--fg-dim);
    font-family: var(--f-pixel);
    font-size: 0.7rem;
    margin-top: 10px;
}

/* --- ASCII ART --- */
.ascii {
    color: var(--wired-cyan);
    font-size: 12px;
    line-height: 1.1;
    white-space: pre;
    font-weight: bold;
    text-shadow: 0 0 8px var(--wired-cyan-dim);
    animation: text-flicker 4s infinite;
}

/* --- ABOUT SECTION --- */
.about p {
    margin-bottom: 10px;
}

/* --- CONTACT LINKS --- */
.contact .links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact .links li {
    display: inline;
}

.contact .links a {
    color: var(--wired-cyan);
    text-decoration: none;
    font-family: var(--f-pixel);
    font-size: 0.8rem;
    transition: color 0.2s;
}

.contact .links a:hover {
    color: var(--wired-pink);
}

/* --- PROJECT CARDS --- */
.card {
    border: 1px solid var(--border-muted);
    background: var(--bg);
    margin-bottom: 0;
}

.card:hover {
    border-color: var(--wired-pink);
    transform: none;
    box-shadow: 5px 5px 0px rgba(255, 0, 255, 0.3);
}

.card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.thumb {
    height: 120px;
    background: var(--bg-dim);
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-muted);
}

.card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-nosignal {
    font-size: 2rem;
    opacity: 0.2;
}

.card h3 {
    color: var(--wired-cyan);
    font-family: var(--f-pixel);
    font-size: 0.8rem;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.card p {
    font-size: 0.85rem;
    color: var(--fg-muted);
    margin: 0 0 12px 0;
}

/* --- PROJECT HERO (detail pages) --- */
.proj-hero {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px dashed var(--border-muted);
}

.proj-hero img {
    flex: 0 0 160px;
    width: 160px;
    height: auto;
    border: 1px solid var(--wired-dim);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* --- VIDEO EMBED (CRT style) --- */
.video-embed {
    flex: 1;
    min-width: 280px;
    max-width: 500px;
    aspect-ratio: 16/9;
    border: 2px solid var(--border-muted);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    background: var(--bg);
    margin-bottom: 0;
}

.video-embed::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.05), transparent 40%);
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.9;
}

/* --- STATUS WIDGET --- */
.status-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 6px 10px;
    font-family: var(--f-pixel);
    font-size: 0.7rem;
    color: var(--wired-green);
}

.val {
    color: var(--fg);
}

.status-bar {
    height: 4px;
    background: var(--bg-subtle);
    margin-top: 2px;
}

.status-bar .fill {
    height: 100%;
    background: var(--wired-green);
    box-shadow: 0 0 5px var(--wired-green);
}