/*
Theme Name: TinyPlanet
Theme URI: https://tinyplanet.cl
Author: TinyPlanet
Author URI: https://tinyplanet.cl
Description: Tema oscuro para portafolio/divulgación con menú lateral desplegable, hero con nube de puntos (Gaussian Splatting / Three.js), secciones tipo feature, galería, pasos y FAQ. Portado del sitio propio de TinyPlanet. Tipografías Space Grotesk + IBM Plex Mono.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tinyplanet
*/

:root {
  --bg: #1a1e29;
  --bg-2: #222736;
  --panel: #2b3142;
  --line: rgba(255, 255, 255, 0.13);
  --text: #f1f3f8;
  --muted: #b6bccc;
  --accent: #4ee0c8;
  --accent-2: #6a8bff;
  --glow: rgba(78, 224, 200, 0.35);
  --hero-bg: #07080c;
  --radius: 16px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body, "Space Grotesk", system-ui, sans-serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, .brand-name {
  font-family: var(--font-head, "Space Grotesk", system-ui, sans-serif);
  line-height: 1.1; font-weight: 600;
}
a { color: inherit; text-decoration: none; }

.eyebrow {
  display: inline-block; font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 1rem;
}

/* ---------- BOTONES ---------- */
.btn {
  display: inline-block; padding: 0.8rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: 0.92rem; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121b; box-shadow: 0 8px 30px -8px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px var(--glow); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- LAYOUT: MENÚ LATERAL + CONTENIDO ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 60;
  display: flex; flex-direction: column; padding: 1.4rem 1.1rem;
  background: var(--bg-2); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform 0.28s ease;
}
body.sidebar-open .sidebar { transform: none; }
.brand { display: flex; align-items: center; gap: 0.6rem; letter-spacing: 0.04em; }
.brand-name { font-size: 1.05rem; font-weight: 500; }
.brand-name strong { font-weight: 700; color: var(--accent); }
.brand-mark {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent-2) 70%, transparent);
  box-shadow: 0 0 16px var(--glow);
}
.side-nav { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 1.4rem; list-style: none; padding: 0; }
.side-nav a { display: block; padding: 0.7rem 0.85rem; border-radius: 10px; color: var(--muted); font-size: 0.98rem; transition: background 0.2s, color 0.2s; }
.side-nav a:hover { background: var(--panel); color: var(--text); }
.side-nav .current-menu-item > a, .side-nav a[aria-current] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04121b; font-weight: 600;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.side-foot a { color: var(--muted); font-size: 0.86rem; }
.side-foot a:hover { color: var(--accent); }

.sidebar-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,0.5); opacity: 0; visibility: hidden; transition: opacity 0.28s, visibility 0.28s; border: 0; cursor: pointer; }
body.sidebar-open .sidebar-scrim { opacity: 1; visibility: visible; }

.content { transition: margin-left 0.28s ease; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.2rem; background: rgba(10, 12, 18, 0.65); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sidebar-toggle { display: flex; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; }
.sidebar-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

@media (min-width: 901px) {
  body.sidebar-open .content { margin-left: 260px; }
  body.sidebar-open .sidebar-scrim { display: none; }
}

/* ---------- HERO CON SPLAT ---------- */
.hero {
  position: relative; min-height: calc(100vh - 56px); display: flex; align-items: center;
  padding: 4rem clamp(1rem, 6vw, 5rem); overflow: hidden; background: var(--hero-bg);
}
.splat-root { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.splat-root canvas { display: block; width: 100% !important; height: 100% !important; }
.hero-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 70% 40%, transparent 0%, var(--hero-bg) 75%), linear-gradient(90deg, var(--hero-bg) 5%, transparent 55%);
}
.hero-content { position: relative; z-index: 2; max-width: 640px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.02em; margin-bottom: 1.4rem; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 34rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }
.hero-stats { display: flex; gap: 2.5rem; list-style: none; flex-wrap: wrap; padding: 0; margin: 0; }
.hero-stats strong { display: block; font-size: 1.4rem; color: var(--text); }
.hero-stats span { font-size: 0.85rem; color: var(--muted); }

