/* Barmaja — estilos base
   Tipografías Inter (texto) y Poppins (títulos), auto-alojadas en /fonts —
   sin peticiones a servicios externos en tiempo de ejecución. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/Inter-Variable.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/Poppins-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Poppins-Bold.woff2") format("woff2");
}

:root {
  --bg: #fafafa;
  --bg-alt: #f4f4f5;
  --surface: #ffffff;
  --text: #111113;
  --text-secondary: #71717a;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-contrast: #ffffff;
  --border: #e4e4e7;
  --focus: #4f46e5;
  --danger: #b3261e;
  --glow-a: rgba(79, 70, 229, 0.12);
  --glow-b: rgba(236, 72, 153, 0.09);
  --radius: 16px;
  --max-width: 1100px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Poppins", var(--font);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b;
    --bg-alt: #1c1c21;
    --surface: #131316;
    --text: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-soft: #1e1b4b;
    --accent-contrast: #0b0b10;
    --border: #27272a;
    --focus: #818cf8;
    --glow-a: rgba(129, 140, 248, 0.24);
    --glow-b: rgba(244, 114, 182, 0.18);
  }
}

:root[data-theme="dark"] {
  --bg: #09090b;
  --bg-alt: #1c1c21;
  --surface: #131316;
  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-soft: #1e1b4b;
  --accent-contrast: #0b0b10;
  --border: #27272a;
  --focus: #818cf8;
  --glow-a: rgba(129, 140, 248, 0.24);
  --glow-b: rgba(244, 114, 182, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: hidden;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-header-bar::before,
.site-header-bar::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(54px);
  pointer-events: none;
}

.site-header-bar::before {
  top: -140px;
  left: -100px;
  width: 380px;
  height: 380px;
  background: var(--glow-a);
}

.site-header-bar::after {
  top: -110px;
  left: 30px;
  width: 300px;
  height: 300px;
  background: var(--glow-b);
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-mark {
  height: 30px;
  width: auto;
  display: block;
}

.logo-mark-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-mark-light {
    display: none;
  }
  :root:not([data-theme="light"]) .logo-mark-dark {
    display: block;
  }
}

:root[data-theme="dark"] .logo-mark-light {
  display: none;
}

:root[data-theme="dark"] .logo-mark-dark {
  display: block;
}

.logo svg {
  border-radius: 6px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface);
}

.lang-switch a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
}

.lang-switch a:hover {
  color: var(--text);
}

.lang-switch a[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* Buttons */
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font);
}

.button:hover {
  background: var(--accent-hover);
}

.button.secondary:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* Hero */
.hero {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 55vh;
  box-sizing: border-box;
  text-align: center;
  padding: 96px 24px 72px;
  max-width: 860px;
  margin: 0 auto;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero::before {
  top: -80px;
  right: -300px;
  width: 560px;
  height: 560px;
  background: var(--glow-a);
}

.hero::after {
  top: 160px;
  right: -160px;
  width: 420px;
  height: 420px;
  background: var(--glow-b);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 0 20px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin: 0 0 32px;
}

.hero-prompt {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 820px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-prompt:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-prompt input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 13px 8px;
  font-size: 1rem;
  color: var(--text);
}

.hero-prompt input:focus {
  outline: none;
}

.hero-prompt input::placeholder {
  color: var(--text-secondary);
}

.hero-prompt-send {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.hero-prompt-send:hover {
  background: var(--accent-hover);
}

.hero-prompt-send:active {
  transform: scale(0.92);
}

.hero-prompt-hint {
  margin: 180px auto 0;
  font-size: 0.5rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hero-prompt-hint {
    white-space: normal;
  }
}

/* Sections */
section {
  padding: 64px 24px;
}

section.alt {
  background: var(--bg-alt);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-heading {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 12px;
}

.section-heading p {
  color: var(--text-secondary);
  margin: 0;
}

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.service-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 15%, transparent);
}

.service-card svg {
  margin-bottom: 16px;
}

.service-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.service-card p {
  margin: 0;
  color: var(--text-secondary);
}

/* About */
.about {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about p {
  color: var(--text-secondary);
}

/* Contact form */
.contact-form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-field .hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

input,
textarea {
  font-family: var(--font);
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.consent-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.consent-field label {
  font-weight: 400;
  font-size: 0.95rem;
}

.form-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 48px 24px 32px;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-grid h3 {
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-grid a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-grid a:hover,
.footer-grid a:focus {
  color: var(--accent);
}

.footer-grid address {
  font-style: normal;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.placeholder {
  background: #fff3cd;
  color: #4a3b00;
  padding: 1px 6px;
  border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
  .placeholder {
    background: #4a3b00;
    color: #ffe08a;
  }
}

[hidden] {
  display: none !important;
}

/* Contact modal */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 19, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 3000;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--accent);
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  padding-right: 24px;
}

.modal-subtitle {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* Process timeline (how-we-work page) */
.process {
  max-width: 680px;
  margin: 0 auto;
}

.process-step {
  position: relative;
  display: flex;
  gap: 24px;
  padding-bottom: 48px;
}

.process-step:last-child {
  padding-bottom: 0;
}

.process-step::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 64px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.process-step:last-child::after {
  content: none;
}

.process-step-number {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  z-index: 1;
}

.process-step-content {
  padding-top: 10px;
}

.process-step-content h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.process-step-content p {
  margin: 0;
  color: var(--text-secondary);
}

/* CTA band */
.cta-band {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 56px 32px;
}

.cta-band h2 {
  margin: 0 0 12px;
}

.cta-band p {
  margin: 0 0 28px;
  color: var(--text-secondary);
}

/* Legal pages */
.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.legal-content h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.legal-content .updated {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.legal-content h2 {
  font-size: 1.3rem;
  margin-top: 40px;
}

.legal-content p,
.legal-content li {
  color: var(--text-secondary);
}

.legal-disclaimer {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 40px;
  font-size: 0.9rem;
}

.legal-disclaimer p {
  margin: 0;
}
