:root {
  --bg: #0b0910;
  --bg-2: #13101b;
  --card: #1a1524;
  --line: #2c2440;
  --text: #f1ecf7;
  --muted: #a89fba;
  --magenta: #ff2e93;
  --amber: #ffb020;
  --green: #3ee08f;
  --radius: 18px;
  --display: 'Chakra Petch', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 46, 147, 0.18), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(255, 176, 32, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
code { font-size: 0.9em; background: rgba(255, 255, 255, 0.07); padding: 0.1em 0.4em; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); font-weight: 700; }
h1 em { font-style: normal; color: var(--magenta); text-shadow: 0 0 32px rgba(255, 46, 147, 0.5); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.hidden, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.9em 1.5em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--magenta); color: #fff; font: 600 1rem var(--body); text-decoration: none;
  box-shadow: 0 8px 30px -8px rgba(255, 46, 147, 0.7);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px -8px rgba(255, 46, 147, 0.9); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .chips button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--magenta); box-shadow: none; }
.btn-sm { padding: 0.6em 1.1em; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(11, 9, 16, 0.75); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(44, 36, 64, 0.6);
}
.logo { font-family: var(--display); font-weight: 700; font-size: 1.15rem; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.logo-mark { background: var(--amber); color: #120d00; padding: 0.1em 0.4em; border-radius: 6px; transform: skewX(-8deg); display: inline-block; }
.nav-links { display: flex; gap: 1.6rem; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

/* Layout */
.section { padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 4vw, 3rem); max-width: 1240px; margin: 0 auto; }
.section.narrow { max-width: 860px; }
.section-head { max-width: 760px; margin-bottom: 3rem; }
.eyebrow { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.8rem; color: var(--amber); margin-bottom: 1rem; }
.eyebrow::before { content: '// '; color: var(--magenta); }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  max-width: 1340px; margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem) 4rem;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 2rem 0 2.5rem; }
.hero-stats { list-style: none; display: flex; gap: 2.5rem; padding: 0; margin: 0; }
.hero-stats strong { display: block; font-family: var(--display); font-size: 1.8rem; color: var(--amber); }
.hero-stats span { color: var(--muted); font-size: 0.88rem; }
.hero-visual { position: relative; margin: 0; transform: rotate(1.5deg); }
.hero-visual img { border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 40px 90px -30px rgba(255, 46, 147, 0.55); }
.hero-visual .tag { position: absolute; left: -1.2rem; bottom: 1.5rem; transform: rotate(-1.5deg); }

.tag {
  display: inline-flex; align-items: center; gap: 0.5em;
  background: rgba(19, 16, 27, 0.92); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.55em 1em; font-size: 0.85rem; backdrop-filter: blur(8px);
}
.tag.mini { padding: 0.3em 0.7em; font-size: 0.75rem; margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(62, 224, 143, 0.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(62, 224, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 224, 143, 0); } }

/* Marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--bg-2); transform: rotate(-1deg); margin: 2rem -2rem; }
.marquee-track { display: flex; gap: 3rem; padding: 1rem 0; width: max-content; animation: scroll 30s linear infinite; }
.marquee span { font-family: var(--display); font-size: 1.4rem; font-weight: 600; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.marquee span:nth-child(3n + 1) { color: var(--magenta); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature {
  background: linear-gradient(180deg, var(--card), var(--bg-2)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.8rem; transition: transform 0.25s, border-color 0.25s;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(255, 46, 147, 0.5); }
.feature p { color: var(--muted); margin: 0; }
.feature-lg { grid-column: span 3; display: grid; grid-template-columns: 1fr 1.3fr; gap: 0 2.5rem; align-items: center; }
.feature-lg img { grid-column: 2; grid-row: 1 / span 3; border-radius: 12px; border: 1px solid var(--line); }
.feature-lg h3 { font-size: 1.7rem; }
.num { font-family: var(--display); color: var(--amber); font-size: 0.85rem; display: block; margin-bottom: 0.8rem; }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split-visual { margin: 0; position: relative; }
.split-visual img { border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(255, 176, 32, 0.35); transform: rotate(-1.2deg); }
.split-visual .tag { position: absolute; right: 1rem; top: -1rem; }
.checks { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.75rem; }
.checks li { padding-left: 2rem; position: relative; color: var(--muted); }
.checks li strong { color: var(--text); }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 1.4rem; height: 1.4rem; border-radius: 6px; background: rgba(255, 46, 147, 0.15); color: var(--magenta); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; }

/* IA chat */
.ia-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: start; }
.chat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px -40px rgba(255, 46, 147, 0.6); }
.chat-head { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--card); }
.chat-head div { display: flex; flex-direction: column; line-height: 1.3; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--magenta), var(--amber)); display: grid; place-items: center; font-family: var(--display); font-weight: 700; flex-shrink: 0; }
.chat-log { height: 360px; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.msg { max-width: 85%; padding: 0.75em 1em; border-radius: 16px; white-space: pre-wrap; animation: pop 0.3s ease-out; }
.msg.bot { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--magenta); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.error { border-color: rgba(255, 90, 90, 0.6); color: #ffb3b3; }
.msg.typing { display: flex; gap: 4px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.msg.typing i:nth-child(2) { animation-delay: 0.2s; }
.msg.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 1.2rem 1rem; }
.chips button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 0.4em 0.9em; font: 500 0.85rem var(--body); cursor: pointer; transition: all 0.2s; }
.chips button:hover { color: var(--text); border-color: var(--amber); }
.chat-form { display: flex; gap: 0.6rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }
.ia-side img { border-radius: 18px; border: 1px solid var(--line); }

/* Inputs */
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 0.8em 1em; font: 1rem var(--body); transition: border-color 0.2s;
}
input:hover, select:hover, textarea:hover { border-color: #463a63; }
textarea { resize: vertical; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; counter-reset: s; }
.steps li { border-top: 2px solid var(--line); padding-top: 1.4rem; position: relative; }
.steps li:hover { border-top-color: var(--magenta); }
.steps span { font-family: var(--display); font-size: 3rem; font-weight: 700; color: transparent; -webkit-text-stroke: 1px var(--amber); display: block; line-height: 1; margin-bottom: 0.8rem; }
.steps p { color: var(--muted); margin: 0; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: stretch; margin-bottom: 2rem; }
.plan { background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; padding: 2rem; display: flex; flex-direction: column; position: relative; }
.plan ul { padding: 0; list-style: none; margin: 1.2rem 0 2rem; display: grid; gap: 0.6rem; flex: 1; }
.plan li { padding-left: 1.4rem; position: relative; color: var(--muted); font-size: 0.95rem; }
.plan li::before { content: '▸'; position: absolute; left: 0; color: var(--amber); }
.plan li strong { color: var(--text); }
.price { font-family: var(--display); font-size: 2.6rem; font-weight: 700; margin: 0.2rem 0; }
.price span { font-size: 0.95rem; color: var(--muted); font-family: var(--body); font-weight: 400; }
.plan-featured { background: linear-gradient(180deg, rgba(255, 46, 147, 0.14), var(--bg-2) 60%); border-color: var(--magenta); transform: translateY(-10px); }
.badge { position: absolute; top: -0.8rem; right: 1.5rem; background: var(--amber); color: #120d00; font-family: var(--display); font-weight: 700; font-size: 0.8rem; padding: 0.3em 0.8em; border-radius: 999px; margin: 0; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 1.2rem 0; }
summary { cursor: pointer; font-family: var(--display); font-size: 1.15rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--magenta); font-size: 1.5rem; line-height: 1; transition: transform 0.25s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); margin: 0.8rem 0 0; }

