/* ===========================================================
   Relmu Estudio — hoja de estilos
   Paleta enraizada en el logo (arcoíris de madera):
   madera/ámbar, salvia, azul-piedra, espresso, papel cálido.
   =========================================================== */

:root {
  /* Papel y tinta */
  --paper:    #F3EDE3;
  --paper-2:  #FBF7F0;   /* tarjetas, superficies claras */
  --paper-3:  #EBE2D3;   /* secciones alternas */
  --ink:      #423B34;   /* texto principal (espresso) */
  --ink-soft: #6B6258;   /* texto secundario */
  --ink-faint:#9A9084;
  --line:     rgba(66, 59, 52, 0.14);
  --line-2:   rgba(66, 59, 52, 0.08);

  /* Acentos del arcoíris */
  --wood:      #D7A86E;  /* ámbar madera */
  --wood-deep: #BC7A47;  /* terracota */
  --sage:      #8E9F8C;  /* salvia */
  --sage-deep: #6F8270;
  --stone:     #9DB0C4;  /* azul piedra */
  --stone-deep:#6E8298;

  /* Acento activo (lo controla Tweaks) */
  --accent:      var(--wood-deep);
  --accent-ink:  #FBF7F0;
  --accent-soft: rgba(188, 122, 71, 0.12);

  /* Tipografía */
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;

  /* Forma */
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --radius-xl: 42px;
  --shadow: 0 1px 2px rgba(66,59,52,.04), 0 18px 40px -24px rgba(66,59,52,.30);
  --shadow-soft: 0 1px 2px rgba(66,59,52,.04), 0 10px 30px -20px rgba(66,59,52,.22);

  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
h1 em, h2 em, h3 em { font-style: italic; font-weight: 400; }

p { margin: 0; text-wrap: pretty; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

section { position: relative; }
.section-pad { padding-block: clamp(72px, 11vw, 150px); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1.5px;
  background: var(--accent);
  display: inline-block;
}

.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft); line-height: 1.6; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 1.05em 1.6em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .2s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -12px var(--accent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-light {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--line);
}
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn-sm { padding: 0.7em 1.1em; font-size: 0.9rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 78px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-name span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--accent); transition: width .25s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 80px); overflow: clip; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy { max-width: 600px; }
.hero h1 {
  font-size: clamp(2.7rem, 5.6vw, 4.6rem);
  margin-top: 26px;
  line-height: 1.02;
}
.hero .lede { margin-top: 26px; max-width: 48ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero-meta {
  margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 32px;
}
.hero-meta .item { display: flex; flex-direction: column; gap: 2px; }
.hero-meta .num { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); }
.hero-meta .lbl { font-size: 0.82rem; color: var(--ink-soft); }

.hero-media { position: relative; }
.hero-media .frame {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper-3);
  aspect-ratio: 4 / 4.4;
}
.hero-media .frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-arc {
  position: absolute;
  width: 132px; height: 66px;
  border-radius: 132px 132px 0 0;
  border: 9px solid var(--wood);
  border-bottom: none;
  z-index: 2;
}
.hero-badge {
  position: absolute;
  left: -22px; bottom: 38px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px 20px;
  box-shadow: var(--shadow-soft);
  max-width: 230px;
  z-index: 3;
}
.hero-badge .t { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.2; }
.hero-badge .d { font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; }

/* arco decorativo del arcoíris */
.rainbow-arcs { display: inline-flex; align-items: flex-end; gap: 0; }

