/* =============================================================
   elBRANDguy — sitio editorial de curaduría y afiliación
   Archetype: Magazine Multi-page, adaptado a los tokens de marca
   reales de soycabas.com (monocromo oscuro + Inter).
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:            #080808;
  --bg-elevated:   #101010;
  --bg-card:       #111111;
  --border:        #1e1e1e;
  --border-subtle: #161616;
  --text:          #ffffff;
  --text-2:        #888888;
  --text-3:        #4a4a4a;
  --accent:        #ffffff;
  --accent-line:   #3a3a3a;
  --good:          #22c55e;
  --good-2:        #16a34a;
  --warn:          #f2994a;

  --max-w: 1160px;
  --max-w-article: 760px;
  --nav-h: 72px;
  --r: 12px;
  --r-sm: 8px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; font-size: 16px; }

@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .5s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
::view-transition-old(root) { animation-name: fadeOutUp; }
::view-transition-new(root) { animation-name: fadeInUp; }
@keyframes fadeOutUp { to { opacity: 0; transform: translateY(-10px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: rgba(255,255,255,.15); color: var(--text); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  z-index: 9999; border-radius: var(--r-sm); font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.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;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}
@media (max-width: 720px) { .wrap { padding: 0 1.25rem; } }

.wrap-article {
  max-width: var(--max-w-article);
  margin: 0 auto;
  padding: 0 2rem;
}
@media (max-width: 720px) { .wrap-article { padding: 0 1.25rem; } }

.section { padding: 5rem 0; }
@media (max-width: 720px) { .section { padding: 3rem 0; } }

.divider { width: 100%; height: 1px; background: var(--border); border: 0; }

.label {
  font-size: .72rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3);
}

/* =============================================================
   4. Typography
   ============================================================= */
.h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 600; letter-spacing: -.03em; }
.h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.lead {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--text-2); line-height: 1.7; font-weight: 300;
  max-width: 62ch;
}

.kicker {
  display: inline-block; font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: .9rem;
}
.deck { color: var(--text-2); font-size: 1.1rem; line-height: 1.65; max-width: 62ch; margin-top: .9rem; }

.byline { color: var(--text-3); font-size: .85rem; margin-top: 1.2rem; }
.byline a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.byline a:hover { color: var(--text); }

.dropcap::first-letter {
  float: left; font-size: 4.2rem; line-height: .82; font-weight: 600;
  padding: .05em .08em 0 0; color: var(--text);
}

.pullquote {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 300;
  line-height: 1.4; color: var(--text); border-left: 2px solid var(--text-3);
  padding: .2rem 0 .2rem 1.6rem; margin: 2.4rem 0; max-width: 56ch;
}

.article-body { color: var(--text-2); font-size: 1.02rem; line-height: 1.8; }
.article-body p { margin-bottom: 1.3rem; }
.article-body h2 { color: var(--text); margin: 2.6rem 0 1rem; font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
.article-body h3 { color: var(--text); margin: 2rem 0 .8rem; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--text-2); }
.article-body ul { margin: 0 0 1.3rem; }
.article-body li { position: relative; padding-left: 1.3rem; margin-bottom: .5rem; color: var(--text-2); }
.article-body li::before { content: "—"; position: absolute; left: 0; color: var(--text-3); }