/* Order */
.order-form { background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; padding: 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.order-form label { display: grid; gap: 0.4rem; font-size: 0.9rem; color: var(--muted); }
.order-form .full { grid-column: 1 / -1; }

.footer { border-top: 1px solid var(--line); padding: 2.5rem clamp(1rem, 4vw, 3rem); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer p { margin: 0; }

/* Thanks page */
.thanks { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.thanks > div { max-width: 560px; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(18px); animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.d1 { animation-delay: 0.08s; } .d2 { animation-delay: 0.18s; } .d3 { animation-delay: 0.28s; } .d4 { animation-delay: 0.38s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero-visual.reveal { animation-name: rise-tilt; }
@keyframes rise-tilt { to { opacity: 1; transform: rotate(1.5deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero, .split, .ia-grid { grid-template-columns: 1fr; }
  .hero-visual .tag { left: 0.8rem; }
  .features, .plans { grid-template-columns: 1fr; }
  .feature-lg { grid-column: auto; grid-template-columns: 1fr; }
  .feature-lg img { grid-column: auto; grid-row: auto; margin-top: 1.5rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .plan-featured { transform: none; }
}
@media (max-width: 560px) {
  .steps, .order-form { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .chat-log { height: 320px; }
}

/* Trabajos realizados */
[hidden] { display: none !important; }
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.work {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-2); cursor: zoom-in; color: inherit; font: inherit; text-align: left; aspect-ratio: 16 / 10;
  transition: transform 0.25s, border-color 0.25s;
}
.work:hover { transform: translateY(-4px); border-color: rgba(255, 46, 147, 0.6); }
.work:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.work img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.work:hover img { transform: scale(1.04); }
.work-cap {
  position: absolute; inset: auto 0 0; padding: 2.5rem 1.1rem 1rem; display: grid; gap: 0.1rem;
  background: linear-gradient(transparent, rgba(11, 9, 16, 0.95));
}
.work-cap strong { font-family: var(--display); font-size: 1.05rem; }
.work-cap span { color: var(--amber); font-size: 0.85rem; }
.lightbox { max-width: min(1100px, 94vw); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); color: var(--text); }
.lightbox::backdrop { background: rgba(5, 4, 8, 0.85); backdrop-filter: blur(6px); }
.lightbox img { width: 100%; max-height: 75vh; object-fit: contain; background: #000; }
.lightbox-text { padding: 1rem 1.3rem 1.3rem; display: grid; gap: 0.3rem; }
.lightbox-close { position: absolute; top: 0.6rem; right: 0.6rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line); background: rgba(11, 9, 16, 0.8); color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* Discord */
.discord-box {
  display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: center;
  padding: clamp(1.8rem, 4vw, 3rem); border-radius: 26px; border: 1px solid rgba(88, 101, 242, 0.5);
  background: radial-gradient(600px 300px at 0% 0%, rgba(88, 101, 242, 0.25), transparent 70%), var(--bg-2);
}
.discord-box h2 { margin-bottom: 0.3em; }
.discord-box p:last-child { margin: 0; }
.discord-logo { width: 72px; height: 72px; color: #8c96ff; }
.btn-discord { background: #5865f2; box-shadow: 0 8px 30px -8px rgba(88, 101, 242, 0.8); white-space: nowrap; }
.btn-discord:hover { box-shadow: 0 12px 40px -8px rgba(88, 101, 242, 1); }
.discord-float {
  position: fixed; right: 1.2rem; bottom: 5.5rem; z-index: 60; display: inline-flex; align-items: center; gap: 0.5rem;
  background: #5865f2; color: #fff; text-decoration: none; padding: 0.75em 1.1em; border-radius: 999px;
  font-weight: 600; font-size: 0.92rem; box-shadow: 0 10px 30px -8px rgba(88, 101, 242, 0.9); transition: transform 0.2s;
}
.discord-float:hover { transform: translateY(-3px); }
.discord-float svg { width: 22px; height: 22px; }
.footer a { color: var(--muted); }

/* Panel del dueño */
.admin-main { max-width: 1100px; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2rem) 5rem; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; padding: clamp(1.4rem, 3vw, 2rem); }
.card h2 { font-size: 1.5rem; }
.auth { max-width: 460px; margin: 3rem auto; }
.auth h1 { font-size: 2.2rem; }
.stack { display: grid; gap: 1rem; }
.stack label { display: grid; gap: 0.4rem; font-size: 0.9rem; color: var(--muted); }
.hint { font-size: 0.8rem; color: var(--muted); opacity: 0.85; line-height: 1.45; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.links { margin: 0; }
.link { background: none; border: 0; padding: 0; color: var(--amber); font: inherit; cursor: pointer; text-decoration: underline; }
.notice { padding: 0.9em 1.2em; border-radius: 12px; border: 1px solid rgba(62, 224, 143, 0.5); background: rgba(62, 224, 143, 0.08); max-width: 1100px; }
.notice.error { border-color: rgba(255, 90, 90, 0.6); background: rgba(255, 90, 90, 0.08); color: #ffc4c4; }
.admin-head { margin-bottom: 2rem; }
.admin-head h1 { font-size: clamp(2rem, 4vw, 3rem); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.drop {
  position: relative; display: grid !important; place-items: center; min-height: 180px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 16px; padding: 1rem; overflow: hidden; transition: border-color 0.2s;
}
.drop:hover { border-color: var(--magenta); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { max-height: 220px; border-radius: 10px; }
.section-tight { margin-top: 3rem; }
.admin-works { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.admin-work { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.admin-work img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.admin-work div { padding: 0.9rem; display: grid; gap: 0.3rem; justify-items: start; }

@media (max-width: 860px) {
  .admin-grid { grid-template-columns: 1fr; }
  .discord-box { grid-template-columns: 1fr; text-align: left; gap: 1.2rem; }
  .discord-logo { width: 52px; height: 52px; }
  .discord-float span { display: none; }
  .discord-float { padding: 0.8em; }
}
