/* PsicoPhone — arcanouno.com */
:root {
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  --transition: 0.35s ease;
  --max-width: 1120px;
  --nav-height: 4.25rem;
}

[data-theme="steampunk"] {
  --bg: #f5ebdc;
  --bg-alt: #ede0cc;
  --bg-card: rgba(237, 224, 204, 0.92);
  --text: #3e2723;
  --text-muted: #5d4037;
  --accent: #b8860b;
  --accent-soft: #e8c896;
  --accent-2: #a0522d;
  --border: #8d6e63;
  --glow: rgba(184, 134, 11, 0.35);
  --hero-overlay: linear-gradient(180deg, rgba(245, 235, 220, 0.12) 0%, rgba(245, 235, 220, 0) 100%);
  --grid-line: rgba(141, 110, 99, 0.12);
  --badge-bg: #f5ebdc;
  --badge-text: #3e2723;
  --badge-border: #6b4a1e;
  --link: #6b4a1e;
}

[data-theme="cyberpunk"] {
  --bg: #0b0712;
  --bg-alt: #150f20;
  --bg-card: rgba(31, 23, 48, 0.88);
  --text: #d6cde8;
  --text-muted: #8e81ac;
  --accent: #39ff88;
  --accent-soft: #00210f;
  --accent-2: #b388ff;
  --border: #4a3d68;
  --glow: rgba(57, 255, 136, 0.28);
  --hero-overlay: linear-gradient(180deg, rgba(11, 7, 18, 0.35) 0%, rgba(57, 255, 136, 0.04) 100%);
  --grid-line: rgba(74, 61, 104, 0.35);
  --badge-bg: rgba(21, 15, 32, 0.92);
  --badge-text: #39ff88;
  --badge-border: #39ff88;
  --link: #39ff88;
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-body: "Share Tech", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
}

[data-theme="cyberpunk"] body {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
}

img { max-width: 100%; height: auto; display: block; }

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

.container {
  width: min(100% - 1.25rem, var(--max-width));
  margin-inline: auto;
}

@media (min-width: 480px) {
  .container { width: min(100% - 2rem, var(--max-width)); }
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2.5vw, 1.15rem);
  letter-spacing: 0.12em;
  color: var(--accent);
}

@media (min-width: 480px) {
  .brand-title { letter-spacing: 0.18em; }
}

.brand-sub {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (min-width: 480px) {
  .brand-sub { font-size: 0.72rem; letter-spacing: 0.12em; }
}

.nav-desktop {
  display: none;
  gap: 1.25rem;
  align-items: center;
}

.nav-desktop a {
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
}

.nav-desktop a:hover { color: var(--accent); text-decoration: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-alt);
}

.theme-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

@media (min-width: 400px) {
  .theme-btn {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 0.45rem 0.75rem;
  }
}

.theme-btn.active {
  background: var(--accent);
  color: var(--bg);
}

[data-theme="cyberpunk"] .theme-btn.active { color: #0b0712; }

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 1rem;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  color: var(--text);
  padding: 0.5rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
}

@media (min-width: 860px) {
  .nav-desktop { display: flex; }
  .menu-toggle { display: none; }
  .nav-mobile { display: none !important; }
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: 2.5rem 0 3rem;
  overflow: hidden;
}

@media (min-width: 640px) {
  .hero { padding: 3.5rem 0 4.5rem; }
}

@media (min-width: 900px) {
  .hero { padding: 4rem 0 5rem; }
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  pointer-events: none;
  z-index: 1;
}

.hero-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 1;
}

.hero-grid {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
    text-align: left;
  }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--badge-bg);
  border: 1.5px solid var(--badge-border);
  color: var(--badge-text);
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

