/* ═══════════════════════════════════════════════════
   HEN MODE — hic et nunc art discovery view
   ═══════════════════════════════════════════════════ */

/* ── Base Layer ── */
.hen-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #111;
    color: #e0e0e0;
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    flex-direction: column;
}
.hen-overlay.active {
    display: flex;
}

/* ── Boot Sequence ── */
.hen-boot {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-family: 'JetBrains Mono', monospace;
    color: #00d4ff;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.3s;
}
.hen-boot.visible { opacity: 1; }
.hen-boot-line {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    margin: 2px 0;
}
.hen-boot-line.show {
    opacity: 1;
    transform: translateY(0);
}
.hen-boot-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #00d4ff;
    animation: hen-blink 0.6s step-end infinite;
    margin-left: 4px;
    vertical-align: middle;
}
@keyframes hen-blink {
    50% { opacity: 0; }
}

/* ── Header ── */
.hen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
    background: #111;
}
.hen-logo {
    font-size: 1rem;
    font-weight: 700;
    color: #e0e0e0;
    letter-spacing: 0.08em;
}
.hen-logo span {
    color: #00d4ff;
}
.hen-mint-count {
    font-size: 0.72rem;
    color: #666;
    letter-spacing: 0.03em;
}
.hen-close {
    background: none;
    border: 1px solid #333;
    color: #666;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
}
.hen-close:hover {
    color: #e0e0e0;
    border-color: #555;
}

/* ── New Mints Pill ── */
.hen-new-pill {
    display: none;
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    background: #00d4ff;
    color: #111;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 16px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.15s;
}
.hen-new-pill.visible {
    display: block;
}
.hen-new-pill:hover {
    background: #33dfff;
}

/* ── Feed Grid ── */
.hen-feed {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: #333 #111;
}
.hen-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

/* ── Card ── */
.hen-card {
    background: #1a1a1a;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
}
.hen-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.hen-card-thumb {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    background: #151515;
}
.hen-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.hen-card:hover .hen-card-thumb img {
    transform: scale(1.04);
}
.hen-card-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hen-card-info {
    padding: 8px 10px 10px;
}
.hen-card-creator {
    font-size: 0.65rem;
    color: #00d4ff;
    letter-spacing: 0.02em;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hen-card-title {
    font-size: 0.75rem;
    color: #e0e0e0;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hen-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: #666;
}
.hen-card-price {
    color: #00ff88;
    font-weight: 600;
}
.hen-card-editions {
    color: #555;
}
.hen-card-time {
    color: #444;
    font-size: 0.6rem;
    margin-top: 3px;
}

/* ── Video badge ── */
.hen-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.7);
    color: #00d4ff;
    font-size: 0.55rem;
    padding: 2px 5px;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* ── Expanded View ── */
.hen-expanded {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10003;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.hen-expanded.active {
    display: flex;
}
.hen-expanded-inner {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.hen-expanded-media {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
}
.hen-expanded-info {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}
.hen-expanded-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 6px;
    margin-top: 24px;
}
.hen-expanded-creator {
    font-size: 0.78rem;
    color: #00d4ff;
    margin-bottom: 8px;
}
.hen-expanded-details {
    font-size: 0.72rem;
    color: #666;
    margin-bottom: 12px;
}
.hen-expanded-details span {
    margin: 0 8px;
}
.hen-expanded-collect {
    display: inline-block;
    background: none;
    border: 1px solid #00d4ff;
    color: #00d4ff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 8px 24px;
    cursor: pointer;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.hen-expanded-collect:hover {
    background: #00d4ff;
    color: #111;
}
.hen-expanded-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #555;
    font-size: 1.5rem;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
}
.hen-expanded-close:hover {
    color: #e0e0e0;
}

/* ── Command Bar ── */
.hen-cli {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid #222;
    background: #0a0a0a;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
}
.hen-cli-prompt {
    color: #00d4ff;
    font-size: 0.78rem;
    margin-right: 8px;
    user-select: none;
}
.hen-cli-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #e0e0e0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    caret-color: #00d4ff;
}
.hen-cli-input::placeholder {
    color: #333;
}

/* ── Loading ── */
.hen-loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #333;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}
.hen-loading.active {
    display: block;
}

/* ── Glitch transition ── */
@keyframes hen-glitch {
    0% { transform: translate(0); filter: none; }
    20% { transform: translate(-3px, 2px); filter: hue-rotate(90deg); }
    40% { transform: translate(3px, -2px); filter: saturate(3); }
    60% { transform: translate(-2px, -1px); filter: hue-rotate(-90deg); }
    80% { transform: translate(2px, 1px); filter: brightness(1.5); }
    100% { transform: translate(0); filter: none; }
}
.hen-glitching {
    animation: hen-glitch 0.3s linear;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .hen-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .hen-grid { grid-template-columns: repeat(2, 1fr); }
    .hen-header { padding: 10px 14px; }
    .hen-feed { padding: 8px; }
    .hen-expanded { padding: 20px; }
}

/* ── Hide EVERYTHING else when HEN is active ── */
body.hen-active > *:not(.hen-overlay) {
    display: none !important;
}
body.hen-active {
    background: #111 !important;
    overflow: hidden !important;
}

/* ── v2: New card elements ── */
.hen-card-collection {
    font-size: 0.58rem;
    color: #444;
    letter-spacing: 0.03em;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}
.hen-card-usd {
    color: #555;
    font-weight: 400;
    font-size: 0.6rem;
}
.hen-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
}
.hen-card-objkt {
    font-size: 0.58rem;
    color: #333;
    letter-spacing: 0.02em;
}

