/*
Theme Name: Brauer
Theme URI: https://maxbrauer.dev
Author: Max Brauer
Author URI: https://maxbrauer.dev
Description: Tema personal de Max Brauer — CV estilo venture capital con paleta monocromática del logo BRAUER, tres temas conmutables (Light/Dark/Red) y blog editorial. Convertido desde web1.
Version: 1.0.0
Requires PHP: 8.0
License: Proprietary
Text Domain: brauer
*/

:root {
  --bg: #d9d9d7;        /* gris claro del logo */
  --surface: #e1e1df;
  --fg: #2b2c2e;        /* grafito */
  --muted: #6c6d70;
  --line: #bcbcba;
  --accent: #57585a;    /* gris BRAUER */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-heavy: 'Archivo', 'Inter', system-ui, sans-serif;
}
body.dark {
  --bg: #131416;
  --surface: #1b1c1e;
  --fg: #d9d9d7;
  --muted: #8f9093;
  --line: #2e2f31;
  --accent: #a9aaac;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; }

.wrap {
  max-width: 1200px;
  margin: auto;
  padding: 0 40px;
}
@media (max-width: 640px) { .wrap { padding: 0 22px; } }

/* ===== Top bar ===== */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.admin-bar .top-bar { top: 32px; }
.brand {
  display: flex;
  align-items: center;
  color: var(--fg);
  text-decoration: none;
  transition: color .25s ease, opacity .25s ease;
}
.brand:hover { color: var(--accent); }
.brand svg { height: 16px; width: auto; display: block; }

/* Wordmark: la silueta viene de la máscara y el color de currentColor, así
   sigue al tema (y al hover) sin necesitar una imagen por variante. */
.logo-mark {
  display: block;
  height: 22px;
  aspect-ratio: 640 / 121;
  background-color: currentColor;
  -webkit-mask: var(--logo-src) no-repeat center / contain;
  mask: var(--logo-src) no-repeat center / contain;
}

.top-controls { display: flex; gap: 18px; align-items: center; }
.top-controls button {
  position: relative;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 0;
  transition: color .2s ease;
}
.top-controls button::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--fg);
  transition: width .28s ease, left .28s ease;
}
.top-controls button:hover { color: var(--fg); }
.top-controls button:hover::after { left: 0; width: 100%; }
.top-controls button.active { color: var(--fg); }
.top-controls button.active::after { left: 0; width: 100%; }
.top-controls .sep { width: 1px; height: 14px; background: var(--line); }
@media (max-width: 640px) {
  .top-bar { padding: 14px 22px; }
  .top-controls { gap: 12px; }
  .top-controls .sep { display: none; }
}

/* ===== Hero ===== */
.hero {
  padding: 190px 0 90px;
  animation: fadeUp .9s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}
.kicker::before {
  content: '';
  width: 44px;
  height: 1px;
  background: var(--fg);
  animation: line-grow .9s .25s cubic-bezier(.65,0,.35,1) both;
}
@keyframes line-grow {
  from { width: 0; }
  to { width: 44px; }
}
.statement {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 1050px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  margin-top: 44px;
}
.subtitle {
  font-size: 1rem;
  color: var(--muted);
  max-width: 560px;
}
.email {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: .06em;
  color: var(--fg);
  text-decoration: none;
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) no-repeat right bottom / 100% 1px;
  transition: background-size .35s ease, color .2s ease;
}
.email:hover {
  color: var(--accent);
  background-size: 0 1px;
}
.socials { display: flex; gap: 16px; }
.socials a {
  color: var(--muted);
  font-size: 1.05rem;
  transition: color .2s ease, transform .2s ease;
}
.socials a:hover { color: var(--accent); transform: translateY(-2px); }

/* ===== Stats strip ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 38px 32px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat-num {
  font-family: var(--font-display);
  font-weight: 340;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-num sup { font-size: 0.45em; color: var(--accent); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 14px;
}
@media (max-width: 768px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--line); padding: 26px 0; }
  .stat:first-child { border-top: none; }
}

/* ===== Sections ===== */
.section { padding: 90px 0 0; }
.section-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 48px;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: .14em;
  color: var(--accent);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  letter-spacing: -0.01em;
}

