/* ===========================
   TWO BIT CONSULTING - STYLESHEET
   =========================== */

/* Import Pixel Font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Pixelify+Sans&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    background-color: #999999; /* fallback */
    background-image: repeating-conic-gradient(#E4E4ED 0% 25%, #999999 0% 50%);
    background-size: 10px 10px;
}

body {
    height: 100%;
    font-family: 'Pixelify Sans', sans-serif;
    background: transparent;
    padding: 10px;
    color: #333333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1500px;
    margin: 0 auto;
    background-color: #f0f0f0;
    border: 3px solid #999;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #666666;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 20px);
}

/* Header Styles */
.header {
    background-color: #000000;
    flex-shrink: 0;
    border: 3px solid;
    border-color: #ffffff #333333 #333333 #ffffff;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #000000;
}

.header-border-top {
    height: 4px;
    background: linear-gradient(to bottom, #cccccc, #999999);
    border-bottom: 1px solid #666666;
}

.header-border-bottom {
    height: 4px;
    background: linear-gradient(to top, #cccccc, #999999);
    border-top: 1px solid #333333;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    gap: 8px;
    height: auto;
}

.color-blocks-left,
.color-blocks-right {
    display: grid;
    grid-template-columns: repeat(4, 20px);
    grid-template-rows: repeat(6, 20px);
    gap: 2px;
    padding: 4px;
    background-color: #999999;
    border: 2px solid;
    border-color: #ffffff #333333 #333333 #ffffff;
    flex-shrink: 0;
}

.color-blocks-left span,
.color-blocks-right span {
    width: 20px;
    height: 20px;
    display: block;
    border: 1px solid #666666;
}

.header-content {
    flex: 1;
    text-align: center;
    background-color: #000000;
    padding: 8px;
}

.header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5em;
    font-weight: 400;
    color: #ff6600;
    margin: 0;
    line-height: 1;
    animation: neon-flicker 3s ease-in-out infinite;
}

@keyframes neon-flicker {
    0%, 100% {
        text-shadow:
            0 0 5px #ff6600,
            0 0 10px #ff6600,
            0 0 20px #ff6600,
            0 0 40px #ff4400,
            0 0 80px #ff4400;
    }
    45% {
        text-shadow:
            0 0 4px #ff6600,
            0 0 8px #ff6600,
            0 0 16px #ff6600,
            0 0 32px #ff4400,
            0 0 64px #ff4400;
    }
    50% {
        text-shadow: none;
    }
    55% {
        text-shadow:
            0 0 4px #ff6600,
            0 0 8px #ff6600,
            0 0 16px #ff6600,
            0 0 32px #ff4400,
            0 0 64px #ff4400;
    }
    85% {
        text-shadow:
            0 0 5px #ff6600,
            0 0 10px #ff6600,
            0 0 20px #ff6600,
            0 0 40px #ff4400,
            0 0 80px #ff4400;
    }
    87% {
        text-shadow: none;
    }
    89% {
        text-shadow:
            0 0 5px #ff6600,
            0 0 10px #ff6600,
            0 0 20px #ff6600,
            0 0 40px #ff4400,
            0 0 80px #ff4400;
    }
}

/* Main Wrapper */
.main-wrapper {
    display: flex;
    flex: 1;
    gap: 10px;
    padding: 10px;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   MAC SYSTEM 9 HORIZONTAL MENU BAR
═══════════════════════════════════════════════════════ */

/* ── Menu Bar ────────────────────────────────────────── */
.sys9-menubar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: stretch;
    height: 32px;
    border-bottom: 1.5px solid #555;
    box-shadow:
        inset 0 1px 0 #f0f0f0,
        0 2px 4px rgba(0,0,0,0.6);
    user-select: none;
    font-family: 'Chicago', 'Share Tech Mono', system-ui, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #000;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 1px,
            rgba(0,0,0,0.04) 1px,
            rgba(0,0,0,0.04) 2px
        ),
        linear-gradient(to bottom, #d8d8d8 0%, #c4c4c4 40%, #b0b0b0 41%, #bcbcbc 100%);
}

/* Apple logo far-left */
.sys9-apple {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 14px;
    border-right: 1px solid #999;
    cursor: default;
    color: #222;
    letter-spacing: -1px;
}

/* ── Each menu item wrapper ───────────────────────────── */
.sys9-menu {
    position: relative;
    display: flex;
    align-items: center;
}

/* ── Menu title / clickable label ────────────────────── */
.sys9-menu-title {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 10px;
    height: 32px;
    cursor: default;
    white-space: nowrap;
    border-right: 1px solid #aaa;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 15px;
    color: #111;
    transition: none;
}

.sys9-menu-title .material-icons {
    font-size: 18px;
    line-height: 1;
}

/* Hover state */
.sys9-menu a.sys9-menu-title {
    text-decoration: none;
    color: #111;
}

.sys9-menu a.sys9-menu-title:hover {
    background: #1A8FE5;
    color: #fff;
    box-shadow: inset 1px 0 0 #444, inset -1px 0 0 #444;
}

.sys9-menu a.sys9-menu-title:hover .material-icons {
    color: #fff;
}

/* Dropdown */
.sys9-dropdown {
    display: none;
    position: absolute;
    top: 32px;
    left: 0;
    min-width: 220px;
    background: linear-gradient(to bottom, #d0d0d0 0%, #c8c8c8 100%);
    border: 1.5px solid #444;
    border-top: none;
    box-shadow: 3px 3px 0 #000, inset 1px 0 0 #e8e8e8, inset 0 1px 0 #e8e8e8;
    z-index: 2000;
}

.sys9-menu:hover .sys9-dropdown,
.sys9-menu:focus-within .sys9-dropdown {
    display: block;
}

.sys9-dropdown a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 2px 16px 2px 10px;
    color: #111;
    text-decoration: none;
    font-size: 14px;
    font-family: 'Chicago', 'Share Tech Mono', system-ui, sans-serif;
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sys9-dropdown a .material-icons {
    font-size: 14px;
    color: #333;
    min-width: 16px;
}

.sys9-dropdown a:hover {
    background: #1A8FE5;
    color: #fff;
}

.sys9-dropdown a:hover .material-icons {
    color: #fff;
}

.sys9-divider {
    height: 1px;
    background: linear-gradient(to right, #888, #bbb, #888);
    margin: 2px 4px;
    border: none;
}

.sys9-dropdown a.sub-item {
    padding-left: 28px;
    font-weight: normal;
    font-size: 14px;
    color: #333;
}

.sys9-dropdown a.sub-item:hover {
    background: #1A8FE5;
    color: #fff;
}

/* Clock / right-side label */
.sys9-clock {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 15px;
    color: #222;
    font-family: 'Share Tech Mono', monospace;
    border-left: 1px solid #aaa;
    letter-spacing: 0.05em;
}

/* Content Area */
.content {
    flex: 1;
    background-color: #ffffff;
    border: 3px solid;
    border-color: #ffffff #666666 #666666 #ffffff;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #333333;
    overflow-y: auto;
    padding: 15px;
}

.content-header {
    background: linear-gradient(to bottom, #0099ff, #0066cc);
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 2px;
    margin: -15px -15px 15px -15px;
    border-bottom: 2px solid #333;
}

.content-box {
    padding: 10px;
}

.content-box h2 {
    color: #0099ff;
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #0099ff;
    padding-bottom: 5px;
}

.content-box h3 {
    color: #ff9900;
    font-size: 18px;
    margin-top: 15px;
    margin-bottom: 8px;
}

.content-box h4 {
    color: #ff6600;
    font-size: 14px;
    margin-top: 15px;
    margin-bottom: 8px;
}

.content-box p {
    color: #333;
    margin-bottom: 12px;
    text-align: justify;
}

.content-box ul {
    margin-left: 30px;
    margin-bottom: 15px;
    color: #333;
}

.content-box li {
    margin-bottom: 8px;
    list-style-type: square;
}

.content-box a {
    color: #ff9900;
}
.content-box a:hover {
    color: #ff6600;
}

/* Section separator */
.section-divider {
    background: linear-gradient(to bottom, #0099ff, #0066cc);
    color: white;
    padding: 8px 15px;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 2px;
    margin: 40px -10px 25px -10px;
    border-top: 2px solid #003399;
    border-bottom: 2px solid #003399;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
    scroll-margin-top: 40px;
}

.section-divider-slim {
    margin: 20px -10px 15px -10px;
}

/* Service card grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 15px 0 20px 0;
}

.service-card {
    background-color: #f0f0f0;
    border: 2px solid;
    border-color: #ffffff #666666 #666666 #ffffff;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #999999;
    padding: 16px 18px;
}

.service-card h3 {
    color: #ff9900;
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 6px;
    border-bottom: none;
}

.service-card p {
    font-size: 13px;
    color: #555;
    margin-bottom: 0;
}

/* Portfolio card images */
.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: top;
    display: block;
    margin-bottom: 8px;
}

/* Portfolio grid last card full width when orphaned */
.service-card:last-child:nth-child(3n+1) {
    grid-column: 1 / -1;
}

/* Collab/person callout card */
.collab-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background-color: #f0f0f0;
    border: 2px solid;
    border-color: #ffffff #666666 #666666 #ffffff;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #999999;
    padding: 14px;
    margin: 15px 0;
}

.collab-card h4 {
    color: #ff6600;
    font-size: 13px;
    margin-top: 0;
    margin-bottom: 6px;
}

.collab-card p {
    font-size: 13px;
    margin-bottom: 0;
}

/* Section note (italic callout) */
.section-note {
    font-size: 13px;
    color: #555;
    border-left: 3px solid #0099ff;
    padding-left: 12px;
    margin: 10px 0 20px 0;
    font-style: italic;
}

/* Pixel-Portrait Items */
.pixel-images {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    text-align: center;
    align-items: end;
}

.pixel-portrait-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.caption {
    text-align: center;
}

.pixel-portrait {
    height: 150px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.pixel-portrait-large {
    display: block;
    margin: 20px auto;
    width: 80%;
    max-width: 600px;
}

/* Contact form */
.content-box form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
}

.content-box form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: #333;
    font-family: 'Pixelify Sans', sans-serif;
}

.content-box form input[type="email"],
.content-box form input[type="text"],
.content-box form textarea {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: #333;
    background-color: #ffffff;
    border: 2px solid;
    border-color: #666666 #ffffff #ffffff #666666;
    box-shadow: inset 1px 1px 0 #999999;
    padding: 6px 8px;
    width: 100%;
}

.content-box form input:focus,
.content-box form textarea:focus {
    outline: none;
    border-color: #0099ff #ffffff #ffffff #0099ff;
    box-shadow: inset 1px 1px 0 #0066cc;
}

.content-box form textarea {
    height: 120px;
    resize: vertical;
}

.content-box form button[type="submit"] {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #333;
    background-color: #e0e0e0;
    border: 2px solid;
    border-color: #ffffff #666666 #666666 #ffffff;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #999999;
    padding: 8px 24px;
    cursor: pointer;
    align-self: flex-start;
}

.content-box form button[type="submit"]:hover {
    background-color: #0099ff;
    color: #ffffff;
    border-color: #ffffff #003399 #003399 #ffffff;
}

.content-box form button[type="submit"]:active {
    border-color: #666666 #ffffff #ffffff #666666;
    box-shadow: inset 1px 1px 0 #999999;
}

/* Konami dogs */
.konami-dog {
    position: fixed;
    bottom: 40px;
    z-index: 10000;
    height: 80px;
    width: auto;
    image-rendering: pixelated;
    animation: dog-run 4s linear forwards;
    right: -150px;
}

#konami-gus {
    animation-delay: 0s;
}

#konami-rosie {
    animation-delay: 0.6s;
    animation-fill-mode: backwards;
}