/* ── v2: New mint flash ── */
.hen-card-new {
    animation: hen-new-flash 1.5s ease-out;
}
@keyframes hen-new-flash {
    0% { box-shadow: 0 0 20px rgba(0,212,255,0.4); }
    100% { box-shadow: none; }
}

/* ── v2: Mint activity pulse ── */
.hen-mint-pulse {
    text-align: center;
    font-size: 0.68rem;
    color: #00d4ff;
    padding: 6px 16px;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.5s;
    background: rgba(0,212,255,0.03);
    border-bottom: 1px solid #1a1a1a;
}
.hen-mint-pulse.visible {
    opacity: 1;
}

/* ── v2: Expanded view additions ── */
.hen-expanded-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}
.hen-expanded-share {
    background: none;
    border: 1px solid #333;
    color: #666;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    padding: 8px 20px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: color 0.15s, border-color 0.15s;
}
.hen-expanded-share:hover {
    color: #e0e0e0;
    border-color: #555;
}
.hen-clickable-artist {
    cursor: pointer;
    transition: color 0.15s;
}
.hen-clickable-artist:hover {
    color: #00ff88;
    text-decoration: underline;
}

/* ── v2: Artist's other work ── */
.hen-artist-work {
    margin-top: 20px;
    width: 100%;
}
.hen-artist-work-label {
    font-size: 0.65rem;
    color: #444;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.hen-artist-work-grid {
    display: flex;
    gap: 2px;
    justify-content: center;
}
.hen-artist-thumb {
    width: 72px;
    height: 72px;
    overflow: hidden;
    cursor: pointer;
    background: #151515;
    transition: transform 0.2s;
}
.hen-artist-thumb:hover {
    transform: scale(1.08);
}
.hen-artist-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── v2: Make expanded view scrollable ── */
.hen-expanded {
    overflow-y: auto;
}
.hen-expanded-inner {
    overflow-y: auto;
}

/* ═══ v3: Subtlety Pass ═══ */

/* 1. Card hover border pulse */
.hen-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    transition: border-color 0.3s;
    pointer-events: none;
}
.hen-card:hover::after {
    border-color: rgba(0,212,255,0.25);
    animation: hen-border-breathe 2s ease-in-out infinite;
}
@keyframes hen-border-breathe {
    0%, 100% { border-color: rgba(0,212,255,0.15); }
    50% { border-color: rgba(0,212,255,0.35); }
}

/* 4. Scanline overlay */
.hen-overlay::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10004;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
}

/* 5. Image loading shimmer */
.hen-card-thumb {
    background: #151515;
    overflow: hidden;
}
.hen-card-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #151515 25%, #1a1a1a 50%, #151515 75%);
    background-size: 200% 100%;
    animation: hen-shimmer 2s ease-in-out infinite;
    z-index: 1;
}
.hen-card-thumb img,
.hen-card-thumb video {
    position: relative;
    z-index: 2;
}
.hen-card-thumb img[src]:not([src=""]) ~ ::before,
.hen-card.visible .hen-card-thumb::before {
    animation-play-state: paused;
}
@keyframes hen-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 6. Pulsing CLI prompt */
.hen-cli-prompt {
    animation: hen-prompt-pulse 2.5s ease-in-out infinite;
}
@keyframes hen-prompt-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 7. Boot text jitter */
.hen-boot-line.show {
    animation: hen-jitter 0.15s linear 1;
}
@keyframes hen-jitter {
    0% { transform: translate(0.5px, 0); }
    25% { transform: translate(-0.3px, 0.5px); }
    50% { transform: translate(0.5px, -0.3px); }
    75% { transform: translate(-0.5px, 0); }
    100% { transform: translate(0); }
}

/* 2/3. Grid & expanded fade transitions */
.hen-grid {
    transition: opacity 0.2s;
}
.hen-grid.fading {
    opacity: 0;
}
.hen-expanded-inner {
    animation: hen-expand-in 0.25s ease-out;
}
@keyframes hen-expand-in {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 3. Staggered artist thumbs */
.hen-artist-thumb {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;
}
.hen-artist-thumb.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 9. Listening idle state */
.hen-listening {
    text-align: center;
    font-size: 0.62rem;
    color: #222;
    padding: 4px 16px;
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 1s;
}
.hen-listening.visible {
    opacity: 1;
}

/* 10. Copy toast */
.hen-copy-toast {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,212,255,0.9);
    color: #111;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 6px 16px;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10005;
    pointer-events: none;
}
.hen-copy-toast.visible {
    opacity: 1;
}

/* 11. Keyboard nav highlight */
.hen-card.hen-focused::after {
    border-color: #00d4ff !important;
    animation: none !important;
}


/* ═══ v4: Rafael's Soul ═══ */

/* 1. Fresh mint warm glow — persistent, cools over 5min */
.hen-card-fresh {
    animation: hen-fresh-arrive 0.6s ease-out;
}
@keyframes hen-fresh-arrive {
    0% { box-shadow: 0 0 24px rgba(255,180,50,0.5); }
    100% { box-shadow: 0 0 12px rgba(255,180,50,var(--warm-opacity, 0.3)); }
}
.hen-card-warm {
    box-shadow: 0 0 12px rgba(255,180,50, var(--warm-opacity, 0.15));
    transition: box-shadow 60s linear;
}

/* 4. No close button */
.hen-close {
    display: none;
}
