:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --sage: #acbd99;
  --sage-deep: #7d9460;
  --tint: #f3f6ee;
  --line: #e7e7e2;
  --muted: #6c6c66;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(20px, 5vw, 64px);
  --maxw: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--sage); color: var(--ink); }

a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ===== Eyebrow / labels ===== */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-deep);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--sage);
  border-radius: 50%;
  display: inline-block;
}

/* ===== Buttons ===== */
.btn {
  --bgc: var(--ink);
  --fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bgc);
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 14px 26px;
  border-radius: 100px;
  border: 1px solid var(--bgc);
  cursor: pointer;
  transition: background .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), transform .45s var(--ease);
  will-change: transform;
}
.btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); transition: transform .45s var(--ease); }
.btn:hover { background: var(--sage); color: var(--ink); border-color: var(--sage); transform: translateY(-2px); }
.btn:hover .dot { background: var(--ink); transform: scale(1.6); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .4s var(--ease), background .4s var(--ease), transform .4s var(--ease);
}
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ===== Nav ===== */
header.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background .5s var(--ease), border-color .5s var(--ease), backdrop-filter .5s var(--ease);
  border-bottom: 1px solid transparent;
}
header.nav.scrolled {
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.wordmark .alt { color: var(--ink); }
.wordmark .std { color: var(--ink); font-weight: 400; }
.wordmark .mark { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); display: inline-block; transform: translateY(-1px); }

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links nav { display: flex; gap: 30px; }
.nav-links a.link {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.nav-links a.link::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: var(--sage-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav-links a.link:hover::after { transform: scaleX(1); }
.nav-links a.link.active::after { transform: scaleX(1); }
.nav-cta { padding: 11px 22px; font-size: 14px; }

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 100%; height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .45s var(--ease), opacity .3s ease, width .45s var(--ease);
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* mobile nav overlay */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 var(--pad);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.mobile-nav.open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.mobile-nav nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 44px;
}
.mobile-nav .m-link {
  font-size: clamp(2.6rem, 13vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  transition: color .3s var(--ease);
}
.mobile-nav .m-link::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.mobile-nav .m-link:hover { color: var(--sage-deep); }
.mobile-nav .m-link:hover::before { transform: scale(1.5); background: var(--sage-deep); }
.mobile-nav .m-cta { font-size: 15px; }
.mobile-nav .m-footer {
  margin-top: 44px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .3s var(--ease);
}
.mobile-nav .m-footer:hover { color: var(--ink); }

/* nav opaco cuando el menú está abierto */
header.nav.menu-open {
  background: var(--bg);
  border-bottom-color: var(--line);
}

/* ===== Section scaffolding ===== */
section { position: relative; }
.section-pad { padding-top: clamp(80px, 12vw, 150px); padding-bottom: clamp(80px, 12vw, 150px); }
.divider { border-top: 1px solid var(--line); }

.sec-head { text-align: center; max-width: 720px; margin: 0 auto clamp(48px, 7vw, 84px); }
.sec-head .eyebrow { margin-bottom: 22px; }
.sec-title {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.sec-lead {
  margin-top: 22px;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  line-height: 1.55;
}

/* ===== Reveal animations ===== */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in { opacity: 1; transform: none; }

.lines .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.lines .line > span {
  display: block;
  transform: translateY(115%);
  transition: transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.lines.in .line > span { transform: translateY(0); }

/* ===== Hero ===== */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 120px;
  padding-bottom: 60px;
  position: relative;
}
.hero .eyebrow { margin-bottom: clamp(26px, 4vw, 42px); }
.hero-name {
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
  font-size: clamp(3.4rem, 15.5vw, 13rem);
}
.hero-name .l2 { color: transparent; -webkit-text-stroke: clamp(1.2px, 0.25vw, 2.6px) var(--ink); }
.hero-tag {
  margin-top: clamp(28px, 4vw, 44px);
  font-size: clamp(1.25rem, 2.7vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero-tag .accent { color: var(--sage-deep); }
.hero-cta { margin-top: clamp(34px, 4.5vw, 50px); }
.hero-scroll {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero-scroll .bar { width: 1px; height: 38px; background: var(--line); position: relative; overflow: hidden; }
.hero-scroll .bar::after {
  content: ""; position: absolute; top: -100%; left: 0;
  width: 100%; height: 100%; background: var(--ink);
  animation: scrolldown 2.2s var(--ease) infinite;
}
@keyframes scrolldown { 0% { top: -100%; } 60%, 100% { top: 100%; } }

/* ===== Servicios ===== */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
.svc {
  padding: clamp(28px, 2.6vw, 40px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 340px;
  transition: background .5s var(--ease);
  position: relative;
}
.svc:last-child { border-right: none; }
.svc:hover { background: var(--tint); }
.svc .num { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.svc .name { margin-top: 26px; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.svc .desc { margin-top: 14px; font-size: 0.95rem; color: var(--muted); line-height: 1.5; }
.svc-features {
  list-style: none;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.svc-features li {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.svc-features li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
}
.svc .price {
  margin-top: 26px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.svc .price .from { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.svc .tag {
  position: absolute; top: clamp(28px,2.6vw,40px); right: clamp(28px,2.6vw,40px);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--sage-deep); border: 1px solid var(--sage); border-radius: 100px; padding: 4px 9px;
}
.svc-cta {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-deep);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .3s var(--ease), gap .3s var(--ease);
}
.svc-cta:hover { color: var(--ink); gap: 10px; }

/* ===== Portafolio ===== */
.port-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 4vw, 56px); }
.project { display: block; }
.project .frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: var(--tint);
}
.project .frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
.project .meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-top: 24px; }
.project .p-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.project .p-cat { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 8px; }
.project .p-link {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 100px; padding: 10px 18px;
  transition: border-color .4s var(--ease), background .4s var(--ease), color .4s var(--ease);
  white-space: nowrap;
}
.project .p-link svg { transition: transform .4s var(--ease); }
.project:hover .p-link { background: var(--ink); color: #fff; border-color: var(--ink); }
.project:hover .p-link svg { transform: translate(2px, -2px); }

/* Portafolio — card próximamente */
.project--coming { cursor: default; pointer-events: none; }
.project--coming .frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint);
}
.project--coming .frame span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.project--coming .p-name { color: var(--muted); }

/* Servicios — nota mantenimiento */
.svc-note {
  margin-top: clamp(28px, 3vw, 40px);
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}
.svc-note strong { color: var(--ink); font-weight: 600; }

/* ===== Proceso — Card Deck ===== */
.pd-stage {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
  isolation: isolate;
}

.pd-stage::before,
.pd-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.pd-stage::before {
  background: var(--tint);
  transform: rotate(2.5deg) translateX(10px) translateY(4px);
  z-index: 1;
}

.pd-stage::after {
  background: #e5ebe1;
  transform: rotate(5deg) translateX(20px) translateY(8px);
  z-index: 0;
}

.pd-clip {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  z-index: 2;
}

.pd-track {
  display: flex;
  transition: transform .48s cubic-bezier(0.23, 1, 0.32, 1);
}

.pd-card {
  flex: 0 0 100%;
  background: var(--bg);
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: clamp(36px, 5vw, 56px);
  min-height: 270px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

.pd-counter {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--sage-deep);
}

.pd-counter em {
  font-style: normal;
  color: var(--muted);
}

.pd-name {
  display: block;
  margin-top: 22px;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.pd-desc {
  margin-top: 16px;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  max-width: 40ch;
}

.pd-nav {
  max-width: 580px;
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pd-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: var(--line);
  cursor: pointer;
  padding: 0;
  transition: background .3s var(--ease), transform .3s var(--ease);
}

.pd-dot.active {
  background: var(--sage-deep);
  transform: scale(1.45);
}

.pd-arrows {
  display: flex;
  gap: 8px;
}

.pd-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease), transform .18s ease;
}

.pd-arrow:hover:not(:disabled) {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.pd-arrow:active:not(:disabled) { transform: scale(0.93); }

.pd-arrow:disabled {
  opacity: 0.22;
  cursor: default;
  pointer-events: none;
}

/* ===== Contacto ===== */
.contacto { background: var(--tint); }
.contact-inner { text-align: center; max-width: 820px; margin: 0 auto; }
.contact-title {
  font-size: clamp(2.6rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.contact-sub { margin-top: 24px; font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--muted); }
.contact-actions { margin-top: clamp(36px, 5vw, 52px); display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact-meta {
  margin-top: clamp(48px, 7vw, 80px);
  display: flex; justify-content: center; gap: clamp(28px, 5vw, 56px); flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.contact-meta a { display: inline-flex; align-items: center; gap: 8px; transition: color .3s var(--ease); }
.contact-meta a:hover { color: var(--ink); }

/* ===== Footer ===== */
footer {
  padding: clamp(48px, 7vw, 80px) 0 40px;
  border-top: 1px solid var(--line);
}
.foot-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.foot-word { font-size: clamp(2.2rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.9; }
.foot-word .std { font-weight: 400; }
.foot-right { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; line-height: 1.9; }
.foot-right .sage { color: var(--sage-deep); }
.foot-nav { display: flex; gap: 20px; justify-content: flex-end; margin: 10px 0; flex-wrap: wrap; }
.foot-nav a { color: var(--muted); transition: color .3s var(--ease); }
.foot-nav a:hover { color: var(--ink); }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .svc:nth-child(1), .svc:nth-child(2) { border-bottom: 1px solid var(--line); }
  .svc:nth-child(2) { border-right: none; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links nav { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: flex; }
  .svc-grid { grid-template-columns: 1fr; }
  .svc { border-right: none !important; border-bottom: 1px solid var(--line); min-height: auto; }
  .svc:last-child { border-bottom: none; }
  .port-grid { grid-template-columns: 1fr; }
  .project .meta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .foot-inner { align-items: flex-start; }
  .foot-right { text-align: left; }
  .foot-nav { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  [data-reveal], .lines .line > span { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}