@keyframes dog-run {
    from { right: -150px; }
    to { right: 110%; }
}

/* Lightning bolt element */
.lightning {
    position: fixed;
    font-family: 'Press Start 2P', cursive;
    font-size: 48px;
    color: #ffff00;
    z-index: 10001;
    pointer-events: none;
    animation: lightning-fly 0.8s ease-out forwards;
}

@keyframes lightning-fly {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(2); }
}

/* Konami neon overdrive */
@keyframes neon-overdrive {
    0%   { color: #ffff00; text-shadow: 0 0 10px #ffff00, 0 0 30px #ffff00, 0 0 80px #ffee00; }
    10%  { color: #ffffff; text-shadow: 0 0 5px #ffffff, 0 0 20px #0099ff, 0 0 60px #0066cc; }
    20%  { color: #ffff00; text-shadow: none; }
    25%  { color: #ffff00; text-shadow: 0 0 10px #ffff00, 0 0 40px #ffff00, 0 0 100px #ffee00; }
    40%  { color: #ffffff; text-shadow: 0 0 5px #ff6600, 0 0 20px #ff6600, 0 0 80px #ff4400, 0 0 120px #ff0000; }
    50%  { color: #ffff00; text-shadow: none; }
    55%  { color: #ffff00; text-shadow: 0 0 15px #ffff00, 0 0 50px #ffff00, 0 0 120px #ffee00; }
    70%  { color: #ffffff; text-shadow: 0 0 5px #0099ff, 0 0 20px #0099ff, 0 0 60px #0066cc; }
    80%  { color: #ffff00; text-shadow: none; }
    85%  { color: #ffff00; text-shadow: 0 0 10px #ffff00, 0 0 30px #ffff00, 0 0 80px #ffee00; }
    100% { color: #ff6600; text-shadow: 0 0 5px #ff6600, 0 0 10px #ff6600, 0 0 20px #ff6600, 0 0 40px #ff4400, 0 0 80px #ff4400; }
}

.neon-overdrive {
    animation: neon-overdrive 3s ease-in-out forwards !important;
}

/* ── Screensaver ────────────────────────────────────── */
#screensaver {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    z-index: 99999;
    overflow: hidden;
    cursor: none;
}

#screensaver-msg {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    color: #444;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, #c0c0c0, #808080);
    color: #333;
    text-align: right;
    padding: 15px;
    border-top: 3px solid;
    border-color: #ffffff #666666 #666666 #ffffff;
    font-size: 12px;
    flex-shrink: 0;
}

.footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        min-height: 100vh;
        min-height: 100svh;
        min-height: -webkit-fill-available;
        border: none;
        box-shadow: none;
    }

    .main-wrapper {
        flex-direction: column;
        overflow: visible;
    }

    .header h1 {
        font-size: 14px;
    }

    .color-blocks-left,
    .color-blocks-right {
        display: none;
    }

    .sys9-menubar {
         position: relative;
         height: auto;
         min-height: 32px;
         /* no overflow-x: auto */
     }

    .sys9-menu-title span:not(.material-icons) {
         display: none; /* hide text, keep icons */
     }

    .sys9-dropdown {
         position: absolute;
         top: 100%;
         left: 0;
         width: 58vw;
         z-index: 9999;
         border-top: 1.5px solid #555;
     }

    .content {
        z-index: 1;
        overflow-y: visible;
    }

    .sys9-menu-title {
        font-size: 12px;
        padding: 0 6px;
        height: 100%;
    }

    .sys9-clock {
        font-size: 12px;
        padding: 0 6px;
    }
    
    .pixel-images {
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
    
        .pixel-portrait {
            height: 100px;
        }

    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    .pixel-images {
         grid-template-columns: 1fr 1fr;
         gap: 12px;
     }
    
     .pixel-portrait {
         height: 80px;
     }
}

/* Print Styles */
@media print {
    .container {
        border: none;
        box-shadow: none;
        max-width: 100%;
    }
}