/* ===== Design tokens ("Bloques mint + profundo") ===== */
:root {
  --mint-50: #E6F3F1;   /* page background */
  --mint-25: #EDF6F7;   /* soft tiles, form */
  --mint-300: #7FCDBD;  /* mint text on deep (4.9:1) */
  --mint-500: #59B6A4;  /* mint accent */
  --deep-700: #224F4E;  /* text, deep tiles */
  --deep-900: #12302F;  /* darkest, text on accent */
  --deep-line: #3E6B69; /* rules on deep tiles */
  --accent: #E2716B;    /* coral: action only */
  --error: #B23A33;

  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-field: 14px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--mint-50);
  color: var(--deep-700);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--deep-700); color: var(--mint-50); }

h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
p, ul, ol { margin: 0; }

a { color: var(--deep-700); text-underline-offset: 3px; }
a:hover { color: var(--deep-900); }
:focus-visible { outline: 2px solid var(--deep-700); outline-offset: 3px; }

input, select, textarea, button { font: inherit; }

.icon { width: 20px; height: 20px; flex: none; }

.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 10;
  background: var(--deep-700); color: var(--mint-50); font-weight: 600;
  padding: 12px 20px; border-radius: var(--radius-pill); text-decoration: none;
  transition: top .2s var(--ease-out);
}
.skip-link:hover, .skip-link:focus { top: 16px; color: var(--mint-50); }

