/* ═══════════════════════════════════════════════════════════════════════════
   PATELARYAN.COM - Terminal Aesthetic Design System
   Inspired by prigoana.com | Built for Aryan Patel
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* Enable smooth touch scrolling on mobile */
@media (pointer: coarse) {
    * {
        cursor: auto;
    }
}

:root {
    --bg: #000000;
    --fg: #e0e0e0;
    --border: #1a1a1a;
    --border-light: #2a2a2a;
    --grid-dim: #050505;
    --font-mono: 'Courier New', Courier, monospace;
    --font-sans: 'Arial Black', 'Helvetica Neue', sans-serif;
    --accent: #ff4444;
    --accent-dim: rgba(255, 68, 68, 0.1);
    --accent-bright: #ffffff;
    --glitch-color-1: #00f2ff;
    --glitch-color-2: #ff00c3;
    --success: #00ff88;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Enable smooth touch scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

/* Disable smooth scroll on touch devices for better native scrolling */
@media (pointer: coarse) {
    html {
        scroll-behavior: auto;
    }
}

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-mono);
    overflow-x: hidden;
    font-size: 13px;
    line-height: 1.6;
    -webkit-font-smoothing: none;
    min-height: 100vh;
}

::selection {
    background: var(--accent);
    color: var(--bg);
    text-shadow: none;
}

/* Custom Scrollbar - Terminal Style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-left: 1px solid var(--border);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    display: inline-block;
}

a:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOISE OVERLAY - Creates that gritty texture
   ═══════════════════════════════════════════════════════════════════════════ */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background: 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.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    /* Ensure touch events pass through */
    touch-action: none;
}

/* CRT Scanline Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    opacity: 0.3;
    /* Ensure touch events pass through */
    touch-action: none;
}

/* Hide visual effects on mobile for better performance and scrolling */
@media (pointer: coarse) {

    .noise,
    .scanlines {
        display: none;
    }
}

/* Screen Flicker (subtle) */
@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    92% {
        opacity: 1;
    }

    93% {
        opacity: 0.9;
    }

    94% {
        opacity: 1;
    }

    97% {
        opacity: 0.95;
    }

    98% {
        opacity: 1;
    }
}

.frame {
    animation: flicker 8s infinite;
}

/* Ambient Glow Pulse */
@keyframes ambientGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.1);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 68, 68, 0.2), 0 0 60px rgba(255, 68, 68, 0.1);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1),
        transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN FRAME CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
.frame {
    max-width: 1400px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.95);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.9);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MARQUEE BANNER
   ═══════════════════════════════════════════════════════════════════════════ */
.marquee-wrap {
    border-bottom: 1px solid var(--fg);
    background: var(--fg);
    color: var(--bg);
    overflow: hidden;
    white-space: nowrap;
    padding: 8px 0;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    user-select: none;
}

.marquee-content {
    display: inline-block;
    animation: marquee 40s linear infinite;
    padding-left: 100%;
}

