/* ============================================
   namu.market - Styles
   Evolved-minimal, HUD-overlay, burgundy-cream
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --market-cream: #F5EDE0;
    --burgundy-deep: #8A4040;
    --timber-dark: #2A2018;
    --hud-green: #4A8858;
    --icon-warm: #B87848;
    --abstract-gray: #A09888;
    --card-white: #FAF7F0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    color: var(--timber-dark);
    background-color: var(--market-cream);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Wood Grain Micro-Texture (global) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(184, 120, 72, 0.03) 3px,
        rgba(184, 120, 72, 0.03) 4px,
        transparent 4px,
        transparent 11px,
        rgba(160, 152, 136, 0.02) 11px,
        rgba(160, 152, 136, 0.02) 12px
    );
}

/* ============================================
   HUD Overlay Frame
   ============================================ */
#hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

#hud-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hud-corner {
    fill: none;
    stroke: var(--abstract-gray);
    stroke-width: 1;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawCorner 400ms ease-out forwards;
}

.hud-line {
    stroke: var(--abstract-gray);
    stroke-width: 0.5;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 600ms ease-out 400ms forwards;
}

@keyframes drawCorner {
    to { stroke-dashoffset: 0; }
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* HUD Data Readouts */
.hud-readout {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    animation: fadeInReadout 300ms ease-out 1000ms forwards;
}

@keyframes fadeInReadout {
    to { opacity: 1; }
}

.hud-readout-tl {
    top: 28px;
    left: 28px;
}

.hud-readout-tr {
    top: 28px;
    right: 28px;
    text-align: right;
}

.hud-readout-bl {
    bottom: 52px;
    left: 28px;
}

.hud-readout-br {
    bottom: 52px;
    right: 28px;
    text-align: right;
}

.hud-label {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--abstract-gray);
}

.hud-value {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hud-green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-readout-tr .hud-value,
.hud-readout-br .hud-value {
    justify-content: flex-end;
}

.hud-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--hud-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   Market Entrance (Hero Section)
   ============================================ */
#market-entrance {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--market-cream);
    z-index: 1;
    overflow: hidden;
}

.entrance-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, transparent, var(--burgundy-deep));
    opacity: 0.3;
    pointer-events: none;
}

.entrance-content {
    text-align: center;
    z-index: 2;
    opacity: 0;
    animation: fadeInTitle 500ms ease-out 600ms forwards;
}

@keyframes fadeInTitle {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.domain-title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 3vw, 44px);
    letter-spacing: 0.01em;
    color: var(--timber-dark);
    margin-bottom: 12px;
}

.domain-subtitle {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--abstract-gray);
}

/* ============================================
   Product Gallery
   ============================================ */
#product-gallery {
    position: relative;
    z-index: 1;
    padding: 80px 10% 120px;
    min-height: 100vh;
}

.gallery-header {
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.section-title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 2vw, 28px);
    letter-spacing: 0.01em;
    color: var(--timber-dark);
    white-space: nowrap;
}

.section-line {
    flex: 1;
    height: 1px;
    background-color: var(--abstract-gray);
    opacity: 0.4;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding-right: 80px;
}

/* Product Card */
.product-card {
    transition: opacity 300ms ease;
}

.product-card.hidden {
    display: none;
}

.card-frame {
    position: relative;
    background-color: var(--card-white);
    border: 1px solid var(--abstract-gray);
    padding: 28px 24px;
    transition: border-left-color 200ms ease, border-left-width 200ms ease;
    border-left: 2px solid transparent;
}

.product-card:hover .card-frame {
    border-left: 2px solid var(--hud-green);
}

/* Dimension Markers (technical drawing style) */
.dimension-marker {
    position: absolute;
    width: 8px;
    height: 8px;
}

.dimension-marker::before,
.dimension-marker::after {
    content: '';
    position: absolute;
    background-color: var(--abstract-gray);
}

.dm-tl { top: -1px; left: -1px; }
.dm-tl::before { width: 8px; height: 1px; top: 0; left: 0; }
.dm-tl::after { width: 1px; height: 8px; top: 0; left: 0; }

