/* ============================================================
   TRILION PROJECT HUB — Base / Reset / Typography
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,500&family=JetBrains+Mono:wght@400;500&family=Outfit:wght@400;500;600;700&display=swap');

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--leading-normal);
    color: var(--trilion-white);
    background-color: var(--trilion-black);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Custom Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--trilion-gold-dark);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--trilion-gold);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--trilion-gold-dark) transparent;
}

/* ── Selection ────────────────────────────────────────────── */
::selection {
    background-color: var(--trilion-gold-glow-lg);
    color: var(--trilion-white);
}

::-moz-selection {
    background-color: var(--trilion-gold-glow-lg);
    color: var(--trilion-white);
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 600;
    line-height: var(--leading-tight);
    color: var(--trilion-white);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--text-3xl); font-weight: 700; }
h2 { font-size: var(--text-2xl); font-weight: 700; }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }
h5 { font-size: var(--text-md);  }
h6 { font-size: var(--text-base); font-weight: 500; }

p {
    color: var(--trilion-gray-light);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

small {
    font-size: var(--text-sm);
    color: var(--trilion-gray);
}

strong, b {
    font-weight: 600;
}

em, i {
    font-style: italic;
}

/* ── Links ────────────────────────────────────────────────── */
a {
    color: var(--trilion-gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--trilion-gold-light);
}

a:focus-visible {
    outline: 2px solid var(--trilion-gold);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* ── Lists ────────────────────────────────────────────────── */
ul, ol {
    list-style: none;
}

/* ── Code / Mono ──────────────────────────────────────────── */
code, pre, kbd, samp, .mono {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

code {
    background: var(--trilion-surface);
    color: var(--trilion-gold-light);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--trilion-border);
}

pre {
    background: var(--trilion-surface);
    color: var(--trilion-gray-light);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--trilion-border);
    overflow-x: auto;
    line-height: var(--leading-relaxed);
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

kbd {
    background: var(--trilion-surface);
    color: var(--trilion-gray-light);
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--trilion-border);
    border-bottom-width: 2px;
    font-size: var(--text-xs);
}

/* ── Images ───────────────────────────────────────────────── */
img, svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

/* ── Tables base ──────────────────────────────────────────── */
table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* ── Forms base ───────────────────────────────────────────── */
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    outline: none;
}

textarea {
    resize: vertical;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

label {
    display: inline-block;
    cursor: pointer;
}

/* ── HR ───────────────────────────────────────────────────── */
hr {
    border: none;
    border-top: 1px solid var(--trilion-border);
    margin: var(--space-6) 0;
}

/* ── Focus Visible Global ─────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--trilion-gold);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ── Utility Classes ──────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.text-gold     { color: var(--trilion-gold); }
.text-white    { color: var(--trilion-white); }
.text-gray     { color: var(--trilion-gray); }
.text-muted    { color: var(--trilion-text-muted); }
.text-success  { color: var(--trilion-success); }
.text-warning  { color: var(--trilion-warning); }
.text-danger   { color: var(--trilion-danger); }
.text-info     { color: var(--trilion-info); }

.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-left     { text-align: left; }
.text-sm       { font-size: var(--text-sm); }
.text-xs       { font-size: var(--text-xs); }
.text-lg       { font-size: var(--text-lg); }
.text-mono     { font-family: var(--font-mono); }
.text-title    { font-family: var(--font-title); }

.font-400      { font-weight: 400; }
.font-500      { font-weight: 500; }
.font-600      { font-weight: 600; }
.font-700      { font-weight: 700; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.gap-1         { gap: var(--space-1); }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }
.gap-4         { gap: var(--space-4); }
.gap-6         { gap: var(--space-6); }
.gap-8         { gap: var(--space-8); }

.grid          { display: grid; }
.grid-cols-2   { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3   { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4   { grid-template-columns: repeat(4, 1fr); }

.relative      { position: relative; }
.absolute      { position: absolute; }

.w-full        { width: 100%; }
.h-full        { height: 100%; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.hidden        { display: none !important; }
.block         { display: block; }
.inline-block  { display: inline-block; }
.pointer       { cursor: pointer; }
.no-select     { user-select: none; }

/* ── Animations Base ──────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.spinner-sm {
    width: 20px; height: 20px; border: 2px solid var(--trilion-border);
    border-top-color: var(--trilion-gold); border-radius: 50%;
    animation: spin 0.6s linear infinite; margin: 0 auto;
}

@keyframes goldPulse {
    0%   { box-shadow: 0 0 0 0 var(--trilion-gold-glow-md); }
    70%  { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.animate-fade-in       { animation: fadeIn 0.3s var(--ease-out) both; }
.animate-fade-in-up    { animation: fadeInUp 0.4s var(--ease-out) both; }
.animate-fade-in-down  { animation: fadeInDown 0.4s var(--ease-out) both; }
.animate-fade-in-scale { animation: fadeInScale 0.5s var(--ease-out) both; }
.animate-pulse         { animation: pulse 2s infinite; }
.animate-shake         { animation: shake 0.5s var(--ease-out); }
