/* DevAl Software — portafolio estático (Hostinger-ready) */

:root {
  /* Tokens alineados a UI UX Pro Max — Trust & Authority (B2B), CTA azul corporativo */
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --bg-card: #1e293b;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-rgb: 56, 189, 248;
  --accent-dim: rgba(var(--accent-rgb), 0.14);
  --accent-glow: rgba(var(--accent-rgb), 0.32);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --space: clamp(1rem, 4vw, 2rem);
  --max: 1120px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* Vista inicial: solo hero informativo; el resto se abre desde el menú */
body.is-landing main .content-section {
  display: none;
}

body.is-landing .site-footer {
  display: none;
}

body.is-landing .hero {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

body.is-landing .hero .container.hero-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Menú: una pantalla = una sección (sin hero arriba ni otra sección abajo) */
body.show-sobre-mi main > .hero,
body.show-empresa main > .hero,
body.show-catalogo main > .hero,
body.show-proyectos main > .hero,
body.show-tu-idea main > .hero,
body.show-contacto main > .hero {
  display: none;
}

body.show-sobre-mi main > section.content-section:not(#sobre-mi),
body.show-empresa main > section.content-section:not(#empresa),
body.show-catalogo main > section.content-section:not(#catalogo),
body.show-proyectos main > section.content-section:not(#proyectos),
body.show-tu-idea main > section.content-section:not(#tu-idea),
body.show-contacto main > section.content-section:not(#contacto) {
  display: none !important;
}

body.show-sobre-mi #sobre-mi,
body.show-empresa #empresa,
body.show-catalogo #catalogo,
body.show-proyectos #proyectos,
body.show-tu-idea #tu-idea,
body.show-contacto #contacto {
  display: block !important;
}

body.show-sobre-mi .site-footer,
body.show-empresa .site-footer,
body.show-catalogo .site-footer,
body.show-proyectos .site-footer,
body.show-tu-idea .site-footer,
body.show-contacto .site-footer {
  display: block;
}

body:not(.is-landing) main {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7ff5e0;
}

.container {
  width: min(100% - var(--space) * 2, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo:hover {
  color: var(--text);
}

.logo-dot {
  color: var(--accent);
}

.logo-software {
  color: var(--accent);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent) !important;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
}

.nav-cta:hover {
  background: rgba(var(--accent-rgb), 0.22);
  color: #e0f2fe !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 1rem;
  }
}

/* Hero */
.hero {
  position: relative;
  padding: clamp(4rem, 12vw, 8rem) 0 clamp(6rem, 14vw, 10rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70%;
  max-width: 600px;
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(60px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  max-width: 18ch;
}

.text-gradient {
  background: linear-gradient(120deg, #7dd3fc 0%, var(--accent) 45%, #bae6fd 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #f8fafc;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
  color: #f8fafc;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary:disabled {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: rgba(255, 255, 255, 0.85);
}

.btn-ghost:disabled {
  opacity: 0.35;
  border-color: var(--border);
}

/* Sections */
.section {
  padding: clamp(4rem, 10vw, 7rem) 0;
}

.section-alt {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 50ch;
  margin: -0.5rem 0 2.5rem;
}

.section-text {
  margin: 0 0 1rem;
  color: var(--text-muted);
  max-width: 52ch;
}

.section-text.muted {
  font-size: 0.95rem;
  opacity: 0.85;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Sobre mí — foto + texto */
.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.about-photo-wrap {
  margin: 0;
}

.about-photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.about-copy .section-title {
  margin-bottom: 1.25rem;
}

.about-heading {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.about-heading:first-of-type {
  margin-top: 1.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.about-block-list {
  margin: 0.5rem 0 0;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo-wrap {
    max-width: 280px;
    margin-inline: auto;
  }
}

.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pill-list li {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.pill-list li:hover {
  border-color: rgba(var(--accent-rgb), 0.25);
  transform: translateX(4px);
}

#empresa .deval-origin {
  margin: 0 0 1.75rem;
  max-width: 65ch;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text);
}

#empresa .deval-origin time {
  color: var(--accent);
  font-weight: 600;
}

.deval-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 1rem;
  line-height: 1.65;
}

#empresa .deval-advisory {
  margin: 0 0 1.25rem;
  max-width: 65ch;
  font-size: 1.05rem;
}

#empresa .deval-follow {
  margin: 0 0 2.5rem;
  max-width: 62ch;
  font-size: 1.05rem;
}

.deval-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (min-width: 901px) {
  .deval-cards .card-values-wrap {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .deval-cards {
    grid-template-columns: 1fr;
  }
}

.card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(var(--accent-rgb), 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.card-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-values {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card-values li {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.card-values strong {
  color: var(--text);
  font-weight: 600;
}

/* Catálogo orientativo (tipos de proyecto y rangos) */
#catalogo .catalog-lead {
  max-width: 68ch;
}

.catalog-disclaimer {
  margin: 0 0 1.75rem;
  padding: 1rem 1.15rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: 72ch;
}

.catalog-disclaimer strong {
  color: var(--text);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

.catalog-card {
  padding: 1.35rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.catalog-card:hover {
  border-color: rgba(var(--accent-rgb), 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.catalog-card--accent {
  border-color: rgba(var(--accent-rgb), 0.18);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.06), var(--bg-card));
}

.catalog-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.catalog-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.3;
  color: var(--text);
}

.catalog-card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.catalog-card-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.catalog-price-block {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.catalog-price-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.catalog-price-range {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
}

.catalog-price-floor {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.catalog-price-foot {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #8b9aab;
}

.catalog-includes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.catalog-includes li {
  padding-left: 1rem;
  position: relative;
}

.catalog-includes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.catalog-sample-link {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: auto;
  padding-top: 0.25rem;
}

.catalog-card-note {
  margin: 0;
  font-size: 0.85rem;
  color: #8b9aab;
  font-style: italic;
}

.catalog-close {
  margin: 2rem 0 0;
  padding: 1.15rem 1.35rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-muted);
  background: var(--accent-dim);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--radius);
  max-width: 72ch;
}

.catalog-close strong {
  color: var(--text);
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
  border-color: rgba(var(--accent-rgb), 0.25);
  transform: translateY(-4px);
}

.project-thumb {
  display: block;
  margin: 0;
  line-height: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.project-thumb img,
.project-thumb svg {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.project-thumb svg {
  object-fit: unset;
}

.project-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.project-card-inner {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.inline-code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.btn-project {
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
}

.link-arrow--soft {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.link-arrow--soft:hover {
  color: var(--accent);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-year {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.project-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.project-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-tech li {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.link-arrow {
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
}

.link-arrow::after {
  content: "→";
  transition: transform 0.2s ease;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* CTA */
.section-cta {
  padding: clamp(5rem, 12vw, 8rem) 0;
}

.cta-inner {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(145deg, var(--bg-card) 0%, #1a1f2e 100%);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.cta-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, var(--accent-glow), transparent 50%);
  pointer-events: none;
}

.cta-title,
.cta-text,
.cta-actions {
  position: relative;
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
}

.cta-text {
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 auto 1.75rem;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.social-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.social-link:hover {
  color: var(--accent);
}

/* Sección «Tu idea» — laboratorio visual + mensaje */
.idea-intro {
  max-width: 62ch;
}

.idea-lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: 2rem;
  margin-bottom: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .idea-lab {
    grid-template-columns: 1fr;
  }
}

.idea-lab-controls {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem clamp(1rem, 2vw, 1.5rem);
}

.idea-lab-lead {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.idea-field {
  margin-bottom: 1.15rem;
}

.idea-field:last-child {
  margin-bottom: 0;
}

.idea-field-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.idea-field-fieldset {
  border: none;
  margin: 0 0 1.15rem;
  padding: 0;
}

.idea-field-fieldset .idea-field-label {
  margin-bottom: 0.5rem;
}

.idea-color-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.idea-color-row input[type="color"] {
  width: 52px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
}

.idea-hex-input {
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 7.5rem;
}

.idea-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.idea-presets {
  margin-bottom: 1.15rem;
}

.idea-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.idea-preset {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.idea-preset:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.06);
}

.idea-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.idea-seg--wrap {
  gap: 0.45rem;
}

.idea-seg-item {
  position: relative;
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.idea-seg-item:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.08);
}

.idea-seg-item input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.idea-select {
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.idea-lab-preview-wrap {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.idea-preview-caption {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.idea-preview-root {
  --idea-primary: #38bdf8;
  min-height: 280px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  transition: background 0.25s ease, color 0.25s ease, border-radius 0.25s ease;
}

.idea-preview-root--dark {
  background: linear-gradient(160deg, #141820 0%, #0a0c10 100%);
  color: #e8eaef;
}

.idea-preview-root--light {
  background: linear-gradient(160deg, #fafafa 0%, #e4e4e7 100%);
  color: #18181b;
  border-color: rgba(0, 0, 0, 0.08);
}

.idea-preview-inner {
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  transition: border-radius 0.25s ease, font-family 0.25s ease;
  min-height: 200px;
}

/* Lienzo wireframe */
.idea-canvas {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 220px;
  border-radius: inherit;
}

.idea-canvas.idea-canvas--free {
  position: relative;
  display: block;
  min-height: 420px;
  gap: 0;
}

.idea-canvas.idea-canvas--free .idea-block--free {
  position: absolute;
  margin: 0;
  box-sizing: border-box;
  min-height: 2rem;
}

.idea-block-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.35rem;
  height: 100%;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  font-size: 0.65rem;
  line-height: 1;
  color: var(--idea-primary);
  opacity: 0.85;
  z-index: 2;
  border-radius: inherit 0 0 inherit;
  background: color-mix(in srgb, var(--idea-primary) 12%, transparent);
  user-select: none;
}

.idea-block-handle:active {
  cursor: grabbing;
}

.idea-block--free {
  padding-left: 1.45rem;
}

.idea-block--free > :not(.idea-block-handle) {
  position: relative;
  z-index: 1;
}

.idea-wb-nav {
  width: 100%;
}

.idea-wb-nav-row {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.5rem;
  border-radius: inherit;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  outline: none;
  min-height: 2.25rem;
}

.idea-preview-root--light .idea-wb-nav-row {
  border-color: rgba(0, 0, 0, 0.12);
}

.idea-wb-box-inner {
  min-height: 4.5rem;
  border-radius: inherit;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: flex-start;
}

.idea-preview-root--light .idea-wb-box-inner {
  border-color: rgba(0, 0, 0, 0.1);
}

.idea-wb-box-label {
  font-size: 0.8rem;
  outline: none;
  width: 100%;
  opacity: 0.9;
}

.idea-block-props {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.idea-block-props-title {
  margin-bottom: 0.5rem !important;
}

.idea-block-props-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.idea-mini-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.idea-mini-field input {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 100%;
  min-width: 0;
}

.idea-block-bg-row {
  margin-top: 0.65rem;
  margin-bottom: 0 !important;
}

.idea-block-bg-clear {
  margin-top: 0.35rem;
  font-size: 0.78rem !important;
}

.idea-lab kbd {
  font-family: ui-monospace, monospace;
  font-size: 0.75em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.idea-block {
  position: relative;
  border-radius: inherit;
  transition: outline 0.15s ease, background 0.15s ease;
}

.idea-block.is-selected {
  outline: 2px solid var(--idea-primary);
  outline-offset: 3px;
  background: color-mix(in srgb, var(--idea-primary) 6%, transparent);
}

.idea-preview-root--light .idea-block.is-selected {
  background: color-mix(in srgb, var(--idea-primary) 10%, #fff);
}

.idea-builder-add {
  margin-top: 0.25rem;
}

.idea-builder-add-hint {
  margin-bottom: 0.65rem;
}

.idea-add-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (min-width: 520px) {
  .idea-add-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.idea-add-btn {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.idea-add-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
}

.idea-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.btn-text {
  font: inherit;
  font-size: 0.82rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text:hover {
  color: var(--text);
}

.idea-clear-canvas {
  color: var(--text-muted);
}

.idea-clear-canvas:hover {
  color: #f87171;
}

.idea-builder-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.idea-builder-panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.idea-panel-btn {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.idea-panel-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.idea-panel-btn--danger:hover {
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}

.idea-wb-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}

.idea-wb-field-cap {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.idea-wb-field-fake {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  border-radius: inherit;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
  min-height: 2.5rem;
  cursor: text;
}

.idea-preview-root--light .idea-wb-field-fake {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.5);
}

.idea-wb-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 0.35rem 0;
}

.idea-preview-root--light .idea-wb-divider {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.idea-pbtn[role="button"] {
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
}

.idea-wb-btn-text {
  min-width: 0.5em;
  outline: none;
}

.idea-preview-root--light .idea-preview-inner {
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.65);
}

.idea-preview-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--idea-primary) 22%, transparent);
  color: var(--idea-primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.idea-preview-root--light .idea-preview-badge {
  color: #0a0c10;
  background: color-mix(in srgb, var(--idea-primary) 35%, #fff);
}

.idea-preview-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.idea-preview-text {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.92;
}

.idea-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.idea-pbtn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: inherit;
  cursor: default;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.idea-message-card {
  margin-top: 0.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.idea-message-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.idea-message-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 75ch;
  line-height: 1.6;
}

.idea-chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

@media (max-width: 768px) {
  .idea-chat-layout {
    grid-template-columns: 1fr;
  }
}

.idea-aside-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.idea-aside-text {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.idea-chip-group {
  margin-bottom: 1.1rem;
}

.idea-chip-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.idea-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.idea-chip {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}

.idea-chip:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.idea-chip--soft {
  border-color: var(--border);
  background: var(--bg-elevated);
}

.idea-chip--soft:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg);
}

.idea-textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 120px;
  margin-bottom: 1rem;
}

.idea-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.idea-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.idea-footnote {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 1.25em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* DevAlIA */
.devalia-card {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.06) 0%, var(--bg-card) 45%);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.devalia-head {
  margin-bottom: 1.25rem;
}

.devalia-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.devalia-brand {
  color: var(--text);
}

.devalia-ia {
  color: var(--accent);
  font-weight: 700;
}

.devalia-tagline {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
}

.devalia-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 72ch;
}

.devalia-free-hint {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 72ch;
}

.devalia-free-hint a {
  color: var(--accent);
}

.devalia-status {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.devalia-status code {
  font-size: 0.8em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.devalia-status--warn {
  color: #fbbf24;
}

.devalia-chat {
  min-height: 220px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  scroll-behavior: smooth;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

.devalia-msg {
  display: flex;
  margin-bottom: 0.85rem;
}

.devalia-msg--user {
  justify-content: flex-end;
}

.devalia-msg--assistant {
  justify-content: flex-start;
}

.devalia-bubble {
  max-width: min(100%, 42rem);
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.devalia-msg--user .devalia-bubble {
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

.devalia-msg--assistant .devalia-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.devalia-bubble p {
  margin: 0 0 0.5rem;
}

.devalia-bubble p:last-child {
  margin-bottom: 0;
}

.devalia-apply {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.devalia-apply-btn {
  width: 100%;
  max-width: 280px;
}

.devalia-apply-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.devalia-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.devalia-input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
  min-height: 52px;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  touch-action: auto;
}

.devalia-input:disabled {
  opacity: 0.55;
}

.devalia-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.devalia-apply-latest:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.devalia-card--loading .devalia-send {
  opacity: 0.7;
  pointer-events: none;
}

.devalia-brief {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.devalia-brief-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.devalia-brief-hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 65ch;
}

.devalia-brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.devalia-brief-feedback {
  margin-top: 0.75rem;
}

/* Modal copia manual (fallback portapapeles) */
.manual-copy-fallback {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.manual-copy-fallback[hidden] {
  display: none !important;
}

.manual-copy-fallback-card {
  width: min(100%, 36rem);
  max-height: min(90vh, 520px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.manual-copy-fallback-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
  font-weight: 600;
}

.manual-copy-fallback-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.manual-copy-fallback-hint kbd {
  font-size: 0.8em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.manual-copy-fallback-ta {
  width: 100%;
  flex: 1;
  min-height: 180px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  -webkit-user-select: text;
  user-select: text;
}

/* Footer */
.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
}

.footer-copy {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .text-gradient {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