/* ---------- Generic section heading ---------- */
.sec-head { max-width: 720px; }
.sec-head h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin-top: 18px; }
.sec-head p { margin-top: 18px; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head.center .eyebrow { justify-content: center; }

/* ---------- Estudio (intro) ---------- */
.estudio { background: var(--paper-2); }
.estudio-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px,5vw,80px); align-items: center;
}
.estudio-text h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); margin-top: 18px; }
.estudio-text p + p { margin-top: 18px; }
.estudio-text .lede { margin-top: 22px; }
.name-note {
  margin-top: 30px; padding: 22px 24px;
  background: var(--accent-soft); border-radius: var(--radius-m);
  border: 1px solid var(--line-2);
  font-size: 0.98rem; color: var(--ink-soft);
}
.name-note b { color: var(--ink); font-weight: 600; }
.estudio-media {
  border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-soft);
  aspect-ratio: 5/6;
}
.estudio-media image-slot { width: 100%; height: 100%; }
.estudio-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Filosofía ---------- */
.filo { background: var(--ink); color: var(--paper-2); }
.filo h2, .filo h3 { color: var(--paper-2); }
.filo .lede { color: rgba(251,247,240,.72); }
.filo .eyebrow { color: var(--wood); }
.filo .eyebrow::before { background: var(--wood); }
.filo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: rgba(251,247,240,.12);
  border: 1px solid rgba(251,247,240,.12);
  border-radius: var(--radius-l); overflow: hidden; margin-top: 56px;
}
.filo-card {
  background: var(--ink);
  padding: 38px 34px;
  transition: background .25s ease;
}
.filo-card:hover { background: #4C443C; }
.filo-num {
  font-family: var(--font-display); font-size: 0.95rem;
  color: var(--wood); letter-spacing: .04em;
}
.filo-card h3 { font-size: 1.45rem; margin-top: 16px; font-weight: 500; }
.filo-card p { margin-top: 12px; color: rgba(251,247,240,.66); font-size: 0.98rem; line-height: 1.55; }
.filo-dot {
  width: 30px; height: 30px; border-radius: 50%; margin-bottom: 20px;
}

/* ---------- Productos ---------- */
.prod-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px; margin-top: 56px;
}
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 4/3; background: var(--paper-3); }
.card-media img, .card-media image-slot { width: 100%; height: 100%; object-fit: cover; display: block; }
.tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 0.72rem; font-weight: 600; letter-spacing: .04em;
  padding: 0.45em 0.8em; border-radius: 999px;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--line);
}
.tag.dev { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.card-body { padding: 26px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.4rem; }
.card-desc { margin-top: 10px; color: var(--ink-soft); font-size: 0.97rem; line-height: 1.55; }
.card-meta { display: flex; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.card-meta .m { display: flex; flex-direction: column; gap: 2px; }
.card-meta .m .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.card-meta .m .v { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.card-foot { margin-top: auto; padding-top: 22px; }
.card-foot .btn { width: 100%; }

/* ---------- Proyectos ---------- */
.proyectos { background: var(--paper-3); }
.proj-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px;
  gap: 18px; margin-top: 56px;
}
.proj { border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-soft); position: relative; }
.proj image-slot { width: 100%; height: 100%; }
.proj.tall { grid-row: span 2; }
.proj.wide { grid-column: span 2; }
.proj-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(40,35,30,.78), transparent);
  color: #fff; font-size: 0.9rem; font-weight: 500;
  pointer-events: none;
}
.proj-note {
  margin-top: 40px; text-align: center; color: var(--ink-soft); font-size: 0.95rem;
}

/* ---------- Proceso ---------- */
.proc-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 28px; margin-top: 56px;
}
.proc-step { position: relative; }
.proc-ico {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; margin-bottom: 22px;
  background: var(--accent-soft); color: var(--accent);
}
.proc-ico svg { width: 28px; height: 28px; }
.proc-step .n {
  font-family: var(--font-display); font-size: 0.9rem; color: var(--accent); letter-spacing: .06em;
}
.proc-step h3 { font-size: 1.3rem; margin-top: 6px; font-weight: 500; }
.proc-step p { margin-top: 10px; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }

/* Tira de fotos del taller (proceso real) */
.proc-media {
  margin-top: 52px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.proc-shot {
  position: relative; margin: 0;
  border-radius: var(--radius-m); overflow: hidden;
  box-shadow: var(--shadow-soft); background: var(--paper-3);
  aspect-ratio: 4/3;
}
.proc-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proc-shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(40,35,30,.78), transparent);
  color: #fff; font-size: 0.85rem; font-weight: 500;
}

