:root {
    /* Base Variables (Dark by default references) */
    --accent-color: #DC2626;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* THEME: DARK (Default) */
.theme-dark {
    --bg-color: #000000;
    --bg-card: #050505;
    --bg-element: #111111;
    --text-color: #FFFFFF;
    --text-muted: #888888;
    --border-color: #1a1a1a;
    --border-hover: #333333;
    --shadow-color: rgba(0,0,0,0.5);
}

/* THEME: LIGHT */
.theme-light {
    --bg-color: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-element: #F4F4F5;
    --text-color: #09090B;
    --text-muted: #71717A;
    --border-color: #E4E4E7;
    --border-hover: #D4D4D8;
    --shadow-color: rgba(0,0,0,0.1);
}

/* Global Navigation & Theme Utils */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent-color);
}

.theme-toggle button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle button:hover {
    background: var(--border-color);
}

/* Premium Buttons (Main Nav) */
.btn-premium {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
}

.btn-premium:hover {
    background: transparent;
    color: var(--accent-color);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Mega Header */
header {
    margin-top: 5vh;
    margin-bottom: 5rem;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.mega-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.85;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
}

.text-white {
    color: #FFFFFF;
}

.text-dynamic {
    color: var(--text-color);
}

.text-red {
    color: var(--accent-color);
}

/* Search Bar */
.search-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

#search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    padding: 1rem 0;
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
}

#search-input::placeholder {
    color: #444;
    text-align: center;
    transition: color 0.3s ease;
}

#search-input:focus {
    border-bottom-color: var(--accent-color);
}

#search-input:focus::placeholder {
    color: #666;
}

/* Main Sections Grid */
.main-sections-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .main-sections-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .main-sections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.section-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.section-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    background: var(--bg-card);
    box-shadow: 0 10px 20px -10px rgba(220, 38, 38, 0.3);
}

.btn-icon {
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.section-btn:hover .btn-icon {
    transform: scale(1.2);
}

.btn-text {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

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

.section-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.section-btn:hover::after {
    transform: scaleX(1);
}

/* Catalog Grid */
#catalog-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

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

/* Cards */
.card-category {
    background: #050505;
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 0; /* Filo recto tech */
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-category:hover {
    border-color: #333;
    transform: translateY(-2px);
}

.card-category h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.item-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.item-tag {
    font-size: 0.85rem;
    color: #666;
    background: #0f0f0f;
    padding: 0.35rem 0.8rem;
    border-radius: 99px; /* Pill shape */
    transition: all 0.2s ease;
    cursor: default;
    border: 1px solid transparent;
}

.item-tag:hover {
    color: #FFF;
    border-color: #333;
    background: #1a1a1a;
}

.item-tag.highlight {
    background: var(--accent-color);
    color: #FFF;
}

.item-tag.action-link {
    text-decoration: none;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.item-tag.action-link:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* No Results */
/* TOKENS PAGE SPECIFIC STYLES */
.top-nav {
    display: flex;
    justify-content: flex-end; /* Align right */
    align-items: center;
    padding: 1rem 2rem;
    position: absolute; /* Absolute for index to float over */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.token-page .top-nav {
    position: fixed; /* Fixed for tokens page */
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between; /* Space between for back link */
}

.back-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-color);
}

.theme-toggle button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
}

/* Show/Hide icons based on theme */
.theme-dark .icon-sun { display: inline; }
.theme-dark .icon-moon { display: none; }
.theme-light .icon-sun { display: none; }
.theme-light .icon-moon { display: inline; }

.token-page {
    padding-top: 6rem;
}

.mega-title-small {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 900;
    font-size: 3rem;
    line-height: 0.9;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-top: 1rem;
}

.token-section {
    margin-bottom: 4rem;
    width: 100%;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.subsection h3 {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Swatches */
.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.swatch {
    height: 100px;
    background-color: var(--swatch-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.swatch:hover {
    transform: scale(1.02);
}

.swatch span {
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 2px;
}

/* Typography Scale */
.typo-scale {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.typo-row {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.typo-row .label {
    display: block;
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.typo-row .sample {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.typo-row .meta {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.display { font-family: var(--font-heading); font-weight: 900; font-size: 6rem; line-height: 1; letter-spacing: -0.05em; }
.h1 { font-family: var(--font-heading); font-weight: 700; font-size: 4rem; line-height: 1.1; letter-spacing: -0.02em; }
.h2 { font-family: var(--font-heading); font-weight: 700; font-size: 3rem; line-height: 1.2; letter-spacing: -0.01em; }
.h3 { font-family: var(--font-heading); font-weight: 700; font-size: 2rem; line-height: 1.25; }
.body-lg { font-size: 1.25rem; }
.body-base { font-size: 1rem; }
.caption { font-size: 0.875rem; font-weight: 500; }
.mono { font-family: var(--font-mono); font-size: 0.9rem; }

/* Spacing */
.spacing-scale {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    background: var(--bg-element);
    padding: 2rem;
    border-radius: 8px;
}

.space-block {
    height: 3rem;
    background: var(--accent-color);
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    min-width: 1px;
}

/* Radius */
.radius-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.radius-box {
    width: 6rem;
    height: 6rem;
    background: var(--bg-card);
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-color);
}

.radius-box.none { border-radius: 0; }
.radius-box.sm { border-radius: 2px; }
.radius-box.md { border-radius: 4px; }
.radius-box.lg { border-radius: 8px; }
.radius-box.xl { border-radius: 12px; }
.radius-box.full { border-radius: 9999px; }

/* Shadows */
.shadow-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.shadow-box {
    width: 8rem;
    height: 8rem;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 0.9rem;
    border-radius: 8px;
}

.theme-dark .shadow-box { box-shadow: 0 0 0 1px #333; } /* En dark el shadow es sutil o glow */
.theme-dark .shadow-box.xl { box-shadow: 0 0 20px rgba(220, 38, 38, 0.3); border-color: var(--accent-color); }

.theme-light .shadow-box.sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.theme-light .shadow-box.md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.theme-light .shadow-box.lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.theme-light .shadow-box.xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