/* ===== Portfolio rows ===== */
.pf-row {
  display: grid;
  grid-template-columns: 56px 1.1fr 0.7fr 1.6fr 40px;
  gap: 28px;
  align-items: baseline;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  position: relative;
  transition: padding-left .25s ease;
}
.pf-row:last-child { border-bottom: 1px solid var(--line); }
.pf-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .3s ease;
}
.pf-row:hover { padding-left: 16px; }
.pf-row:hover::before { transform: scaleY(1); }
.pf-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.pf-name {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}
.pf-name a {
  text-decoration: none;
  transition: color .2s ease;
}
.pf-name a:hover { color: var(--accent); }
.pf-role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 6px;
}
.pf-period {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: .08em;
  color: var(--muted);
}
.pf-desc {
  font-size: 0.92rem;
  color: var(--muted);
}
.pf-arrow {
  font-size: 1rem;
  color: var(--line);
  justify-self: end;
  transition: color .2s ease, transform .2s ease;
}
.pf-row:hover .pf-arrow { color: var(--accent); transform: translateX(4px); }
@media (max-width: 900px) {
  .pf-row { grid-template-columns: 1fr; gap: 8px; padding: 28px 0; }
  .pf-index, .pf-arrow { display: none; }
}

/* ===== Expertise columns ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}
.card {
  position: relative;
  border-top: 2px solid var(--line);
  padding-top: 22px;
}
.card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.65,0,.35,1);
}
.card:hover::before { transform: scaleX(1); }
.card h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.card h4 .idx { color: var(--accent); margin-right: 8px; }
.card li {
  font-size: 0.84rem;
  color: var(--muted);
  list-style-type: none;
  padding: 5px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.card li:last-child { border-bottom: none; }

/* ===== Education ===== */
.edu {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.edu small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}
.edu-desc {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 14px;
  max-width: 560px;
}

/* ===== Blog carousel (portada) ===== */
.carousel-container { overflow: hidden; position: relative; }
.carousel {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 0 16px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.post-card {
  flex: 0 0 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color .3s ease, transform .3s ease;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.post-image {
  display: block;
  height: 150px;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) contrast(1.05);
  transition: filter .4s ease;
  border-bottom: 1px solid var(--line);
}
.post-card:hover .post-image { filter: grayscale(0%); }
.post-content { padding: 22px; }
.post-content h4 {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: 1.08rem;
  margin-bottom: 10px;
  line-height: 1.3;
}
.post-content h4 a { color: inherit; text-decoration: none; }
.post-content p {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.post-content a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.post-content a:hover { color: var(--fg); }
.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--fg);
  color: var(--bg);
  border: none;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s ease, background .2s ease;
  z-index: 2;
}
.carousel-prev:hover, .carousel-next:hover { background: var(--accent); }
.carousel-prev { left: 0; }
.carousel-next { right: 0; }
.carousel-container:hover .carousel-prev,
.carousel-container:hover .carousel-next { opacity: 1; }
@media (max-width: 768px) {
  .post-card { flex: 0 0 230px; }
  .carousel-prev, .carousel-next { display: none; }
}

/* ===== Listado de artículos (home/archive) ===== */
.blog-hero {
  padding: 190px 0 0;
  animation: fadeUp .9s ease both;
}
.blog-title {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 48px;
}
.compromiso {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 36px 0;
  margin-bottom: 24px;
}
.compromiso-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.compromiso ul { list-style: none; }
.compromiso li {
  font-size: 0.95rem;
  color: var(--muted);
  padding: 4px 0;
}
.compromiso li strong { color: var(--fg); font-weight: 600; }

.post-row {
  display: grid;
  grid-template-columns: 220px 1fr 40px;
  gap: 28px;
  align-items: baseline;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  position: relative;
  transition: padding-left .25s ease;
}
.post-row:last-of-type { border-bottom: 1px solid var(--line); }
.post-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .3s ease;
}
.post-row:hover { padding-left: 16px; }
.post-row:hover::before { transform: scaleY(1); }
.post-row-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-row-meta .cat { color: var(--accent); }
.post-row h2 {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  transition: color .2s ease;
}
.post-row:hover h2 { color: var(--accent); }
.post-row .excerpt {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 10px;
  max-width: 720px;
}
.post-row .leer {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 14px;
}
.post-row .pf-arrow { align-self: center; }
@media (max-width: 768px) {
  .post-row { grid-template-columns: 1fr; gap: 8px; padding: 28px 0; }
  .post-row .pf-arrow { display: none; }
}

.blog-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.blog-pagination a {
  color: var(--fg);
  text-decoration: none;
  transition: color .2s ease;
}
.blog-pagination a:hover { color: var(--accent); }