@media (min-width: 480px) {
  .hero-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.hero-wave {
  width: 100%;
  max-width: 28rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  background: color-mix(in srgb, var(--bg-alt) 70%, transparent);
  box-shadow: inset 0 0 24px color-mix(in srgb, var(--accent) 12%, transparent);
}

@media (min-width: 900px) {
  .hero-wave { margin: 0 0 1rem; }
}

.hero-wave-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-lead {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 auto 1.5rem;
}

@media (min-width: 900px) {
  .hero-lead { margin: 0 0 1.75rem; }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

@media (min-width: 900px) {
  .hero-cta { justify-content: flex-start; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background var(--transition);
}

@media (min-width: 480px) {
  .btn {
    padding: 0.75rem 1.35rem;
    font-size: 0.9rem;
  }
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 24px var(--glow);
}

[data-theme="cyberpunk"] .btn-primary { color: #0b0712; }

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

.phone-mock {
  margin: 0 auto;
  padding: 0;
  border: none;
  width: 100%;
  max-width: 260px;
}

@media (min-width: 480px) {
  .phone-mock { max-width: 300px; }
}

.phone-bezel {
  position: relative;
  width: 100%;
  border-radius: 2rem;
  border: 3px solid var(--border);
  background: var(--bg-alt);
  box-shadow: var(--shadow), 0 0 60px var(--glow);
  padding: 0.65rem;
  overflow: hidden;
}

@media (min-width: 480px) {
  .phone-bezel { padding: 0.75rem; border-radius: 2.25rem; }
}

.phone-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 1.35rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  background: #1a1410;
}

[data-theme="steampunk"] .phone-screen {
  aspect-ratio: 941 / 1600;
  background: #2a1810;
}

[data-theme="cyberpunk"] .phone-screen {
  aspect-ratio: 572 / 1024;
  background: #0b0712;
}

@media (min-width: 480px) {
  .phone-screen { border-radius: 1.4rem; }
}

.phone-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

/* Con la proporción exacta de cada captura, encaja sin recortar laterales */
[data-theme="steampunk"] .phone-bg-steampunk,
[data-theme="cyberpunk"] .phone-bg-cyberpunk {
  object-fit: fill;
}

[data-theme="steampunk"] .phone-bg-cyberpunk { display: none; }
[data-theme="cyberpunk"] .phone-bg-steampunk { display: none; }

/* ── Sections ── */
section { padding: 2.75rem 0; }

@media (min-width: 640px) {
  section { padding: 3.5rem 0; }
}

@media (min-width: 900px) {
  section { padding: 4rem 0; }
}

section:nth-child(even) { background: color-mix(in srgb, var(--bg-alt) 65%, transparent); }

.section-head {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.section-head p { margin: 0; color: var(--text-muted); }

.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 28px var(--glow);
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.65rem;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── Theory timeline ── */
.theory-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.theory-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

@media (min-width: 540px) {
  .theory-list li {
    grid-template-columns: auto 1fr;
    gap: 1rem;
  }
}

.theory-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
  opacity: 0.85;
}

.theory-list h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.theory-list p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ── Pipeline diagram ── */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
}

.pipeline-step {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--badge-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
  text-align: center;
}

@media (min-width: 480px) {
  .pipeline-step {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
  }
}

.pipeline-arrow { color: var(--accent); font-size: 1.1rem; }

.disclaimer {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-alt) 80%, transparent);
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .disclaimer {
    padding: 2rem;
    font-size: 0.92rem;
  }
}

.disclaimer strong { color: var(--text); }

/* ── Footer ── */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.site-footer .brand-title { font-size: 0.95rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

/* ── Coming soon badge ── */
.soon {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--accent-2);
  color: var(--bg);
  margin-left: 0.35rem;
  vertical-align: middle;
}

[data-theme="steampunk"] .soon { color: #f5ebdc; }

/* ── Animaciones temáticas ── */
html.theme-switching .site-header,
html.theme-switching .hero-grid,
html.theme-switching .hero-fx {
  transition: filter 0.45s ease, opacity 0.45s ease;
}

html.theme-switching[data-theme="steampunk"] .hero-grid {
  filter: sepia(0.35) brightness(1.05);
}

html.theme-switching[data-theme="cyberpunk"] .hero-grid {
  filter: hue-rotate(-8deg) saturate(1.2);
}

html.theme-glitch[data-theme="cyberpunk"] .brand-title,
html.theme-glitch[data-theme="cyberpunk"] .hero h1 {
  animation: cyber-glitch 0.42s steps(2, end);
}

@keyframes cyber-glitch {
  0%   { transform: translate(0); text-shadow: none; }
  25%  { transform: translate(-2px, 1px); text-shadow: 2px 0 #39ff88, -2px 0 #b388ff; }
  50%  { transform: translate(2px, -1px); text-shadow: -2px 0 #39ff88, 2px 0 #b388ff; }
  75%  { transform: translate(-1px, 0); text-shadow: 1px 0 #39ff88; }
  100% { transform: none; text-shadow: none; }
}

[data-theme="cyberpunk"] .phone-bezel {
  animation: emf-pulse 4s ease-in-out infinite;
}

@keyframes emf-pulse {
  0%, 100% { box-shadow: var(--shadow), 0 0 40px var(--glow); }
  50%      { box-shadow: var(--shadow), 0 0 72px var(--glow), 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  [data-theme="cyberpunk"] .phone-bezel { animation: none; }
  html.theme-glitch[data-theme="cyberpunk"] .brand-title,
  html.theme-glitch[data-theme="cyberpunk"] .hero h1 { animation: none; }
}
