/* ==========================================================================
   Esquerra Business Services — stylesheet
   1. Tokens
   2. Base & typography
   3. Layout helpers
   4. Buttons
   5. Header & navigation
   6. Hero
   7. About
   8. Services
   9. Why us
   10. Contact & form
   11. Footer
   12. Motion & responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --ink:        #0F2233;   /* headings, dark surfaces */
  --ink-soft:   #1B3247;
  --body:       #4A5B6B;   /* body copy */
  --muted:      #7A8896;
  --stone:      #EDF0F3;   /* cool section surface */
  --stone-deep: #DDE3E8;
  --paper:      #FFFFFF;
  --accent:     #146B64;   /* single action colour */
  --accent-dark:#0E514C;
  --sand:       #D9CFBF;   /* quiet warm secondary */
  --line:       #D6DCE2;
  --danger:     #A3372B;

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --shell: 1140px;
  --gap: 2rem;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 2. Base & typography ----------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.15rem; line-height: 1.3; }

p { margin: 0 0 1.1em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

img, svg { max-width: 100%; }

ul { margin: 0; padding: 0; list-style: none; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.8rem 1.2rem;
  z-index: 200;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* 3. Layout helpers -------------------------------------------------------- */
.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.section { padding: clamp(4rem, 9vw, 7rem) 0; }

.section-head { margin-bottom: 3rem; }
.section-head h2 { margin-bottom: 0.4rem; }

.section-note {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 54ch;
}

.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
}

/* 4. Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: rgba(15, 34, 51, 0.04); }

.btn-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-light:hover { background: #fff; color: var(--ink); border-color: #fff; }

.btn-block { width: 100%; }

/* 5. Header & navigation --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 14px rgba(15, 34, 51, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  flex: none;
}
.brand-mark rect:last-of-type { fill: var(--sand); fill-opacity: 0.35; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.primary-nav { display: flex; align-items: center; gap: 2rem; }
.primary-nav ul { display: flex; gap: 1.8rem; }

.primary-nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.3rem 0;
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.primary-nav a:hover::after,
.primary-nav a.is-active::after { transform: scaleX(1); }
.primary-nav a.is-active { color: var(--ink); }
.nav-cta::after { display: none; }
.nav-cta:hover { color: #fff; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.nav-toggle-bars { display: grid; gap: 4px; width: 18px; }
.nav-toggle-bars span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* 6. Hero ------------------------------------------------------------------ */
.hero {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3.5rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(237, 240, 243, 0.55), rgba(255, 255, 255, 0)) no-repeat;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-kicker {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  margin-bottom: 1.1rem;
  padding-left: 2.4rem;
  position: relative;
}
.hero-kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 1.8rem;
  height: 1px;
  background: var(--accent);
}

.hero-copy h1 { max-width: 15ch; }

.hero-lede {
  font-size: 1.12rem;
  max-width: 48ch;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.hero-art { display: block; width: 100%; height: auto; }
.art-sky { fill: var(--stone); }
.art-lines rect,
.art-lines line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-opacity: 0.55;
}
.art-windows rect { fill: var(--ink); fill-opacity: 0.1; }
.art-windows rect:nth-child(4n) { fill: var(--sand); fill-opacity: 0.85; }

.hero-facts {
  margin: 0;
  border-top: 1px solid var(--line);
}
.hero-facts > div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.hero-facts > div:last-child { border-bottom: 0; }
.hero-facts dt { color: var(--muted); font-size: 0.85rem; }
.hero-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
}

/* 7. About ----------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.about .section-head { margin-bottom: 0; }

.about-points {
  display: grid;
  gap: 1.6rem;
  margin-top: 2.5rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}
.about-points h3 { margin-bottom: 0.2rem; font-size: 1.05rem; }
.about-points p { font-size: 0.97rem; margin: 0; }

/* 8. Services -------------------------------------------------------------- */
.services { background: var(--stone); }

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--stone-deep);
  border: 1px solid var(--stone-deep);
  border-radius: var(--radius);
  overflow: hidden;
}

.service {
  background: var(--paper);
  padding: 2.1rem 1.8rem 2.3rem;
  transition: background-color 0.25s var(--ease);
}
.service:hover { background: #FAFBFC; }

.service-icon {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 1.2rem;
}

.service h3 { margin-bottom: 0.45rem; }
.service p { font-size: 0.96rem; margin: 0; }

/* 9. Why us ---------------------------------------------------------------- */
.why {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.75);
}
.why h2, .why h3 { color: #fff; }

.why-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.why-intro p { margin-bottom: 1.8rem; }

.benefits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.2rem 2.5rem;
}
.benefits li {
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.benefits h3 { font-size: 1.08rem; margin-bottom: 0.35rem; }
.benefits p { font-size: 0.95rem; margin: 0; }

/* 10. Contact & form ------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.contact-details {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.6rem;
}
.detail h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.detail address,
.detail p {
  font-style: normal;
  color: var(--ink);
  margin: 0;
  line-height: 1.55;
}

.form-wrap {
  background: var(--stone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.4rem);
}

.field { margin-bottom: 1.15rem; }

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}
.optional { color: var(--muted); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.97rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 107, 100, 0.14);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--danger); }

.error {
  margin: 0.35rem 0 0;
  min-height: 0;
  font-size: 0.83rem;
  color: var(--danger);
}

.field-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.65rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.field-check input { width: 18px; height: 18px; margin-top: 0.25rem; accent-color: var(--accent); }
.field-check label { font-size: 0.87rem; font-weight: 400; color: var(--body); margin: 0; }
.field-check .error { grid-column: 1 / -1; }

.form-status {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  display: none;
}
.form-status.is-visible { display: block; }
.form-status.is-success {
  background: rgba(20, 107, 100, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(20, 107, 100, 0.3);
}
.form-status.is-error {
  background: rgba(163, 55, 43, 0.08);
  color: var(--danger);
  border: 1px solid rgba(163, 55, 43, 0.3);
}

/* 11. Footer --------------------------------------------------------------- */
.site-footer {
  background: var(--stone);
  border-top: 1px solid var(--line);
  padding-top: 3.5rem;
  font-size: 0.93rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.footer-line { margin: 0 0 0.25rem; color: var(--body); }
.footer-reg { margin-top: 0.8rem; color: var(--muted); font-size: 0.85rem; }

.footer-nav h2 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.footer-nav li { margin-bottom: 0.4rem; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; }
.footer-nav a:hover { color: var(--accent-dark); text-decoration: underline; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}
.footer-bottom p { margin: 0; }

/* 12. Motion & responsive -------------------------------------------------- */
/* Hidden only when JS is running, so the page still reads without it. */
.js-ready .js-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.js-ready .js-reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .hero-grid,
  .about-grid,
  .why-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .hero-copy h1 { max-width: 20ch; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1.25rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(15, 34, 51, 0.08);
    display: none;
  }
  .primary-nav.is-open { display: flex; }

  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav li { border-bottom: 1px solid var(--line); }
  .primary-nav ul a { display: block; padding: 0.85rem 0; }
  .primary-nav a::after { display: none; }
  .nav-cta { margin-top: 1rem; }

  .service-grid { grid-template-columns: 1fr; }
  .benefits { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero-facts > div { grid-template-columns: 1fr; gap: 0.15rem; }
}

@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .js-reveal { opacity: 1; transform: none; }
}