.copy-flag {
  display: block; font-size: .72rem; color: var(--warn); font-weight: 600;
  letter-spacing: .05em; margin: .4rem 0 1rem;
}

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  font-size: .92rem; font-weight: 600; white-space: nowrap;
  transition: transform .25s var(--ease-out), background .25s var(--ease-out), border-color .25s var(--ease-out);
}
.btn-w { background: #fff; color: #080808; }
.btn-w:hover { background: #e6e6e6; transform: translateY(-1px); }
.btn-o { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-o:hover { border-color: var(--accent-line); background: rgba(255,255,255,.04); transform: translateY(-1px); }
.btn-sm { padding: .55rem 1.1rem; font-size: .82rem; }

/* Disclosure banner */
.disclosure {
  display: flex; gap: .6rem; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: .9rem 1.2rem; margin: 0 0 2.5rem;
  font-size: .84rem; color: var(--text-2); line-height: 1.55;
}
.disclosure .dot { color: var(--text-3); flex-shrink: 0; }
.disclosure a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.6rem;
}
.card-hover { transition: transform .3s var(--ease-out), border-color .3s var(--ease-out); }
.card-hover:hover { transform: translateY(-3px); border-color: var(--accent-line); }

.badge {
  display: inline-block; font-size: .7rem; font-weight: 600;
  padding: .28rem .7rem; border-radius: 999px; white-space: nowrap;
  letter-spacing: .02em;
}
.badge-good { background: rgba(34,197,94,.13); color: var(--good); }
.badge-warn { background: rgba(242,153,74,.13); color: var(--warn); }
.badge-mute { background: var(--bg-elevated); color: var(--text-2); border: 1px solid var(--border); }

/* Comparison tables */
.tablewrap { border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; background: var(--bg-card); }
.cmp-table { width: 100%; font-size: .92rem; min-width: 560px; }
.cmp-table th {
  text-align: left; padding: 1rem 1.2rem; background: var(--bg-elevated);
  color: var(--text-2); font-weight: 600; font-size: .74rem;
  letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cmp-table td { padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.cmp-table tr:last-child td { border-bottom: none; }
.cmp-table tr:hover td { background: var(--bg-elevated); }
.cmp-table strong { color: var(--text); }

/* Forms */
.form-field {
  display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem;
}
.form-field label { font-size: .82rem; color: var(--text-2); }
.form-field input {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-sm); padding: .8rem 1rem; font: inherit; font-size: .95rem;
  outline: none;
}
.form-field input:focus { border-color: var(--accent-line); }
.form-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.form-row .form-field { flex: 1; min-width: 200px; }
.form-note { font-size: .78rem; color: var(--text-3); margin-top: .6rem; }

/* =============================================================
   6. Sections
   ============================================================= */

/* Masthead / header */
.masthead {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center;
  background: rgba(8,8,8,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; width: 100%; }
.brand-mark { font-size: 1.1rem; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; }
.brand-mark span { color: var(--text-2); }
.logo-header { height: 26px; width: auto; display: block; }
.logo-footer { height: 96px; width: auto; margin-bottom: 1rem; }
@media (max-width: 540px) { .logo-header { height: 22px; } }
.masthead nav { display: flex; gap: 1.6rem; align-items: center; }
.masthead nav a {
  font-size: .86rem; color: var(--text-2); position: relative; padding: .3rem 0;
}
.masthead nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--text); transition: width .25s var(--ease-out);
}
.masthead nav a:hover { color: var(--text); }
.masthead nav a:hover::after { width: 100%; }
.masthead .nav-toggle { display: none; }
@media (max-width: 820px) {
  .masthead nav.primary-nav { display: none; }
  .masthead .nav-toggle { display: inline-flex; }
}

/* Hero article (home + content pages) */
.hero-article { padding: 4.5rem 0 3.5rem; }
.hero-article .h1 { margin-top: .6rem; }
.hero-article .accent { font-style: normal; color: var(--text-2); }

.hero-manifesto {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 3.4rem;
  align-items: start;
  margin-top: 2.6rem;
}
.hero-manifesto .article-body { max-width: 62ch; }
/* deck as bright lead paragraph inside the manifesto column */
.hero-manifesto .deck {
  margin: 0 0 1.4rem;
  max-width: none;
  color: var(--text);
  font-weight: 400;
  font-size: clamp(1.08rem, 1.5vw, 1.24rem);
  line-height: 1.6;
}
.hero-photo {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  aspect-ratio: 3 / 4;
  background: var(--bg-elevated);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* tablet: keep two columns, narrower photo */
@media (max-width: 900px) {
  .hero-manifesto { grid-template-columns: minmax(240px, 300px) 1fr; gap: 2.6rem; }
}
/* mobile: stack, portrait first (natural DOM order), constrained */
@media (max-width: 720px) {
  .hero-article { padding: 3rem 0 2.5rem; }
  .hero-manifesto { grid-template-columns: 1fr; gap: 1.8rem; margin-top: 2rem; }
  .hero-manifesto .deck { font-size: 1.08rem; }
  .hero-photo {
    max-width: 280px;
    margin: 0 auto;
    position: static;
  }
}

/* Departments / category grid */
.departments { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.department {
  background: var(--bg-card); padding: 1.8rem 1.5rem; display: flex; flex-direction: column; gap: .5rem;
  transition: background .25s var(--ease-out);
}
.department:hover { background: var(--bg-elevated); }
.department .n { font-size: .74rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.department h3 { font-size: 1rem; }
.department p { font-size: .84rem; color: var(--text-2); }
@media (max-width: 960px) { .departments { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .departments { grid-template-columns: 1fr; } }

/* Featured guides grid */
.guides-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 960px) { .guides-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .guides-grid { grid-template-columns: 1fr; } }
.guide-card .kicker { margin-bottom: .6rem; }
.guide-card h3 { margin-bottom: .5rem; font-size: 1.15rem; }
.guide-card p { color: var(--text-2); font-size: .9rem; }

/* Newsletter */
.newsletter { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 2.4rem; }
.newsletter-inline { display: flex; gap: 2.5rem; align-items: center; flex-wrap: wrap; }
.newsletter-inline .copy { flex: 1; min-width: 240px; }
.newsletter form { flex: 1; min-width: 260px; display: flex; gap: .6rem; flex-wrap: wrap; }
.newsletter form input { flex: 1; min-width: 200px; }

/* Author bio (end of article) */
.author-box {
  display: flex; gap: 1.1rem; align-items: flex-start; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r); padding: 1.6rem; margin: 3rem 0;
}
.author-box .initials {
  width: 52px; height: 52px; border-radius: 50%; background: var(--bg-elevated);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0;
}
.author-box h4 { font-size: .98rem; margin-bottom: .3rem; }
.author-box p { color: var(--text-2); font-size: .88rem; line-height: 1.6; }
.author-box a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Criteria list (curation transparency) */
.criteria-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.6rem 0 2.4rem; }
@media (max-width: 720px) { .criteria-list { grid-template-columns: 1fr; } }
.criteria-item { border: 1px solid var(--border); border-radius: var(--r); padding: 1.2rem 1.4rem; background: var(--bg-card); }
.criteria-item .n { color: var(--text-3); font-size: .78rem; font-variant-numeric: tabular-nums; }
.criteria-item p { color: var(--text-2); font-size: .88rem; margin-top: .3rem; }

/* Product / program fiche */
.fiche { border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-card); padding: 1.8rem; margin-bottom: 1.4rem; }
.fiche-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.fiche-head h3 { font-size: 1.2rem; }
.fiche-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.fiche-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 1.2rem; }
@media (max-width: 720px) { .fiche-body { grid-template-columns: 1fr; } }
.fiche-col h5 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: .5rem; }
.fiche-col ul li { color: var(--text-2); font-size: .88rem; }
.fiche-verdict { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); color: var(--text); font-size: .92rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 3.5rem 0 2.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h5 { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 1rem; }
.footer-grid ul li { margin-bottom: .6rem; }
.footer-grid a { color: var(--text-2); font-size: .88rem; }
.footer-grid a:hover { color: var(--text); }
.footer-bio p { color: var(--text-2); font-size: .9rem; line-height: 1.6; max-width: 40ch; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  margin-top: 3rem; padding-top: 1.8rem; border-top: 1px solid var(--border-subtle);
  font-size: .78rem; color: var(--text-3);
}

