/* Patch for Master Archive // Terminal - Visual Scent Update */

:root {
    --bg: #050505;
    --rail: #020202;
    --accent: #ff4d00;
    --intent-v: #00f2ff;
    --border: #1a1a1a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    perspective: 1500px;
    user-select: none;
    overscroll-behavior: none;
}

header {
    height: 60px;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    padding: 0 30px;
    justify-content: space-between;
    z-index: 100;
    background: var(--bg);
}

/* NEW: Logo and Center Column Title Grouping */
.logo-group { 
    display: flex; 
    align-items: baseline; 
    gap: 20px; 
}

.article-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo { 
    color: var(--accent); 
    letter-spacing: 4.8px; 
    font-weight: bold; 
    font-size: 1.08rem;
    opacity: 0.96;
    text-shadow: 0 0 12px rgba(0,0,0,0.38);
}

#article-title {
    font-size: 1rem;
    color: #d7d0c1;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

#article-label {
    font-size: 0.68rem;
    color: #666;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

#commit-btn {
    font-size: 0.7rem; color: var(--accent); border: 1px solid var(--accent);
    padding: 6px 15px; letter-spacing: 2px; cursor: pointer;
    opacity: 0; transform: translateY(-5px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}
[data-state="dirty"] #commit-btn { opacity: 1; transform: translateY(0); pointer-events: auto; }

.row-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    overscroll-behavior: none;
}

/* PERIMETER GLOW */
.row-shell::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1000;
    transition: box-shadow 0.4s ease; box-shadow: inset 0 0 40px rgba(0,0,0,1); 
}
.row-shell[data-intent="vertical"]::after {
    box-shadow: inset 0 60px 80px -40px var(--intent-v), inset 0 -60px 80px -40px var(--intent-v);
}
.row-shell[data-intent="horizontal"]::after {
    box-shadow: inset 60px 0 80px -40px var(--accent), inset -60px 0 80px -40px var(--accent);
}

/* HORIZONTAL PINCHROLLERS (Top/Bottom Strips) */
.horizontal-strip {
    position: absolute; width: 100%; height: 78px; left: 0; z-index: 1100;
    background: #080808; 
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    transition: border-color 0.3s, background 0.3s;
}
#zone-top { top: 0; }
#zone-bottom { bottom: 0; }

.strip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    font-size: 0.62rem;
    line-height: 1;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.68;
}

.preview-row {
    --preview-color: var(--accent);
    width: calc(100% - 32px);
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 20px;
    pointer-events: none;
}

#top-preview-thumb-left,
#bottom-preview-thumb-left {
    justify-self: start;
}

#top-preview-thumb-right,
#bottom-preview-thumb-right {
    justify-self: end;
}

.preview-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    justify-self: center;
    width: min(760px, 100%);
}

.preview-domain {
    max-width: 100%;
    color: var(--preview-color);
    opacity: 0.94;
    font-size: clamp(1.04rem, 1.45vw, 1.4rem);
    line-height: 1.02;
    letter-spacing: 0.18em;
    text-shadow: 0 0 14px rgba(0,0,0,0.45);
    text-align: center;
}

.preview-title {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: color-mix(in srgb, var(--preview-color) 22%, #ddd5c8 78%);
    font-size: 0.82rem;
    line-height: 1.08;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.82;
    text-align: center;
    text-shadow: 0 0 10px rgba(0,0,0,0.42);
}

.preview-thumb {
    --preview-accent: var(--accent);
    --preview-image: none;
    width: 72px;
    height: 42px;
    border: 1px solid color-mix(in srgb, var(--preview-accent) 40%, #111 60%);
    background:
        var(--preview-image) center / cover no-repeat,
        linear-gradient(135deg, color-mix(in srgb, var(--preview-accent) 22%, #050505 78%), #050505 72%),
        linear-gradient(to bottom, #111, #050505);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
    position: relative;
}

.preview-thumb[data-thumb-state="image"] {
    border-color: color-mix(in srgb, var(--preview-accent) 58%, #161616 42%);
}

.preview-thumb[data-thumb-state="image"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.42));
}

.preview-thumb::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(255,255,255,0.08);
}

.row-shell[data-intent="vertical"] .horizontal-strip {
    border-color: var(--intent-v);
    background: #0a0a0a;
}

.row-shell[data-intent="vertical"] .preview-thumb {
    border-color: color-mix(in srgb, var(--intent-v) 55%, #111 45%);
    background:
        var(--preview-image) center / cover no-repeat,
        linear-gradient(135deg, color-mix(in srgb, var(--intent-v) 20%, #050505 80%), #050505 72%),
        linear-gradient(to bottom, #111, #050505);
}

/* SIDE PINCHROLLER ZONES */
.gesture-zone {
    touch-action: none;
    -ms-touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.side-spine-zone { position: absolute; height: 100%; width: 80px; top: 0; z-index: 1100; cursor: ew-resize; }
#zone-left { left: 0; }
#zone-right { right: 0; }

#category-package {
    display: flex; flex: 1; width: 100%; align-items: center; transform-style: preserve-3d;
    padding: 78px 0;
}

/* UPDATED: Visual Spines with Thumbnail Support */
.spine {
    width: 80px; /* Widened for thumbnails */
    height: 100%; 
    background: var(--rail);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-left: 1px solid #111; 
    border-right: 1px solid #111;
}

.spine-thumb {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.15; /* Rest State */
    filter: grayscale(1) contrast(1.2);
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.spine-thumb.empty {
    background: linear-gradient(to bottom, var(--rail), #080808);
}

/* Wake up the thumbnail hint on intent */
.row-shell[data-intent="horizontal"] .spine-thumb {
    opacity: 0.4;
    filter: grayscale(0.5);
}

.spine-copy {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    max-height: calc(100% - 28px);
}

.spine-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    max-height: calc(100% - 18px);
}

.spine-title {
    font-size: clamp(0.66rem, 0.92vw, 0.86rem);
    color: var(--accent);
    opacity: 0.96;
    letter-spacing: 3.4px;
    line-height: 1.05;
    white-space: nowrap;
    text-shadow: 0 0 10px #000;
}

.spine-label {
    position: relative;
    z-index: 2;
    font-size: 0.56rem;
    color: color-mix(in srgb, var(--accent) 60%, #bcb4a4 40%);
    opacity: 0.82;
    letter-spacing: 1.7px;
    text-transform: uppercase;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
    max-height: 140px;
    text-shadow: 0 0 10px #000;
}

/* Orientation: Reading from the inside frame out */
#spine-left .spine-title-block { transform: rotate(180deg); }
#spine-right .spine-title-block { transform: rotate(0deg); }

#hero-container {
    flex: 1; height: 100%; background: #000;
}

iframe { width: 100%; height: 100%; border: none; }
.dragging iframe { pointer-events: none; }

.rolling-up { transform: translateY(-100%) scale(0.85); opacity: 0; }
.rolling-down { transform: translateY(100%) scale(0.85); opacity: 0; }

@media (hover: none) and (pointer: coarse) {
    .horizontal-strip {
        height: 104px;
    }

    .side-spine-zone {
        width: 104px;
    }

    #category-package {
        padding: 104px 0;
    }
}