.page { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
main { display: flex; flex-direction: column; gap: 16px; }

/* ===== Tiles ===== */
.tile { border-radius: var(--radius-xl); }
.tile-soft { background: var(--mint-25); }
.tile-mint { background: var(--mint-500); color: var(--deep-900); }
.tile-deep { background: var(--deep-700); color: var(--mint-50); }
.tile-deep a { color: var(--mint-50); }
.tile-deep a:hover { color: #fff; }
.tile-deep :focus-visible { outline-color: var(--mint-50); }

/* ===== Buttons ===== */
.btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: var(--deep-900);
  font-weight: 700; font-size: 17px; text-decoration: none; text-align: center;
  padding: 18px 32px; border: 0; border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color .2s ease, box-shadow .25s var(--ease-out), transform .12s ease;
}
.btn-accent:hover {
  color: var(--deep-900);
  background: color-mix(in srgb, var(--accent) 86%, #fff);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-accent:active { transform: scale(.98); box-shadow: none; transition-duration: .08s; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 26px; border: 1.5px solid var(--deep-700); border-radius: var(--radius-pill);
  color: var(--deep-700); font-weight: 600; text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.btn-outline:hover { background: var(--deep-700); color: var(--mint-50); }
.btn-accent[aria-busy="true"] { cursor: progress; opacity: .75; }
.btn-accent:disabled { cursor: progress; }

/* ===== Header ===== */
.site-header {
  padding: 12px 24px 12px 40px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; fill: var(--deep-700); }
.brand-mark .brand-mark-open { fill: var(--mint-500); fill-opacity: 0; stroke: var(--mint-500); stroke-width: 8; transition: fill-opacity .3s var(--ease-out); }
.brand:hover .brand-mark-open, .brand:focus-visible .brand-mark-open { fill-opacity: 1; }
.brand-word { font-family: var(--font-display); font-size: 24px; line-height: 1; }
.brand-fractional { font-weight: 500; }
.brand-cto { font-weight: 800; }

.site-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 500; }
.site-nav a { text-decoration: none; padding: 10px 16px; border-radius: var(--radius-pill); transition: background .2s ease; }
.site-nav a:hover { background: color-mix(in srgb, var(--deep-700) 8%, transparent); }
.site-nav .nav-cta { padding: 12px 20px; background: var(--deep-700); color: var(--mint-50); white-space: nowrap; }
.site-nav .nav-cta:hover { background: var(--deep-900); color: var(--mint-50); }

/* ===== Hero ===== */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 48px; align-items: center;
  padding: 72px 40px 80px;
  min-height: min(760px, calc(100svh - 90px));
}
.hero-body { display: flex; flex-direction: column; gap: 28px; }
.hero h1 {
  font-weight: 800; font-size: clamp(52px, 7.2vw, 112px);
  line-height: 0.96; letter-spacing: -0.04em;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.16em; margin-bottom: -0.1em; }
.hero h1 .line > span { display: inline-block; animation: rise .9s var(--ease-out) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .08s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .16s; }
.hero-pitch { font-size: 21px; line-height: 1.5; max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.link-wa { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; }

/* Fraction motif: three pieces in place, the fourth (the CTO) completes the block */
.fraction {
  --gap: clamp(10px, 1.3vw, 18px);
  --r: clamp(18px, 2.2vw, 32px);
  justify-self: end;
  width: min(460px, 100%);
  aspect-ratio: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap);
}
.fr { border-radius: var(--r); }
/* Entrance (transform) + a slow, out-of-phase drift (translate) so the pieces
   keep settling into each other instead of sitting still. */
.fr-1 { background: var(--deep-700); animation: block-in .8s var(--ease-out) .1s both, drift-a 7s ease-in-out 1.2s infinite; }
.fr-2 { background: var(--mint-500); animation: block-in .8s var(--ease-out) .2s both, drift-b 8.5s ease-in-out 1.6s infinite; }
.fr-3 { background: var(--deep-900); animation: block-in .8s var(--ease-out) .3s both, drift-c 9.5s ease-in-out 1.4s infinite; }
.fr-4 {
  position: relative;
  border: 2px dashed color-mix(in srgb, var(--deep-700) 45%, transparent);
  animation: fade-only .6s ease .4s both, drift-d 8s ease-in-out 2.2s infinite;
}
.fr-fill {
  position: absolute; inset: -3px; border-radius: var(--r);
  background: color-mix(in srgb, var(--mint-500) 38%, var(--mint-50)); color: var(--deep-700);
  display: grid; place-items: center;
  clip-path: inset(0 round var(--r));
  animation: fill-in .9s var(--ease-out) 1s both;
}
.fr-label {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(32px, 4.4vw, 64px);
  animation: fade-only .5s ease 1.5s both;
}

/* ===== About ===== */
.about { display: flex; flex-wrap: wrap; gap: 16px; }
.about-text { flex: 3 1 520px; padding: 48px 40px; }
.about-text h2 { margin: 0 0 16px; font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; }
.about-text p { font-size: 18px; max-width: 680px; }
.stats {
  flex: 2 1 360px; padding: 40px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-content: center;
}
.stat-num { font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.stat-label { font-weight: 500; line-height: 1.35; }

/* ===== Sections ===== */
.section { padding: 80px 40px; }
.section-title { margin: 0 0 32px; font-weight: 800; font-size: 56px; letter-spacing: -0.03em; line-height: 1.05; }

/* Services */
.services { display: flex; flex-direction: column; }
.service {
  display: grid; grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px 40px; align-items: baseline;
  padding: 32px 0; border-top: 2px solid var(--deep-700);
}
.service:last-child { border-bottom: 2px solid var(--deep-700); }
.service-num { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.service h3 { font-size: 36px; font-weight: 700; line-height: 1.15; }
.service p { font-size: 17px; max-width: 60ch; }

/* Mid-page CTA */
.midcta {
  padding: 28px 40px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
}
.midcta p { font-size: 19px; max-width: 52ch; }
.midcta strong { font-family: var(--font-display); font-weight: 700; }

/* Process */
.process { padding: 72px 40px; }
.process h2 { margin: 0 0 48px; font-weight: 800; font-size: 48px; letter-spacing: -0.02em; line-height: 1.1; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.step { border-top: 1.5px solid var(--deep-line); padding-top: 24px; }
.step-num { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: 1; color: var(--mint-500); }
.step h3 { font-size: 22px; font-weight: 700; margin-top: 20px; text-wrap: pretty; }
.step p { margin-top: 8px; max-width: 42ch; }

/* Projects */
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.case { background: var(--mint-25); border-radius: var(--radius-lg); padding: 32px; }
.case-client { font-weight: 600; }
.case-result { font-weight: 800; font-size: 28px; line-height: 1.15; margin: 10px 0; }
.promise {
  margin-top: 64px; max-width: 24ch;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 4vw, 52px); line-height: 1.1; letter-spacing: -0.02em;
}

/* Contact */
.contact { display: flex; flex-wrap: wrap; gap: 16px; }
.contact-pitch {
  flex: 1 1 380px; padding: 56px 40px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.contact-pitch h2 { font-weight: 800; font-size: 52px; line-height: 1.02; letter-spacing: -0.03em; }
.assurances { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 17px; }
.assurances li { display: grid; grid-template-columns: 20px 1fr; gap: 12px; }
.assurances li::before {
  content: ""; width: 14px; height: 14px; margin-top: 6px; border-radius: 4px;
  background: var(--mint-300);
}
.contact-direct { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }

.contact-form-wrap { flex: 1 1 480px; padding: 48px 40px; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; align-content: start; }
.contact-form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; }
.optional { font-weight: 400; color: color-mix(in srgb, var(--deep-700) 80%, var(--mint-25)); }
.contact-form input, .contact-form select, .contact-form textarea {
  border: 1.5px solid var(--deep-700); border-radius: var(--radius-field);
  background: var(--mint-50); color: var(--deep-700);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-form input, .contact-form select { height: 48px; padding: 0 14px; }
.contact-form textarea { padding: 12px 14px; resize: vertical; min-height: 96px; }
.contact-form select {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23224F4E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.contact-form input:hover, .contact-form select:hover, .contact-form textarea:hover { border-color: var(--deep-900); }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--deep-900);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint-500) 55%, transparent);
}
.contact-form [aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.field-error { color: var(--error); font-size: 14px; font-weight: 500; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-status {
  background: var(--mint-50); border: 1.5px solid var(--mint-500); border-radius: var(--radius-field);
  padding: 16px 18px;
  animation: success-in .5s var(--ease-out) both;
}
.contact-status strong { font-family: var(--font-display); font-size: 20px; display: block; margin-bottom: 2px; }
.contact-status:focus { outline: none; }
.contact-status.is-error { border-color: var(--error); }
.contact-status.is-error strong { color: var(--error); }

/* ===== Footer ===== */
.site-footer {
  padding: 16px 24px;
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  font-size: 14px;
}
.footer-links { display: flex; gap: 20px; }

/* ===== Motion ===== */
@keyframes rise       { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes block-in   { from { opacity: 0; transform: translateY(28px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fill-in    { from { clip-path: inset(100% 0 0 0 round var(--r)); } to { clip-path: inset(0 round var(--r)); } }
@keyframes fade-only  { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift-a { 0%, 100% { translate: 0 0; } 50% { translate: -4px -10px; } }
@keyframes drift-b { 0%, 100% { translate: 0 0; } 50% { translate: 8px -6px; } }
@keyframes drift-c { 0%, 100% { translate: 0 0; } 50% { translate: -8px 6px; } }
@keyframes drift-d { 0%, 100% { translate: 0 0; } 50% { translate: 6px 9px; } }

/* The drift stops while the hero is off screen */
.hero.is-offscreen .fr { animation-play-state: paused; }
@keyframes success-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Process: the three steps arrive in order (JS opts in; visible by default) */
.steps.reveal-ready .step {
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s var(--ease-out), transform .7s var(--ease-out);
}
.steps.reveal-ready .step.is-in { opacity: 1; transform: none; }
@media (min-width: 1025px) {
  .steps.reveal-ready .step.is-in:nth-child(2) { transition-delay: .14s; }
  .steps.reveal-ready .step.is-in:nth-child(3) { transition-delay: .28s; }
}
@media print { .steps .step { opacity: 1 !important; transform: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .hero h1 .line > span, .fr, .fr-label, .contact-status { animation: fade-only .6s ease both !important; }
  .fr-fill { animation: none !important; }
  .btn-accent:active { transform: none; }
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 48px; gap: 40px; }
  .fraction { justify-self: start; width: min(360px, 70vw); }
  .steps, .cases { grid-template-columns: 1fr; }
  .steps { gap: 28px; }
  .service { grid-template-columns: 48px minmax(0, 1fr); }
  .service p { grid-column: 2; }
}

/* ===== Small screens ===== */
@media (max-width: 600px) {
  .site-header { padding: 8px 8px 8px 24px; flex-wrap: nowrap; }
  .brand { gap: 10px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-word { font-size: 19px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .site-nav .nav-cta { padding: 10px 14px; font-size: 15px; }
  .hero h1 { font-size: 44px; }
  .hero { padding: 32px 24px 48px; }
  .hero-pitch { font-size: 19px; }
  .fraction { width: min(260px, 66vw); }
  .section, .about-text, .stats, .process, .contact-pitch, .contact-form-wrap, .midcta { padding-left: 24px; padding-right: 24px; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .section-title { font-size: 40px; }
  .about-text { flex-basis: 100%; }
  .about-text h2 { font-size: 32px; }
  .stats { flex-basis: 100%; grid-template-columns: 1fr; gap: 14px; padding-top: 32px; padding-bottom: 32px; }
  .stats > div { display: flex; align-items: baseline; gap: 14px; }
  .stat-num { font-size: 36px; margin: 0; min-width: 2.4ch; }
  .service { grid-template-columns: 1fr; }
  .service p { grid-column: auto; }
  .service h3 { font-size: 28px; }
  .process h2 { font-size: 34px; }
  .contact-pitch h2 { font-size: 40px; }
  .contact-pitch, .contact-form-wrap { flex-basis: 100%; }
  .contact-form { grid-template-columns: 1fr; }
  .form-actions .btn-accent, .form-actions .btn-outline { width: 100%; }
}