/* ===== Artículo (single) ===== */
.article-head {
  padding: 190px 0 0;
  animation: fadeUp .9s ease both;
}
.article-title {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 950px;
}
.article-content {
  max-width: 760px;
  padding: 56px 0 0;
  font-size: 1.02rem;
  line-height: 1.8;
}
.article-content p { margin-bottom: 22px; }
.article-content h2, .article-content h3 {
  font-family: var(--font-display);
  font-weight: 480;
  letter-spacing: -0.01em;
  margin: 44px 0 18px;
  line-height: 1.2;
}
.article-content h2 { font-size: 1.7rem; }
.article-content h3 { font-size: 1.3rem; }
.article-content ul, .article-content ol { margin: 0 0 22px 22px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 22px;
  margin: 28px 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.article-content img { max-width: 100%; height: auto; }
.article-content a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.article-content a:hover { color: var(--accent); }
.article-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px 6px;
}
.article-content pre {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 22px;
}
.article-content pre code { border: none; background: none; padding: 0; }
.article-nav {
  max-width: 760px;
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 28px 0;
}
.article-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.article-nav a:hover { color: var(--fg); }

/* ===== Contact / Footer ===== */
.contact {
  margin-top: 110px;
  border-top: 1px solid var(--line);
  padding: 90px 0 70px;
}
.contact-title {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 28px;
}
.contact-title .hl { color: var(--accent); }
.contact-sub {
  color: var(--muted);
  max-width: 580px;
  font-size: 1rem;
  margin-bottom: 64px;
}
.contact-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  position: relative;
  transition: padding-left .25s ease;
}
.contact-row:last-of-type { border-bottom: 1px solid var(--line); }
.contact-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .3s ease;
}
.contact-row:hover { padding-left: 16px; }
.contact-row:hover::before { transform: scaleY(1); }
.contact-row-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--accent);
}
.contact-row-value {
  font-weight: 600;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  letter-spacing: -0.01em;
  transition: color .2s ease;
}
.contact-row:hover .contact-row-value { color: var(--accent); }
@media (max-width: 640px) {
  .contact-row { grid-template-columns: 1fr; gap: 6px; }
}

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ===== Tema RED (editorial bold oscuro) ===== */
body.theme-red {
  --bg: #100e0e;
  --surface: #181616;
  --fg: #f4f2ef;
  --muted: #8f8d8b;
  --line: #272524;
  --accent: #d2323e;
}
body.theme-red .statement,
body.theme-red .section-title,
body.theme-red .pf-name,
body.theme-red .stat-num,
body.theme-red .contact-title,
body.theme-red .edu,
body.theme-red .post-content h4,
body.theme-red .blog-title,
body.theme-red .article-title,
body.theme-red .post-row h2 {
  font-family: var(--font-heavy);
  font-weight: 800;
  letter-spacing: -0.03em;
}
body.theme-red .statement {
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
body.theme-red .section-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}
body.theme-red .blog-title,
body.theme-red .contact-title {
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}
body.theme-red .contact-row-value {
  font-family: var(--font-heavy);
  font-weight: 800;
  letter-spacing: -0.02em;
}
body.theme-red .pf-name { font-size: 1.55rem; }
body.theme-red .kicker::before,
body.theme-red .pf-row::before,
body.theme-red .post-row::before,
body.theme-red .card::before,
body.theme-red .top-controls button::after {
  background: var(--accent);
}
body.theme-red .contact-row-label,
body.theme-red .pf-role,
body.theme-red .section-num,
body.theme-red .post-content a,
body.theme-red .post-row-meta .cat,
body.theme-red .post-row .leer,
body.theme-red .compromiso-label {
  color: var(--accent);
}
body.theme-red ::selection { background: var(--accent); color: #fff; }
body.theme-red .email:hover,
body.theme-red .socials a:hover,
body.theme-red .pf-name a:hover,
body.theme-red .post-row:hover h2,
body.theme-red .contact-row:hover .contact-row-value,
body.theme-red .brand:hover { color: var(--accent); }
body.theme-red .carousel-prev:hover,
body.theme-red .carousel-next:hover { background: var(--accent); color: #fff; }
body.theme-red .post-card:hover { border-color: var(--accent); }

/* ===== Scroll reveal ===== */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}

/* ===== Print ===== */
@media print {
  .top-bar, .carousel-prev, .carousel-next { display: none; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .hero, .blog-hero, .article-head { padding-top: 40px; }
  a { color: #000; text-decoration: none; }
  .socials { display: none; }
}
