/* Jueves de Satoshi — Estilos
   Paleta: fondo blanco, naranja Bitcoin #F7931A, negro #1A1A1A */

:root {
  --bg: #FFFFFF;
  --bg-soft: #FAF7F2;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-soft: #5A5A5A;
  --orange: #F7931A;
  --orange-dark: #D97B0A;
  --green: #1FA858;
  --red: #D9483B;
  --border: #ECE4D8;
  --shadow: 0 2px 12px rgba(26, 26, 26, 0.07);
}

[data-theme="dark"] {
  --bg: #131110;
  --bg-soft: #1C1916;
  --card: #201C18;
  --text: #F2EDE6;
  --text-soft: #B5AB9E;
  --orange: #F7931A;
  --orange-dark: #FFAA3D;
  --border: #353029;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 3px solid var(--orange);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand-logo { width: 38px; height: 38px; }
.brand-name { font-size: 1.25rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.brand-accent { color: var(--orange); }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: var(--text); font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { color: var(--orange); text-decoration: none; }
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; cursor: pointer; font-size: 1rem; }
[data-theme="light"] .icon-dark { display: none; }
[data-theme="dark"] .icon-light { display: none; }
.nav-burger { display: none; background: none; border: none; font-size: 1.6rem; color: var(--text); cursor: pointer; }

/* ---------- Hero ---------- */
.hero { background: var(--bg-soft); padding: 48px 0 40px; text-align: center; }
.hero h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -1px; }
.hero h1 .brand-accent { color: var(--orange); }
.hero p.lead { max-width: 640px; margin: 12px auto 0; color: var(--text-soft); font-size: 1.1rem; }
.live-price { display: inline-flex; align-items: center; gap: 14px; margin-top: 22px; background: var(--card); border: 1px solid var(--border); border-radius: 30px; padding: 8px 22px; box-shadow: var(--shadow); font-weight: 600; flex-wrap: wrap; justify-content: center; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 28px 0; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.kpi .kpi-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-soft); font-weight: 700; }
.kpi .kpi-value { font-size: 1.7rem; font-weight: 800; margin-top: 4px; letter-spacing: -0.5px; }
.kpi .kpi-sub { font-size: 0.85rem; color: var(--text-soft); }
.kpi-highlight { border-top: 4px solid var(--orange); }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- Sections ---------- */
section.block { padding: 36px 0; }
section.block h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
section.block h2 .brand-accent { color: var(--orange); }
.section-sub { color: var(--text-soft); margin-bottom: 20px; }

/* ---------- Charts ---------- */
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 22px; }
.chart-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.chart-card .chart-hint { font-size: 0.82rem; color: var(--text-soft); margin-bottom: 12px; }
.chart-wrap { position: relative; height: 340px; }
.chart-wrap.small { height: 260px; }
/* Todas las gráficas a ancho completo: con 52 semanas el eje X necesita espacio */

/* ---------- Barra de progreso del año ---------- */
.year-progress { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 20px; height: 12px; overflow: hidden; margin-top: 10px; }
.year-progress-bar { background: linear-gradient(90deg, var(--orange), var(--orange-dark)); height: 100%; border-radius: 20px; transition: width 0.8s ease; }
.year-progress.big { height: 16px; max-width: 480px; margin: 18px auto 0; }

