:root {
    --bg-color: #080808;
    --card-bg: #111111;
    --text-main: #F2F0EB;
    --text-muted: #555555;
    --accent: #CC2200;
    --acid-accent: #E8FF47;
    --border: rgba(255, 255, 255, 0.07);
    --hover-border: rgba(255, 255, 255, 0.15);
    
    --bg-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M 60 0 L 0 0 0 60' fill='none' stroke='white' stroke-width='1'/%3E%3C/svg%3E");
    
    --font-sans: 'Syne', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

[data-theme="light"] {
    --bg-color: #F2F0EB;
    --card-bg: #E8E6E1;
    --text-main: #080808;
    --text-muted: #999999;
    --border: rgba(0, 0, 0, 0.08);
    --hover-border: rgba(0, 0, 0, 0.20);
    
    --bg-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M 60 0 L 0 0 0 60' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E");
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.4;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Drifting background pattern */
#grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    z-index: -1;
    pointer-events: none;
    background-image: var(--bg-pattern);
    background-size: 60px 60px;
    opacity: 0.04;
    animation: drift 200s linear infinite;
    transition: background-image 0.4s ease;
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to { transform: translate(-60px, -60px); }
}

/* Header Grid Styling */
.header-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 2fr 1.5fr;
    border-bottom: 1px solid var(--border);
    width: 100%;
    background: transparent;
    transition: border-color 0.4s ease;
}

.header-cell {
    padding: 1.5rem 2.5rem;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    transition: border-color 0.4s ease;
}

.header-cell:last-child {
    border-right: none;
}

.logo-cell {
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.logo-mark {
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
    color: var(--text-main);
    display: inline-block;
    vertical-align: middle;
    transition: color 0.4s ease;
}

.mode-cell .tagline {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: color 0.4s ease;
}

.follow-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color 0.2s, color 0.2s, border-color 0.4s;
}

.theme-toggle-btn:hover {
    background: var(--text-main);
    color: var(--bg-color);
}

.version-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.4s ease;
}

main.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100vh;
}

/* Search Section Container */
.search-container {
    margin-top: 8vh;
    margin-bottom: 5rem;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.4s ease forwards;
}

.hero-content {
    margin-bottom: 3.5rem;
    max-width: 850px;
}

.hero-title {
    font-family: var(--font-sans);
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--text-main) 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-title {
    background: linear-gradient(135deg, var(--text-main) 0%, rgba(0, 0, 0, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 700px;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-grid {
    display: grid;
    grid-template-columns: 1.5fr 3fr 1fr;
    border: 1px solid var(--border);
    background: transparent;
    transition: border-color 0.4s ease;
}

.search-cell {
    padding: 2.5rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: border-color 0.4s ease;
}

.search-cell:last-child {
    border-right: none;
    padding: 0;
    align-items: stretch;
}

.cell-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #666666;
    margin-bottom: 1.25rem;
    letter-spacing: 0.15em;
    font-weight: 700;
    text-transform: uppercase;
}

/* Mode toggle styling */
.mode-toggle {
    display: flex;
    border: 1px solid var(--border);
    width: fit-content;
    background: transparent;
    transition: border-color 0.4s ease;
    border-radius: 0;
}

.toggle-btn {
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    border: none;
    padding: 0.85rem 1.5rem; /* Touch-friendly tap target: 44px min-height total */
    min-height: 44px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.4s;
    letter-spacing: 0.1em;
    font-weight: 700;
    border-right: 1px solid var(--border);
    border-radius: 0;
}

.toggle-btn:last-child {
    border-right: none;
}

.toggle-btn:hover {
    color: var(--text-main);
}

.toggle-btn.active {
    background: var(--text-main);
    color: var(--bg-color);
}

.input-group-row {
    width: 100%;
}

.input-group {
    width: 100%;
}

input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 500;
    padding: 0.6rem 0; /* Touch-friendly hit target */
    min-height: 44px;
    transition: border-color 0.4s ease, color 0.4s ease;
}

input::placeholder {
    color: var(--text-muted);
    text-transform: lowercase;
}

input:focus {
    outline: none;
    border-bottom: 1px solid var(--text-main);
}

/* Discover Button styling */
.btn {
    width: 100%;
    height: 100%;
    background: var(--text-main);
    color: var(--bg-color);
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
    letter-spacing: 0.15em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 48px;
}

.btn:hover {
    background: #CC2200;
    color: #FFFFFF;
}

.btn:disabled {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    cursor: not-allowed;
}

[data-theme="light"] .btn:disabled {
    background: rgba(0, 0, 0, 0.03);
}

.error-msg {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-top: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    width: 100%;
}

/* Section Title and Header Meta Row */
.section-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
    padding-bottom: 0.75rem;
    width: 100%;
    transition: border-color 0.4s ease;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #666666;
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Seed section redesign - full width banner */
.seed-card {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 5rem;
    border: 1px solid var(--border);
    padding: 2.5rem;
    background: var(--card-bg);
    transition: border-color 0.4s ease, background-color 0.4s ease;
    width: 100%;
}

.seed-art-wrapper {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

#seed-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    border: 1px solid var(--border);
    transition: filter 0.4s ease, border-color 0.4s ease;
}

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

.seed-info h2 {
    font-family: var(--font-sans);
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.seed-info p {
    font-family: var(--font-mono);
    text-transform: lowercase;
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    transition: color 0.4s ease;
}

/* Grid sheet styling */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    transition: border-color 0.4s ease;
}

.track-card {
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.track-card:hover {
    border-color: var(--hover-border);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    transition: border-color 0.4s ease, color 0.4s ease;
}

.card-index {
    font-weight: 400;
}

.plus-icon {
    font-size: 1rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.track-card:hover .plus-icon {
    transform: rotate(90deg);
    color: var(--text-main);
}

/* Images & transitions */
.track-art-container {
    width: 100%;
    aspect-ratio: 1/1; /* Square full-bleed cover art */
    overflow: hidden;
    background: transparent;
    position: relative;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.4s ease;
}

.track-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.track-card:hover .track-art {
    filter: grayscale(0%);
    transform: scale(1.02);
}

/* Card Content styling */
.track-content {
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.track-artist {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.track-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    transition: color 0.4s ease;
    text-transform: lowercase;
}

/* HTML5 audio bar */
audio {
    width: 100%;
    height: 24px;
    outline: none;
    opacity: 0.25;
    transition: opacity 0.3s ease;
    margin-bottom: 1.5rem;
}

audio:hover {
    opacity: 0.9;
}

.track-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    transition: border-color 0.4s ease;
}

.track-meta a {
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    text-decoration: none;
    transition: opacity 0.2s ease;
    letter-spacing: 0.05em;
}

.track-meta a:hover {
    opacity: 0.8;
}

/* Label specific layouts */
.label-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: lowercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color 0.4s ease;
}

.label-name {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 1.25rem;
    color: var(--text-main);
    line-height: 1.2;
}

.label-releases {
    margin-bottom: 1.5rem;
}

.releases-title {
    font-size: 10px;
    color: #666666;
    text-transform: uppercase;
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
    letter-spacing: 0.15em;
    font-weight: 700;
}

.releases-list {
    font-size: 12px;
    color: var(--text-muted);
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 1.5;
    transition: color 0.4s ease;
    font-family: var(--font-mono);
    text-transform: lowercase;
}

.releases-list li {
    position: relative;
    padding-left: 0.75rem;
}

.releases-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--border);
}

