/* =============================================================
   etcn.link — Estilos compartidos
   ============================================================= */

:root {
    --bg: #0a0a0f;
    --bg-elev: #13131a;
    --bg-elev-2: #1a1a24;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .16);

    --text: #e4e4e7;
    --text-strong: #fafafa;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;

    --indigo: #6366f1;
    --indigo-light: #818cf8;
    --emerald: #10b981;
    --emerald-light: #34d399;
    --amber: #f59e0b;
    --red: #ef4444;

    --accent-grad: linear-gradient(135deg, var(--indigo-light) 0%, var(--emerald-light) 100%);

    --radius: .75rem;
    --radius-lg: 1rem;
    --radius-sm: .5rem;

    --shadow: 0 20px 40px -12px rgba(0, 0, 0, .6);
    --shadow-glow: 0 0 40px -10px rgba(99, 102, 241, .35);

    --ff-sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --ff-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* , *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font-family: var(--ff-sans);
    font-size: 16px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0 0 .5rem; color: var(--text-strong); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.75rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }
h2 { font-size: 1.125rem; font-weight: 600; }

p { margin: 0 0 1rem; }

code, pre { font-family: var(--ff-mono); }

button { font: inherit; cursor: pointer; }

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

/* =============================================================
   Background decoraciones (home / 404 / login)
   ============================================================= */

.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .4;
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 40%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 40%, transparent 85%);
    animation: grid-drift 60s linear infinite;
}
@keyframes grid-drift {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 56px 56px, 56px 56px; }
}

.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: .4;
    animation: orb-float 20s ease-in-out infinite alternate;
}
.orb--1 {
    top: -10%; left: -5%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--indigo) 0%, transparent 70%);
}
.orb--2 {
    bottom: -20%; right: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--emerald) 0%, transparent 70%);
    animation-delay: -10s;
}
@keyframes orb-float {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -30px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .bg-grid, .orb { animation: none; }
}

/* =============================================================
   Home
   ============================================================= */

.home {
    min-height: 100dvh;
    display: flex;
    background-image:
        radial-gradient(1200px 700px at 10% -20%, rgba(99, 102, 241, .12), transparent 50%),
        radial-gradient(900px 500px at 110% 120%, rgba(16, 185, 129, .10), transparent 50%);
}

.home__wrap {
    position: relative; z-index: 1;
    width: 100%; max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex; flex-direction: column;
    min-height: 100dvh;
}

.home__header { padding: 1rem 0 3rem; }
.home__footer {
    margin-top: auto; padding: 2rem 0 0;
    font-size: .8125rem; color: var(--text-dim);
}
.home__footer a {
    color: var(--text-muted);
    transition: color .2s;
}
.home__footer a:hover {
    color: var(--indigo-light);
    text-decoration: underline;
}

/* =============================================================
   Linktree público (/links)
   ============================================================= */
.linktree {
    position: relative; z-index: 1;
    max-width: 560px; width: 100%;
    margin: 0 auto;
    padding: 3rem 1.25rem 4rem;
    display: flex; flex-direction: column; min-height: 100dvh;
}
.linktree__header { text-align: center; margin-bottom: 2rem; }
.linktree__header .logo { justify-content: center; margin-bottom: 1.25rem; }
.linktree__title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    margin: 0 0 .5rem;
}
.linktree__bio {
    color: var(--text-muted);
    max-width: 36ch; margin: 0 auto;
    font-size: .95rem;
}

.linktree__list {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: .625rem;
}
.linktree__item {
    display: flex; align-items: center; gap: .875rem;
    padding: 1rem 1.125rem;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: transform .15s, background .2s, border-color .2s;
}
.linktree__item:hover {
    background: rgba(255, 255, 255, .06);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}