/* ---------- Montaña rusa (hero) ---------- */
.coaster { max-width: 760px; margin: 30px auto 0; }
.coaster-svg { width: 100%; height: auto; display: block; }
.coaster-track { fill: none; stroke: var(--orange); stroke-width: 5; stroke-linecap: round; }
.coaster-posts line { stroke: var(--border); stroke-width: 3; }
.coaster-posts .coaster-ground { stroke-width: 4; }
.cart-coin { fill: var(--orange); stroke: #fff; stroke-width: 2; }
.cart-b { fill: #fff; font: bold 16px Arial, sans-serif; }
.cart-wheel { fill: var(--text); }
.cart-head { fill: var(--text); }
.cart-arm { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.cart-smile { fill: none; stroke: var(--bg); stroke-width: 1.4; stroke-linecap: round; }
.coaster-caption { font-size: 0.85rem; color: var(--text-soft); margin-top: 4px; }

/* ---------- Tabla de compras ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
table.compras { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 800px; }
table.compras th { background: var(--orange); color: #fff; padding: 10px 12px; text-align: right; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
table.compras th:first-child, table.compras td:first-child,
table.compras th:nth-child(2), table.compras td:nth-child(2) { text-align: left; }
table.compras td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
table.compras tr:hover td { background: var(--bg-soft); }
.x-link { display: inline-block; font-weight: 700; border: 1px solid var(--border); border-radius: 8px; padding: 1px 9px; color: var(--text); }
.x-link:hover { border-color: var(--orange); color: var(--orange); text-decoration: none; }

/* ---------- Year cards ---------- */
.year-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.year-card { background: var(--card); border: 1px solid var(--border); border-left: 6px solid var(--orange); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); display: block; color: var(--text); }
.year-card:hover { text-decoration: none; transform: translateY(-2px); transition: transform 0.15s; }
.year-card .year-num { font-size: 2rem; font-weight: 800; color: var(--orange); }
.year-card .year-stats { display: flex; gap: 18px; margin-top: 8px; flex-wrap: wrap; }
.year-card .year-stats div strong { display: block; font-size: 1.1rem; }
.year-card .year-stats div span { font-size: 0.78rem; color: var(--text-soft); text-transform: uppercase; }

/* ---------- Contenido / Acerca / Herramientas ---------- */
.content-page { max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.content-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 18px; }
.content-page h2 { font-size: 1.3rem; margin: 28px 0 10px; }
.content-page p, .content-page li { color: var(--text); margin-bottom: 12px; }
.content-page ol, .content-page ul { padding-left: 24px; }
.quote-card { background: var(--bg-soft); border-left: 5px solid var(--orange); border-radius: 0 12px 12px 0; padding: 18px 22px; margin: 20px 0; font-style: italic; }
.tool-card { display: flex; gap: 18px; align-items: flex-start; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.tool-icon { font-size: 2rem; background: var(--bg-soft); border-radius: 12px; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-card h3 { margin-bottom: 4px; }
.btn { display: inline-block; background: var(--orange); color: #fff !important; font-weight: 700; padding: 10px 24px; border-radius: 10px; border: none; cursor: pointer; font-size: 1rem; }
.btn:hover { background: var(--orange-dark); text-decoration: none; }
.btn-outline { background: none; color: var(--orange-dark) !important; border: 2px solid var(--orange); }

/* ---------- Formularios ---------- */
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 1rem; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: 2px solid var(--orange); border-color: var(--orange); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.alert-ok { background: rgba(31, 168, 88, 0.12); color: var(--green); border: 1px solid var(--green); }
.alert-err { background: rgba(217, 72, 59, 0.1); color: var(--red); border: 1px solid var(--red); }
.hp-field { position: absolute; left: -9999px; opacity: 0; } /* honeypot */

/* ---------- Avatar / contacto ---------- */
.profile-card { display: flex; gap: 22px; align-items: center; background: var(--bg-soft); border-radius: 14px; padding: 22px; margin-bottom: 26px; }
.profile-card img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid var(--orange); }
.profile-card .bio { font-style: italic; color: var(--text-soft); }

/* ---------- Admin ---------- */
.admin-bar { background: var(--text); color: #fff; padding: 8px 0; font-size: 0.85rem; }
.admin-bar .container { display: flex; justify-content: space-between; }
.admin-bar a { color: var(--orange); }
.login-box { max-width: 380px; margin: 70px auto; }

/* ---------- Footer ---------- */
.site-footer { background: #1A1A1A; color: #E8E0D4; margin-top: 50px; padding: 36px 0; }
[data-theme="dark"] .site-footer { background: #0B0A09; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; padding: 0 20px; }
.site-footer .brand-accent { color: var(--orange); }
.site-footer p { font-size: 0.88rem; color: #B8AE9F; margin-top: 6px; }
.footer-bio { font-style: italic; }
.social-links { display: flex; gap: 10px; margin-top: 10px; }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #2C2822; color: #fff; font-weight: 700; }
.social-links a:hover { background: var(--orange); text-decoration: none; }
.footer-disclaimer p { font-size: 0.78rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; position: absolute; top: 100%; right: 0; left: 0; background: var(--bg); flex-direction: column; padding: 16px 20px; border-bottom: 3px solid var(--orange); align-items: flex-start; }
  .main-nav.open { display: flex; }
  .nav-burger { display: block; }
  .hero h1 { font-size: 1.7rem; }
  .chart-wrap { height: 280px; }
}