.label-styles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}

.label-styles-container span {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 0.2rem 0.5rem;
    font-size: 10px;
    text-transform: lowercase;
    font-family: var(--font-mono);
    transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}

/* Branded Loading Indicator */
#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 0;
    width: 100%;
}

.loading-logo-wrapper {
    width: 64px;
    height: 64px;
    margin-bottom: 2rem;
}

.loading-logo {
    width: 100%;
    height: 100%;
    color: var(--text-main);
}

@keyframes loading-pulse {
    0% {
        opacity: 0.15;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.15;
    }
}

.loading-logo rect {
    animation: loading-pulse 1.2s infinite ease-in-out;
}

.loading-logo .sq-1 { animation-delay: 0.0s; }
.loading-logo .sq-2 { animation-delay: 0.1s; }
.loading-logo .sq-3 { animation-delay: 0.2s; }
.loading-logo .sq-4 { animation-delay: 0.3s; }
.loading-logo .sq-5 { animation-delay: 0.4s; }
.loading-logo .sq-6 { animation-delay: 0.5s; }
.loading-logo .sq-7 { animation-delay: 0.6s; }
.loading-logo .sq-8 { animation-delay: 0.7s; }
.loading-logo .sq-9 { animation-delay: 0.8s; }

.loading-text {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: color 0.4s ease;
}

.text-center { text-align: center; }
.hidden { display: none !important; }

/* Micro-copy and results-meta styling */
.mode-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.micro-copy {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    color: #444444;
    text-transform: uppercase;
    text-align: center;
    transition: color 0.4s ease;
}

[data-theme="light"] .micro-copy {
    color: #999999;
}

/* Touch-friendly adjustments */
.theme-toggle-btn {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
}

.track-meta a {
    display: inline-block;
    padding: 0.5rem 0;
    min-height: 44px;
}

/* Grid adjustments responsive */
@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
    .header-grid { grid-template-columns: 1.5fr 1fr 1fr; }
    .spacer-cell { display: none; }
}

@media (max-width: 768px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .header-grid { grid-template-columns: 1.2fr 1fr; }
    .mode-cell { display: none; }
    .search-grid { grid-template-columns: 1fr; }
    .search-cell {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 2rem;
    }
    .search-cell:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
    .header-grid { grid-template-columns: 1fr; }
    .follow-cell { display: none; }
    main.container { padding: 3rem 1.5rem; }
}
