/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #fbfdfe;
  --bg-2:      #edf3f5;
  --bg-3:      #e1eaed;
  --ink:       #171b1e;
  --mute:      #5c6670;
  --mute-2:    #8a96a0;
  --accent:    #e2734b;
  --accent-2:  #b84f2c;
  --cream:     #fbfdfe;
  --line:      rgba(23,27,30,0.12);

  --serif: "Fraunces", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -0.01em; font-weight: 600; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--cream); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--cream);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.container { max-width: 1160px; margin-inline: auto; padding-inline: var(--gutter); }
.kicker {
  font-size: .78rem; letter-spacing: .16em; font-weight: 600;
  text-transform: uppercase; color: var(--mute);
}
section { padding-block: clamp(3.5rem, 9vw, 7rem); position: relative; }
.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 5vw, 3rem); text-align: center; margin-inline: auto; }
.section-head h2 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); margin-top: .7rem; }
.section-head p { color: var(--mute); font-size: 1.05rem; margin-top: 1rem; }

/* =============================================================
   4. Typography
   ============================================================= */
em { font-style: italic; color: var(--accent); font-family: var(--serif); }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 1.7rem; border-radius: 999px; font-weight: 600;
  font-size: .92rem; transition: transform .35s var(--ease-out), background .35s var(--ease-out), color .35s var(--ease-out), border-color .35s;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent); }
.btn-ghost { border: 1px solid rgba(28,23,18,0.3); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.nav-link { position: relative; font-size: .92rem; font-weight: 500; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0;
  background: currentColor; transition: width .35s var(--ease-out);
}
.nav-link:hover::after { width: 100%; }

.lang-switch { display: inline-flex; gap: .25rem; border: 1px solid currentColor; border-radius: 999px; padding: .2rem; opacity: .85; }
.lang-btn { font-size: .7rem; font-weight: 700; letter-spacing: .04em; padding: .3rem .6rem; border-radius: 999px; transition: background .3s, color .3s; }
.lang-btn.is-active { background: var(--ink); color: var(--cream); }

/* =============================================================
   6. Sections
   ============================================================= */

/* --- Header --- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem var(--gutter);
  color: var(--ink);
  transition: background .4s var(--ease-out), padding .4s var(--ease-out), box-shadow .4s;
}
.site-header.is-scrolled {
  background: rgba(251,253,254,0.92);
  backdrop-filter: blur(8px);
  padding-block: .9rem;
  box-shadow: 0 1px 0 var(--line);
}
.logo { font-family: var(--sans); font-size: .92rem; letter-spacing: .04em; font-weight: 700; text-transform: uppercase; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.site-header nav { display: none; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .site-header nav { display: flex; } }
.header-contact { padding: .6rem 1.3rem; font-size: .82rem; white-space: nowrap; }
.nav-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; flex-shrink: 0;
  border: 1px solid currentColor; border-radius: 999px; padding: 0;
}
@media (min-width: 860px) { .nav-toggle { display: none; } }
.hamburger { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 16px; }
.hamburger span { display: block; height: 2px; width: 100%; background: currentColor; border-radius: 1px; }
.site-header nav.is-open {
  display: flex; position: fixed; inset: 5rem 1rem auto 1rem; flex-direction: column; align-items: flex-start;
  background: var(--cream); color: var(--ink); padding: 1.5rem; border-radius: 16px; border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(23,27,30,.15);
}

/* --- Hero --- */
.hero {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; text-align: center; color: var(--ink);
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media video, .hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  filter: brightness(1.55) saturate(.7) contrast(.92);
  opacity: .5;
  transform: scaleX(-1);
}
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(250,247,242,.55) 0%, rgba(250,247,242,.25) 40%, rgba(250,247,242,.6) 100%);
}
.hero-kicker { margin-bottom: 1.2rem; color: var(--mute); }
.hero-title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(2.1rem, 7vw, 5rem);
  letter-spacing: -0.01em;
  max-width: 16ch;
  margin-inline: auto;
  color: var(--ink);
}
.hero-sub {
  margin-top: 1.4rem; max-width: 34ch; margin-inline: auto;
  font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--mute);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; justify-content: center; }