/* Resource directory */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.filter-chip {
  padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  font-size: .82rem; color: var(--text-2); background: var(--bg-card);
}
.filter-chip[aria-pressed="true"] { background: #fff; color: #080808; border-color: #fff; }

/* =============================================================
   7. Effects
   ============================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; } /* defensive: never hide text if JS fails */

/* =============================================================
   8. Responsive tweaks
   ============================================================= */
@media (min-width: 540px) { }
@media (min-width: 720px) { }
@media (min-width: 960px) { }
@media (min-width: 1280px) { }

/* =============================================================
   9. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* =============================================================
   10. Sistema visual (gráficos de sección, logos, marcos de UI)
   ============================================================= */

/* Gráfico editorial de cabecera de guía */
.guide-figure { margin: 2rem 0 2.6rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-card); overflow: hidden; }
.guide-figure svg { display: block; width: 100%; height: auto; }
.guide-figure figcaption { padding: .7rem 1.1rem; border-top: 1px solid var(--border); font-size: .72rem; color: var(--text-3); letter-spacing: .03em; text-transform: uppercase; }

/* Logo monocromo de herramienta (glyph oficial vía máscara CSS) */
.fiche-title { display: flex; align-items: center; gap: .7rem; }
.tool-logo {
  width: 24px; height: 24px; flex-shrink: 0; display: inline-block;
  background: var(--text);
  -webkit-mask: var(--logo) center / contain no-repeat;
          mask: var(--logo) center / contain no-repeat;
}
.tool-mono {
  width: 24px; height: 24px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--accent-line); border-radius: 6px;
  font-size: 12px; font-weight: 600; color: var(--text); line-height: 1;
}

/* Marco "navegador" para capturas / retratos de UI */
.ui-frame { margin: 1.5rem 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-card); }
.ui-frame .ui-bar { display: flex; align-items: center; gap: 7px; padding: 9px 13px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.ui-frame .ui-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); display: block; }
.ui-frame .ui-url { margin-left: 8px; font-size: .72rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ui-frame img, .ui-frame .ui-shot svg { display: block; width: 100%; height: auto; }
.ui-caption { font-size: .74rem; color: var(--text-3); margin: .5rem 0 0; }