.marquee-wrap:hover .marquee-content {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER WITH ASCII TITLE
   ═══════════════════════════════════════════════════════════════════════════ */
header {
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    background: linear-gradient(180deg, #0a0a0a 0%, #000 100%);
    overflow-x: auto;
}

.ascii-title {
    font-family: var(--font-mono);
    font-size: clamp(0.35rem, 1.2vw, 0.75rem);
    line-height: 1.1;
    letter-spacing: 0;
    color: var(--fg);
    display: inline-block;
    position: relative;
    white-space: pre;
    transition: all 0.3s ease;
}

.ascii-title:hover {
    color: var(--accent-bright);
    text-shadow:
        0 0 5px var(--accent),
        0 0 10px var(--accent),
        0 0 20px var(--accent),
        0 0 40px var(--accent);
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.domain-suffix {
    color: var(--accent);
    font-weight: bold;
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-1deg);
    }

    40% {
        transform: skew(1deg);
    }

    60% {
        transform: skew(-0.5deg);
    }

    80% {
        transform: skew(0.5deg);
    }

    100% {
        transform: skew(0deg);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */
nav {
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
}

nav a {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border-right: 1px solid var(--border);
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.8rem;
    min-width: 100px;
    overflow: hidden;
}

nav a:last-child {
    border-right: none;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: translateY(100%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

nav a:hover {
    color: var(--bg);
}

nav a:hover::before {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GRID LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.grid-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
aside {
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    background: #000;
}

.widget {
    margin-bottom: 1.5rem;
}

.widget-title {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    margin-bottom: 12px;
    display: inline-block;
    color: var(--accent-bright);
}

/* Currently Reading Widget */
.reading-card {
    background: var(--grid-dim);
    border: 1px solid var(--border);
    padding: 12px;
}

.reading-quote {
    font-style: italic;
    font-size: 0.8rem;
    color: #bbb;
    border-left: 2px solid var(--accent);
    padding-left: 10px;
    margin-bottom: 8px;
}

.reading-source {
    font-size: 0.7rem;
    text-align: right;
    color: var(--accent);
    font-weight: bold;
}

/* Now Playing Widget */
.player-card {
    display: flex;
    gap: 12px;
    background: var(--grid-dim);
    border: 1px solid var(--border);
    padding: 10px;
}

.player-art-container {
    flex-shrink: 0;
}

.player-art {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid var(--border);
    filter: grayscale(30%);
    transition: filter 0.3s;
}

.player-card:hover .player-art {
    filter: grayscale(0%);
}

.player-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.player-track {
    font-weight: bold;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-time {
    font-size: 0.65rem;
    color: var(--success);
    margin-top: 4px;
}

/* Currently Building Widget */
.building-card {
    background: var(--grid-dim);
    border: 1px solid var(--border);
    padding: 12px;
}

.building-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 5px var(--success);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 15px var(--success);
    }
}

.status-text {
    font-size: 0.6rem;
    font-weight: bold;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.building-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.building-desc {
    font-size: 0.75rem;
    color: #888;
}

.commit-time {
    display: block;
    font-size: 0.65rem;
    color: var(--glitch-color-1);
    margin-top: 8px;
    font-family: var(--font-mono);
}

.building-card a {
    color: var(--accent);
    text-decoration: none;
}

.building-card a:hover {
    text-decoration: underline;
}

/* AI Twin Widget */
.ai-twin-container {
    background: var(--grid-dim);
    border: 1px solid var(--border);
}

.chat-messages {
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    font-size: 0.7rem;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #000;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-light);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.chat-message {
    margin-bottom: 8px;
    padding: 8px;
    background: #0a0a0a;
    border-left: 2px solid var(--accent);
}

.chat-message.user {
    border-left-color: var(--success);
    background: #0a0f0a;
}

.chat-text {
    color: #ccc;
    line-height: 1.4;
    font-size: 0.7rem;
}

/* Typing indicator animation */
.chat-message.typing .chat-text {
    color: var(--glitch-color-1);
}

.typing-dots {
    display: inline-block;
    animation: typingPulse 1s infinite;
}

@keyframes typingPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

.chat-form input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-form {
    display: flex;
    border-top: 1px solid var(--border);
}

.chat-form input {
    flex: 1;
    background: #000;
    border: none;
    color: var(--fg);
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.chat-form input:focus {
    outline: none;
    background: #050505;
}

.chat-form input::placeholder {
    color: #444;
}

.chat-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 15px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.chat-btn:hover {
    background: var(--accent-bright);
}

/* Connect Widget */
.connect-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.connect-links a {
    font-size: 0.8rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

.connect-links a:hover {
    padding-left: 10px;
    border-bottom-color: var(--accent);
}

.connect-links a:last-child {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
main {
    padding: 0;
}

.section-block {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
}

h2 {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-bright);
}

h2::before {
    content: '>';
    color: var(--accent);
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.section-num {
    color: var(--border-light);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* Project Cards - Enhanced */
.project-card {
    display: block;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    position: relative;
    background: #000;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--accent), var(--glitch-color-2));
    transition: height 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-card:hover::before {
    height: 100%;
}

/* RGB Shift on hover */
.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            rgba(0, 242, 255, 0.03) 0%,
            rgba(255, 0, 195, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateX(8px) scale(1.01);
    box-shadow:
        -8px 8px 0 rgba(255, 68, 68, 0.15),
        0 0 30px rgba(255, 68, 68, 0.1);
}

/* Focus state for keyboard nav */
.project-card:focus,
.project-card.keyboard-focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
    transform: translateX(8px);
    box-shadow:
        -8px 8px 0 rgba(255, 68, 68, 0.15),
        0 0 30px rgba(255, 68, 68, 0.1);
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    background: var(--grid-dim);
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.project-card:hover .card-header {
    background: #0a0a0a;
    padding-left: 1.2rem;
}

.card-status {
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.card-status.live {
    color: var(--success);
    text-shadow: 0 0 10px var(--success);
}

.project-card:hover .card-status.live {
    animation: pulse 1.5s infinite;
}

.card-body {
    padding: 1rem;
    transition: all 0.3s ease;
}

.project-card:hover .card-body {
    padding-left: 1.2rem;
}

.project-desc {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.project-card:hover .project-desc {
    color: #ddd;
}

/* Shopify Stores Grid */
.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.store-card {
    background: var(--grid-dim);
    border: 1px solid var(--border);
    padding: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.store-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--glitch-color-1));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.store-card:hover::after {
    transform: scaleX(1);
}

.store-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
}

.store-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.store-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 6px;
}

.store-desc {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 10px;
    line-height: 1.4;
}

.store-tag {
    display: inline-block;
    font-size: 0.6rem;
    padding: 3px 8px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Links List */
ul.resource-list {
    list-style: none;
    padding-left: 0;
}

ul.resource-list li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    transition: transform 0.2s;
    font-size: 0.9rem;
}

ul.resource-list li::before {
    content: '□';
    position: absolute;
    left: 0;
    color: var(--border-light);
    font-size: 0.8em;
    top: 2px;
}

ul.resource-list li:hover::before {
    content: '■';
    color: var(--accent);
}

ul.resource-list li:hover {
    transform: translateX(5px);
    color: #fff;
}

ul.resource-list a {
    font-weight: bold;
    border-bottom: 1px solid transparent;
}

ul.resource-list a:hover {
    border-bottom-color: var(--accent);
}

ul.resource-list span {
    color: #666;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMMAND PALETTE
   ═══════════════════════════════════════════════════════════════════════════ */
.cmd-palette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cmd-palette.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cmd-palette.hidden .cmd-modal {
    transform: translateY(-20px) scale(0.95);
}

.cmd-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.cmd-modal {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid var(--border-light);
    box-shadow:
        0 0 0 1px rgba(255, 68, 68, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 100px rgba(255, 68, 68, 0.1);
    transform: translateY(0) scale(1);
    transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.cmd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #050505;
}

.cmd-prompt {
    color: var(--accent);
    font-weight: bold;
    font-family: var(--font-mono);
}

#cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
}

#cmd-input::placeholder {
    color: #555;
}

.cmd-hint {
    background: var(--border);
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.cmd-results {
    max-height: 300px;
    overflow-y: auto;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #aaa;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.cmd-item:hover,
.cmd-item.active {
    background: rgba(255, 68, 68, 0.1);
    color: #fff;
    border-left-color: var(--accent);
}

.cmd-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: var(--border);
    color: var(--accent);
    font-weight: bold;
    font-size: 0.75rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.cmd-footer {
    display: flex;
    gap: 20px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: #050505;
    font-size: 0.7rem;
    color: #666;
}

.cmd-footer kbd {
    background: var(--border);
    color: #888;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    margin-right: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   KEYBOARD NAVIGATION INDICATOR
   ═══════════════════════════════════════════════════════════════════════════ */
.keyboard-mode-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--accent);
    padding: 8px 16px;
    font-size: 0.75rem;
    color: var(--accent);
    font-family: var(--font-mono);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.keyboard-mode-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.keyboard-mode-indicator kbd {
    background: var(--accent);
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 0 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER - Enhanced
   ═══════════════════════════════════════════════════════════════════════════ */
footer {
    padding: 2rem;
    border-top: 1px solid var(--border);
    background: var(--grid-dim);
}

.terminal-footer {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
}

.terminal-prompt {
    color: var(--success);
    font-weight: bold;
}

.terminal-colon {
    color: #fff;
}

.terminal-path {
    color: var(--glitch-color-1);
}

.terminal-dollar {
    color: #fff;
    margin-right: 8px;
}

.terminal-command {
    color: #888;
}

.terminal-cursor {
    color: var(--accent);
    animation: cursor-blink 1s infinite;
    margin-left: 2px;
}

@keyframes cursor-blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tablet landscape / small desktop (900px and below) */
@media (max-width: 900px) {
    body {
        font-size: 12px;
    }

    .grid-layout {
        grid-template-columns: 1fr;
    }

    aside {
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1.25rem;
    }

    .widget {
        margin-bottom: 0;
    }

    header {
        padding: 2rem 1rem;
    }

    .ascii-title {
        font-size: 0.35rem;
    }

    nav a {
        padding: 0.75rem 0.5rem;
        font-size: 0.65rem;
        min-width: 60px;
    }

    .section-block {
        padding: 1.5rem 1rem;
    }

    h2 {
        font-size: 1.4rem;
    }

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

/* Tablet portrait (768px and below) */
@media (max-width: 768px) {
    aside {
        gap: 0.75rem;
        padding: 1rem;
    }

    .section-block {
        padding: 1.25rem 0.75rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .ascii-title {
        font-size: 0.33rem;
    }
}

/* Large phones (600px and below) */
@media (max-width: 600px) {
    body {
        font-size: 11px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    aside {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0.75rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .widget {
        max-width: 100%;
        overflow: hidden;
    }

    .reading-card,
    .player-card,
    .building-card,
    .ai-twin-container {
        max-width: 100%;
        box-sizing: border-box;
    }

    .reading-source {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    header {
        padding: 1.5rem 0.75rem;
        overflow-x: hidden;
    }

    .frame {
        border-left: none;
        border-right: none;
        max-width: 100%;
    }

    main {
        max-width: 100%;
        overflow-x: hidden;
    }

    .project-card {
        max-width: 100%;
    }

    .project-desc {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .ascii-title {
        font-size: 0.3rem;
    }

    /* Navigation: Convert to 2x2 grid for better tap targets */
    nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    nav a {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem;
        min-width: unset;
    }

    nav a:nth-child(odd) {
        border-right: 1px solid var(--border);
    }

    nav a:nth-child(n+3) {
        border-bottom: none;
    }

    nav a:last-child {
        border-right: none;
    }

    .section-block {
        padding: 1rem;
        box-sizing: border-box;
        width: 100%;
    }

    h2 {
        font-size: 1.2rem;
    }

    .card-header,
    .card-body {
        box-sizing: border-box;
        width: 100%;
    }

    .stores-grid {
        grid-template-columns: 1fr;
    }

    .terminal-footer {
        font-size: 0.7rem;
    }

    /* Disable transform on mobile - causes scroll issues */
    .project-card:hover {
        transform: none;
    }

    .project-card:active {
        background: #0a0a0a;
        border-color: var(--accent);
    }

    .project-card:hover .card-header,
    .project-card:hover .card-body {
        padding-left: 1rem;
    }
}

/* Standard phones (480px and below) */
@media (max-width: 480px) {
    .ascii-title {
        font-size: 0.22rem;
        transform: scale(0.85);
        transform-origin: center;
    }

    header {
        padding: 1.25rem 0.5rem;
        overflow: hidden;
    }

    .section-block {
        padding: 0.75rem;
        box-sizing: border-box;
    }

    main,
    .project-card,
    .card-header,
    .card-body {
        box-sizing: border-box;
        max-width: 100%;
    }

    h2 {
        font-size: 1.1rem;
    }

    .card-header {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .project-desc {
        font-size: 0.8rem;
    }

    .terminal-footer {
        font-size: 0.65rem;
        padding: 0.75rem;
    }

    .widget-title {
        font-size: 0.8rem;
    }

    .reading-quote {
        font-size: 0.75rem;
    }

    .player-art {
        width: 60px;
        height: 60px;
    }

    .player-track {
        font-size: 0.8rem;
    }

    .player-artist {
        font-size: 0.7rem;
    }
}

/* Small phones (375px and below) */
@media (max-width: 375px) {
    body {
        font-size: 10px;
    }

    .ascii-title {
        font-size: 0.18rem;
        transform: scale(0.7);
        transform-origin: center;
    }

    header {
        padding: 1rem 0.5rem;
        overflow: hidden;
    }

    aside {
        padding: 0.75rem 0.5rem;
    }

    .widget-title {
        font-size: 0.75rem;
    }

    .reading-quote {
        font-size: 0.7rem;
    }

    .section-block {
        padding: 0.75rem 0.5rem;
    }

    h2 {
        font-size: 1rem;
    }

    .card-header {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .card-body {
        padding: 0.5rem;
    }

    .project-desc {
        font-size: 0.75rem;
    }

    nav a {
        padding: 0.6rem 0.4rem;
        font-size: 0.65rem;
    }

    .terminal-footer {
        font-size: 0.6rem;
        padding: 0.5rem;
    }

    .player-art {
        width: 50px;
        height: 50px;
    }

    .chat-messages {
        max-height: 120px;
        font-size: 0.65rem;
    }

    .chat-text {
        font-size: 0.65rem;
    }

    .chat-form input {
        font-size: 0.65rem;
        padding: 8px;
    }

    .chat-btn {
        padding: 8px 12px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE TOUCH SCROLLING OPTIMIZATION
   Fixes scroll getting "stuck" on touch devices
   ═══════════════════════════════════════════════════════════════════════════ */
@media (pointer: coarse),
(hover: none) {

    /* Enable smooth momentum scrolling */
    html,
    body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: none;
        touch-action: pan-y pinch-zoom;
    }

    /* Ensure main scrollable areas work properly */
    .frame {
        touch-action: pan-y;
        overflow-y: auto;
    }

    /* Remove all transforms that can capture scroll events */
    .project-card,
    .store-card,
    nav a,
    ul.resource-list li {
        transform: none !important;
        will-change: auto;
    }

    /* Disable pseudo-element animations that cause repaints */
    .project-card::before,
    .project-card::after,
    nav a::before {
        display: none;
    }

    /* Simpler active states for touch feedback */
    .project-card:active {
        background: rgba(255, 68, 68, 0.1);
        border-color: var(--accent);
    }

    nav a:active {
        background: var(--accent);
        color: var(--bg);
    }

    ul.resource-list li:active {
        color: var(--accent);
    }

    /* Disable flicker animation that can affect scrolling */
    .frame {
        animation: none !important;
    }

    /* Ensure chat doesn't interfere with page scroll */
    .chat-messages {
        touch-action: pan-y;
        overscroll-behavior: contain;
    }

    /* Command palette backdrop fix */
    .cmd-backdrop {
        touch-action: none;
    }

    /* Widget cards - remove any scroll-blocking transforms */
    .widget,
    .reading-card,
    .player-card,
    .building-card,
    .ai-twin-container {
        transform: none;
        will-change: auto;
    }
}