.materials {
  margin-top: 64px; padding: 40px clamp(28px,4vw,56px);
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-l);
  display: flex; flex-wrap: wrap; align-items: center; gap: 28px; justify-content: space-between;
}
.materials .mt { max-width: 460px; }
.materials .mt h3 { font-size: 1.5rem; }
.materials .mt p { margin-top: 10px; color: var(--ink-soft); font-size: 0.97rem; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; max-width: 520px; }
.chip {
  font-size: 0.9rem; font-weight: 500; padding: 0.65em 1.05em;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  display: inline-flex; align-items: center; gap: 0.5em;
}
.chip .d { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Contacto ---------- */
.contacto { background: var(--ink); color: var(--paper-2); }
.contacto h2, .contacto h3 { color: var(--paper-2); }
.contacto .eyebrow { color: var(--wood); }
.contacto .eyebrow::before { background: var(--wood); }
.contacto .lede { color: rgba(251,247,240,.74); }
.contacto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px,6vw,90px); align-items: start; }
.contacto h2 { font-size: clamp(2.1rem,3.8vw,3.1rem); margin-top: 18px; }
.contact-methods { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; }
.method {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 22px; border-radius: var(--radius-m);
  background: rgba(251,247,240,.06); border: 1px solid rgba(251,247,240,.12);
  transition: background .2s ease, transform .2s ease;
}
.method:hover { background: rgba(251,247,240,.11); transform: translateY(-2px); }
.method-ico {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: var(--wood); color: var(--ink);
}
.method-ico svg { width: 24px; height: 24px; }
.method .t { font-weight: 600; color: var(--paper-2); }
.method .d { font-size: 0.88rem; color: rgba(251,247,240,.62); margin-top: 2px; }
.method .arr { margin-left: auto; color: rgba(251,247,240,.5); transition: transform .2s ease; }
.method:hover .arr { transform: translateX(4px); color: var(--wood); }

/* Form */
.form-card {
  background: var(--paper-2); border-radius: var(--radius-l);
  padding: clamp(28px,4vw,44px); box-shadow: var(--shadow);
}
.form-card h3 { color: var(--ink); font-size: 1.5rem; }
.form-card .sub { color: var(--ink-soft); font-size: 0.95rem; margin-top: 8px; }
.field { margin-top: 18px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; letter-spacing: .01em; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 0.98rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 0.85em 1em; transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-card .btn { width: 100%; margin-top: 22px; }
.form-note { font-size: 0.82rem; color: var(--ink-faint); margin-top: 14px; text-align: center; }

/* ---------- Footer ---------- */
.footer { background: var(--paper); padding-block: 56px 40px; }
.footer-top { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-start; }
.footer .brand-name { font-size: 1.5rem; }
.footer-tag { color: var(--ink-soft); font-size: 0.95rem; max-width: 320px; margin-top: 14px; }
.footer-links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); font-weight: 600; }
.footer-col a { display: block; margin-top: 12px; font-size: 0.95rem; color: var(--ink-soft); transition: color .2s ease; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 0.85rem; color: var(--ink-faint);
}

/* ---------- Reveal on scroll ---------- */
/* Hidden state only applies once JS has confirmed it's running (html.js),
   so content is never invisible if JS is slow or disabled. */
.reveal { transition: opacity .7s ease, transform .7s ease; }
html.js .reveal { opacity: 0; transform: translateY(22px); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Floating WhatsApp ---------- */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 28px -8px rgba(37,211,102,.6); border: none; cursor: pointer;
  transition: transform .2s ease;
}
.fab:hover { transform: scale(1.07); }
.fab svg { width: 30px; height: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .estudio-grid, .contacto-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 460px; margin-inline: auto; }
  .filo-grid { grid-template-columns: repeat(2, 1fr); }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .proc-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }

  /* Nav colapsa a menú hamburguesa: 6 enlaces + logo + CTA no caben cómodos en tablet */
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 78px; left: 0; right: 0;
    background: var(--paper-2); padding: 20px var(--gutter) 28px; gap: 18px;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-soft);
  }
  .nav-toggle { display: block; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .nav .btn-primary { display: none; }
  .filo-grid, .prod-grid, .proc-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; }
  .field-row { grid-template-columns: 1fr; }
  .materials { flex-direction: column; align-items: flex-start; }
  .proc-media { grid-template-columns: 1fr; }
  /* El badge cuelga en left:-22px (lindo en desktop) pero se corta en pantallas chicas */
  .hero-badge { left: 10px; bottom: 14px; max-width: min(230px, calc(100% - 20px)); }
}