.linktree__emoji { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.linktree__item-body { flex: 1; min-width: 0; }
.linktree__item-name {
    display: block;
    color: var(--text-strong);
    font-weight: 500;
}
.linktree__item-desc {
    display: block;
    font-size: .8125rem;
    color: var(--text-muted);
    margin-top: .125rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.linktree__item-arrow {
    color: var(--text-dim);
    font-size: 1.125rem;
    transition: transform .15s, color .15s;
}
.linktree__item:hover .linktree__item-arrow {
    color: var(--indigo-light);
    transform: translateX(3px);
}
.linktree__empty {
    text-align: center; color: var(--text-muted);
    padding: 3rem 1rem;
}
.linktree__footer {
    margin-top: auto; padding-top: 2rem; text-align: center;
    font-size: .8125rem; color: var(--text-dim);
}
.linktree__footer a { color: var(--text-muted); }
.linktree__footer a:hover { color: var(--indigo-light); text-decoration: underline; }

/* Logo */
.logo {
    display: inline-flex; align-items: center; gap: .625rem;
    font-family: var(--ff-mono);
    color: var(--text-strong);
    font-weight: 700;
    font-size: 1.0625rem;
    transition: opacity .2s;
}
.logo:hover { opacity: .85; }
.logo__glyph {
    display: grid; place-items: center;
    width: 28px; height: 28px;
    border-radius: 7px;
    background: var(--accent-grad);
    color: var(--bg);
    font-weight: 800;
    font-size: .9375rem;
    box-shadow: 0 4px 20px -4px rgba(99, 102, 241, .5);
}
.logo__dot { color: var(--indigo-light); }

/* Hero */
.hero {
    flex: 1;
    display: flex; flex-direction: column; justify-content: center;
    padding: 2rem 0;
    max-width: 780px;
}
.hero__eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--ff-mono);
    font-size: .75rem;
    color: var(--text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 1.25rem;
}

.pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
    animation: pulse 2s infinite;
}
.pulse--warn { background: var(--amber); box-shadow: 0 0 0 0 rgba(245, 158, 11, .6); }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); }
    70%  { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero__title {
    margin: 0 0 1.25rem;
    font-weight: 700;
}
.hero__accent {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__lead {
    font-size: clamp(1rem, 2vw, 1.125rem);
    max-width: 56ch;
    color: var(--text-muted);
    margin: 0 0 2.5rem;
}

.hero__example {
    display: inline-flex; align-items: center; gap: 1rem;
    padding: .75rem 1.125rem;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}
.hero__example-label {
    font-size: .75rem; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: .08em;
    border-right: 1px solid var(--border);
    padding-right: 1rem;
}
.hero__example-code {
    font-family: var(--ff-mono);
    font-size: .9375rem;
    color: var(--text);
}
.hero__example-slug {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.hero__actions { margin-top: 2rem; display: flex; gap: .75rem; flex-wrap: wrap; }

.hero--404 .hero__title { font-size: clamp(2.5rem, 10vw, 5rem); }

/* =============================================================
   Botones
   ============================================================= */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .75rem 1.25rem;
    font-size: .9375rem;
    font-weight: 500;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .02);
    color: var(--text);
    text-decoration: none;
    transition: transform .15s, background .2s, border-color .2s, color .2s;
    cursor: pointer;
    line-height: 1;
}
.btn:hover { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .24); color: var(--text-strong); }
.btn:active { transform: translateY(1px); }

.btn--primary {
    background: var(--accent-grad);
    color: var(--bg);
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 10px 30px -8px rgba(99, 102, 241, .5);
}
.btn--primary:hover { color: var(--bg); filter: brightness(1.08); }

.btn--ghost {
    background: transparent;
    border-color: var(--border);
}

.btn--sm {
    padding: .375rem .625rem;
    font-size: .8125rem;
    border-radius: var(--radius-sm);
}

.btn--danger {
    color: var(--red);
    border-color: rgba(239, 68, 68, .2);
}
.btn--danger:hover {
    background: rgba(239, 68, 68, .08);
    border-color: rgba(239, 68, 68, .4);
    color: var(--red);
}

.btn--block { width: 100%; }

/* =============================================================
   Utilidades
   ============================================================= */

.muted { color: var(--text-muted); }
.link { color: var(--indigo-light); text-decoration: none; }
.link:hover { text-decoration: underline; }

.t-right  { text-align: right; }
.t-strong { color: var(--text-strong); font-weight: 500; }
.t-truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ok  { color: var(--emerald-light); }
.err { color: #f87171; }

.errors {
    list-style: none; margin: 0 0 1rem; padding: .75rem 1rem;
    border: 1px solid rgba(239, 68, 68, .3);
    background: rgba(239, 68, 68, .08);
    color: #fecaca;
    border-radius: var(--radius);
    font-size: .875rem;
}
.errors li + li { margin-top: .25rem; }

hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
