/* =========================================================
   BiWebStudio · Landing Page
   ---------------------------------------------------------
   Tabla de contenidos:
     1.  Variables (custom properties)
     2.  Reset y base
     3.  Utilidades (grano)
     4.  Navegación
     5.  Hero
     6.  Servicios
     7.  Contacto (sección oscura)
     8.  Formulario
     9.  Footer
     10. Animaciones
     11. Responsive (mobile / tablet)
   ========================================================= */


/* =========================================================
   1. VARIABLES
   ========================================================= */
:root {
  /* Paleta */
  --bg:         #f4f1ea;    /* fondo crema cálido */
  --bg-warm:    #ede8dd;    /* hover sutil */
  --paper:      #faf8f3;    /* sección servicios */
  --ink:        #1a1a1a;    /* texto principal */
  --ink-soft:   #4a4a4a;    /* texto secundario */
  --ink-muted:  #8a857a;    /* texto terciario / labels */
  --line:       #d8d2c4;    /* divisores */
  --accent:     #c44a1f;    /* terracota */
  --success:    #7fb069;    /* verde feedback */

  /* Tipografía */
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono:  'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --pad-x:      3rem;
  --max-width:  1400px;
}


/* =========================================================
   2. RESET Y BASE
   ========================================================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }


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


/* =========================================================
   4. NAVEGACIÓN
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.75rem var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  mix-blend-mode: difference;
  color: #f4f1ea;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo em {
  font-style: italic;
  font-weight: 300;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links a {
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.nav-links a:hover { opacity: 1; }


/* =========================================================
   5. HERO
   ========================================================= */
.hero {
  min-height: 100vh;
  padding: 8rem var(--pad-x) 4rem;
  display: grid;
  align-content: center;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  animation: fadeUp 0.9s ease 0.2s both;
}

.hero-meta .status::before {
  content: '●';
  color: var(--accent);
  margin-right: 0.5rem;
  font-size: 0.6rem;
  vertical-align: middle;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(3rem, 10vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 3rem;
  font-variation-settings: "opsz" 144;
}

.hero-title .line {
  display: block;
  overflow: hidden;
}

.hero-title .line span {
  display: inline-block;
  animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-title .line:nth-child(1) span { animation-delay: 0.30s; }
.hero-title .line:nth-child(2) span { animation-delay: 0.45s; }
.hero-title .line:nth-child(3) span { animation-delay: 0.60s; }

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
  animation: fadeUp 0.9s ease 0.9s both;
}

.hero-tagline {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 28rem;
}

.hero-cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ink);
  transition: gap 0.3s ease, color 0.3s ease;
}

.hero-cta:hover {
  gap: 1.5rem;
  color: var(--accent);
}

.hero-cta .arrow {
  font-family: var(--font-serif);
  font-size: 1.2rem;
}


/* =========================================================
   6. SERVICIOS
   ========================================================= */
.services {
  padding: 8rem var(--pad-x);
  background: var(--paper);
}

.section-header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 6rem;
  align-items: end;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.section-title em {
  font-style: italic;
  font-weight: 400;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.service {
  padding: 3rem 2.5rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s ease;
}

.service:nth-child(3n) { border-right: none; }

.service:hover { background: var(--bg-warm); }

.service-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  margin-bottom: 2.5rem;
}

.service h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.65rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.service h3 em {
  font-style: italic;
  color: var(--accent);
}

.service p {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.service-tags span::after {
  content: '/';
  margin-left: 0.5rem;
  opacity: 0.5;
}

.service-tags span:last-child::after { content: ''; }


/* =========================================================
   7. CONTACTO
   ========================================================= */
.contact {
  padding: 10rem var(--pad-x) 4rem;
  background: var(--ink);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(196, 74, 31, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.contact-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(216, 210, 196, 0.2);
  display: flex;
  justify-content: space-between;
}

.contact-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 4rem;
  max-width: 14ch;
}

.contact-title em {
  font-style: italic;
  color: var(--accent);
}

.contact-cta {
  display: inline-flex;
  align-items: baseline;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--bg);
  transition: gap 0.4s ease, color 0.3s ease, border-color 0.3s ease;
}

.contact-cta:hover {
  gap: 2rem;
  color: var(--accent);
  border-color: var(--accent);
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 6rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(216, 210, 196, 0.2);
}

.info-block .info-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.info-block p,
.info-block a {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--bg);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.info-block a:hover { color: var(--accent); }


/* =========================================================
   8. FORMULARIO
   ========================================================= */
.form-wrapper {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(216, 210, 196, 0.2);
}

.form-intro {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 3rem;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3rem;
  max-width: 900px;
}

.honeypot {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
}

.field.full { grid-column: 1 / -1; }

.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.field label .req {
  color: var(--accent);
  margin-left: 0.25rem;
}

.field input,
.field select,
.field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(216, 210, 196, 0.3);
  padding: 0.5rem 0 0.75rem;
  color: var(--bg);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  width: 100%;
  outline: none;
  transition: border-color 0.3s ease;
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
  line-height: 1.5;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23f4f1ea' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  padding-right: 1.5rem;
}

.field select option {
  background: var(--ink);
  color: var(--bg);
  font-family: sans-serif;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-bottom-color: var(--accent);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-muted);
  font-style: italic;
}

/* Estado de error en validación */
.field.error input,
.field.error select,
.field.error textarea {
  border-bottom-color: var(--accent);
}

.field.error label {
  color: var(--accent);
}

.submit-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.btn-submit {
  background: var(--bg);
  color: var(--ink);
  border: none;
  padding: 1.15rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.3s ease, color 0.3s ease, gap 0.3s ease;
}

.btn-submit:hover {
  background: var(--accent);
  color: var(--bg);
  gap: 1.25rem;
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: wait;
}

.form-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.form-status {
  grid-column: 1 / -1;
  padding: 1.25rem 1.5rem;
  border-left: 2px solid var(--accent);
  background: rgba(196, 74, 31, 0.08);
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--bg);
  display: none;
}

.form-status.show { display: block; }

.form-status.success {
  border-color: var(--success);
  background: rgba(127, 176, 105, 0.1);
}


/* =========================================================
   9. FOOTER
   ========================================================= */
.footer {
  padding: 3rem;
  background: var(--ink);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(216, 210, 196, 0.1);
}


/* =========================================================
   10. ANIMACIONES
   ========================================================= */
@keyframes slideUp {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Respeto a usuarios con motion reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* =========================================================
   11. RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  :root {
    --pad-x: 1.5rem;
  }

  .nav { padding: 1.25rem var(--pad-x); }
  .nav-links { gap: 1.25rem; font-size: 0.7rem; }

  .hero { padding: 7rem var(--pad-x) 3rem; }
  .hero-bottom { grid-template-columns: 1fr; gap: 2rem; }
  .hero-cta { justify-self: start; }

  .services { padding: 5rem var(--pad-x); }
  .section-header { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 3rem; }
  .services-grid { grid-template-columns: 1fr; }
  .service {
    border-right: none !important;
    padding: 2.5rem 0;
  }

  .contact { padding: 6rem var(--pad-x) 3rem; }
  .contact-info { grid-template-columns: 1fr; gap: 2rem; }

  .contact-form { grid-template-columns: 1fr; gap: 2rem; }
  .submit-row { flex-direction: column; align-items: flex-start; }
  .btn-submit { width: 100%; justify-content: center; }

  .footer {
    padding: 2rem var(--pad-x);
    flex-direction: column;
    gap: 1rem;
  }
}