.hero-scroll {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  color: var(--mute-2); font-size: 1.3rem;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* --- Qué hacemos --- */
.what-grid { max-width: 46rem; margin-inline: auto; text-align: center; }
.what-lede { font-size: clamp(1.1rem, 2.2vw, 1.35rem); margin-bottom: clamp(2rem, 5vw, 3rem); }
.what-lines { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: left; }
.what-line-row { background: var(--bg); }
.what-line-toggle { width: 100%; display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 1rem; padding: 1.6rem 1.8rem; text-align: left; align-items: start; }
.what-line-toggle .n { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.2rem; }
.what-line-toggle p { color: var(--ink); font-size: 1rem; }
.what-line-plus { font-size: 1.2rem; color: var(--mute); transition: transform .35s var(--ease-out), color .3s; flex-shrink: 0; }
.what-line-row.is-open .what-line-plus { transform: rotate(45deg); color: var(--accent); }
.what-line-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease-out); }
.what-line-row.is-open .what-line-panel { grid-template-rows: 1fr; }
.what-line-panel-inner { overflow: hidden; }
.what-line-brand {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem;
  padding: .9rem 1.8rem .9rem calc(1.8rem + 2.2rem + 1rem);
  border-top: 1px solid var(--line); transition: background .3s var(--ease-out);
}
.what-line-brand:hover { background: var(--bg-2); }
.what-line-brand strong { font-family: var(--serif); font-weight: 600; }
.what-line-brand .b-desc { color: var(--mute); font-size: .9rem; }
.what-line-brand .b-link { margin-left: auto; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.what-foot { margin-top: clamp(2rem, 5vw, 2.6rem); color: var(--mute); font-size: .95rem; }

/* --- Brands / sectors --- */
.sector-block { padding-block: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--line); scroll-margin-top: 6rem; }
.sector-block:first-child { border-top: 0; padding-top: 0; }
.sector-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: clamp(1.5rem, 3vw, 2rem); justify-content: center; }
.sector-index { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.1rem; }
.sector-title { font-size: clamp(1.3rem, 3vw, 1.8rem); }
.sector-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; max-width: 46rem; margin-inline: auto; }
@media (min-width: 640px) { .sector-grid { grid-template-columns: repeat(2, 1fr); } }
.item-card {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; background: var(--bg);
  transition: background .3s var(--ease-out);
}
.item-card:hover { background: var(--bg-2); }
.item-card.is-live { background: var(--bg-3); }
.item-card.is-live:hover { background: color-mix(in srgb, var(--bg-3) 80%, var(--accent) 12%); }
.item-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.item-desc { color: var(--mute); font-size: .88rem; line-height: 1.5; }
.item-link {
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); margin-top: auto; padding-top: .4rem;
}
.item-badge {
  font-size: .78rem; color: var(--mute-2); margin-top: auto; padding-top: .4rem;
  text-decoration: underline; text-underline-offset: 3px;
}

/* --- About / Quiénes somos --- */
.about { background: var(--bg-2); }
.about-inner { max-width: 42rem; margin-inline: auto; text-align: center; }
.about-inner p { font-size: 1.05rem; color: var(--ink); }
.about-inner .pull-quote {
  margin-top: clamp(2.2rem, 6vw, 3.5rem);
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.3rem, 3.2vw, 1.9rem); line-height: 1.35;
  color: var(--accent-2);
  position: relative;
}
.pull-quote::before, .pull-quote::after { content: '"'; }

/* --- Contact --- */
.contact-grid { display: grid; gap: clamp(2rem, 6vw, 4rem); }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-details { display: grid; gap: 1rem; margin-top: 1.5rem; }
.contact-row { display: flex; align-items: center; gap: .8rem; }
.contact-row-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mute-2); width: 5.5rem; flex-shrink: 0; }
.contact-email, .contact-phone {
  font-family: var(--serif); font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  display: inline-block;
}
.contact-email:hover, .contact-phone:hover { color: var(--accent); }
.contact-row-label { width: 6.5rem; }
.contact-address, .contact-ein { font-size: .92rem; color: var(--mute); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.form-field { display: grid; gap: .5rem; margin-bottom: 1.2rem; }
.form-field label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.form-field input, .form-field textarea, .form-field select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: .85rem 1rem; color: var(--ink); font-family: var(--sans); font-size: .95rem;
  transition: border-color .3s; width: 100%;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--accent); outline: none; }
.form-status { font-size: .85rem; margin-top: 1rem; color: var(--mute); min-height: 1.2em; }
.form-status.is-ok { color: #3f7a3f; }
.form-status.is-err { color: var(--accent-2); }

/* --- Justified text (centred blocks keep their last line centred) --- */
.what-lede, .what-foot, .about-inner p, .section-head p {
  text-align: justify; text-align-last: center; hyphens: auto;
}
#contacto p[data-i18n="pContact"] { text-align: justify; hyphens: auto; }
.item-desc, .what-line-brand .b-desc { text-align: justify; hyphens: auto; }
.what-line-brand .b-desc { flex: 1 1 100%; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 6vw, 4rem); background: var(--bg-2); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-legal { color: var(--mute-2); font-size: .82rem; margin-top: 2rem; }

/* --- Legal pages --- */
.page-legal { background: var(--bg); color: var(--ink); }
.page-legal main { max-width: 70ch; margin-inline: auto; padding: clamp(6rem, 10vw, 8rem) var(--gutter) 4rem; }
.page-legal h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1.5rem; }
.page-legal h2 { font-weight: 600; font-size: 1.1rem; margin-top: 2rem; margin-bottom: .6rem; }
.page-legal p, .page-legal li { color: var(--mute); font-size: .95rem; margin-bottom: .8rem; }
.page-legal a { color: var(--accent); text-decoration: underline; }
.back-link { position: fixed; top: 1.5rem; left: var(--gutter); z-index: 50; font-size: .82rem; font-weight: 600; }

/* =============================================================
   7. Effects
   ============================================================= */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.is-ready .hero-title, .is-ready .hero-sub, .is-ready .hero-actions { animation: fadeUp .9s var(--ease-out) both; }
.is-ready .hero-sub { animation-delay: .12s; }
.is-ready .hero-actions { animation-delay: .24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {}
@media (min-width: 720px) {}
@media (min-width: 960px) {}
@media (min-width: 1280px) {}

/* =============================================================
   9. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-scroll { animation: none; }
  .is-ready .hero-title, .is-ready .hero-sub, .is-ready .hero-actions { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