.dm-tr { top: -1px; right: -1px; }
.dm-tr::before { width: 8px; height: 1px; top: 0; right: 0; }
.dm-tr::after { width: 1px; height: 8px; top: 0; right: 0; }

.dm-bl { bottom: -1px; left: -1px; }
.dm-bl::before { width: 8px; height: 1px; bottom: 0; left: 0; }
.dm-bl::after { width: 1px; height: 8px; bottom: 0; left: 0; }

.dm-br { bottom: -1px; right: -1px; }
.dm-br::before { width: 8px; height: 1px; bottom: 0; right: 0; }
.dm-br::after { width: 1px; height: 8px; bottom: 0; right: 0; }

/* Card Icon */
.card-icon {
    width: 24px;
    height: 24px;
    color: var(--icon-warm);
    margin-bottom: 16px;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

/* Card Content */
.card-name {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: var(--timber-dark);
    margin-bottom: 6px;
    transition: background-size 200ms ease;
    display: inline-block;
    background-image: repeating-linear-gradient(
        90deg,
        var(--icon-warm) 0px,
        var(--icon-warm) 2px,
        transparent 2px,
        transparent 5px
    );
    background-position: 0 100%;
    background-size: 0% 1px;
    background-repeat: no-repeat;
    padding-bottom: 2px;
}

.product-card:hover .card-name {
    background-size: 100% 1px;
}

.card-desc {
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 15px);
    line-height: 1.7;
    color: var(--abstract-gray);
    margin-bottom: 14px;
}

.card-price {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: var(--timber-dark);
}

/* ============================================
   Category HUD Panel (fixed right)
   ============================================ */
#category-panel {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 64px;
    background: rgba(245, 237, 224, 0.92);
    backdrop-filter: blur(8px);
    border-left: 1px solid var(--abstract-gray);
    z-index: 500;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeInPanel 400ms ease-out 1200ms forwards;
}

@keyframes fadeInPanel {
    to { opacity: 1; }
}

.panel-header {
    margin-bottom: 16px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.panel-header .hud-label {
    font-size: 9px;
    letter-spacing: 0.15em;
    color: var(--abstract-gray);
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 200ms ease;
    pointer-events: auto;
}

.category-item:hover .category-icon {
    transform: rotate(5deg);
}

.category-item:hover .category-icon::after {
    opacity: 1;
}

.category-item.active .category-icon svg {
    stroke: var(--hud-green);
}

.category-icon {
    position: relative;
    width: 24px;
    height: 24px;
    color: var(--icon-warm);
    transition: transform 200ms ease;
}

.category-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(184, 120, 72, 0.12);
    opacity: 0;
    transition: opacity 200ms ease;
    z-index: -1;
}

.category-icon svg {
    width: 100%;
    height: 100%;
    transition: stroke 200ms ease;
}

.category-name {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--abstract-gray);
    text-align: center;
    max-width: 56px;
    line-height: 1.3;
}

/* ============================================
   Monitoring Strip (bottom)
   ============================================ */
#monitoring-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 36px;
    background: rgba(245, 237, 224, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--abstract-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 500;
    padding: 0 28px;
    opacity: 0;
    animation: fadeInStrip 400ms ease-out 1400ms forwards;
}

@keyframes fadeInStrip {
    to { opacity: 1; }
}

.strip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
}

.strip-label {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--abstract-gray);
}

.strip-value {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--hud-green);
}

.strip-divider {
    width: 1px;
    height: 16px;
    background-color: var(--abstract-gray);
    opacity: 0.4;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        padding-right: 72px;
    }

    #product-gallery {
        padding: 60px 6% 120px;
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
        padding-right: 60px;
    }

    #product-gallery {
        padding: 40px 4% 120px;
    }

    #category-panel {
        width: 48px;
    }

    .category-name {
        display: none;
    }

    .hud-readout-tl,
    .hud-readout-tr,
    .hud-readout-bl,
    .hud-readout-br {
        display: none;
    }
}
