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

/* Ghost typist */
.ghost-field {
    display: inline;
    color: var(--theme-text);
    letter-spacing: 0.04em;
    font-size: 1em;
}

.ghost-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: var(--theme-text);
    box-shadow: 0 0 4px var(--theme-text);
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: ghost-blink 0.9s step-start infinite;
}

@keyframes ghost-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

:root {
    --bg-color: #0b0811;
    --neon-green: #39ff14;
    --magi-orange: #ff6600;
    --magi-red: #ff0000;
    --grid-color: rgba(255, 102, 0, 0.2);
    --theme-text: var(--magi-orange);
    --theme-ui: var(--magi-orange);
    --theme-clock: var(--magi-orange);
    --theme-bg: var(--bg-color);
    /* chromatic aberration split colors — updated by JS based on theme */
    --aberr-warm: rgba(255, 0, 0, 0.6);
    --aberr-cool: rgba(0, 204, 255, 0.6);
}

body {
    background-color: var(--theme-bg);
    color: var(--theme-text);
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
    /* CRT color bleed & slight blur, reduced offsets */
    text-shadow: 1px 0px 2px var(--aberr-warm), -1px 0px 2px var(--aberr-cool),
                 0 0 8px rgba(255,255,255,0.4);
    filter: contrast(1.2) brightness(1.1) saturate(1.2) blur(0.5px);
}

/* ASCII Bunny element (centered) */
#ascii-bunny {
    color: var(--theme-ui);
      font-size: clamp(10px, 1.5vw, 16px);
      line-height: 1.18;
      letter-spacing: .05em;
      white-space: pre;
      text-shadow: 0 0 8px var(--theme-ui);
      user-select: none;
      cursor: grab;
      font-family: 'Share Tech Mono', 'Courier New', monospace;
      z-index: 20;
      display: none; 
      overflow: visible; 
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    outline: none;
    box-shadow: none;
}

.bunny-shape-float--left {
    float: left;
    width: 0;
    height: 0;
    pointer-events: none;
    user-select: none;
}
.bunny-shape-float--right {
    float: right;
    width: 0;
    height: 0;
    pointer-events: none;
    user-select: none;
}

.text-area {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    gap: 0;
    align-items: flex-start;
}

#bunny-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: max-content;
    border: none;
    background: transparent;
    box-shadow: none;
    outline: none;
    z-index: 2;
}

/* CRT Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    /* Vignette */
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.9), inset 0 0 40px rgba(0,0,0,0.8);
    animation: crt-flicker 0.15s infinite;
}

.scanlines::before {
    content: " ";
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Fine scanlines */
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.3) 50%,
        rgba(0,0,0,0.3)
    );
    background-size: 100% 4px;
}