/* ---------- SECCIONES ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 5vw, 2rem); }
.section.w-narrow { max-width: 760px; }
.section.w-wide { max-width: 1480px; }
.section.w-full { max-width: 100%; }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.02em; margin-bottom: 1rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- FEATURE (media + texto) ---------- */
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.feature.feat-flip .feat-media { order: -1; }
.feat-text .eyebrow { margin-bottom: 0.8rem; }
.feat-text h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.02em; margin-bottom: 1rem; }
.feat-body { color: var(--muted); font-size: 1.05rem; }
.feat-body p { margin-bottom: 0.9rem; }
.feat-cta { margin-top: 1.6rem; }
.feat-media { background-size: cover; background-position: center; border: 1px solid var(--line); border-radius: var(--radius); min-height: 340px; height: 100%; position: relative; background-color: var(--panel); }
@media (max-width: 820px) { .feat-grid { grid-template-columns: 1fr; } .feature.feat-flip .feat-media { order: 0; } .feat-media { min-height: 240px; } }

/* ---------- GALERÍA ---------- */
.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.obs-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s; }
.obs-card:hover { transform: translateY(-4px); border-color: rgba(78,224,200,0.4); box-shadow: 0 20px 50px -20px var(--glow); }
.obs-thumb { position: relative; aspect-ratio: 16 / 10; background-size: cover; background-position: center; }
.obs-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(7,8,12,0.65)); }
.obs-body { padding: 1.3rem 1.4rem 1.6rem; }
.obs-body h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.obs-meta { font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; color: var(--accent); margin-bottom: 0.7rem; }
.obs-body > p:last-child { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- PASOS ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding: 0; margin: 0; }
.steps li { position: relative; padding-top: 1.5rem; border-top: 2px solid var(--line); }
.step-n { font-size: 0.9rem; color: var(--accent); letter-spacing: 0.1em; }
.steps h3 { font-size: 1.2rem; margin: 0.7rem 0 0.5rem; }
.steps p { color: var(--muted); font-size: 0.92rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.3rem; position: relative; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; }
.faq-item[open] summary::after { content: "–"; }
.faq-a { color: var(--muted); margin-top: 0.8rem; font-size: 0.98rem; }

/* ---------- EXPLORADOR / EMBED ---------- */
.explorer { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); height: min(80vh, 720px); }
.explorer iframe { display: block; width: 100%; height: 100%; border: 0; }
.embed-body iframe { width: 100%; min-height: 420px; border: 0; border-radius: var(--radius); display: block; }

/* ---------- TEXTO RICO ---------- */
.richtext-body { max-width: 46rem; }
.richtext-body p { color: var(--muted); margin-bottom: 1rem; font-size: 1.05rem; }
.richtext-body h3 { font-size: 1.25rem; margin: 1.8rem 0 0.7rem; color: var(--text); }
.richtext-body ul { list-style: disc; padding-left: 1.3rem; margin: 0.4rem 0 1rem; }
.richtext-body li { color: var(--muted); margin-bottom: 0.5rem; }
.richtext-body strong { color: var(--text); }
.richtext-body a { color: var(--accent); text-decoration: underline; }
.richtext-body .credits { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); }

/* ---------- CONTACTO ---------- */
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; max-width: 720px; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; color: var(--muted); }
.field input, .field textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem;
  color: var(--text); font-family: inherit; font-size: 0.95rem; transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .btn { grid-column: 1 / -1; justify-self: start; }
.form-status { grid-column: 1/-1; color: var(--accent); font-size: 0.9rem; min-height: 1.2em; }

/* ---------- PIE ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 3rem clamp(1rem, 6vw, 5rem) 1.5rem; }
.footer-bottom { max-width: var(--max); margin: 0 auto; color: var(--muted); font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- REVEAL ---------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .grid-3 { grid-template-columns: 1fr; } .steps { grid-template-columns: 1fr; } .contact-form { grid-template-columns: 1fr; } .hero-stats { gap: 1.4rem; } }
@media (prefers-reduced-motion: reduce) { *, [data-reveal] { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; } }