.screen {
    width: 100vw;
    height: 100vh;
    padding: 2rem;
    display: none;
    animation: crt-flicker 0.2s infinite;
    transition: opacity 0.5s ease-in-out;
    /* Lens distortion curvature */
    transform: perspective(1000px) rotateX(1deg) rotateY(-0.5deg) scale(0.98);
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.screen.hidden {
    display: none;
}

/* Petting */
.ascii-heart {
    position: fixed;
    color: var(--magi-red, #ff0000);
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 1000;
    user-select: none;
    animation: floatHeart 1.2s ease-out forwards;
    text-shadow: 0 0 8px var(--magi-red, #ff0000);
}

@keyframes floatHeart {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    50% { opacity: 1; }
    100% { transform: translateY(-80px) scale(1.5); opacity: 0; }
}

/* --- TERMINAL SCREEN --- */
#terminal-screen {
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.terminal-container {
    width: 70vw;
    height: 70vh;
    max-width: none;
    max-height: none;
    color: var(--theme-text);
    text-shadow: 1px 0px 2px var(--aberr-warm), -1px 0px 2px var(--aberr-cool), 0 0 8px var(--theme-text);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.system-text {
    margin-bottom: 2rem;
    font-size: 2rem;
    letter-spacing: 2px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    margin-top: 2rem;
}

.prompt {
    margin-right: 10px;
    font-size: 2rem;
}

#cmd-input {
    background: transparent;
    border: none;
    color: var(--theme-text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 2rem;
    width: 100%;
    outline: none;
    text-transform: uppercase;
    text-shadow: 1px 0px 2px var(--aberr-warm), -1px 0px 2px var(--aberr-cool), 0 0 8px var(--theme-text);
}

/* --- HOMEPAGE SCREEN --- */
#home-screen {
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    background-attachment: fixed; 
    min-height: 100vh; 
    overflow-y: auto; 
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 3px solid var(--theme-ui);
    padding: 1rem 2rem;
    background-color: color-mix(in srgb, var(--theme-ui) 10%, transparent);
    margin-bottom: 2rem;
}

.brand {
    display: flex;
    flex-direction: column;
}

.alert-text {
    color: var(--magi-red);
    font-weight: bold;
    animation: blink 1s infinite alternate;
}

.main-header h1 {
    font-size: 2.5rem;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.top-nav {
    display: flex;
    gap: 2rem;
    margin-left: auto;
}

.gear-btn {
    background: transparent;
    color: var(--theme-text);
    font-size: 1.2rem;
    cursor: pointer;
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--theme-ui);
    transition: all 0.3s;
    margin-left: 2rem;
    border-radius: 3px;
    line-height: 1;
    padding: 0;
}

.gear-btn:hover {
    background-color: var(--theme-ui);
    color: var(--bg-color);
}

/* settings screen elements */
.settings-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 2px solid var(--theme-ui);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.settings-content {
    padding: 1rem;
}

/* settings console mimics terminal look */
.settings-terminal {
    background-color: rgba(0,0,0,0.5);
    padding: 0.5rem;
    border: 1px solid var(--theme-ui);
    margin-top: 1rem;
    font-family: 'Share Tech Mono', monospace;
    color: var(--theme-text);
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.settings-log {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 0.5rem;
}

.settings-log .entry {
    margin-bottom: 0.3rem;
}

.settings-terminal .input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.settings-terminal .prompt {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.suggestion {
    position: absolute;
    left: calc(1ch * 0 + 0);
    pointer-events: none;
    color: var(--theme-text);
    opacity: 0.4;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    white-space: pre;
    z-index: 0;
}

.suggestion .current {
    text-decoration: underline;
    opacity: 1;
    color: var(--neon-green);
}
#settings-input {
    background: transparent;
    border: none;
    color: var(--theme-text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    width: 100%;
    outline: none;
    text-transform: lowercase;
    z-index: 1;
}

.nav-item {
    color: var(--theme-text);
    text-decoration: none;
    font-size: 1.2rem;
    border: 1px solid var(--theme-ui);
    padding: 0.5rem 1rem;
    transition: all 0.3s;
}

.nav-item:hover {
    background-color: var(--theme-ui);
    color: var(--bg-color);
}

.disable-click {
    cursor: not-allowed;
}

.text-archive-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    flex-grow: 1;
    min-width: 0;
    padding: 0 4rem 4rem 4rem; 
    font-size: 1.1rem;
    line-height: 1.4;
    text-transform: none;
    position: relative;
}

.archive-column {
    flex: 1 1 0;
    min-width: 0;
    display: block;
    position: relative;
    font-weight: bold;
    text-align: left;
    text-justify: inter-word;
    text-shadow: 0 0 5px var(--theme-text);
    overflow-wrap: break-word;
    overflow: hidden;
    opacity: 0.6;
}

.archive-column--left,
.archive-column--left p {
    text-align: left;
}

.archive-column--right,
.archive-column--right p {
    text-align: right;
}

.archive-column p {
    word-break: break-word;
    margin-bottom: 0.25rem;
    text-align: inherit;
    line-height: 1.35;
}

.archive-column .indent {
    margin-left: 3rem;
}

.archive-column--right .indent {
    margin-left: 0;
    margin-right: 3rem;
}

.archive-column .data-block {
    letter-spacing: 2px;
    line-height: 1.8;
}

/* System Clock */
.system-clock {
    position: fixed; 
    bottom: 20px;
    left: 20px;
    background-color: #0b0811;
    border: none; 
    border-radius: 5px;
    padding: 10px 15px;
    color: var(--theme-clock); 
    font-size: 2.5rem;
    font-weight: 900;
    display: flex;
    align-items: baseline;
    gap: 5px;
    box-shadow: 0 0 15px var(--theme-clock), inset 0 0 10px var(--theme-clock);
    text-shadow: 0 0 8px var(--theme-clock);
    transform: none;
}

.system-clock .meridian {
    font-size: 1.5rem;
}

/* Social Links Card */
.sidebar-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 0 0 280px; /* fixed width column on the right */
    position: sticky;
    top: 2rem;
}

.social-card {
    min-width: 280px;
    height: max-content;
    border: 2px solid var(--theme-ui);
    background-color: rgba(11, 8, 17, 0.9);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.15);
    z-index: 50; /* Keep above text */
}

.social-header {
    background-color: var(--theme-ui);
    color: #000;
    padding: 0.5rem 1rem;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.social-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid var(--theme-ui);
    text-decoration: none;
    color: var(--theme-text);
    transition: all 0.2s;
    cursor: pointer;
}

.social-item.non-link {
    cursor: default;
}

.social-item:last-child {
    border-bottom: none;
}

.social-item:hover:not(.non-link) {
    background-color: var(--theme-ui);
    color: #000;
}

.social-item:hover:not(.non-link) .diag-bar {
    background-color: #000;
    box-shadow: none;
}

.diag-bar {
    width: 6px;
    background-color: var(--theme-ui);
    margin-right: 15px;
    box-shadow: 0 0 5px var(--theme-ui);
}

.diag-bar.warning {
    background-color: #00ffff;
    box-shadow: 0 0 5px #00ffff;
}

.social-item.non-link:hover .diag-bar.warning {
    background-color: #00ffff;
}

.social-content {
    display: flex;
    flex-direction: column;
}

.s-label {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.3rem;
}

.s-value {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Glitch Effect */
.glitch {
    font-size: 3rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    color: var(--magi-red);
    margin-bottom: 1.5rem;
    text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.025em -0.05em 0 rgba(0,255,0,0.75), 0.025em 0.05em 0 rgba(0,0,255,0.75);
    animation: glitch 500ms infinite;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    border: 1px solid var(--magi-red);
    margin-top: 1rem;
}

.progress-bar {
    width: 80%;
    height: 100%;
    background-color: var(--magi-red);
    animation: load 2s ease-in-out infinite alternate;
}

.data-list {
    list-style: none;
    margin-top: 1rem;
}

.data-list li {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.critical {
    color: var(--magi-red);
    animation: blink 0.5s infinite alternate;
}

@keyframes blink {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes crt-flicker {
    0% { opacity: 1; }
    5% { opacity: 0.8; }
    10% { opacity: 0.9; }
    15% { opacity: 0.6; }
    20% { opacity: 0.95; }
    25% { opacity: 0.7; }
    30% { opacity: 0.85; }
    40% { opacity: 0.9; }
    60% { opacity: 0.75; }
    80% { opacity: 0.9; }
    90% { opacity: 0.8; }
    100% { opacity: 1; }
}

@keyframes load {
    0% { width: 75%; }
    100% { width: 95%; }
}

@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
    14% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
    15% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
    49% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
    50% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
    99% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
    100% { text-shadow: -0.025em 0 0 rgba(255,0,0,0.75), -0.025em -0.025em 0 rgba(0,255,0,0.75), -0.025em -0.05em 0 rgba(0,0,255,0.75); }
}